Data query method and device, computer device and computer readable storage medium

By setting up a data identifier linked list for each data index and using the data index graph for aggregation queries, the problem of slow data query speed for merchants with multiple stores is solved, and efficient data query is achieved.

CN115982200BActive Publication Date: 2026-04-24RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2023-02-14
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

When a merchant has multiple stores and a large number of orders, existing technology results in slow data query speeds, low efficiency, and a significant waste of query time.

Method used

By creating a linked list of data identifiers for each data index, and directly querying the data identifier set using the data index graph, the data query results are generated and transmitted, thus achieving aggregated querying.

Benefits of technology

It significantly improves data query speed and efficiency, saving query time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115982200B_ABST
    Figure CN115982200B_ABST
Patent Text Reader

Abstract

The application discloses a data query method and device, computer equipment and a computer readable storage medium, and relates to the technical field of Internet. By setting a data identifier linked list for each data index, the method quickly realizes the aggregate query of the data index. Compared with the query method of the traditional relational database by establishing multiple index tables, the data query speed is greatly improved, the efficiency is obviously improved, and a large amount of query time is saved. The method comprises the following steps: in response to a data query request, acquiring at least one data index to be queried; determining a data identifier set corresponding to each data index to be queried according to a data identifier linked list associated with each data index to be queried, obtaining at least one data identifier set of the at least one data index to be queried; determining at least one target data identifier in the at least one data identifier set, and generating and transmitting a data query result based on the at least one target data identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a data query method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] In recent years, with the continuous development of internet technology, numerous online shopping platforms have emerged, and many merchants have also used these platforms to establish online stores, providing purchasing services to more customers. Among these services, to help merchants understand their store's operational status as much as possible, the platforms offer data query services, displaying statistical reports on store operations based on the retrieved data.

[0003] In this technology, the platform provides each merchant with around dozens of data statistics reports, each involving extensive queries of underlying order data. If a merchant has many stores, a large volume of orders can cause an explosion in order data, significantly impacting data query speed, resulting in low query efficiency and wasted time. Summary of the Invention

[0004] In view of this, this application provides a data query method, apparatus, computer device, and computer-readable storage medium. The main purpose is to solve the problem that if a merchant has many stores, a large number of orders will cause an explosion in order data, which will have a significant impact on the data query speed, resulting in low data query efficiency and a waste of a lot of query time.

[0005] According to a first aspect of this application, a data query method is provided, the method comprising:

[0006] In response to a data query request, retrieve at least one index of the data to be queried;

[0007] Based on the data identifier linked list associated with each data index to be queried, determine the data identifier set corresponding to each data index to be queried, and obtain at least one data identifier set for the at least one data index to be queried;

[0008] At least one target data identifier is determined in the at least one set of data identifiers, and a data query result is generated and transmitted based on the at least one target data identifier, wherein each set of data identifiers in the at least one set of data identifiers includes the at least one target data identifier.

[0009] Optionally, before obtaining at least one index of the data to be queried in response to a data query request, the process includes:

[0010] Obtain multiple order data to be stored, and read at least one data index corresponding to each order data to be stored in the multiple order data to obtain multiple data indexes;

[0011] Each of the multiple data indexes is counted to identify at least one order data to be stored for each data index, and a data identifier linked list is generated for each data index based on the at least one order data to be stored for each data index.

[0012] Optionally, generating a data identifier linked list for each data index based on at least one order data to be stored corresponding to each data index includes:

[0013] A first data index is determined among the plurality of data indexes, wherein the first data index is any data index among the plurality of data indexes;

[0014] Determine a plurality of first string elements constituting the first data index, draw a chain-like first element chain including the plurality of first string elements according to the arrangement order of the plurality of first string elements in the first data index, and generate a data index graph including the first element chain;

[0015] In the plurality of order data to be stored, at least one order data corresponding to the first data index is determined, at least one data identifier of the at least one order data to be stored is obtained, a data identifier linked list including the at least one data identifier is generated, and the data identifier linked list is associated with and stored with the first element chain in the data index graph.

[0016] A second data index is determined among the plurality of data indexes, wherein the second data index is any data index other than the first data index among the plurality of data indexes;

[0017] Draw a second element chain for the second data index on the data index graph, and determine at least one order data to be stored corresponding to the second data index among the plurality of order data to be stored, obtain at least one data identifier of the at least one order data to be stored, generate a data identifier linked list including the at least one data identifier, and associate and store the data identifier linked list with the second element chain in the data index graph;

[0018] Continue to determine a third data index among the plurality of data indices, draw a third element chain for the third data index on the storage graph and generate a data identifier linked list for associated storage, until the plurality of data indices are traversed, and a data identifier linked list is generated for each data index. The third data index is any data index among the plurality of data indices other than the first data index and the second data index.

[0019] Optionally, drawing the second element chain for the second data index on the data index graph includes:

[0020] Determine a plurality of second string elements constituting the second data index, and identify whether the plurality of second string elements include a plurality of target string elements, wherein the string formed by the plurality of target string elements in the second data index is included in the first data index;

[0021] When the plurality of second string elements includes the plurality of target string elements, a plurality of remaining string elements are determined from the plurality of second string elements, wherein the plurality of remaining string elements are second string elements other than the plurality of target string elements;

[0022] Among the plurality of target string elements, a target string element is determined as a turning point, wherein the turning point is a target string element that is adjacent to the plurality of remaining string elements.

[0023] In the first element chain drawn in the data index graph, determine the first transition string element mapped by the transition node, and draw the second element chain including the plurality of remaining string elements, starting from the first transition string element.

[0024] Optionally, the method further includes:

[0025] When none of the plurality of target string elements are included in the plurality of second string elements, a chain-like second element chain including the plurality of second string elements is drawn on the data index graph according to the order of the plurality of second string elements in the second data index.

