Data query method, device, equipment, storage medium and program product

By displaying only a portion of the fields in the historical business transaction log table and storing them as a file, and using the primary key information to set the file path, the problem of low query efficiency in database sharding and table partitioning was solved, achieving efficient data querying and simplified operation processes.

CN119149493BActive Publication Date: 2025-12-26CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411177645.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-12-26
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The existing technology that uses database sharding and table partitioning for querying results in low data query efficiency, complicated and time-consuming operations, and affects user experience.

Method used

When multiple target records are found in the historical business transaction log, only the fields within the preset range are displayed, while the other fields are stored as a file. The file name and path are set using the primary key information, and users can click the details button to view the detailed content.

Benefits of technology

It improves the efficiency of querying massive amounts of data, simplifies the operation process, reduces operation and maintenance costs, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149493B_ABST
    Figure CN119149493B_ABST
Patent Text Reader

Abstract

The application provides a data query method and device, equipment, storage medium and program product, and relates to the field of big data. The method comprises the following steps: in response to a first query request of a user, at least one target record is obtained from a historical business log table; if it is determined that the number of fields of the target record is greater than a preset number, a first field in the target record is displayed, and a detail button corresponding to the target record is displayed; a first file corresponding to the target record is generated according to a second field in the target record; the file name and the file path of the first file are determined according to the primary key information corresponding to the target record; and in response to a click operation of the user on the target detail button, the second field in the target record corresponding to the target detail button is displayed. The method improves the data query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of big data, and in particular, to a data query method and device, equipment, a storage medium and a program product. BACKGROUND

[0002] After business processing based on a computer system, a large amount of historical business data is generated, and historical business data query processing can be performed based on a data query function.

[0003] In the prior art, a method of database and table separation query is adopted, and after data storage through vertical or horizontal database separation, data query is performed through vertical or horizontal database separation.

[0004] However, in the above-mentioned method, the method of database and table separation query needs to perform multiple database and table query operations, which is complicated and time-consuming, resulting in low data query efficiency. SUMMARY

[0005] The present application provides a data query method, device, equipment, storage medium and program product to solve the technical problem of low data query efficiency caused by the method of database and table separation query.

[0006] In a first aspect, the present application provides a data query method, comprising: in response to a first query request of a user, obtaining at least one target record from a historical business log table; wherein the first query request includes a first query field representing a data query condition; the historical business log table includes at least one business record, and the business record includes at least one business table field representing business data; the target record is a business record in which the business table field corresponding to the first query field is located; if it is determined that the number of fields of the target record is greater than a preset number, the first field in the target record is displayed, and a detail button corresponding to the target record is displayed; wherein the number of fields is the total number of business table fields in the target record; the first field is a business table field within a preset range in the target record; a first file corresponding to the target record is generated according to a second field in the target record; wherein the second field is other business table field in the target record except for each first field; the first file includes each second field in the target record; the first file is stored in a file system; the file name and file path of the first file are determined according to the primary key information of the target record; wherein the primary key information represents the unique identifier corresponding to each second field in the target record; in response to the click operation of the target detail button by the user, the second field in the target record corresponding to the target detail button is displayed.

[0007] In a possible design, the file name and the file path of the first file are determined according to the primary key information corresponding to the target record, including: determining the primary key information and description information corresponding to the target record; and determining the file name of the first file according to the primary key information and the description information; wherein the description information represents the type of the business table in which the target record is located; and the file path of the first file is determined according to the primary key information corresponding to the target record.

[0008] In a possible design, the primary key information corresponding to the target record is determined, including:

[0009] The time field and the identification field in the target record are determined; wherein the time field represents time data in the business data represented by each second field in the target record, and the identification field represents identification data in the business data represented by each second field in the target record; and the primary key information corresponding to the target record is determined according to the time field and the identification field.

[0010] In a possible design, the method further includes: if it is determined that the business table field corresponding to the first query field does not exist in the historical business log table, adding the business table field corresponding to the first query field in the current business log table; and migrating the business log table to the historical business log table.

[0011] In a possible design, after the business log table is migrated to the historical business log table, the method further includes: determining at least one associated business table associated with the business log table; wherein the associated business table includes at least one business record; and storing each associated business table into a second file in the file system; wherein the second file has a file name and a file path.

