Invoice query method and device, computer device, and storage medium
By obtaining document query requests from the document management system and using a query method based on document headers and journal entry tables, the problem of low efficiency in traditional document queries is solved, achieving efficient document queries, especially with significant performance improvements in scenarios with large amounts of data.
Patent Information
- Application Number
- CN202311664669.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-12-05
AI Technical Summary
In large enterprise document management systems, traditional document query methods are inefficient and cannot efficiently handle tens or hundreds of millions of document data volumes, especially when the monthly entry volume of journal entry documents exceeds one billion.
By obtaining document query requests, and based on document query conditions and sorting conditions, a preset number of document header sequences are queried from the document header data table, and the target entry data sequence is queried from the entry data table according to the sorting of the document headers, which serves as the first page query result, thus shielding the complexity of database join queries.
It improves document retrieval efficiency, especially in scenarios with large amounts of data, significantly enhancing query performance, reducing unnecessary entry queries, and improving query efficiency and accuracy.
Smart Images

Figure CN117743409B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a document retrieval method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] In large enterprise document management systems, the monthly document volume can reach tens or hundreds of millions, while for journal entry-type documents, the average monthly entry volume can exceed one billion. In document management systems, querying document lists is a frequently used function. Based on user-input document filtering conditions, the system queries the database for documents that meet the filtering conditions and displays the resulting document list and statistics on the page.
[0003] Traditional document query methods involve performing related queries in the database based on document filtering conditions, and statistically analyzing the amount of data that meets the conditions during the query process. After obtaining the full amount of data that meets the filtering conditions, the list of documents and statistics obtained from the query are displayed on the page. However, for queries involving large amounts of data, there is a problem of low document query efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a document query method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency of document query in order to address the above-mentioned technical problems.
[0005] This application provides a document query method. The method includes:
[0006] Retrieve document query requests; document query requests carry document query conditions and document sorting conditions;
[0007] From the document header data table, based on the document query conditions and document sorting conditions, query a preset number of document header sequences;
[0008] Based on the order of document headers in the document header sequence, the corresponding entry data is retrieved from the entry data table to obtain the target entry data sequence; the target entry data sequence includes a preset number of target entry data.
[0009] Use the target entry data sequence as the homepage query result corresponding to the document query request.
[0010] This application also provides a document query device. The device includes:
[0011] The query request acquisition module is used to acquire document query requests; the document query request carries the document query conditions and document sorting conditions;
[0012] The document header sequence determination module is used to query a preset number of document header sequences from the document header data table based on document query conditions and document sorting conditions.
[0013] The journal entry data sequence determination module is used to query the journal entry data corresponding to the document header from the journal entry data table according to the sorting of the document headers in the document header sequence, and obtain the target journal entry data sequence; the target journal entry data sequence includes a preset number of target journal entries;
[0014] The query result determination module is used to use the target entry data sequence as the homepage query result corresponding to the document query request.
[0015] A computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described document query method.
[0016] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described document query method.
[0017] A computer program product includes a computer program that, when executed by a processor, implements the steps of the aforementioned document query method.
[0018] The aforementioned document query method, apparatus, computer equipment, storage medium, and computer program product acquire a document query request carrying document query conditions and document sorting conditions. Based on the document query conditions and document sorting conditions, a document header sequence consisting of a preset number of document headers is retrieved from the document header data table. According to the sorting of the document headers in the document header sequence, the corresponding entry data is retrieved from the entry data table to obtain the target entry data sequence corresponding to the document header sequence. The target entry data sequence includes a preset number of target entry data. The target entry data sequence is used as the first page query result corresponding to the document query request. In this way, by first retrieving the document header sequence from the document header data table based on the document query conditions, and then retrieving the target entry data sequence from the entry data table based on the document headers in the document header sequence, the complexity of database join queries is shielded, improving the query performance for entry-type document bodies. Furthermore, the improvement in document query efficiency is more significant for document query scenarios with larger data volumes. Attached Figure Description
[0019] Figure 1 This is an application environment diagram of a document query method in one embodiment;
[0020] Figure 2 This is a flowchart illustrating a document query method in one embodiment;
[0021] Figure 3This is a schematic diagram illustrating the display of query results on the homepage in one embodiment;
[0022] Figure 4 This is a schematic diagram of a reference summary statistics table in one embodiment;
[0023] Figure 5 This is a flowchart illustrating the process of determining target journal entry data in one embodiment;
[0024] Figure 6 This is a flowchart illustrating the document query method in another embodiment;
[0025] Figure 7 This is a schematic diagram illustrating the updating and use of a dimension summary statistics table in one embodiment;
[0026] Figure 8 This is a flowchart illustrating the process of updating and using the voucher count statistics table in one embodiment;
[0027] Figure 9 This is a structural block diagram of a document query device in one embodiment;
[0028] Figure 10 This is a structural block diagram of a document query device in another embodiment;
[0029] Figure 11 This is an internal structural diagram of a computer device in one embodiment;
[0030] Figure 12 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0032] The document query method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart TVs, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. Terminal 102 and server 104 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0033] Both the terminal and the server can be used independently to execute the document query method provided in the embodiments of this application.
[0034] For example, a terminal receives a document query request, which carries document query conditions and document sorting conditions. The terminal retrieves a preset number of document headers from the document header data table, based on the query and sorting conditions. Following the sorting of the document headers in the header sequence, the terminal retrieves the corresponding entry data from the entry data table, obtaining a target entry data sequence. This target entry data sequence includes a preset number of target entry data entries. The terminal uses this target entry data sequence as the first page query result corresponding to the document query request.
[0035] Terminals and servers can also work together to execute the document query method provided in the embodiments of this application.
[0036] For example, a terminal receives a document query request and sends it to the server. The query request includes query conditions and sorting criteria. The server retrieves a predetermined number of document headers from the document header data table, based on the query and sorting criteria. Following the sorting order of the document headers in the header sequence, the server retrieves the corresponding entry data from the entry data table, obtaining the target entry data sequence. This target entry data sequence includes a predetermined number of target entry data entries. The server uses this target entry data sequence as the homepage query result corresponding to the document query request. The server then sends the homepage query result to the terminal, which can then display it.
[0037] In one embodiment, such as Figure 2 As shown, a document query method is provided. Taking the application of this method to a computer device as an example, the computer device can be a terminal or a server. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. The document query method includes the following steps:
[0038] Step S202: Obtain a document query request; the document query request carries the document query conditions and document sorting conditions.
[0039] Among them, document query request refers to the request used to query journal entry documents. In actual implementation, document query request can be generated based on the document sorting conditions entered by the user on the document query page and the dimension field values corresponding to multiple document query dimensions. The document sorting conditions can be selected by the user from multiple preset sorting conditions or the default document sorting conditions.
[0040] Journal entry-type documents refer to documents containing one or more journal entries. The document header refers to the header information corresponding to each journal entry within the journal entry-type document; that is, the header information corresponding to the journal entry-type document. For example, the document header may include information such as document number, posting date, document status, document type, and whether it has been reviewed. A journal entry refers to a subset of data within a document. For example, when a journal entry-type document is generated based on a user's shopping order, the purchase information for each item in the shopping order constitutes one journal entry. If the shopping order contains multiple different items, then multiple journal entries will be corresponding to those items.
[0041] The document query page allows setting multiple query dimensions for document headers. Each query dimension can correspond to multiple dimension field values, which are used to filter document headers in the document header data table. For example, the document query page can set query dimensions such as posting date, document status, document type, and whether it has been reviewed. Each query dimension can correspond to multiple dimension field values. Specifically, for the document status query dimension, "saved," "submitted," and "all" statuses can be used as multiple dimension field values. For the "whether it has been reviewed" query dimension, "reviewed" and "not reviewed" can be used as two dimension field values.
[0042] Document query conditions refer to the filtering conditions composed of the dimension field values corresponding to each document query dimension on the document query page. Document sorting conditions refer to the conditions used to sort the retrieved document headers. For example, sorting can be based on the document identifier corresponding to the document header, or it can be based on the accounting date corresponding to the document.
[0043] For example, in response to inputting dimension field values for each document query dimension on the document query page, document query conditions are obtained. In response to a document query confirmation operation, a document query request carrying the document query conditions and document sorting conditions is generated. The computer device obtains the document query request and performs a document query based on the document query conditions and document sorting conditions carried in the document query request.
[0044] Step S204: From the document header data table, based on the document query conditions and document sorting conditions, query a preset number of document header sequences.
[0045] The document header data table refers to the data table in the database used to store document headers. The preset quantity indicates the maximum number of document headers that need to be retrieved for displaying the query results on the homepage. In actual implementation, the maximum number of data that can be displayed on the homepage can be used as the preset quantity. For example, when the homepage contains 1000 rows of data display columns, each column can display one data entry, and the preset quantity can be set to 1000. The document header sequence refers to a sequence composed of the first preset quantity of document headers that meet the document query criteria, sorted according to the document sorting conditions. The document headers in the sequence are arranged in an orderly manner according to the document sorting conditions.
[0046] For example, the computer device queries a sequence of document headers that meet the document query conditions and document sorting conditions, and then sorts the document headers according to the document sorting conditions, with a preset number of document headers at the top.
[0047] Step S206: According to the order of document headers in the document header sequence, query the entry data corresponding to the document headers from the entry data table to obtain the target entry data sequence; the target entry data sequence includes a preset number of target entry data.
[0048] The journal entry table refers to the data table in the database used to store journal entries. The journal entry data corresponding to the document header refers to the journal entries contained in the journal entry type document to which the document header belongs. The target journal entry data refers to the data obtained by associating the queried journal entry data with the corresponding document header. The target journal entry data sequence refers to the sequence containing the first preset number of target journal entries from each target journal entry data set arranged in order according to document sorting criteria.
[0049] For example, the computer device sequentially queries the entry data corresponding to the document header in the document header sequence from the entry data table, associates the queried entry data with the document header corresponding to the entry data to obtain target entry data, and obtains a preset number of target entry data to form a target entry data sequence.
[0050] Step S208: Use the target entry data sequence as the homepage query result corresponding to the document query request.
[0051] The homepage query results refer to the document query results displayed on the homepage of the query results display page. The homepage of query results display is the first page among all pages displaying document query results. For example, document query results can be displayed in a list format. If the query results display page can only display a maximum of 1000 rows of data, and the number of data matching the document query conditions exceeds 1000, then the query results need to be displayed in pages, and the first page is the homepage of the query results display. In actual implementation, if only document headers are queried, the various data display columns on the homepage can be used to display document headers, and the number of data display columns on the query results display page is the maximum number of document headers that the query results display page can display. If the entire entry-type document needs to be queried, the various data display columns on the homepage are used to display entries, and the number of data display columns on the query results display page is the maximum number of target entry data that the query results display page can display.
[0052] For example, the computer device uses the target entry data sequence as the homepage query result corresponding to the document query request, and displays the homepage query result corresponding to the document query request on the query result display homepage. For entry-type documents, each document can correspond to multiple entry data, for example, Figure 3 As shown, when querying the entire journal entry document, each row of data displayed represents one journal entry. The image shows 5 documents, with the third document corresponding to three journal entries and each of the other documents corresponding to two journal entries. The journal entries corresponding to the 5 documents occupy 11 rows on the homepage.
[0053] The document query method described above obtains a document query request carrying document query conditions and document sorting conditions. Based on these conditions, a predetermined number of document header sequences are retrieved from the document header data table. Following the sorting order of the document headers in the sequence, the corresponding entry data is retrieved from the entry data table to obtain the target entry data sequence, which includes a predetermined number of target entry data. This target entry data sequence is then used as the first page query result corresponding to the document query request. This approach, by first retrieving the document header sequence from the document header data table based on the query conditions, and then retrieving the target entry data sequence from the entry data table based on the document headers within the sequence, masks the complexity of database join queries and improves the performance of querying entry-type document bodies. Furthermore, the improvement in document query efficiency is more significant for document query scenarios with larger data volumes. This method can be applied to various business systems, such as Enterprise Resource Planning (ERP) systems, enterprise management systems, financial systems, human resource systems, and supply chain systems.
[0054] In one embodiment, the target entry data sequence is used as the first page query result corresponding to the document query request, including:
[0055] When there is a combination of reference dimension field values corresponding to the document query conditions in the reference summary statistics table, the target document quantity and / or target entry quantity corresponding to the document query conditions are obtained based on the reference document quantity and / or reference entry quantity corresponding to the reference dimension field value combination in the reference summary statistics table; at least one of the target document quantity and target entry quantity, as well as the target entry data sequence, are used as the homepage query result corresponding to the document query request.
[0056] Among them, a dimension field value combination refers to a combination of field values consisting of the dimension field values corresponding to each document query dimension, and each dimension field value combination constitutes a document query condition. A reference dimension field value combination refers to a combination of dimension field values corresponding to commonly used document query conditions. A reference summary statistics table is a data table that records the number of reference documents and / or reference entries corresponding to each reference dimension field value combination. The reference summary statistics table can record at least one of the number of reference documents and the number of reference entries corresponding to a reference dimension field value combination. For example, the header of a reference summary statistics table is as follows: Figure 4 As shown, organization, period, ledger type, posting date, status, type, whether reviewed, and whether posted are multiple document query dimensions. The dimension field value combination is composed of the dimension field value corresponding to each document query dimension. Refer to the summary statistics table to record the document quantity and journal entry quantity corresponding to each dimension field value combination.
[0057] The reference document quantity corresponding to the reference dimension field value combination refers to the number of document headers recorded in the reference summary statistics table that meet the document query conditions corresponding to the reference dimension field value combination. The reference entry quantity corresponding to the reference dimension field value combination refers to the number of entries recorded in the reference summary statistics table that meet the document query conditions corresponding to the reference dimension field value combination; that is, the sum of the number of entries corresponding to each document header that meets the document query conditions. The target document quantity corresponding to the document query conditions refers to the number of document headers actually corresponding to the document query conditions, determined based on the reference document quantity corresponding to the document query conditions. The target entry quantity corresponding to the document query conditions refers to the number of entries actually corresponding to the document query conditions, determined based on the reference entry quantity corresponding to the document query conditions.
[0058] For example, when a combination of reference dimension field values corresponding to document query conditions exists in the reference summary statistics table, the computer device determines the target document quantity and / or target journal entry quantity corresponding to the document query conditions based on the reference document quantity and / or reference journal entry quantity corresponding to the reference dimension field value combination in the reference summary statistics table. For instance, the reference document quantity and reference journal entry quantity corresponding to the reference dimension field value combination of the document query conditions can be directly used as the target document quantity and target journal entry quantity corresponding to the document query conditions. Then, based on at least one of the target document quantity and target journal entry quantity, and the target journal entry data, the homepage query results corresponding to the document query request are obtained. It is understood that the homepage query results do not necessarily contain both the target document quantity and target journal entry quantity simultaneously. The homepage query results corresponding to the document query request are displayed on the query results display homepage.
[0059] In the above embodiments, when performing document queries, if there is a combination of reference dimension field values corresponding to the document query conditions in the reference summary statistics table, the target document quantity and / or target journal entry quantity corresponding to the document query conditions can be quickly obtained based on the reference summary statistics table, thereby improving the efficiency of document queries.
[0060] In one embodiment, such as Figure 5 As shown, according to the order of the document headers in the document header sequence, the corresponding entry data is retrieved from the entry data table to obtain the target entry data sequence, including:
[0061] Step S502: Determine the document header subsequence in the document header sequence based on the batch query volume.
[0062] Step S504: Query the initial entry data corresponding to the document header in the document header subsequence from the entry data table to obtain the initial entry subset.
[0063] Step S506: Based on the document identifier corresponding to the initial entry data in the initial entry subset, associate the initial entry data with the corresponding document header to obtain the target entry data corresponding to each initial entry data in the initial entry subset, and form the target entry subset.
[0064] Step S508: Sort the target entry data in the target entry subset based on the document sorting conditions to obtain the corresponding target entry subsequence.
[0065] Step S510: Continue to query the next target entry subsequence based on the batch query volume until the total number of entries corresponding to each target entry subsequence is greater than the preset number, and obtain the initial entry data sequence; the initial entry data sequence is obtained by merging each target entry subsequence.
[0066] Step S512: Determine a preset number of target entry data in the initial entry data sequence to form a target entry data sequence.
[0067] Here, "batch query volume" refers to the number of document heads included in each subsequence of document heads obtained when querying each document head in a batch. "Initial entry data corresponding to a document head" refers to the entry data corresponding to the document head in the entry data table. "Initial entry subset" refers to the set containing the initial entry data corresponding to each document head in the document head subsequence. "Document identifier" refers to the identifier used to distinguish different documents; each document's document identifier is unique, and both the document head and the entry for the same entry type contain the document identifier. "Target entry data" refers to the entry data obtained by associating the initial entry data with the document heads corresponding to the initial entry data. "Target entry subset" refers to the set containing the target entry data corresponding to each initial entry data in the initial entry subset. "Total entry volume corresponding to each target entry subsequence" refers to the total number of entries obtained by summing the number of target entry data contained in each target entry subsequence obtained from the batch query.
[0068] For example, the computer device, based on the batch query volume, retrieves document headers starting from the head of the document header sequence until it obtains a document header subsequence consisting of multiple document headers matching the batch query volume. It then queries the entry data table to retrieve the initial entry data corresponding to each document header in the document header subsequence, obtaining an initial entry subset. Based on the document identifiers corresponding to the initial entry data in the initial entry subset, it queries the document headers corresponding to the initial entry data, associating the initial entry data with their corresponding document headers to obtain the target entry data corresponding to each initial entry data in the initial entry subset, forming a target entry subset. Based on the document sorting conditions and the document headers contained in the target entry data, it sorts the target entry data in the target entry subset, obtaining a target entry subsequence. Based on the batch query volume, it continues to retrieve the next document header subsequence from the document header sequence, using the same method to obtain the target entry subsequence corresponding to the next document header subsequence. If the total number of entries corresponding to each target entry subsequence is less than or equal to a preset number, then based on the batch query volume, the next document header subsequence is obtained from the document header sequence until the total number of entries corresponding to each target entry subsequence is greater than the preset number, resulting in an initial entry data sequence obtained by merging the target entry subsequences. If the total number of entries corresponding to each target entry subsequence is greater than the preset number, then an initial entry data sequence obtained by merging the target entry subsequences is obtained. Starting from the beginning of the initial entry sequence, a preset number of target entry data are obtained to obtain the target entry data sequence.
[0069] For example, such as Figure 6As shown, when performing a voucher (i.e., document) list query, the system first determines whether the filter condition is a homepage list query with only voucher headers (i.e., document headers). If not, the document query is performed using a structured query mode, i.e., a traditional database query mode. If so, the voucher header query is performed based on the voucher header filter condition, sorting condition, and data volume limit (i.e., preset quantity), resulting in a voucher header sequence containing the preset number of voucher headers that meet the voucher header filter condition. If there is no need to query the corresponding journal entries for the voucher headers, the voucher header sequence is directly output as the homepage query result. If journal entries need to be queried, the voucher headers in the voucher header sequence are queried in batches according to the batch query volume. For example, the batch query volume can be set to 1000, dividing every 1000 voucher headers into a batch. After determining the voucher header subsequence from the voucher header sequence based on the batch query volume, the journal entry data corresponding to the voucher header is retrieved based on the voucher ID (i.e., document identifier) corresponding to the voucher header. The journal entry data corresponding to each voucher header is then sorted according to the voucher sorting conditions (i.e., document sorting conditions) to obtain the target journal entry subsequence corresponding to the voucher header subsequence. If the total number of journal entries corresponding to the target journal entry subsequence (i.e., the total number of journal entries) has not reached the page number (i.e., the preset number), the next batch of voucher headers is retrieved, and the target journal entry subsequence corresponding to the next voucher header subsequence is merged into the end of the previous target journal entry subsequence until the total number of journal entries reaches the page number. The journal entry data sequence obtained by merging the target journal entry subsequences retrieved in batches is then obtained and output as the first page query result.
[0070] In the above embodiments, querying the journal entries corresponding to each document header in the document header sequence in batches based on the batch query volume is because the number of journal entries corresponding to each document header is different, and the query results homepage only contains a preset number of document display columns, which cannot fully display the journal entries corresponding to each document header in the document header sequence. Therefore, by querying the journal entries corresponding to each document header in batches, when the total number of journal entries corresponding to each target journal entry subsequence is greater than the preset number, an initial journal entry data sequence is obtained. This reduces unnecessary journal entry queries and improves the efficiency of document query.
[0071] In one embodiment, the document query method further includes:
[0072] Retrieve pending document operations, extracting the historical and current document headers corresponding to the pending document operations; pending document operations refer to document operations that update document headers; based on the first dimension field value combination and the corresponding entry quantity of the historical document header, generate the first count update record corresponding to the pending document operation; based on the second dimension field value combination and the corresponding entry quantity of the current document header, generate the second count update record corresponding to the pending document operation; based on the first and second count update records, update the reference document quantity and reference entry quantity corresponding to the first and second dimension field value combinations in the reference summary statistics table, respectively.
[0073] In this context, "pending document operations" refers to document operations that are yet to be processed and will update the document header. Examples of pending document operations include saving, submitting, approving, unapproving, posting, and reversing posting—all of which update the corresponding document header. The historical document header corresponding to a pending document operation refers to the document header of the document targeted by the pending document operation before its execution. The current document header corresponding to a pending document operation refers to the updated document header of the document targeted by the pending document operation after its execution.
[0074] The first dimension field value combination refers to the reference dimension field combination to which the historical document header belongs in the reference summary statistics table. The second dimension field value combination refers to the reference dimension field combination to which the current document header belongs in the reference summary statistics table. The first count update record is a record containing the first dimension field value combination and entry quantity corresponding to the historical document header, used to update the reference entry quantity and reference document quantity corresponding to the first dimension field value combination in the reference summary statistics table. The second count update record is a record containing the second dimension field value combination and entry quantity corresponding to the current document header, used to update the reference entry quantity and reference document quantity corresponding to the second dimension field value combination in the reference summary statistics table.
[0075] For example, the computer device monitors real-time document operations. When a document operation to be processed is received, it extracts the historical document header corresponding to the document targeted by the document operation to be processed, and the current document header corresponding to the document obtained after the document operation to be processed. Based on the dimension field values corresponding to the historical document header under each document query dimension, the reference dimension field value combination to which the historical document header belongs in the reference summary statistics table is determined, resulting in a first dimension field value combination. The entry quantity corresponding to the historical document header is obtained, and a first count update record of the first dimension field value combination and the entry quantity corresponding to the historical document header is generated. Based on the dimension field values corresponding to the current document header under each document query dimension, the reference dimension field value combination to which the current document header belongs in the reference summary statistics table is determined, resulting in a second dimension field value combination. The entry quantity corresponding to the current document header is obtained, and a second count update record of the second dimension field value combination and the entry quantity corresponding to the current document header is generated. For the reference document quantity and reference entry quantity corresponding to the first dimension field value combination in the reference summary statistics table, subtract the entry quantity corresponding to the first count update record from the reference entry quantity to obtain the updated reference entry quantity, and subtract 1 from the reference document quantity to obtain the updated reference document quantity. For the reference document quantity and reference entry quantity corresponding to the second dimension field value combination in the reference summary statistics table, add the entry quantity corresponding to the second count update record to obtain the updated reference entry quantity, and add 1 to the reference document quantity to obtain the updated reference document quantity.
[0076] In the above embodiments, by real-time monitoring of document operations that update the document header, and upon obtaining the document operations to be processed, a first count update record and a second count update record corresponding to the document operations to be processed are generated. Based on the first count update record and the second count update record, the entry quantity and document quantity corresponding to the corresponding reference dimension field value combination in the summary table are updated, enabling synchronous updates between the documents and the reference summary statistics table. This allows for quick retrieval of the target document quantity and target entry quantity based on the reference summary statistics table when the reference dimension field value combination corresponding to the document query conditions exists, thus improving the accuracy and efficiency of document queries.
[0077] In one embodiment, updating the reference document quantity and reference entry quantity corresponding to the first dimension field value combination and the second dimension field value combination in the reference summary statistics table, based on the first count update record and the second count update record, includes:
[0078] Write the first and second count update records to the summary log table; determine the synchronization status of the first and second count update records in the summary log table as unsynchronized; continue to obtain the next pending document operation until the log synchronization time is reached; based on the target count update record in the summary log table whose synchronization status is unsynchronized, update the corresponding target dimension field value combination in the reference summary statistics table to the corresponding reference document quantity and reference entry quantity.
[0079] The summary log table records the first and second count update records corresponding to document operations that update the document header. The synchronization status indicates whether the first or second count update record corresponding to the document operation has been synchronized to the reference summary statistics table. The log synchronization time is determined based on the log synchronization cycle, which can be set according to actual needs; for example, the end of each log synchronization cycle can be used as the log synchronization time. The target count update record refers to the record in the summary statistics table that is not synchronized when the log synchronization time arrives.
[0080] For example, after generating the first and second count update records corresponding to the pending document operations, the computer device writes the first and second count update records to a summary log table. The synchronization status of both the first and second count update records corresponding to the pending document operations is determined to be out of synchronization. The system continues to monitor the pending document operations generated in real time, and sequentially writes the first and second count update records corresponding to each pending document operation to the summary log table, setting the synchronization status of each first and second count update record to out of synchronization. Until the log synchronization time is reached, based on the target count update record in the summary log table whose synchronization status is out of synchronization, the corresponding target dimension field values are combined in the reference summary statistics table to update the reference document quantity and reference entry quantity, and the synchronization status of the target count update record is updated to synchronized. Specifically, when the target count update record is the first count update record, the reference entry quantity corresponding to the target count update record is subtracted from the reference entry quantity corresponding to the target count update record in the reference summary statistics table to obtain the updated reference entry quantity. The reference document quantity corresponding to the target count update record is subtracted by 1 from the reference document quantity corresponding to the reference summary statistics table to obtain the updated reference document quantity. When the target count update record is the second count update record, the reference entry quantity corresponding to the target count update record is added to the reference entry quantity corresponding to the target count update record in the reference summary statistics table to obtain the updated reference entry quantity. The reference document quantity corresponding to the target count update record is added by 1 from the reference document quantity corresponding to the reference summary statistics table to obtain the updated reference document quantity.
[0081] In the above embodiments, the operations on pending documents are monitored in real time. After generating the first and second count update records corresponding to the pending document operations, these records are stored in a summary log table. The summary log table records the first and second count update records for each document operation, as well as the synchronization status of each record. When the log synchronization time is reached, based on the target count update records in the summary statistics table that are not synchronized, the reference document quantity and reference entry quantity corresponding to the target dimension field value combination in the reference summary statistics table are updated. This not only improves the accuracy of record synchronization but also enhances the traceability of the update process of the reference summary statistics table.
[0082] In one embodiment, the target document quantity and / or target entry quantity corresponding to the document query conditions are obtained based on the reference document quantity and / or reference entry quantity corresponding to the reference dimension field values in the reference summary statistics table, including:
[0083] Retrieve the reference document quantity and reference entry quantity corresponding to the reference dimension field value combination corresponding to the document query condition in the reference summary statistics table; retrieve the pending synchronization count update record corresponding to the pending synchronization count update record in the summary log table; based on the pending synchronization count update record, determine the pending synchronization document quantity and pending synchronization entry quantity corresponding to the reference dimension field value combination corresponding to the document query condition; merge the reference document quantity and pending synchronization document quantity to obtain the target document quantity corresponding to the document query condition, and merge the reference entry quantity and pending synchronization entry quantity to obtain the target entry quantity corresponding to the document query condition.
[0084] Specifically, the "records to be synchronized" in the summary log table corresponding to the reference dimension field value combination refer to records whose synchronization status is "not synchronized" in the summary log table. The "number of documents to be synchronized" corresponding to the reference dimension field value combination refers to the number of documents determined based on the individual records to be synchronized based on the reference dimension field value combination, which is used to merge with the reference document number corresponding to the document query conditions to obtain the target number of documents. The "number of entries to be synchronized" corresponding to the reference dimension field value combination refers to the number of entries determined based on the individual records to be synchronized based on the reference dimension field value combination, which is used to merge with the reference entry number corresponding to the document query conditions to obtain the target number of entries.
[0085] For example, when the reference summary statistics table simultaneously records the reference document quantity and reference entry quantity corresponding to each combination of reference dimension field values, the computer device obtains the reference document quantity and reference entry quantity corresponding to the combination of reference dimension field values corresponding to the document query conditions in the reference summary statistics table, and the corresponding records of the pending synchronization count update in the summary log table. The entry quantity and document quantity corresponding to each pending synchronization count update record are then calculated to obtain the pending synchronization document quantity and pending synchronization entry quantity corresponding to the combination of reference dimension field values corresponding to the document query conditions. Specifically, if the record to be synchronized is the first record, when calculating the number of entries corresponding to each record, the number of entries corresponding to the first record is subtracted; when calculating the number of documents corresponding to each record, the number of documents corresponding to the first record is subtracted. If the record to be synchronized is the second record, when calculating the number of entries corresponding to each record, the number of entries corresponding to the second record is added; when calculating the number of documents corresponding to each record, the number of documents corresponding to the second record is added. After calculating the number of entries and documents corresponding to each record, the number of documents and entries to be synchronized corresponding to the combination of reference dimension field values corresponding to the document query conditions is obtained.
[0086] The computer equipment sums the number of reference documents corresponding to the combination of reference dimension field values for the document query conditions in the reference summary statistics table, and the number of documents to be synchronized corresponding to the combination of reference dimension field values for the document query conditions, to obtain the target number of documents corresponding to the document query conditions. Similarly, it sums the number of reference entries corresponding to the combination of reference dimension field values for the document query conditions in the reference summary statistics table, and the number of entries to be synchronized corresponding to the combination of reference dimension field values for the document query conditions, to obtain the target number of entries corresponding to the document query conditions.
[0087] In the above embodiments, when determining the target document quantity and target journal entry quantity corresponding to the document query conditions, the reference document quantity and reference journal entry quantity corresponding to the reference dimension field value combination corresponding to the document query conditions are obtained from the reference summary statistics table. The quantity of documents to be synchronized and the quantity of journal entries to be synchronized corresponding to the reference dimension field value combination corresponding to the document query conditions are obtained from the summary log table. The reference document quantity and the quantity of documents to be synchronized are merged to obtain the target document quantity corresponding to the document query conditions. Similarly, the reference journal entry quantity and the quantity of journal entries to be synchronized are merged to obtain the target journal entry quantity corresponding to the document query conditions. In this way, by merging the summary log table and the reference summary statistics table to obtain the target document quantity and target journal entry quantity, the quantity of documents and journal entries corresponding to records that have not yet been synchronized to the reference summary statistics table in a timely manner can be included in the statistics, making the target document quantity and target journal entry quantity more accurate and improving the accuracy of document queries.
[0088] In one embodiment, the document query method further includes:
[0089] The statistics display area on the query results homepage displays the preset quantity, target document quantity, and target entry quantity; the preset number of entries display column on the query results homepage displays each target entry data contained in the target entry data sequence in sequence.
[0090] The entry display section refers to the data display section on the homepage of the query results, which is used to display the target entry data in the target entry data sequence.
[0091] For example, after receiving the homepage query results corresponding to the document query request, the computer device displays the preset quantity, the target document quantity, and the target journal entry quantity corresponding to the document query conditions in the statistics display area of the query results homepage. This allows users to quickly and intuitively determine the target document quantity and target journal entry quantity, as well as the maximum number of target journal entry data displayed on the query results homepage. Based on the preset number of journal entry display columns included in the query results homepage, each target journal entry data contained in the target journal entry data sequence is displayed sequentially.
[0092] In the above embodiments, a statistical display area and a preset number of entry display columns are set up on the query results homepage. The preset number, target entry quantity, and target document quantity are displayed in the statistical display area, and each target entry data in the target entry data sequence is sequentially displayed in the preset number of entry display columns included on the query results homepage, thus realizing an intuitive display of the homepage query results.
[0093] In one embodiment, the document query method further includes:
[0094] The document headers corresponding to each target entry in the target entry data sequence are counted to obtain the number of documents queried for the target entry data sequence. Based on the number of documents queried and the number of target documents, the range of documents to be queried is determined. Based on the document query conditions and document sorting conditions, the entry data table and the document header data table are correlated to obtain the remaining entry data sequence that matches the range of documents to be queried.
[0095] The quantity of documents queried refers to the number of document headers corresponding to the target entry data sequence. For example, if the target entry data sequence contains target entry data corresponding to 50 document headers, then the quantity of documents queried corresponding to the target entry data sequence is 50. The range of documents to be queried refers to the range of remaining document headers to be queried corresponding to the document query conditions. For example, if there are 3000 document headers that meet the document query conditions, with a preset quantity of 1000, and the target entry data sequence contains entry data corresponding to 300 document headers, then the range of documents to be queried is the range from the 301st document header to the 3000th document header after sorting the document headers that meet the document query conditions based on the document sorting conditions. The remaining entry data sequence refers to the sequence containing the target entry data corresponding to each document header in the document header sequence that is located within the range of documents to be queried, arranged in order according to the document sorting conditions. The target entry data in the remaining entry data sequence is arranged in order according to the document sorting conditions.
[0096] For example, the computer device counts the document headers corresponding to each target entry in the target entry data sequence to obtain the number of documents queried corresponding to the target entry data. Based on the number of queried documents and the number of target documents, the range of remaining document headers to be queried corresponding to the document query conditions is determined. Based on the document query conditions and document sorting conditions, a join query is performed on the document header data table and the entry data table to obtain the remaining entry data sequence composed of the target entry data corresponding to each document header located within the range of documents to be queried. When the number of target entry data contained in the remaining entry data sequence exceeds a preset number, the target entry data contained in the remaining entry data sequence can be displayed in pages.
[0097] In the above embodiments, after retrieving the homepage query results, the number of queried documents corresponding to the target entry data sequence is counted, and the range of documents to be queried is determined based on the number of queried documents. Then, based on the document query conditions and document sorting conditions, a direct association query is performed on the entry data table and the document header data table to obtain the remaining entry data sequence that matches the range of documents to be queried, thus ensuring the completeness of the document query.
[0098] In one specific embodiment, the document query method proposed in this application can be applied to a financial accounting system. The document query method includes the following steps:
[0099] 1. Update Dimension Summary Statistics Table
[0100] like Figure 7 As shown, the financial accounting system updates the dimension summary statistics table based on the acquired documents. When performing document count queries, it quickly calculates the document quantity and journal entry quantity through the dimension summary statistics table (i.e., the reference summary statistics table). Specifically, as... Figure 8 As shown, the process retrieves the pending document operation (i.e., voucher operation), generates a first count update record corresponding to the first dimension field value combination of the pending document operation, and uses this first count update record to deduct the entry quantity and document quantity corresponding to the original dimension field value combination of the document. Then, a second count update record is generated corresponding to the second dimension field value combination of the pending document operation, and uses this second count update record to increase the entry quantity and document quantity corresponding to the new dimension field value combination of the document. Both the first and second count update records are then synchronously written to the voucher count log (details) table. Through asynchronous calculation, the records in the voucher count log table are synchronized to the voucher count statistics (summary) table (i.e., dimension summary statistics table). That is, based on the records in the voucher count log table, the entry quantity and document quantity corresponding to the corresponding dimension field combination in the voucher count statistics table are updated.
[0101] 2. Non-related query of journal entry document body
[0102] The financial accounting system receives document query requests. When the query request targets both the homepage and document headers, it retrieves a sequence of document headers that meet the specified filtering and sorting criteria, based on the document filtering conditions. This preset number represents the maximum number of journal entries that can be displayed on the homepage. The system then queries the journal entries in batches for each document header in the sequence until the total number of retrieved journal entries reaches the preset number, thus obtaining the target journal entry sequence.
[0103] 3. Query statistical data
[0104] like Figure 8As shown, when there are reference dimension field value combinations corresponding to document filtering conditions in the voucher count statistics table, the reference document quantity and reference entry quantity corresponding to the reference dimension field value combinations corresponding to the document query conditions are queried from the voucher count statistics table. Records corresponding to the reference dimension field value combinations that are not synchronized to the voucher count statistics table are queried from the voucher count log table. Based on the records corresponding to the reference dimension field value combinations that are not synchronized to the voucher count statistics table, the document quantity and entry quantity to be synchronized are determined. The document quantity to be synchronized and the reference document quantity are merged to obtain the target document quantity corresponding to the document query conditions. The entry quantity to be synchronized and the reference entry quantity are merged to obtain the target entry quantity corresponding to the document query conditions.
[0105] In the above embodiments, when performing homepage queries, correlation queries based on filter conditions are avoided, thus shielding the complexity of database correlation queries and improving query performance. Without table partitioning, the performance of commonly used filters on the homepage for hundreds of millions of documents is below 500 milliseconds. By establishing a dimension summary statistics table of commonly used query conditions for documents, the corresponding query dimensions for documents are statistically analyzed in real time during document operations. When querying the document list, data is directly retrieved from the statistics table to quickly calculate the document volume and entry volume under different dimensions, achieving millisecond-level query statistics performance.
[0106] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0107] Based on the same inventive concept, this application also provides a document query device for implementing the document query method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more document query device embodiments provided below can be found in the limitations of the document query method described above, and will not be repeated here.
[0108] In one embodiment, such as Figure 9 As shown, a document query device is provided, including: a query request acquisition module 902, a document header sequence determination module 904, an entry data sequence determination module 906, and a query result determination module 908, wherein:
[0109] The query request acquisition module 902 is used to acquire document query requests; the document query request carries the document query conditions and document sorting conditions.
[0110] The document header sequence determination module 904 is used to query a preset number of document header sequences from the document header data table based on document query conditions and document sorting conditions.
[0111] The journal entry data sequence determination module 906 is used to query the journal entry data corresponding to the document header from the journal entry data table according to the sorting of the document headers in the document header sequence, and obtain the target journal entry data sequence; the target journal entry data sequence includes a preset number of target journal entries.
[0112] The query result determination module 908 is used to use the target entry data sequence as the homepage query result corresponding to the document query request.
[0113] In one embodiment, the query result determination module 908 is further configured to:
[0114] When there is a combination of reference dimension field values corresponding to the document query conditions in the reference summary statistics table, the target document quantity and / or target entry quantity corresponding to the document query conditions are obtained based on the reference document quantity and / or reference entry quantity corresponding to the reference dimension field value combination in the reference summary statistics table; at least one of the target document quantity and target entry quantity, as well as the target entry data sequence, are used as the homepage query result corresponding to the document query request.
[0115] In one embodiment, the journal entry data sequence determination module 906 is further configured to:
[0116] Based on the batch query volume, determine the document header subsequence in the document header sequence; query the initial entry data corresponding to the document header in the document header subsequence from the entry data table to obtain the initial entry subset; based on the document identifier corresponding to the initial entry data in the initial entry subset, associate the initial entry data with the corresponding document header to obtain the target entry data corresponding to each initial entry data in the initial entry subset, forming the target entry subset; sort the target entry data in the target entry subset based on the document sorting conditions to obtain the corresponding target entry subsequence; continue to query the next target entry subsequence based on the batch query volume until the total entry volume corresponding to each target entry subsequence is greater than a preset number, to obtain the initial entry data sequence; the initial entry data sequence is obtained by merging each target entry subsequence; determine a preset number of target entry data in the initial entry data sequence to form the target entry data sequence.
[0117] In one embodiment, the query result determination module 908 is further configured to:
[0118] Retrieve pending document operations, extracting the historical and current document headers corresponding to the pending document operations; pending document operations refer to document operations that update document headers; based on the first dimension field value combination and the corresponding entry quantity of the historical document header, generate the first count update record corresponding to the pending document operation; based on the second dimension field value combination and the corresponding entry quantity of the current document header, generate the second count update record corresponding to the pending document operation; based on the first and second count update records, update the reference document quantity and reference entry quantity corresponding to the first and second dimension field value combinations in the reference summary statistics table, respectively.
[0119] In one embodiment, the query result determination module 908 is further configured to:
[0120] Write the first and second count update records to the summary log table; determine the synchronization status of the first and second count update records in the summary log table as unsynchronized; continue to obtain the next pending document operation until the log synchronization time is reached; based on the target count update record in the summary log table whose synchronization status is unsynchronized, update the corresponding target dimension field value combination in the reference summary statistics table to the corresponding reference document quantity and reference entry quantity.
[0121] In one embodiment, the query result determination module 908 is further configured to:
[0122] Retrieve the reference document quantity and reference entry quantity corresponding to the reference dimension field value combination corresponding to the document query condition in the reference summary statistics table; retrieve the pending synchronization count update record corresponding to the pending synchronization count update record in the summary log table; based on the pending synchronization count update record, determine the pending synchronization document quantity and pending synchronization entry quantity corresponding to the reference dimension field value combination corresponding to the document query condition; merge the reference document quantity and pending synchronization document quantity to obtain the target document quantity corresponding to the document query condition, and merge the reference entry quantity and pending synchronization entry quantity to obtain the target entry quantity corresponding to the document query condition.
[0123] In one embodiment, the query result determination module 908 is further configured to:
[0124] The statistics display area on the query results homepage displays the preset quantity, target document quantity, and target entry quantity; the preset number of entries display column on the query results homepage displays each target entry data contained in the target entry data sequence in sequence.
[0125] In one embodiment, such as Figure 10 As shown, the document query device also includes:
[0126] The remaining document query module 1002 is used to count the document headers corresponding to each target entry data in the target entry data sequence to obtain the number of documents queried corresponding to the target entry data sequence; based on the number of documents queried and the number of target documents, the document range to be queried is determined; based on the document query conditions and document sorting conditions, the entry data table and the document header data table are correlated and queried to obtain the remaining entry data sequence that matches the document range to be queried.
[0127] The aforementioned document query device first queries the document header sequence in the document header data table based on the document query conditions, and then queries the target entry data sequence from the entry data table based on the document headers in the document header sequence. This shields the complexity of database join queries and improves the query performance for entry-type document bodies. Furthermore, the improvement in document query efficiency is more significant for document query scenarios with larger data volumes.
[0128] Each module in the aforementioned document query device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0129] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as document header sequences and target entry data sequences. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a document query method.
[0130] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a document retrieval method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0131] Those skilled in the art will understand that Figure 11 , 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0132] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0133] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0134] In one embodiment, a computer program product or computer program is provided, the computer product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above-described method embodiments.
[0135] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0136] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0137] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A document query method, characterized in that, The method includes: Obtain a document query request; the document query request carries document query conditions and document sorting conditions; From the document header data table, based on the document query conditions and the document sorting conditions, query a document header sequence consisting of a preset number of document headers; According to the sorting of document headers in the document header sequence, the corresponding entry data of the document header is queried from the entry data table to obtain the target entry data sequence; the target entry data sequence includes the preset number of target entry data; When the reference dimension field value combination corresponding to the document query condition exists in the reference summary statistics table, the target document quantity and / or target entry quantity corresponding to the document query condition is obtained based on the reference document quantity and / or reference entry quantity corresponding to the reference dimension field value combination corresponding to the document query condition in the reference summary statistics table. The target document quantity, the target journal entry quantity, and the target journal entry data sequence are used as the homepage query results corresponding to the document query request.
2. The method according to claim 1, characterized in that, The step of retrieving the corresponding entry data from the entry data table according to the sorting of the document headers in the document header sequence to obtain the target entry data sequence includes: The document header subsequence is determined from the document header sequence based on the batch query volume; Query the initial entry data corresponding to the document header in the document header subsequence from the entry data table to obtain the initial entry subset; Based on the document identifiers corresponding to the initial entry data in the initial entry subset, the initial entry data is associated with the corresponding document headers to obtain the target entry data corresponding to each initial entry data in the initial entry subset, thus forming the target entry subset; Based on the document sorting conditions, the target entry data in the target entry subset are sorted to obtain the corresponding target entry subsequence; Continue querying the next target entry subsequence based on the batch query volume until the total number of entries corresponding to each target entry subsequence is greater than the preset number, to obtain an initial entry data sequence; the initial entry data sequence is obtained by merging each target entry subsequence. The preset number of target entry data are determined from the initial entry data sequence to form a target entry data sequence.
3. The method according to claim 1, characterized in that, The method further includes: Obtain pending document operations, and extract the historical document header and current document header corresponding to the pending document operations; the pending document operations refer to document operations that cause document headers to be updated. Based on the combination of the first dimension field values corresponding to the historical document header and the entry quantity corresponding to the historical document header, a first count update record corresponding to the document operation to be processed is generated. Based on the combination of the second dimension field values corresponding to the current document header and the entry quantity corresponding to the current document header, a second count update record corresponding to the document operation to be processed is generated. Based on the first count update record and the second count update record, update the reference document quantity and reference entry quantity corresponding to the first dimension field value combination and the second dimension field value combination in the reference summary statistics table, respectively.
4. The method according to claim 3, characterized in that, The step of updating the reference document quantity and reference entry quantity corresponding to the first dimension field value combination and the second dimension field value combination in the reference summary statistics table based on the first count update record and the second count update record includes: Write the first count update record and the second count update record into the summary log table; The synchronization status of the first count update record and the second count update record in the summary log table is determined to be unsynchronized. Continue acquiring the next pending document operation until the log synchronization time is reached. Based on the target count update record with an unsynchronized synchronization status in the summary log table, update the corresponding target dimension field value combination to the reference document quantity and reference entry quantity in the reference summary statistics table.
5. The method according to claim 1, characterized in that, The process of obtaining the target document quantity and / or target entry quantity corresponding to the document query condition by combining the reference dimension field values corresponding to the document query condition in the reference summary statistics table includes: Obtain the reference document quantity and reference entry quantity corresponding to the reference dimension field value combination corresponding to the document query conditions in the reference summary statistics table; Retrieve the corresponding count update record to be synchronized in the summary log table for the combination of reference dimension field values corresponding to the document query conditions; Based on the record to be synchronized, determine the number of documents to be synchronized and the number of entries to be synchronized corresponding to the combination of reference dimension field values corresponding to the document query conditions. The target document quantity corresponding to the document query condition is obtained by merging the reference document quantity and the document quantity to be synchronized. The target entry quantity corresponding to the document query condition is obtained by merging the reference entry quantity and the entry quantity to be synchronized.
6. The method according to claim 1, characterized in that, The method further includes: The statistics display area on the homepage of the query results page displays the preset quantity, the target document quantity, and the target journal entry quantity; In the preset number of entry display columns included on the query results homepage, the target entry data contained in the target entry data sequence are displayed sequentially.
7. The method according to claim 1, characterized in that, The method further includes: By counting the document headers corresponding to each target entry in the target entry data sequence, the number of queried documents corresponding to the target entry data sequence is obtained. Based on the number of queried documents and the target number of documents, determine the range of documents to be queried; Based on the document query conditions and the document sorting conditions, a correlation query is performed on the entry data table and the document header data table to obtain the remaining entry data sequence that matches the document range to be queried.
8. A document query device, characterized in that, The device includes: The query request acquisition module is used to acquire document query requests; the document query request carries document query conditions and document sorting conditions; The document header sequence determination module is used to query a preset number of document header sequences from the document header data table based on the document query conditions and the document sorting conditions. The journal entry data sequence determination module is used to query the journal entry data corresponding to the document header from the journal entry data table according to the sorting of the document headers in the document header sequence, so as to obtain the target journal entry data sequence; the target journal entry data sequence includes the preset number of target journal entries. The query result determination module is used to determine the target document quantity and / or target entry quantity corresponding to the document query condition when the reference dimension field value combination corresponding to the document query condition exists in the reference summary statistics table. This is done based on the reference document quantity and / or reference entry quantity corresponding to the reference dimension field value combination in the reference summary statistics table. At least one of the target document quantity and the target entry quantity, as well as the target entry data sequence, is used as the homepage query result corresponding to the document query request.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data combination query method and system, corresponding equipment and storage medium
CN112506942A
Mass data query method, device and system, and storage medium
CN116719841A