[0026] Optionally, before obtaining at least one index of the data to be queried in response to a data query request, the method further includes:

[0027] When a request to display data is detected, it is determined that the data query request has been received; or,

[0028] The system continuously monitors the current time point, and when the time interval between the current time point and the historical display time point reaches a preset update interval, it determines that the data query request has been received.

[0029] Optionally, obtaining at least one index of data to be queried includes:

[0030] Read the data item to be queried as indicated by the data query request;

[0031] Determine the data index corresponding to the data item to be queried, and use the determined data index as the at least one data index to be queried.

[0032] Optionally, determining the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, and obtaining at least one data identifier set for the at least one data index to be queried, includes:

[0033] For each of the at least one query data indexes, obtain a data index graph and determine the target element chain corresponding to the query data index on the data index graph;

[0034] Obtain the target data identifier chain list associated with the target element chain in the data index graph, extract at least one data identifier included in the target data identifier chain list, and generate an identifier set including the at least one data identifier as the data identifier set corresponding to the data index to be queried.

[0035] Generate a corresponding set of data identifiers for each of the data indexes to be queried, thereby obtaining at least one set of data identifiers.

[0036] Optionally, generating and transmitting data query results based on the at least one target data identifier includes:

[0037] Query the order data corresponding to each of the at least one target data identifiers to obtain at least one order data;

[0038] Read the data items to be queried indicated by the data query request, organize the at least one order data according to the data items to be queried, and generate the data query results;

[0039] Determine the recipient of the results indicated by the data query request, and transmit the data query results to the recipient.

[0040] According to a second aspect of this application, a data query apparatus is provided, the apparatus comprising:

[0041] The acquisition module is used to retrieve at least one index of the data to be queried in response to a data query request;

[0042] The determining module is used to determine the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, so as to obtain at least one data identifier set for the at least one data index to be queried;

[0043] A generation module is configured to determine at least one target data identifier in the at least one set of data identifiers, generate a data query result based on the at least one target data identifier, and transmit it, wherein each set of data identifiers in the at least one set of data identifiers includes the at least one target data identifier.

[0044] Optionally, the device further includes:

[0045] The reading module is used to acquire multiple order data to be stored, and to read at least one data index corresponding to each order data to be stored in the multiple order data to be stored, thereby obtaining multiple data indexes;

[0046] The construction module is used to count at least one order data to be stored corresponding to each of the multiple data indexes, and to generate a data identifier linked list for each data index based on the at least one order data to be stored corresponding to each data index.

[0047] Optionally, the construction module is configured to: determine a first data index among the plurality of data indexes, wherein the first data index is any data index among the plurality of data indexes; determine a plurality of first string elements constituting the first data index; draw a chain-like first element chain including the plurality of first string elements according to the arrangement order of the plurality of first string elements in the first data index; generate a data index graph including the first element chain; determine at least one order data to be stored corresponding to the first data index among the plurality of order data to be stored; obtain at least one data identifier of the at least one order data to be stored; generate a data identifier linked list including the at least one data identifier; and associate and store the data identifier linked list with the first element chain in the data index graph; and determine a second data index among the plurality of data indexes, wherein the second data index is any data index among the plurality of data indexes. Any data index other than the first data index in the data index; draw a second element chain for the second data index on the data index graph, and determine at least one order data corresponding to the second data index in the plurality of order data to be stored, obtain at least one data identifier of the at least one order data to be stored, generate a data identifier linked list including the at least one data identifier, and associate the data identifier linked list with the second element chain in the data index graph; continue to determine a third data index in the plurality of data indexes, draw a third element chain for the third data index on the storage graph and generate a data identifier linked list for associated storage, until the plurality of data indexes are traversed, and a data identifier linked list is generated for each data index, wherein the third data index is any data index other than the first data index and the second data index in the plurality of data indexes.

[0048] Optionally, the construction module is configured to determine a plurality of second string elements constituting the second data index, identify whether the plurality of second string elements include a plurality of target string elements, wherein the string formed by the plurality of target string elements in the second data index is included in the first data index; when the plurality of second string elements include the plurality of target string elements, determine a plurality of remaining string elements among the plurality of second string elements, wherein the plurality of remaining string elements are second string elements other than the plurality of target string elements among the plurality of second string elements; determine a target string element as a turning node among the plurality of target string elements, wherein the turning node is a target string element adjacent to the plurality of remaining string elements among the plurality of target string elements; determine the turning first string element mapped by the turning node in the first element chain drawn in the data index graph, and draw the second element chain including the plurality of remaining string elements starting from the turning first string element.

[0049] Optionally, the construction module is further configured to, when the plurality of second string elements do not include the plurality of target string elements, draw a chain-like second element chain on the data index graph according to the arrangement order of the plurality of second string elements in the second data index.

[0050] Optionally, the determining module is further configured to determine that the data query request has been received when a request to display data is detected; or, to continuously detect the current time point and determine that the data query request has been received when the time interval between the current time point and the historical display time point is detected to reach a preset update interval.

[0051] Optionally, the acquisition module is configured to read the data item to be queried indicated by the data query request; determine the data index corresponding to the data item to be queried; and use the determined data index as the at least one data index to be queried.

[0052] Optionally, the determining module is configured to: for each of the at least one query data indexes, obtain a data index graph; determine the target element chain corresponding to the query data index on the data index graph; obtain a target data identifier chain list associated with the target element chain in the data index graph; extract at least one data identifier included in the target data identifier chain list; generate an identifier set including the at least one data identifier as the data identifier set corresponding to the query data index; and generate a corresponding data identifier set for each query data index to obtain the at least one data identifier set.