[0012] In a possible design, the method further includes: in response to a second query request of the user, determining a target file name corresponding to the second query request; wherein the second query request includes a second query field representing a data query condition; and querying a file corresponding to the target file name from the file system according to the target file name.

[0013] In a second aspect, the present application provides a data query device, comprising: an acquisition module, configured to acquire at least one target record from a historical business log table in response to a first query request of a user; wherein the first query request comprises a first query field representing a data query condition; the historical business log table comprises at least one business record, and the business record comprises at least one business table field representing business data; the target record is a business record in which the business table field corresponding to the first query field is located; a first display module, configured to display a first field in the target record and a detail button corresponding to the target record if it is determined that a field number of the target record is greater than a preset number; wherein the field number is a total number of business table fields in the target record; the first field is a business table field within a preset range in the target record; a generation module, configured to generate a first file corresponding to the target record according to a second field in the target record; wherein the second field is a business table field other than each first field in the target record; the first file comprises each second field in the target record; the first file is stored in a file system; a determination module, configured to determine a file name and a file path of the first file according to primary key information corresponding to the target record; wherein the primary key information represents a unique identifier corresponding to each second field in the target record; and a second display module, configured to display the second field in the target record corresponding to the target detail button in response to a click operation of the user on the target detail button.

[0014] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory connected to the processor in communication;

[0015] The memory stores computer execution instructions.

[0016] The processor executes the computer execution instructions stored in the memory to implement the method of the first aspect.

[0017] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method of the first aspect.

[0018] In a fifth aspect, the present application provides a computer program product, comprising: a computer program, wherein the computer program is executed by a processor to implement the method of the first aspect.

[0019] The data query method, device, equipment, storage medium and program product provided by the application can query a plurality of target records corresponding to a query field in a historical business flow table, display only the fields in a preset range in each target record, place other fields in a first file, set the file name and file path of the first file according to the primary key information of the other fields, so as to facilitate subsequent file review, and meanwhile, the user can click a target detail button to view the other fields in the corresponding target record, thereby improving the mass data query efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0021] Figure 1 An application scenario diagram is provided for the application;

[0022] Figure 2 A flowchart of a data query method is provided for the embodiments of the application;

[0023] Figure 3 A flowchart of another data query method is provided for the embodiments of the application;

[0024] Figure 4 A flowchart of still another data query method is provided for the embodiments of the application;

[0025] Figure 5 A flowchart of yet another data query method is provided for the embodiments of the application;

[0026] Figure 6 A structural diagram of a data query device is provided for the embodiments of the application;

[0027] Figure 7 A structural diagram of an electronic device is provided for the embodiments of the application.

[0028] The specific embodiments of the application have been shown in the above drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to restrict the scope of the concept of the application in any way, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0029] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is only exemplary of the application. Therefore, specific details disclosed herein are not to be interpreted as limiting the scope of the application. Rather, the embodiments described herein are merely exemplary and intended to provide an overview or framework to understanding the application. The application can be used in any number of embodiments and the specifics set forth herein are merely intended to provide a contextual basis for the application and are not intended to limit the scope of the application in any way.

[0030] In the technical solutions of the present application, the collection, storage, use, processing, transmission, provision and disclosure of financial data or user data and other information comply with relevant laws and regulations and do not violate public order and good customs.

[0031] It should be noted that in the embodiments of the present application, some software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0032] Figure 1 An application scenario provided by the present application is shown in FIG. 1. As shown in FIG. 1, the specific application scenario of the present application includes an electronic device 101 and a user 102. The user 102 can perform historical business data query processing through the data query function of the electronic device 101. Figure 1

[0033] In one example, in the historical data query, the method of splitting the database and the table is generally used, which is mainly divided into vertical database splitting and horizontal database splitting. The vertical database splitting is generally stored according to the dimension of the business or the dimension of the data hotspot, and based on the electronic device 101, the database query operation is performed according to the dimension of the business or the dimension of the data hotspot. The horizontal database splitting is to split the business data as evenly as possible into different tables for storage according to certain rules, and based on the electronic device 101, the database query operation is performed from different tables.