[0053] Optionally, the generation module is configured to query the order data corresponding to each of the at least one target data identifiers to obtain at least one order data; read the data items to be queried indicated by the data query request, organize the at least one order data according to the data items to be queried, and generate the data query result; determine the result recipient indicated by the data query request, and transmit the data query result to the result recipient.

[0054] According to a third aspect of this application, 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 of the method described in any of the first aspects above.

[0055] According to a fourth aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0056] By employing the above technical solutions, this application provides a data query method, apparatus, computer device, and computer-readable storage medium. In response to a data query request, this application obtains at least one data index to be queried, queries the data identifier set corresponding to each of the at least one data index to be queried, obtains at least one data identifier set, determines at least one target data identifier in the at least one data identifier set, and generates and transmits a data query result based on the at least one target data identifier. By setting a data identifier linked list for each data index, aggregate queries targeting data indexes are quickly achieved. Compared to the traditional relational database method of querying by establishing multiple index tables, this significantly improves data query speed, increases efficiency markedly, and saves a considerable amount of query time.

[0057] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0058] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0059] Figure 1 This illustration shows a schematic flowchart of a data query method provided in an embodiment of this application;

[0060] Figure 2A This illustration shows a schematic flowchart of a data storage method provided in an embodiment of this application;

[0061] Figure 2B This illustration shows a schematic diagram of a data index diagram provided in an embodiment of this application;

[0062] Figure 2C This illustration shows a schematic diagram of a data index diagram provided in an embodiment of this application;

[0063] Figure 3 This paper illustrates a schematic diagram of another data query method provided in an embodiment of this application.

[0064] Figure 4 This illustration shows a schematic diagram of the structure of a data query device provided in an embodiment of this application;

[0065] Figure 5 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0066] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.

[0067] Example 1

[0068] This application provides a data query method, such as... Figure 1 As shown, the method includes:

[0069] 101. In response to a data query request, obtain at least one index of the data to be queried.

[0070] The applicant recognizes that online shopping platforms primarily provide merchants with data by displaying operational statistics reports for their stores, allowing merchants to understand their store's performance as much as possible. In practice, these platforms provide approximately forty data statistics reports, each involving extensive queries of underlying order data. If the merchant has numerous stores and a large order volume, this can lead to an explosion in order data, significantly impacting the efficiency of data report queries. Therefore, this application proposes a data query method that, when storing order data, creates a corresponding data identifier linked list for each data index using a data index graph. During data queries, the data index graph can be used to directly retrieve the set of data identifiers corresponding to each data index to be queried. The query results are generated and transmitted based on the target data identifiers from the intersection of all retrieved data identifier sets. By setting up a data identifier linked list for each data index, aggregate queries targeting data indexes can be quickly achieved. Compared to traditional relational databases that rely on multiple index tables for queries, this method significantly improves data query speed, resulting in a marked increase in efficiency and saving substantial query time.

[0071] This application can be applied to online platforms that provide merchants with access to data queries, such as "Report Query" and "Data Query" buttons on the merchant interface. When a button is triggered, it is determined that a data query request from the merchant has been received. Since this application is based on aggregated queries implemented using data indexes, in response to the data query request, the platform will obtain at least one data index to be queried, and subsequently perform aggregated queries on the data indexes using at least one data index to be queried. The data index to be queried can be a status field such as "busi_type = BUSINESS_INCOME" or "order_source = POS". There can be one or more data indexes to be queried. For example, if it is necessary to query all order data where busi_type = BUSINESS_INCOME, order source = POS, and order status = SETTLED, then the above three status fields can be used as the data index to be queried. This application does not specifically limit the form or number of data indexes to be queried.

[0072] 102. Based on the linked list of data identifiers associated with each data index to be queried, determine the set of data identifiers corresponding to each data index to be queried, and obtain at least one set of data identifiers for at least one data index to be queried.

[0073] Since this application embodiment sets up a data identifier linked list for each data index, after determining at least one data index to be queried, the platform will determine the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, and obtain at least one data identifier set for at least one data index to be queried. That is, it will query which data identifiers correspond to each data index to be queried, and form the data identifier set for each data index to be queried. Subsequently, the data query results can be output through the queried data identifiers.

[0074] 103. Determine at least one target data identifier in at least one set of data identifiers, generate data query results based on at least one target data identifier, and transmit them.

[0075] In this embodiment, since at least one index of the data to be queried is set as a query condition when querying data, the final output query result must simultaneously satisfy these indexes. Therefore, after determining at least one set of data identifiers, the platform will determine at least one target data identifier from the at least one set of data identifiers. Each set of data identifiers in the at least one set of data identifiers includes at least one target data identifier; that is, at least one target data identifier is the intersection of at least one set of data identifiers. After determining at least one target data identifier, the corresponding full data can be obtained through the target data identifier, generating data query results and transmitting them. Compared with the database query method, the query speed of this application is higher.

[0076] The method provided in this application embodiment, in response to a data query request, obtains at least one data index to be queried, queries the data identifier set corresponding to each of the at least one data index to be queried, obtains at least one data identifier set, determines at least one target data identifier in the at least one data identifier set, generates and transmits a data query result based on the at least one target data identifier, and quickly realizes aggregate query for data index by setting a data identifier linked list for each data index. Compared with the traditional relational database method of querying by establishing multiple index tables, it greatly improves the data query speed, significantly improves efficiency, and saves a lot of query time.

[0077] Example 2

[0078] Furthermore, as a refinement and extension of the specific implementation of Embodiment 1 above, and in order to fully illustrate the specific implementation process of this embodiment, this application provides a data storage method, such as... Figure 2A As shown, the method includes:

[0079] 201. Obtain multiple order data to be stored, and read at least one data index corresponding to each order data to be stored in the multiple order data to obtain multiple data indexes.

[0080] To achieve rapid aggregation queries for data indexes by setting up a data identifier linked list for each data index in this application embodiment, this application embodiment proposes a data storage method. When storing order data, a corresponding data identifier linked list is created for each data index through a data index graph. In this way, when performing data queries, the data index graph can be used to directly query the data identifier set corresponding to each data index to be queried. The data query result is generated and transmitted based on the target data identifier of the intersection of all queried data identifier sets.

[0081] Therefore, in this embodiment, the platform will obtain multiple order data to be stored. Since the technical solution in this application is mainly based on data index when storing data, the platform will read at least one data index corresponding to each order data to be stored in the multiple order data to be stored, and obtain multiple data indexes, so as to set a corresponding data identifier linked list for each data index in the future.

[0082] 202. Collect at least one order data to be stored for each data index in the multiple data indexes, and generate a data identifier linked list for each data index based on the at least one order data to be stored for each data index.

[0083] In this embodiment, since a data identifier linked list needs to be set for each data index, the platform will separately count at least one order data to be stored corresponding to each data index in multiple data indexes, and generate a data identifier linked list for each data index based on the at least one order data to be stored corresponding to each data index. The process of generating the data identifier linked list is described below:

[0084] First, the platform can determine any data index from multiple data indices as the first data index, and identify multiple first string elements constituting the first data index. Based on the order of these first string elements within the first data index, a chain-like first element chain including these multiple first string elements is drawn, and a data index graph including the first element chain is generated. For example, if the first data index is "SETTLED", then the multiple first string elements constituting this data index can be identified as "S", "E", "T", "T", "L", "E", and "D", and a data index graph can be generated for this data index. Figure 2B The first element chain shown can be connected to each first string element by arrows to indicate the order of the first string elements. The first element chain includes... Figure 2B It can then be used as a data index graph.

[0085] Subsequently, the platform identifies at least one order data point corresponding to the first data index from multiple order data points to be stored, obtains at least one data identifier for that order data point, generates a linked list of data identifiers including the at least one data identifier, and associates and stores the linked list of data identifiers with the first element chain in the data index graph. In other words, the platform queries which order data points correspond to the first data index and integrates the data identifiers of these order data points as the linked list of data identifiers corresponding to the first data index. See [link to details] for more information. Figure 2B The data identifier linked list generated for the first data index "SETTLED" includes data identifiers "1" and "4". This data identifier linked list can be linked to the last string element of the first data index "SETTLED" in the data index graph.

[0086] Next, the platform determines any data index other than the first data index from multiple data indexes as the second data index, draws a second element chain for the second data index on the data index graph, determines at least one order data corresponding to the second data index from multiple order data to be stored, obtains at least one data identifier of at least one order data to be stored, generates a data identifier linked list including at least one data identifier, and associates and stores the data identifier linked list with the second element chain in the data index graph. It should be noted that when drawing the second element chain, some data indices may overlap. For example, the data indexes "SETTLED" and "WAIT_PROCESSED" overlap by a "T", and the data indexes "WAIT_PROCESSED" and "WAIT_SETTLED" overlap by "WAIT". In order to enable the element chains generated for each data index to be interconnected, realize the integrated processing of multiple element chains, reduce the number of chain beginnings, and facilitate finding the data identifier linked lists corresponding to multiple different data indices by following the same chain, in this embodiment of the application, when generating the second element linked list for the second data index, the multiple second string elements constituting the second data index are determined, and it is identified whether the multiple second string elements include multiple target string elements. The string formed by the multiple target string elements in the second data index is included in the first data index. That is, it is identified whether there is an overlap between the second data index and the first data index (i.e., the string formed by multiple target string elements).

[0087] Accordingly, when multiple second string elements include multiple target string elements, it indicates that there is an overlap between the second data index and the first data index. When constructing the second element chain for the second data index, a portion of the first element chain can be used to link the two element chains. This allows the data identifier linked lists for the first and second data indices to be found along the beginning of the first element chain, saving space. Therefore, the platform will determine multiple remaining string elements among the multiple second string elements. These remaining string elements are the second string elements other than the multiple target string elements. A target string element will be determined as a turning point among the multiple target string elements. This turning point is the target string element adjacent to the multiple remaining string elements. The turning point first string element mapped to the turning point will be determined in the first element chain drawn in the data index graph. Starting from this turning point first string element, a second element chain including multiple remaining string elements will be drawn. Specifically, as follows... Figure 2C As shown, assuming the first data index is "WAIT_PROCESSED" and the second data index is "WAIT_SETTLED", the overlapping part between the two data indices is "WAIT", meaning the multiple target string elements are "W", "A", "I", and "T" respectively. The first element chain of the first data index has been drawn. Compared to the first data index, the multiple remaining strings of the second data index are "_", "S", "E", "T", "T", "L", "E", and "D". Among the multiple target string elements, the target string element adjacent to the multiple remaining strings is "T". Therefore, we need to take "T" in "WAIT" as the first transition string element, starting from "T", as follows: Figure 2C As shown, draw the second element chain including "_", "S", "E", "T", "T", "L", "E", and "D", and associate the last string element "D" of the second element chain with the data identifier linked list created for the second data index, which includes data identifiers "2", "3", and "6". This completes the drawing of the second element chain.

[0088] It should be noted that if there is no overlap between the second data index and the first data index, that is, when multiple second string elements do not include multiple target string elements, the process of generating the first element chain can be referred to. According to the arrangement order of multiple second string elements in the second data index, a chain-like second element chain including multiple second string elements is drawn on the data index graph. In other words, a new element chain that is relatively independent of the first element chain is generated as the second element chain. For a detailed generation process, please refer to the generation process of the first element chain, which will not be repeated here.