[0034] However, in the above-mentioned manner, the database and table query method needs to perform multiple database and table query operations, which is complicated and time-consuming, resulting in low data query efficiency. In addition, the historical query involves multi-table query association and result aggregation after multi-database execution, or a new product tool needs to be introduced, which has high operation and maintenance cost. In addition, the user queries multiple times in different time periods, which reduces the user experience.

[0035] ​In view of the above technical problems, the present application proposes the following technical concept: by querying a plurality of target records corresponding to the query field in the historical business flow table, only the fields in a preset range in each target record are displayed, other fields are placed in a first file, and the file name and file path of the first file are set according to the primary key information of the other fields, so as to facilitate subsequent file review, and meanwhile, the user can click the target detail button to view the other fields in the corresponding target record. In this way, the problem of low data query efficiency caused by the query mode of separate database and separate table in the prior art can be solved.

[0036] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0037] Figure 2 A flowchart of a data query method provided by an embodiment of the present application is shown in FIG. 1, and the method comprises the following steps. Figure 2

[0038] 201, in response to a first query request of a user, at least one target record is obtained from a historical business flow table; wherein the first query request includes a first query field representing a data query condition; the historical business flow table includes at least one business record, and each business record includes at least one business table field representing business data; the target record is a business record in which the business table field corresponding to the first query field is located.

[0039] Exemplarily, the execution subject of the present embodiment can be an electronic device, hereinafter referred to as a device. The device can be an entity device or a virtual device that executes the data query method. When a user establishes a historical business flow table through the device, the table structure is the same as or similar to the current business table, and at the end of the day or at a certain time, a scheduled task will migrate data meeting the conditions from the current business table to the historical business flow table, and then the historical business flow table includes a plurality of business records, and each business record includes at least one business table field representing business data; for example, as shown in Table 1, in a system for managing buses, there is a historical main flow table of buses as follows.

[0040] Table 1 Historical main flow table of buses

[0041]

[0042] ​When the user needs to make a data query, the user operates the device, selects the displayed preset query field on the device interface, and inputs a query request to the device, wherein the query request includes a first query field used to represent a data query condition, such as a bus management history query condition including a start time of use, an end time of use, an applicant, a passenger, and a license plate number. The device responds to the first query request of the user, selects a history business log table as a query master table according to a correspondence between the query field and a business table field, and performs a query from the history business log table to obtain one or more business records corresponding to the first query field, that is, a target record.

[0043] 202. If it is determined that the number of fields of the target record is greater than the preset number, a first field in the target record is displayed, and a detail button corresponding to the target record is displayed; wherein the number of fields is the total number of business table fields in the target record; and the first field is a business table field within a preset range in the target record.

[0044] Exemplarily, the device determines the total number of business table fields in each target record searched based on the history list query function, that is, the number of fields of the target record, judges whether the number of fields of the target record is greater than the preset number, and if it is determined that the number of fields of the target record is greater than the preset number, that is, the number of business table fields in the target record in the history master log table is too large, the device determines a business table field within a preset range in the target record, that is, a first field, displays only the first field in each target record through list query, and displays a detail button corresponding to each target record based on the history detail display function, which is used to instruct the user to query the specific detailed content of the target record. For example, as shown in Table 2, the query list searched displays the first field in each target record.

[0045] Table 2 Query list

[0046] Serial ID Application Date Applicant Rider License Plate Number 20240101123045666a123456 20240101 Zhang San Li Si Hai A11111

[0047] 203. A first file corresponding to the target record is generated according to a second field in the target record; wherein the second field is a business table field other than each first field in the target record; the first file includes each second field in the target record; and the first file is stored in a file system.

[0048] Exemplarily, after the device determines the first field in each target record, the device determines a business table field other than each first field in each target record as a second subfield, generates a text file corresponding to each target record, that is, a first file, stores each second field in each target record in the corresponding first file, and stores the first file in the file system for processing.

[0049] 204. Based on the primary key information corresponding to the target record, determine the file name and file path of the first file; whereby the primary key information represents the unique identifier corresponding to each second field in the target record.

[0050] For example, when storing the first file corresponding to each target record, the device sets the file name and file path of each corresponding first file according to the unique identifier corresponding to each second field in each target record, i.e., the primary key information; for example, other fields are put into a text file, the file name of which is "20240101123045666a123456.dat", and the field format can be key:value or json.