[0089] The platform will then continue to determine a third data index from among multiple data indices. This third data index is any data index other than the first and second data indices. A third element chain will be drawn on the storage graph for this third data index, and a data identifier linked list will be generated for associated storage. This process continues until all data indices are traversed, generating a data identifier linked list for each data index. It should be noted that since the first and second element chains have already been generated, during the subsequent generation of element chains, they can be continuously compared with the already generated chains to identify any overlapping parts. If overlapping parts are found, the length of the subsequently generated element chains can be shortened using these overlapping parts, allowing multiple generated element chains to be grouped together. Otherwise, new element chains can be generated directly by referring to the generation process of the first element chain, without forcibly associating each element chain.

[0090] In this way, the embodiments of this application realize that for each string element of the input index, the data index graph is used to classify the data indexes one node at a time, and the data indexes with the same data identifier are clustered into the linked list of the same data identifier. This storage scheme can not only compress storage space, but also improve storage and query efficiency.

[0091] The method provided in this application, when storing order data, creates a corresponding data identifier linked list for each data index through a data index graph. Thus, during data querying, at least one data index to be queried is obtained, and the data identifier set corresponding to each of the at least one data index to be queried is queried to obtain at least one data identifier set. At least one target data identifier is determined from the at least one data identifier set, and a data query result is generated and transmitted based on the at least one target data identifier. By setting a data identifier linked list for each data index, aggregate queries targeting data indexes are quickly achieved. Compared to the traditional relational database method of querying by creating multiple index tables, this significantly improves data query speed, resulting in a marked increase in efficiency and saving a considerable amount of query time.

[0092] Example 3

[0093] Furthermore, as a refinement and extension of the specific implementation method of the above embodiment one, in order to fully illustrate the specific implementation process of this embodiment, this application provides another data storage method, such as... Figure 3 As shown, the method includes:

[0094] 301. Receive data query request.

[0095] In this embodiment, the online platform can provide merchants with an entry point for data querying, such as providing "Report Query" and "Data Query" buttons on the merchant interface. When the button is detected to be triggered, it is determined that a request to display data has been detected, that is, it is determined that a data query request has been received.

[0096] In addition, in practical applications, the platform can also set a preset update interval to continuously monitor the current time point. When it detects that the time interval between the current time point and the historical display time point has reached the preset update interval, it will determine that a data query request has been received, automatically perform data query, and update the data displayed to merchants. This allows merchants to directly see the store's operating status after logging into the platform without having to manually query it.

[0097] 302. In response to a data query request, read the data item to be queried indicated by the data query request, determine the data index corresponding to the data item to be queried, and use the determined data index as at least one data index to be queried.

[0098] In this embodiment, since the application implements aggregated queries based on data indexes, in response to a data query request, the platform obtains at least one data index to be queried, and subsequently performs aggregated queries on the data indexes using at least one data index to be queried. Since different data items depend on different data indexes for querying data, the platform reads the data item to be queried indicated by the data query request, determines the data index corresponding to the data item to be queried, and uses the determined data index as at least one data index to be queried.

[0099] For example, if the data index corresponding to the item to be queried indicated by the current data query request is busi_type=BUSINESS_INCOME, order_source=POS, and order_status=SETTLED, then these three status fields can be used as the index of the data to be queried. Subsequently, data identifiers that simultaneously satisfy these three status fields can be obtained through querying.

[0100] 303. Based on the linked list of data identifiers associated with each data index to be queried, determine the set of data identifiers corresponding to each data index to be queried, and obtain at least one set of data identifiers for at least one data index to be queried.

[0101] Since this application embodiment sets up a data identifier linked list for each data index, after determining at least one data index to be queried, the platform will determine the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, thus obtaining at least one data identifier set for at least one data index to be queried. That is, it will query which data identifiers correspond to each data index to be queried, forming the data identifier set for each data index to be queried. Subsequently, the data query results can be output through the queried data identifiers. The process of generating the data identifier set is described below:

[0102] For each data index to be queried in at least one data index, since each element chain drawn in the data index graph is associated with a data identifier linked list at the end, and the data identifier linked list indicates the data identifier corresponding to the data index, the platform will obtain the data index graph and determine the target element chain corresponding to the data index to be queried on the data index graph. Subsequently, the platform will obtain the target data identifier linked list associated with the target element chain in the data index graph, extract at least one data identifier included in the target data identifier linked list, and generate an identifier set including at least one data identifier as the data identifier set corresponding to the data index to be queried. For example, suppose the data index graph is as follows: Figure 2C As shown, if the data index to be queried is "WAIT_SETTLED", then the data identifiers "2", "3", and "6" can be obtained from the data identifier chain associated with the element chain of the data index to be queried. A data identifier set including the data identifiers "2", "3", and "6" is generated as the data identifier set corresponding to the data index to be queried.

[0103] By repeating the above process of generating data identifier sets, a corresponding data identifier set can be generated for each data index to be queried, resulting in at least one data identifier set.

[0104] 304. Identify at least one target data identifier in at least one set of data identifiers.

[0105] In this embodiment of the application, since the final output data identifier needs to satisfy all the query data indexes at the same time, the platform will determine at least one target data identifier in at least one data identifier set. Each data identifier set in the at least one data identifier set includes at least one target data identifier, that is, at least one target data identifier is the intersection of at least one data identifier set.

[0106] For example, if we need to query all order data where busi_type = BUSINESS_INCOME, order source = POS, and order status = SETTLED, and the data identifier set retrieved by the data index "busi_type = BUSINESS_INCOME" is [1, 2, 6], the data identifier set retrieved by the data index "order_source = POS" is [1, 2], and the data identifier set retrieved by the data index "order_status = SETTLED" is [1, 2, 4], then the result obtained by merging the intersection of the three data identifiers is [1, 2]. Thus, the final target data identifiers are 1 and 2.