[0051] 205. In response to the user's click on the target details button, display the second field in the target record corresponding to the target details button.

[0052] For example, based on the historical details display function, users typically select a target record from the displayed query list and click the details button corresponding to the selected target record, i.e., the target details button. The device then responds to the click operation and displays the second field in the target record corresponding to the target details button. For example, after clicking the details button of a record in the historical query results, the application information, dispatch information, approval opinion details, vehicle information, driver information, etc. of the corresponding record are displayed. At this time, the user can query the business data corresponding to all business table fields of the target record.

[0053] This embodiment provides a data query method. By querying multiple target records corresponding to the query field in a historical business transaction table, only the fields within a preset range in each target record are displayed, and the other fields are placed in a first file. The file name and file path of the first file are set according to the primary key information of the other fields so that the file can be accessed later. At the same time, the user can click the target details button to view the other fields in the corresponding target record; thereby improving the efficiency of querying massive amounts of data.

[0054] Figure 3 A flowchart illustrating another data query method provided in this application embodiment is shown below. Figure 3 As shown, the method includes:

[0055] 301. In response to a user's first query request, obtain at least one target record from the historical business transaction table; wherein the first query request includes a first query field representing the data query conditions; the historical business transaction table includes at least one business record, and the business record includes at least one business table field representing business data; the target record is the business record containing the business table field corresponding to the first query field.

[0056] Exemplarily, the step can be referred to step 201, which will not be repeated here.

[0057] 302、If it is determined that the number of fields of the target record is greater than the preset number, display the first field in the target record and display the detail button corresponding to the target record; wherein the number of fields is the total number of business table fields in the target record; and the first field is a business table field within a preset range in the target record.

[0058] Exemplarily, the step can be referred to step 202, which will not be repeated here.

[0059] 303、According to the second field in the target record, generate a first file corresponding to the target record; wherein the second field is other business table field in the target record except for each first field; the first file includes each second field in the target record; and the first file is stored in the file system.

[0060] Exemplarily, the step can be referred to step 203, which will not be repeated here.

[0061] 304、Determine the primary key information and the description information corresponding to the target record; and determine the file name of the first file according to the primary key information and the description information; wherein the description information represents the type of the business table in which the target record is located.

[0062] Exemplarily, the device determines the primary key information and the description information corresponding to each target record according to the second field in the target record, wherein the description information represents the type of the business table in which the target record is located, such as an approval opinion table, a vehicle table, etc.; and sets the file name of the first file corresponding to the target record according to the primary key information and the description information corresponding to the target record, for example, the content of the approval opinion table can be landed as “20240101123045666a123456-opinion.dat”.

[0063] In one example, the determination of the primary key information corresponding to the target record in step 304 includes the following steps:

[0064] The first step of step 304 is to determine the time field and the identification field in the target record; wherein the time field represents the time data in the business data represented by each second field in the target record, and the identification field represents the identification data in the business data represented by each second field in the target record.

[0065] The second step of step 304 is to determine the primary key information corresponding to the target record according to the time field and the identification field.

[0066] Exemplarily, in order to ensure the uniqueness of the primary key, time information and personal identification information are generally added, that is, the device can first determine the time field and the identification field in each target record, the time field represents the time data in the business data represented by each second field in the target record, that is, the time information, for example, the application time, the departure time; the identification field represents the identification data in the business data represented by each second field in the target record, that is, the personal identification information, for example, the driver number; according to the time field and the identification field in each target record, the primary key information corresponding to each target record is determined; for example, the time field in the target record is 20240101123045666, and the identification field is a123456, then the obtained primary key information is 20240101123045666a123456, and the description field is opinion, then the obtained file name is 20240101123045666a123456-opinion.dat.

[0067] 305、According to the primary key information corresponding to the target record, the file path of the first file is determined.

[0068] Exemplarily, in order to quickly review each file, the device sets the file path of the first file corresponding to each target record according to the primary key information corresponding to each target record that has been determined, that is, the file path can be segmented, for example, segmented according to time interval and personal identification, which facilitates locating the file, for example, the method of "regular expression" can be used for path calculation, and when the file name is "20240101123045666a123456-opinion.dat", it is known that the file path is: / home / ap / nas / 20240101 / 1230 / 45 / 666 / a123456 / -opinion.dat.