[0107] 305. Generate and transmit data query results based on at least one target data identifier.

[0108] In this embodiment, after determining at least one target data identifier, the platform generates and transmits data query results. When generating the data query results, since the currently determined data identifier is used, the platform needs to retrieve all data based on the identifier to generate the data query results and provide feedback to the merchant. Therefore, the platform queries the order data corresponding to each of the at least one target data identifier, obtaining at least one order data item. It then reads the data items to be queried as indicated in the data query request, organizes the at least one order data item according to the data items to be queried, and generates the data query results. Finally, the platform determines the recipient of the results indicated in the data query request. This recipient can be an account, phone number, email address, etc., set by the merchant, and the platform transmits the data query results to the recipient.

[0109] In this way, the data query process can be greatly accelerated by creating multiple index tables in the database to query all results and then merge and filter them. By creating a data index graph of the fields in the data table to be indexed and combining it with a data identifier linked list, aggregate queries on the data index can be quickly achieved. Compared with traditional relational databases that query by creating multiple index tables, the efficiency is significantly improved, the query speed is much faster, and the query time can be greatly reduced.

[0110] The method provided in this application embodiment, in response to a data query request, obtains at least one data index to be queried, queries the data identifier set corresponding to each of the at least one data index to be queried, obtains at least one data identifier set, determines at least one target data identifier in the at least one data identifier set, generates and transmits a data query result based on the at least one target data identifier, and quickly realizes aggregate query for data index by setting a data identifier linked list for each data index. Compared with the traditional relational database method of querying by establishing multiple index tables, it greatly improves the data query speed, significantly improves efficiency, and saves a lot of query time.

[0111] Furthermore, as Figure 1 To specifically implement the method, this application provides a data query device, such as... Figure 4 As shown, the device includes: an acquisition module 401, a determination module 402, and a generation module 403.

[0112] The acquisition module 401 is used to acquire at least one index of data to be queried in response to a data query request;

[0113] The determining module 402 is used to determine the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, so as to obtain at least one data identifier set for the at least one data index to be queried;

[0114] The generation module 403 is used to determine at least one target data identifier in the at least one set of data identifiers, generate a data query result based on the at least one target data identifier, and transmit it, wherein each set of data identifiers in the at least one set of data identifiers includes the at least one target data identifier.

[0115] In specific application scenarios, the device also includes:

[0116] The reading module is used to acquire multiple order data to be stored, and to read at least one data index corresponding to each order data to be stored in the multiple order data to be stored, thereby obtaining multiple data indexes;

[0117] The construction module is used to count at least one order data to be stored corresponding to each of the multiple data indexes, and to generate a data identifier linked list for each data index based on the at least one order data to be stored corresponding to each data index.

[0118] In a specific application scenario, this construction module is used to: determine a first data index among the plurality of data indexes, wherein the first data index is any data index among the plurality of data indexes; determine a plurality of first string elements constituting the first data index; draw a chain-like first element chain including the plurality of first string elements according to the arrangement order of the plurality of first string elements in the first data index; generate a data index graph including the first element chain; determine at least one order data to be stored corresponding to the first data index among the plurality of order data to be stored; obtain at least one data identifier of the at least one order data to be stored; generate a data identifier linked list including the at least one data identifier; and associate and store the data identifier linked list with the first element chain in the data index graph; and determine a second data index among the plurality of data indexes, wherein the second data index is... The method involves considering any data index other than the first data index among multiple data indexes; drawing a second element chain for the second data index on the data index graph; determining at least one order data corresponding to the second data index among the multiple order data to be stored; obtaining at least one data identifier for the at least one order data to be stored; generating a data identifier linked list including the at least one data identifier; and associating the data identifier linked list with the second element chain in the data index graph; continuing to determine a third data index among the multiple data indexes; drawing a third element chain for the third data index on the storage graph and generating a data identifier linked list for associated storage; and so on, until the multiple data indexes are traversed and a data identifier linked list is generated for each data index, wherein the third data index is any data index other than the first data index and the second data index among the multiple data indexes.

[0119] In a specific application scenario, this construction module is used to determine multiple second string elements constituting the second data index, identify whether the multiple second string elements include multiple target string elements, wherein the string formed by the multiple target string elements in the second data index is included in the first data index; when the multiple second string elements include the multiple target string elements, multiple remaining string elements are determined among the multiple second string elements, the multiple remaining string elements being second string elements other than the multiple target string elements; a target string element is determined as a turning point among the multiple target string elements, the turning point being a target string element adjacent to the multiple remaining string elements; a turning first string element mapped by the turning point is determined in the first element chain drawn in the data index graph, and a second element chain including the multiple remaining elements is drawn starting from the turning first string element.

[0120] In specific application scenarios, the building module is also used to draw a chain-like second element chain that includes the multiple target string elements on the data index graph according to the arrangement order of the multiple second string elements in the second data index when the multiple second string elements do not include the multiple target string elements.

[0121] In specific application scenarios, the determining module 402 is also used to determine that the data query request has been received when a request to display data is detected; or, to continuously detect the current time point and determine that the data query request has been received when the time interval between the current time point and the historical display time point is detected to reach a preset update interval.

[0122] In a specific application scenario, the acquisition module 401 is used to read the data item to be queried indicated by the data query request; determine the data index corresponding to the data item to be queried; and use the determined data index as the at least one data index to be queried.