[0069] 306、In response to the clicking operation of the user on the target detail button, the second field in the target record corresponding to the target detail button is displayed.

[0070] Exemplarily, this step can refer to step 205, which will not be described here.

[0071] In this embodiment, on the basis of the above embodiment, the time field and the identification field are added in the primary key information, which is used to set the file name and the file path; and then, the response in the mass level data can be faster, and the query efficiency of the mass data is improved.

[0072] Figure 4 The flowchart of another data query method provided by the embodiment of the application is shown in FIG. 6. Figure 4 The method comprises the following steps.

[0073] 401. In response to a user's first query request, obtain at least one target record from the historical business transaction table; wherein the first query request includes a first query field representing the data query conditions; the historical business transaction table includes at least one business record, and the business record includes at least one business table field representing business data; the target record is the business record containing the business table field corresponding to the first query field.

[0074] For example, this step can be referred to as step 201, which will not be repeated here.

[0075] 402. If the number of fields in the target record is greater than the preset number, the first field in the target record will be displayed, and the details button corresponding to the target record will be displayed; where the number of fields is the total number of business table fields in the target record; the first field is a business table field within the preset range in the target record.

[0076] For example, this step can be referred to as step 202, which will not be repeated here.

[0077] 403. Generate a first file corresponding to the target record based on the second field in the target record; wherein, the second field is the other business table fields in the target record besides the first fields; the first file includes all the second fields in the target record; the first file is stored in the file system.

[0078] For example, this step can be referred to as step 203, which will not be repeated here.

[0079] 404. Based on the primary key information corresponding to the target record, determine the file name and file path of the first file; whereby the primary key information represents the unique identifier corresponding to each second field in the target record.

[0080] For example, this step can be referred to as step 204, which will not be repeated here.

[0081] 405. In response to the user's click on the target details button, display the second field in the target record corresponding to the target details button.

[0082] For example, this step can be referred to as step 205, which will not be repeated here.

[0083] 406. If it is determined that the business table field corresponding to the first query field does not exist in the historical business transaction table, then add the business table field corresponding to the first query field to the current business transaction table.

[0084] For example, after step 401, when the device performs a data query, if it determines that the table field corresponding to the query field is not in the historical business transaction table, it directly stores the business table field corresponding to the first query field into the current business transaction table.

[0085] 407. Migrate the business flow table into a historical business flow table.

[0086] Exemplarily, based on the timing task, the device migrates each business table field in the business flow table into the historical main flow table at the end of the day, that is, it can facilitate subsequent data query.

[0087] 408. Determine at least one associated business table associated with the business flow table; wherein the associated business table includes at least one business record.

[0088] Exemplarily, based on the timing task, the device determines a plurality of associated business tables associated with the business flow table when the data meeting the condition is migrated from the business flow table into the historical main flow table at the end of the day, as shown in the following tables, wherein each associated business table includes at least one business record.

[0089] Table 3 Main flow table

[0090]

[0091] Table 4 Dispatch table

[0092] Serial ID Vehicle ID Driver ID Rider …… 20240101123045666a123456 CAR001 DR001 Li Si ……

[0093] Table 5 Approval opinion table

[0094] Serial ID Approval Time Approver Opinion … 20240101123045666a123456 20240101 13:01 Wang Wu Agree … 20240101123045666a123456 20240101 13:41 Zhao Liu Agree … 20240101123045666a123456 20240101 13:55 Sun Qi Disagree …

[0095] Table 6 Vehicle table

[0096] Vehicle ID License Plate Number Brand Model CAR001 Hai A11111 GL8 MPV

[0097] Table 7 Driver table

[0098] Driver ID Name Driver's License Type …… DR001 Zhou Ba C1 ……

[0099] 409. Store each associated business table into a second file in the file system; wherein the second file has a file name and a file path.

[0100] Exemplarily, the device lands the data of each associated business table into a file, that is, stores it into a second file in the file system, and the second file also has a file name and a file path. The file name and file path setting of the second file can refer to the file name and file path setting process of the first file, which will not be described here. For example, the file name can be set as “primary key + description.dat”, the table field format can be key:value or json, and the content of the approval opinion table can be landed as “20240101123045666a123456-opinion.dat”.