[0123] In a specific application scenario, the determining module 402 is used to obtain a data index graph for each of the at least one query data indexes, determine the target element chain corresponding to the query data index on the data index graph, obtain the target data identifier chain associated with the target element chain in the data index graph, extract at least one data identifier included in the target data identifier chain, generate an identifier set including the at least one data identifier as the data identifier set corresponding to the query data index, and generate a corresponding data identifier set for each query data index to obtain the at least one data identifier set.

[0124] In a specific application scenario, the generation module 403 is used to query the order data corresponding to each target data identifier in the at least one target data identifier to obtain at least one order data; read the data items to be queried indicated by the data query request, organize the at least one order data according to the data items to be queried, and generate the data query result; determine the result recipient indicated by the data query request, and transmit the data query result to the result recipient.

[0125] The apparatus provided in this application embodiment, in response to a data query request, obtains at least one data index to be queried, queries the data identifier set corresponding to each of the at least one data index to be queried, obtains at least one data identifier set, determines at least one target data identifier in the at least one data identifier set, generates and transmits a data query result based on the at least one target data identifier, and quickly realizes aggregate query for data index by setting a data identifier linked list for each data index. Compared with the traditional relational database method of querying by establishing multiple index tables, it greatly improves the data query speed, significantly improves efficiency, and saves a lot of query time.

[0126] It should be noted that other corresponding descriptions of the functional units involved in the data query device provided in this application embodiment can be found by referring to... Figure 1 , Figures 2A to 2C as well as Figure 3 The corresponding description in [the document] will not be repeated here.

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

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

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

[0130] In an exemplary embodiment, see Figure 5 The invention also provides a computer device including a bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device, wherein the various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor executes the program stored in the memory, performing the data query method described in the above embodiments.

[0131] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the data query method.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented in hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0133] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.

[0134] Those skilled in the art will understand that the modules in the apparatus of the implementation scenario can be distributed within the apparatus of the implementation scenario as described, or they can be located in one or more apparatuses different from this implementation scenario, with corresponding changes. The modules of the above-described implementation scenario can be combined into one module, or they can be further divided into multiple sub-modules.

[0135] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of the implementation scenario.

[0136] The above disclosures are only a few specific implementation scenarios of this application. However, this application is not limited to these. Any variations that can be conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. A data query method, characterized in that, include: In response to a data query request, at least one data index to be queried is obtained; wherein, before obtaining at least one data index to be queried in response to a data query request, multiple order data to be stored are obtained, and at least one data index corresponding to each order data to be stored in the multiple order data to be stored is read respectively to obtain multiple data indexes; at least one order data to be stored corresponding to each data index in the multiple data indexes is counted respectively, and a data identifier linked list is generated for each data index based on the at least one order data to be stored corresponding to each data index, wherein generating a data identifier linked list for each data index includes: determining a first data index in the multiple data indexes, wherein the first data index is any data index in the multiple data indexes; determining multiple first string elements constituting the first data index, drawing a chain-like first element chain including the multiple first string elements according to the arrangement order of the multiple first string elements in the first data index, and generating a data index graph including the first element chain; determining at least one order data to be stored corresponding to the first data index in the multiple order data to be stored, and obtaining the at least one order data to be stored. At least one data identifier of the order data is used to generate a data identifier linked list including the at least one data identifier, and the data identifier linked list is associated and stored with the first element chain in the data index graph; a second data index is determined among the plurality of data indexes, the second data index being any data index other than the first data index among the plurality of data indexes; a second element chain is drawn for the second data index on the data index graph, and at least one order data to be stored corresponding to the second data index is determined among the plurality of order data to be stored, at least one data identifier of the at least one order data to be stored is obtained, a data identifier linked list including the at least one data identifier is generated, and the data identifier linked list is associated and stored with the second element chain in the data index graph; a third data index is determined among the plurality of data indexes, a third element chain is drawn for the third data index on the data index graph and a data identifier linked list is generated for associated storage, until the plurality of data indexes are traversed, and a data identifier linked list is generated for each data index, the third data index being any data index other than the first data index and the second data index among the plurality of data indexes; Based on the linked list of data identifiers associated with each data index to be queried, determine the set of data identifiers corresponding to each data index to be queried, and obtain at least one set of data identifiers for the at least one data index to be queried; At least one target data identifier is determined in the at least one set of data identifiers, and a data query result is generated and transmitted based on the at least one target data identifier, wherein each set of data identifiers in the at least one set of data identifiers includes the at least one target data identifier.

2. The method according to claim 1, characterized in that, The step of drawing the second element chain for the second data index on the data index graph includes: Determine a plurality of second string elements constituting the second data index, and identify whether the plurality of second string elements include a plurality of target string elements, wherein the string formed by the plurality of target string elements in the second data index is included in the first data index; When the plurality of second string elements includes the plurality of target string elements, a plurality of remaining string elements are determined from the plurality of second string elements, wherein the plurality of remaining string elements are second string elements other than the plurality of target string elements; Among the plurality of target string elements, a target string element is determined as a turning point, wherein the turning point is a target string element that is adjacent to the plurality of remaining string elements. In the first element chain drawn in the data index graph, determine the first transition string element mapped by the transition node, and draw the second element chain including the plurality of remaining string elements, starting from the first transition string element.

3. The method according to claim 2, characterized in that, The method further includes: When none of the plurality of target string elements are included in the plurality of second string elements, a chain-like second element chain including the plurality of second string elements is drawn on the data index graph according to the order of the plurality of second string elements in the second data index.

4. The method according to claim 1, characterized in that, Before obtaining at least one index of the data to be queried in response to a data query request, the method further includes: When a request to display data is detected, it is determined that the data query request has been received; or, The system continuously monitors the current time point, and when the time interval between the current time point and the historical display time point reaches a preset update interval, it determines that the data query request has been received.