[0101] In this embodiment, based on the above embodiments, data migration is used to store each related business table as a file to facilitate subsequent file queries and improve data query efficiency. At the same time, storing data in the form of files means that the increase in data volume only requires disk expansion, which is low cost.

[0102] Figure 5 A flowchart illustrating another processing method provided in an embodiment of this application is shown below. Figure 5 As shown, the method includes:

[0103] 501. In response to a user's first query request, obtain at least one target record from the historical business transaction table; wherein the first query request includes a first query field representing the data query conditions; the historical business transaction table includes at least one business record, and the business record includes at least one business table field representing business data; the target record is the business record containing the business table field corresponding to the first query field.

[0104] For example, this step can be referred to as step 201, which will not be repeated here.

[0105] 502. If the number of fields in the target record is greater than the preset number, the first field in the target record will be displayed, along with the details button corresponding to the target record; where the number of fields is the total number of business table fields in the target record; and the first field is a business table field within the preset range in the target record.

[0106] For example, this step can be referred to as step 202, which will not be repeated here.

[0107] 503. Generate a first file corresponding to the target record based on the second field in the target record; wherein, the second field is the other business table fields in the target record besides the first fields; the first file includes all the second fields in the target record; the first file is stored in the file system.

[0108] For example, this step can be referred to as step 203, which will not be repeated here.

[0109] 504. Based on the primary key information corresponding to the target record, determine the file name and file path of the first file; whereby the primary key information represents the unique identifier corresponding to each second field in the target record.

[0110] For example, this step can be referred to as step 204, which will not be repeated here.

[0111] 505. In response to the user's click on the target details button, display the second field in the target record corresponding to the target details button.

[0112] For example, this step can be referred to as step 205, which will not be repeated here.

[0113] 506、in response to the second query request of the user, determine a target file name corresponding to the second query request; wherein the second query request includes a second query field representing a data query condition.

[0114] Exemplarily, when the user performs data query again, the device responds to the second query request input by the user, and according to the second query field representing the data query condition in the second query request, the target file name corresponding to the second query field can be determined based on the correspondence between the first query field and the file name.

[0115] 507、according to the target file name, query the file corresponding to the target file name from the file system.

[0116] Exemplarily, the device can use a "regular expression" method or the like to calculate the path of the target file name according to the determined target file name, so as to obtain the file path corresponding to the target file name, and through the file path, the file corresponding to the target file name can be queried from the file system, so as to complete the data query process.

[0117] In the embodiment, on the basis of the above-mentioned embodiment, the query field, the business table field, and the relationship between the file name and the file path are used to quickly locate the file corresponding to the query field, so as to improve the data query efficiency.

[0118] Figure 6 A structural schematic diagram of a data query device provided by the embodiment of the present application is shown in FIG. 1, which includes: Figure 6

[0119] The acquisition module 601 is configured to acquire at least one target record from the historical business log table in response to a first query request of a user; wherein the first query request includes a first query field representing a data query condition; the historical business log table includes at least one business record, and the business record includes at least one business table field representing business data; and the target record is a business record in which the business table field corresponding to the first query field is located.

[0120] The first display module 602 is configured to display a first field in the target record and a detail button corresponding to the target record if it is determined that the number of fields in the target record is greater than a preset number; wherein the number of fields is the total number of business table fields in the target record; and the first field is a business table field within a preset range in the target record.

[0121] ​The generating module 603 is configured to generate a first file corresponding to the target record according to a second field in the target record; the second field is a field of a business table in the target record other than the first fields; the first file includes the second fields in the target record; and the first file is stored in a file system.

[0122] The determining module 604 is configured to determine a file name and a file path of the first file according to primary key information corresponding to the target record; the primary key information represents unique identifiers of the second fields in the target record.

[0123] The second displaying module 605 is configured to display the second fields in the target record corresponding to the target detail button in response to a click operation of the target detail button by a user.

[0124] In a possible design, the determining module 604 is specifically configured to determine the primary key information and description information corresponding to the target record, and determine the file name of the first file according to the primary key information and the description information; the description information represents a type of the business table in which the target record is located; and the file path of the first file is determined according to the primary key information corresponding to the target record.

[0125] In a possible design, the determining module 604 is specifically configured to:

[0126] The determining module 604 is configured to determine a time field and an identifier field in the target record; the time field represents time data in the business data represented by the second fields in the target record, and the identifier field represents identifier data in the business data represented by the second fields in the target record; and the primary key information corresponding to the target record is determined according to the time field and the identifier field.

[0127] In a possible design, the apparatus is further configured to add a business table field corresponding to the first query field in the current business log table if it is determined that the business table field corresponding to the first query field does not exist in the historical business log table, and migrate the business log table to the historical business log table.

[0128] In a possible design, the apparatus is further specifically configured to determine at least one associated business table associated with the business log table; the associated business table includes at least one business record; and the associated business tables are stored in a second file in the file system; the second file has a file name and a file path.

[0129] In a possible design, the apparatus is further specifically configured to determine a target file name corresponding to a second query request of a user in response to the second query request; the second query request includes a second query field representing a data query condition; and a file corresponding to the target file name is queried from the file system according to the target file name.

[0130] The device of the embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principles are the same, which will not be repeated here.

[0131] It should be noted that the division of each module of the above device is only a logical division of functions, and all or part of the actual implementation can be integrated into a physical entity, or can be physically separated. And these modules can all be implemented in the form of software called by the processing element; all can be implemented in the form of hardware; some modules can be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware. Each module can be a separately established processing element, or can be integrated in a chip of the above device, in addition, the functions of each module can also be stored in the form of program code in the memory of the above device, and called and executed by a processing element of the above device. In addition, all or part of these modules can be integrated together, or can be independently implemented. The processing element here can be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit of hardware or the instruction of software in the processing element.

[0132] Figure 7 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 1. Figure 7 As shown in FIG. 1, the electronic device includes a memory 701, a processor 702, a memory 701, and a memory for storing executable instructions of the processor 702.

[0133] The processor 702 is configured to execute the method provided by the above embodiment.

[0134] The electronic device further includes a receiver 703 and a transmitter 704. The receiver 703 is used to receive instructions and data sent by other devices, and the transmitter 704 is used to send instructions and data to external devices.

[0135] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solutions in the above embodiments.

[0136] An embodiment of the present application also provides a computer readable storage medium, which stores computer instructions, and when the computer instructions run on a computer, the computer executes the technical solutions in the above embodiments.

[0137] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer readable storage medium, and at least one processor can read the computer program from the computer readable storage medium, and when the at least one processor executes the computer program, the technical solutions in the above embodiments can be implemented.

[0138] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other manners. For example, the embodiments of the device described above are merely schematic. For example, the division of the modules is only a logical function division. There can be another division manner for the actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different modules can be indirect couplings or communication connections through some interfaces, devices or modules, and can be electrical, mechanical or in other forms.

[0139] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to implement the embodiments of the present application.

[0140] In addition, each functional module in the embodiments of the present application can be integrated in one processing unit, or each module can be physically present separately, or two or more modules can be integrated in one unit. The unit formed by the above modules can be realized in the form of hardware, or in the form of hardware plus software function unit.

[0141] The integrated module realized in the form of software function module can be stored in a computer readable storage medium. The software function module stored in the storage medium includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the embodiments of the present application.

[0142] It should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor and the like. The steps of the method disclosed in the present application can be directly embodied as the execution of the hardware processor, or the execution of the combination of hardware and software modules in the processor.

[0143] The aforementioned storage medium can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk, or an optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0144] An exemplary storage medium is coupled to the processor so that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a part of the processor. Consistent with the teachings of this disclosure, the processor and the storage medium can be located in an ASIC. Alternatively, the processor and the storage medium can be located in a system on chip (SoC) component.

[0145] It should be noted that, for the aforementioned method embodiments, the sequences of the described actions are not the only possible implementation, and the actions can be implemented in other sequences or even simultaneously. Furthermore, it should be understood that the embodiments described in the specification are all optional embodiments of the present application, and the actions and modules involved are not necessarily essential to the present application.