5. The method according to claim 1, characterized in that, The step of obtaining at least one index of data to be queried includes: Read the data item to be queried as indicated by the data query request; Determine the data index corresponding to the data item to be queried, and use the determined data index as the at least one data index to be queried.

6. The method according to claim 1, characterized in that, The step of determining the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, and obtaining at least one data identifier set for the at least one data index to be queried, includes: For each of the at least one query data indexes, obtain a data index graph and determine the target element chain corresponding to the query data index on the data index graph; Obtain the target data identifier chain list associated with the target element chain in the data index graph, extract at least one data identifier included in the target data identifier chain list, and generate an identifier set including the at least one data identifier as the data identifier set corresponding to the data index to be queried. Generate a corresponding set of data identifiers for each of the data indexes to be queried, thereby obtaining at least one set of data identifiers.

7. The method according to claim 1, characterized in that, The step of generating and transmitting data query results based on the at least one target data identifier includes: Query the order data corresponding to each of the at least one target data identifiers to obtain at least one order data; Read the data items to be queried indicated by the data query request, organize the at least one order data according to the data items to be queried, and generate the data query results; Determine the recipient of the results indicated by the data query request, and transmit the data query results to the recipient.

8. A data query device, characterized in that, include: The device includes an acquisition module for acquiring at least one data index to be queried in response to a data query request; the device further includes: a reading module for acquiring multiple order data to be stored, and reading at least one data index corresponding to each order data to be stored in the multiple order data to be stored, thereby obtaining multiple data indexes; and a construction module for statistically analyzing at least one order data to be stored corresponding to each data index in the multiple data indexes, and generating a data identifier linked list for each data index based on the at least one order data to be stored corresponding to each data index; wherein the construction module is configured to determine a first data index among the multiple data indexes, wherein the first data index is any data index among the multiple data indexes; determine multiple first string elements constituting the first data index; draw a chain-like first element chain including the multiple first string elements according to the arrangement order of the multiple first string elements in the first data index; and generate a data index graph including the first element chain; determine at least one order data to be stored corresponding to the first data index among the multiple order data to be stored, and acquire the at least one order data to be stored. At least one data identifier is used; a data identifier linked list including the at least one data identifier is generated; and the data identifier linked list is associated and stored with the first element chain in the data index graph. A second data index is determined among the plurality of data indexes, where the second data index is any data index other than the first data index among the plurality of data indexes. A second element chain is drawn for the second data index on the data index graph, and at least one order data corresponding to the second data index is determined among the plurality of order data to be stored. At least one data identifier of the at least one order data to be stored is obtained, and a data identifier linked list including the at least one data identifier is generated; and the data identifier linked list is associated and stored with the second element chain in the data index graph. A third data index is further determined among the plurality of data indexes, and a third element chain is drawn for the third data index on the data index graph, and a data identifier linked list is generated for associated storage, until the plurality of data indexes are traversed, and a data identifier linked list is generated for each data index, where the third data index is any data index other than the first data index and the second data index among the plurality of data indexes. The determining module is used to determine the data identifier set corresponding to each data index to be queried based on the data identifier linked list associated with each data index to be queried, so as to obtain at least one data identifier set for the at least one data index to be queried; A generation module is configured to determine at least one target data identifier in the at least one set of data identifiers, generate a data query result based on the at least one target data identifier, and transmit it, wherein each set of data identifiers in the at least one set of data identifiers includes the at least one target data identifier.

9. The apparatus according to claim 8, characterized in that, The construction module is configured to determine a plurality of second string elements constituting the second data index, identify whether the plurality of second string elements include a plurality of target string elements, wherein the string formed by the plurality of target string elements in the second data index is included in the first data index; when the plurality of second string elements include the plurality of target string elements, determine a plurality of remaining string elements among the plurality of second string elements, wherein the plurality of remaining string elements are second string elements other than the plurality of target string elements; determine a target string element as a turning node among the plurality of target string elements, wherein the turning node is a target string element adjacent to the plurality of remaining string elements among the plurality of target string elements; determine the turning first string element mapped by the turning node in the first element chain drawn in the data index graph, and draw the second element chain including the plurality of remaining elements starting from the turning first string element.

10. The apparatus according to claim 9, characterized in that, The construction module is further configured to, when the plurality of second string elements do not include the plurality of target string elements, draw a chain-like second element chain on the data index graph according to the arrangement order of the plurality of second string elements in the second data index.

11. The apparatus according to claim 8, characterized in that, The determining module is further configured to determine that the data query request has been received when a request to display data is detected; or, to continuously detect the current time point and determine that the data query request has been received when the time interval between the current time point and the historical display time point is detected to reach a preset update interval.

12. The apparatus according to claim 8, characterized in that, The acquisition module is used to read the data item to be queried indicated by the data query request; determine the data index corresponding to the data item to be queried; and use the determined data index as the at least one data index to be queried.

13. The apparatus according to claim 8, characterized in that, The determining module is configured to: for each of the at least one query data indexes, obtain a data index graph; determine the target element chain corresponding to the query data index on the data index graph; obtain a target data identifier chain list associated with the target element chain in the data index graph; extract at least one data identifier included in the target data identifier chain list; generate an identifier set including the at least one data identifier as the data identifier set corresponding to the query data index; and generate a corresponding data identifier set for each query data index to obtain the at least one data identifier set.

14. The apparatus according to claim 8, characterized in that, The generation module is used to query the order data corresponding to each target data identifier in the at least one target data identifier, and obtain at least one order data; Read the data items to be queried indicated by the data query request, organize the at least one order data according to the data items to be queried, and generate the data query results; Determine the recipient of the results indicated by the data query request, and transmit the data query results to the recipient.

15. 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.

16. 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.

Citation Information

Patent Citations

  • Data query method and device, equipment and medium

    CN115292322A