[0146] It should be understood that the above-described apparatus embodiments are only illustrative, and the apparatus of the present application can also be implemented in other manners. For example, the division of the units / modules in the above-described embodiments is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units / modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0147] In the above-described embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments. The technical features of the above-described embodiments can be combined arbitrarily, and in order to make the description concise, not all possible combinations of the technical features in the above-described embodiments are described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0148] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0149] It is to be understood that the application is not limited to the precise construction herein disclosed and shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the claims that follow.

Claims

1. A data query method, characterized by, The method comprises: in response to a first query request of a user, obtaining at least one target record from a historical business log table; wherein the first query request comprises a first query field representing a data query condition; the historical business log table comprises at least one business record, and the business record comprises at least one business table field representing business data; the target record is a business record in which the business table field corresponding to the first query field is located; if it is determined that the number of fields of the target record is greater than a preset number, displaying a first field in the target record and displaying a detail button corresponding to the target record; wherein the number of fields is the total number of business table fields in the target record; the first field is a business table field within a preset range in the target record; generating a first file corresponding to the target record according to a second field in the target record; wherein the second field is a business table field other than each first field in the target record; the first file comprises each second field in the target record; and the first file is stored in a file system; determining a file name and a file path of the first file according to primary key information corresponding to the target record; wherein the primary key information represents a unique identifier corresponding to each second field in the target record; in response to a click operation of the user on the target detail button, displaying the second field in the target record corresponding to the target detail button.

2. The method of claim 1, wherein, Determining a file name and a file path of the first file according to primary key information corresponding to the target record comprises: determining primary key information and description information corresponding to the target record, and determining the file name of the first file according to the primary key information and the description information; wherein the description information represents the type of the business table in which the target record is located; determining the file path of the first file according to the primary key information corresponding to the target record.

3. The method of claim 2, wherein, Determining the primary key information corresponding to the target record comprises: determining a time field and an identifier field in the target record; wherein the time field represents time data in the business data represented by each second field in the target record, and the identifier field represents identifier data in the business data represented by each second field in the target record; determining the primary key information corresponding to the target record according to the time field and the identifier field.

4. The method of claim 1, wherein, The method further comprises: if it is determined that the historical business log table does not comprise a business table field corresponding to the first query field, adding the business table field corresponding to the first query field to a current business log table; migrating the business log table to the historical business log table.

5. The method of claim 4, wherein, After migrating the business log table to the historical business log table, the method further comprises: determining at least one associated business table associated with the business log table; wherein the associated business table comprises at least one business record; storing each associated business table in a second file in the file system; wherein the second file has a file name and a file path.

6. The method according to any one of claims 1-5, characterized in that, The method further comprises: In response to a second query request of the user, a target file name corresponding to the second query request is determined; wherein the second query request includes a second query field representing a data query condition; According to the target file name, a file corresponding to the target file name is queried from the file system.

7. A data query apparatus, characterized by comprising: The apparatus comprises: An acquisition module is configured to acquire at least one target record from a historical business log table in response to a first query request of a user; wherein the first query request includes a first query field representing a data query condition; the historical business log table includes at least one business record, and the business record includes at least one business table field representing business data; the target record is a business record in which the business table field corresponding to the first query field is located; A first display module is configured to display a first field in the target record and display a detail button corresponding to the target record if it is determined that the number of fields in the target record is greater than a preset number; wherein the number of fields is the total number of business table fields in the target record; and the first field is a business table field within a preset range in the target record; A generation module is configured to generate a first file corresponding to the target record according to a second field in the target record; wherein the second field is a business table field other than each first field in the target record; the first file includes each second field in the target record; and the first file is stored in a file system; A determination module is configured to determine a file name and a file path of the first file according to primary key information corresponding to the target record; wherein the primary key information represents a unique identifier corresponding to each second field in the target record; A second display module is configured to display the second field in the target record corresponding to the target detail button in response to a click operation of the user on the target detail button.

8. An electronic device, comprising: Comprise: A processor and a memory connected to the processor in communication; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method of any one of claims 1 to 6.

10. A computer program product, characterised in that, The computer program is executed by the processor to implement the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data storage method, data query method and related devices

    CN117972012A

  • Collection query driven generation of inverted index for raw machine data

    US20170139996A1