A data query method, device, equipment and storage medium
By building a wide target table in the data warehouse, the data query logic of the revenue board is simplified, and the problems of high query complexity and insufficient system stability in the existing technology are solved, and data query efficiency and user experience are improved.
Patent Information
- Application Number
- CN202210778189.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2042-06-29
AI Technical Summary
The data query logic of the existing revenue board is complex, resulting in timeout of interface response, high maintenance costs, insufficient system stability, difficult to troubleshoot problems, affecting user experience and system performance.
By obtaining multiple business data tables with association relationships from the database of the business system, storing them into the data warehouse, and building a wide target table in the database of the statistical system, simplifying query logic, reducing table associations, and improving query efficiency.
It effectively avoids query timeout problems, reduces maintenance costs, improves system performance and user experience, simplifies query logic, and improves data query efficiency and system fault tolerance.
Smart Images

Figure CN115033575B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data query method, device, equipment and storage medium. Background Art
[0002] At present, the data query of the revenue dashboard is directly based on the data warehouse, connecting the front-end and the back-end through the Data API, and providing data services using the API. The specific process is as follows: Figure 1 , write the query statement corresponding to the query item in the Data API, and then use the interface call to obtain the desired data from the data warehouse and provide it to the front end. When the user searches on the page, the front end provides the query parameters when calling the API, and then after the back end processing, the query parameters are added to the Data API query statement to obtain the desired query results.
[0003] The above process has the following problems: 1) The query logic is complex, and the interface response timeout problem occurs. Often, the query of a data in the revenue dashboard requires multiple tables to be associated and there are too many query conditions, which greatly reduces the query speed. The interface response time often exceeds 10 seconds, resulting in a very poor user experience;
[0004] 2) High connection and maintenance costs. Due to the complex query logic, the query statements in the Data API are generally long, with dozens of lines of query statements, and the code is relatively complex. Each iteration and optimization of the revenue dashboard requires taking over the development of the project and spending a lot of time to familiarize yourself with how to use it. As an internal operation of the company, when they find that the revenue statistics on the revenue dashboard are inconsistent with the cumulative revenue they estimate, they hope to find out which specific amount is inconsistent. Operations generally don’t know much about the Data API tool. If the query statement is too complicated, it will also cost operations a certain amount of learning costs and communication costs with testers and developers, which is time-consuming and laborious. In addition, the query statements are stored in the Data API development tool and require manual regular maintenance. Once someone else uses it, the query results will be affected; 3) The system is not stable enough, and problems are not easy to troubleshoot. Based on the current status of the business promotion of each business unit, the revenue of each business, and the lack of system stability during the peak trading period, there will be abnormal data on the revenue dashboard. Problems are not easy to troubleshoot, and it takes a lot of time to check the data.
[0005] Therefore, the above technical problems need to be solved urgently by those skilled in the art. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a data query method, device, equipment and storage medium, which can avoid the problem that the query logic involves multiple data tables at the same time, making the query complexity high and causing query timeout, simplify the query logic and thus improve the data query efficiency. The specific scheme is as follows:
[0007] The first aspect of the present application provides a data query method, comprising:
[0008] Acquire multiple business data tables with associated relationships from a database of the business system, and store the multiple business data tables in a data warehouse;
[0009] Determine a target field from fields corresponding to a plurality of business data tables stored in the data warehouse according to the query requirements, and construct a target wide table containing the target field and corresponding field data in a database of the statistical system; wherein the target field at least contains a field corresponding to the query data;
[0010] A query instruction is obtained and the target wide table is queried according to the query instruction to obtain the query data corresponding to the query instruction.
[0011] Optionally, after acquiring a plurality of business data tables having association relationships from a database of the business system, the method further includes:
[0012] The data in the multiple business data tables are sequentially extracted, cleaned and converted, so that the multiple business data tables after final processing are stored in the data warehouse.
[0013] Optionally, acquiring a plurality of business data tables having an associated relationship from a database of the business system and storing the plurality of business data tables in a data warehouse includes:
[0014] A data synchronization tool is used to synchronize the multiple business data tables with associated relationships in the database of the business system to the data warehouse according to a first preset synchronization period.
[0015] Optionally, after storing the plurality of business data tables in the data warehouse, the method further includes:
[0016] Integrate and calculate the data in the plurality of data tables according to the configuration logic stored in the data table format to obtain integrated field data;
[0017] Accordingly, constructing a target wide table including the target field and corresponding field data in the database of the statistical system includes:
[0018] The target wide table including the target field and the corresponding integrated field data is constructed in the database of the statistical system.
[0019] Optionally, constructing the target wide table containing the target field and the corresponding integrated field data in the database of the statistical system includes:
[0020] Constructing the target wide table including the target field in the database of the statistical system;
[0021] The integrated field data corresponding to the target field in the data warehouse is updated in the target wide table by setting and running a scheduled task.
[0022] Optionally, after obtaining the query instruction, the step further includes:
[0023] Obtaining a trigger account of the query instruction; wherein the trigger account is the first department account currently logged in the statistical system;
[0024] Determine the second department account number corresponding to the trigger account number in the business system, and query the field data related to the second department account number in the target wide table according to the query instruction to obtain the query data corresponding to the query instruction;
[0025] The query data corresponding to the query instruction is output to the manual interaction interface of the revenue dashboard for display.
[0026] Optionally, the data query method further includes:
[0027] A mapping relationship between the first department account in the statistical system and the second department account in the business system is constructed, so as to determine the second department account corresponding to the trigger account in the business system according to the mapping relationship.
[0028] A second aspect of the present application provides a data query device, comprising:
[0029] An acquisition storage module is used to acquire a plurality of business data tables having associated relationships from a database of a business system, and store the plurality of business data tables in a data warehouse;
[0030] A determination construction module is used to determine a target field from fields corresponding to the plurality of business data tables stored in the data warehouse according to the query requirements, and to construct a target wide table containing the target field and corresponding field data in the database of the statistical system; wherein the target field at least contains the field corresponding to the query data;
[0031] The query acquisition module is used to acquire a query instruction and query the target wide table according to the query instruction to obtain the query data corresponding to the query instruction.
[0032] A third aspect of the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned data query method.
[0033] A fourth aspect of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the aforementioned data query method is implemented.
[0034] In this application, a plurality of business data tables with associated relationships are first obtained from the database of the business system, and the plurality of business data tables are stored in the data warehouse; then, according to the query requirements, the target field is determined from the fields corresponding to the plurality of business data tables stored in the data warehouse, and a target wide table containing the target field and the corresponding field data is constructed in the database of the statistical system; wherein the target field at least contains the field corresponding to the query data; finally, a query instruction is obtained and the target wide table is queried according to the query instruction to obtain the query data corresponding to the query instruction. It can be seen that the present application uniformly stores the plurality of business data tables in the database of the business system in the data warehouse. Since the plurality of business data tables have associated relationships, when performing a query, the query logic may involve a plurality of data tables at the same time, and the query logic is relatively complex. To this end, the fields of the plurality of business data tables in the data warehouse are used as the extraction basis, the fields are extracted as needed, and a new wide table is constructed in the statistical system using the extracted fields and field data. When performing a query, most of the query logic only involves the newly constructed wide table, which can avoid the problem that the query logic involves a plurality of data tables at the same time, making the query complexity high and causing the query timeout, simplifying the query logic and thus improving the efficiency of data query. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 A schematic diagram of a method for querying data through an API provided in this application;
[0037] Figure 2 A flow chart of a data query method provided for this application;
[0038] Figure 3A schematic diagram of a specific data query method provided for this application;
[0039] Figure 4 A schematic diagram of a method for querying the paid amount of a statistical commission order provided in this application;
[0040] Figure 5 A schematic diagram of the structure of a data query device provided by this application;
[0041] Figure 6 A structural diagram of a data query electronic device provided in this application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] In the prior art, the solution of using Data API to connect the front-end and back-end and provide data services by API has technical problems such as complex query logic, interface response timeout, high connection and maintenance costs, insufficient system stability, and difficulty in troubleshooting. In response to the above technical defects, this application provides a data query solution that can avoid the query logic involving multiple data tables at the same time, making the query complexity high and causing query timeout, simplifying the query logic and thus improving data query efficiency.
[0044] Figure 2 A flow chart of a data query method provided in an embodiment of the present application. Figure 2 As shown, the data query method includes:
[0045] S11: Acquire a plurality of business data tables having association relationships from a database of a business system, and store the plurality of business data tables in a data warehouse.
[0046] In this embodiment, the data of each business constitutes the business system data source, that is, the database of the business system. User transactions are in each business system, and the transaction data generated during the transaction process is stored in the database of each business system, which constitutes the data source of the business system. First, a plurality of business data tables with associated relationships are obtained from the database of the business system, and the plurality of business data tables are stored in the data warehouse. It can be understood that the data warehouse (DataWarehouse, DW or DWH) can be abbreviated as a strategic set that provides all types of data support for decision-making processes at all levels of the enterprise. It is a single data storage created for analytical reporting and decision support purposes. For enterprises that need business intelligence, it provides guidance for business process improvement, monitoring time, cost, quality and control.
[0047] Furthermore, a data synchronization tool can be used to synchronize multiple business data tables with related relationships in the database of the business system to the data warehouse according to a first preset synchronization cycle. The data synchronization tool can trigger the synchronization of data to the data warehouse through a scheduled task, and the query adopts the form of "T+1" days, that is, today can only find data up to yesterday. Before synchronization, that is, after obtaining multiple business data tables with related relationships from the database of the business system, it is necessary to extract, clean and convert the data in the multiple business data tables in turn, so as to store the multiple business data tables after final processing in the data warehouse. For example, multiple business data tables (business order data, configuration data of the charging system, etc.) are: table1, table2, table3, table4, and the above tables are extracted, cleaned and converted by the data synchronization tool and loaded into the data warehouse and stored. Specifically, Figure 3 shown.
[0048] S12: Determine a target field from the fields corresponding to the multiple business data tables stored in the data warehouse according to the query requirements, and construct a target wide table containing the target field and corresponding field data in the database of the statistical system; wherein the target field at least includes the field corresponding to the query data.
[0049] In this embodiment, after storing multiple business data tables in the data warehouse, the target field is determined from the fields corresponding to the multiple business data tables stored in the data warehouse according to the query requirements. The target field at least includes the field corresponding to the query data. Then, a target wide table containing the target field and the corresponding field data is constructed in the database of the statistical system. A wide table literally means a database table with more fields. It usually refers to a data table in which indicators, attributes, and maintenance related to a business theme are associated together. It reduces table associations by placing related fields in multiple tables in the same table, thereby improving the efficiency of data calculation. In short, it is to exchange space for time, facilitate iteration, reduce the number of table associations, and do not need to change multiple tables when modifying a small amount of data.
[0050] In this embodiment, configuration logic is stored in the data warehouse, and the data in the multiple data tables are further integrated and calculated according to the configuration logic stored in the data table format to obtain the integrated field data. The newly created target wide table is mainly used to store the integrated statistical fields. All the fields to be used for statistics are placed in the same table, and finally the data statistical query is performed directly through the wide table, which reduces the number of table associations and improves the efficiency of data query statistics. The target wide table containing the target field and the corresponding integrated field data is constructed in the database of the statistical system. Specifically, the target wide table containing the target field is first constructed in the database of the statistical system, and then the integrated field data corresponding to the target field in the data warehouse is updated in the target wide table by setting and running a scheduled task.
[0051] For example, after the data warehouse task is synchronized every day, the fields required for statistics, such as field 1, field 2, field 3, field 4, field 5, etc., are taken out from multiple business tables and permission tables such as table1, table2, table3, table4, etc. through a scheduled task to form a temporary wide table table5. The fields required for data statistics are synchronized from each table to the temporary wide table table5 at 00:00 every day in the form of a scheduled task. In this way, the wide table already has all the fields we need to use for data query. As for the index of the wide table, it can be created according to actual business needs. In addition, the data may be updated every day. Through the scheduled task, the changed data in the data warehouse is updated and synchronized to the wide table table5 at 2:00 am every day. Because table5 already contains all the fields required for statistical data, the data system query can directly filter all conditions through the temporary wide table and query all required fields. This greatly reduces the number of table associations, greatly reduces the database pressure, speeds up the query speed, and improves the query performance.
[0052] S13: Acquire a query instruction and query the target wide table according to the query instruction to obtain the query data corresponding to the query instruction.
[0053] In this embodiment, when a screening query is performed on a page, a query instruction is obtained and the target wide table is queried according to the query instruction to obtain the query data corresponding to the query instruction. This data query process can be used in all statistical schemes, can improve data query efficiency, has universality and is conducive to secondary development. In most cases, statistical data cannot be obtained in only one table. For logically complex queries, the fields in multiple tables can be extracted and integrated into a new wide table for query as needed in this way, reducing data association queries, simplifying SQL query statements, and thus improving query efficiency. Generally speaking, data statistics will have some commonalities, such as statistics by time, by region, by department, etc., and secondary development statistics can also be performed based on the statistical wide table extracted by this set of processes. It can be done by modifying a small amount of data in the wide table without having to modify multiple tables, which can save time and effort during development.
[0054] In this embodiment, after obtaining the query results, the query results are displayed on the revenue dashboard. The revenue dashboard uses data visualization tools to count the company's various revenue data in a more intuitive and vivid way, which is also a management method that can improve efficiency. For data security reasons, the data on the revenue dashboard is not open to everyone, but the data range that can be seen is different due to different permissions. Based on this, when performing a screening query on the page in this embodiment, it is necessary to filter the account permissions and other screening conditions to obtain the final desired statistical results. Specifically, first obtain the trigger account of the query instruction; wherein the trigger account is the first department account currently logged in in the statistical system. Then determine the second department account corresponding to the trigger account in the business system, and query the field data related to the second department account in the target wide table according to the query instruction to obtain the query data corresponding to the query instruction. Therefore, it is necessary to construct a mapping relationship between the first department account in the statistical system and the second department account in the business system, so as to determine the second department account corresponding to the trigger account in the business system according to the mapping relationship. Finally, the query data corresponding to the query instruction is output to the manual interaction interface of the revenue dashboard for display.
[0055] Among them, the first department account can be a DingTalk department account (id), and the second department account can be a business department account (id). Each employee account has a department to which it belongs. The DingTalk department id is connected with the revenue department id in the bill to map and filter permissions. For example, an order has a corresponding bill, and the bill has a revenue department. The revenue department id in the bill is mapped by the DingTalk department id of the login account, and then the corresponding order is filtered out through the bill under the revenue department, thereby filtering the desired order statistics through the departmental permissions of the account. This makes it easy to count the revenue data of each employee and the revenue data of each department. Taking the interface for counting the paid amount of commission orders in the prior art as an example, the interface often responds for more than 10 seconds before optimization, and the page statistics are delayed, and users often complain. When the concurrency is 5, the database CPU utilization rate reaches more than 90%. If you apply a little pressure, the system will collapse. After optimization, the interface was stress tested again. The average response time of the interface was generally controlled at around 1 second, the database pressure was also reduced a lot, the database CPU utilization rate was controlled below 60%, and the optimal concurrency number of the interface was increased to 30. It can be said that the interface performance was significantly improved.
[0056] It can be seen that the embodiment of the present application first obtains multiple business data tables with associated relationships from the database of the business system, and stores the multiple business data tables in the data warehouse; then, according to the query requirements, the target field is determined from the fields corresponding to the multiple business data tables stored in the data warehouse, and a target wide table containing the target field and the corresponding field data is constructed in the database of the statistical system; wherein, the target field at least includes the field corresponding to the query data; finally, the query instruction is obtained and the target wide table is queried according to the query instruction to obtain the query data corresponding to the query instruction. The embodiment of the present application uniformly stores multiple business data tables in the database of the business system in the data warehouse. Since multiple business data tables have associated relationships, when querying, the query logic may involve multiple data tables at the same time, and the query logic is relatively complex. To this end, the fields of multiple business data tables in the data warehouse are used as the extraction basis, the fields are extracted as needed, and the extracted fields and field data are used to construct a new wide table in the statistical system. When querying, most of the query logic only involves the newly constructed wide table, which can avoid the query logic involving multiple data tables at the same time, making the query complexity high to generate the query timeout problem, simplifying the query logic and thus improving the data query efficiency.
[0057] The following is an example of querying the paid amount of commission orders to explain the above process in detail. Figure 4 shown.
[0058] First, the business system generates transaction data based on transactions. These transaction-related data are stored in different databases, forming the data source of the business system. Moreover, these data originally stored in the database have not been processed by logical operations. Considering the special business scenarios and system performance factors, the logic of commission calculation is placed on the big data platform for processing. This requires that the table data be synchronized to the data warehouse through a scheduled task in advance and then calculated. Then, multiple tables such as table1, table2, table3, table4, and table5 in the original database are synchronized to a copy of the database in the data warehouse. Then, some fields required for statistics are extracted from these tables, such as bill type, bill status, charge amount, total amount, charging strategy, payee (company), revenue department, and bill district. Use the extracted fields to create a new temporary wide table data new table and synchronize the changed data in the data warehouse to the newtable table every day through a scheduled task. In this way, data that originally needed to be queried in multiple tables can be queried through only a single table, which greatly reduces the database pressure and speeds up data query.
[0059] Often due to the company's data security, the data on the revenue dashboard is not open to everyone, but different permissions have different visible data ranges. In addition to filtering by account permissions, the data on the revenue dashboard is also filtered by business data permissions. Account permission filtering is achieved by mapping the DingTalk department with the revenue department of the bill. The corresponding revenue department ID can be found through each DingTalk department ID. Orders exist in bills, and bills have revenue departments, so that the viewable order data can be filtered through the department permissions of the account. The page is queried under the screening conditions, and the backend undergoes logical operations and processing, and the final amount of the order paid is returned in the interface and displayed through the front end.
[0060] The above process, on the one hand, simplifies queries and reduces the cost of docking learning. In the original solution, query statements are stored in the DATA API development tool. The query statements on the DATA API development tool are different from those directly queried from the database. In addition, there are too many SQL-related database tables, and the statements are too complex. New testing and development require a certain amount of learning costs. The new solution realizes the conversion from multi-table related queries to single-table queries. The SQL statements are more concise, which improves the query efficiency. It is easier for novices to take over the business and reduces the learning time cost. Practice has proved that when the original solution was used, development and testing required at least 0.5 days to familiarize yourself with the original design. After adopting the new solution, the development and testing took less than 0.5 days to get started, saving time costs.
[0061] The second aspect is to improve query efficiency, user experience and system performance. The original solution directly queried from the data warehouse by calling DATAAPI. Due to the constraints of the data warehouse, problems such as interface timeout and slow SQL often occurred. The new solution is optimized in combination with the data warehouse. By pre-processing the data, the data of dozens of tables are unified into a temporary wide table, realizing the conversion from multi-table association query to single-table query, simplifying the query SQL statement, and improving query efficiency. The problems of slow SQL and interface timeout have been solved, the user experience has been improved, and the system performance has been significantly improved.
[0062] The third aspect also improves the system's fault tolerance and provides smoother support for business expansion. Due to the continuous expansion of the business, if you want to add, delete, or modify some content for the revenue dashboard in the future, you only need to determine whether you need to add new fields in the temporary wide table based on the statistical fields, and then update the query SQL. The SQL of the new solution is simpler and easier to modify. And if the data in the data warehouse is lost for some reason, the temporary wide table will also be synchronized to the wide table through scheduled tasks before the data is lost, so the entire dashboard will not be unusable. At the same time, system monitoring alarms can be added to re-pull and calculate the lost and unsynchronized data.
[0063] Fourthly, improve versatility, reduce secondary development costs, and shorten project delivery cycles. In most cases, statistical data cannot be obtained in just one table. For similar logically complex queries, fields from multiple tables can be extracted and integrated into a new wide table for query on demand in this way, thereby improving query efficiency. This method is applicable to data statistical queries for various businesses. In addition, secondary statistics can be performed based on the statistical wide table extracted by this set of processes, such as statistics by time, by region, by department, etc., to facilitate upward compatibility with different types of statistics. The original solution required 1 day for the development and design of each data statistics dashboard, 5 days for development, and at least 3 days for data testing; the new solution can be modified based on the original wide table. According to the needs of iteration, only a small number of data fields need to be modified without changing multiple tables. The development and design require almost no changes, and development only takes 1 day, and testing only takes 2 days to complete. The original delivery took 9 days, but after optimization, it only takes 3 days, which greatly reduces the time cost of secondary development and shortens the delivery cycle.
[0064] See also Figure 5 As shown, the embodiment of the present application also discloses a data query device, including:
[0065] An acquisition storage module 11 is used to acquire a plurality of business data tables having an associated relationship from a database of a business system, and store the plurality of business data tables in a data warehouse;
[0066] A determination construction module 12 is used to determine a target field from fields corresponding to the plurality of business data tables stored in the data warehouse according to the query requirements, and to construct a target wide table containing the target field and corresponding field data in the database of the statistical system; wherein the target field at least contains a field corresponding to the query data;
[0067] The query acquisition module 13 is used to acquire a query instruction and query the target wide table according to the query instruction to obtain the query data corresponding to the query instruction.
[0068] It can be seen that the embodiment of the present application first obtains multiple business data tables with associated relationships from the database of the business system, and stores the multiple business data tables in the data warehouse; then, according to the query requirements, the target field is determined from the fields corresponding to the multiple business data tables stored in the data warehouse, and a target wide table containing the target field and the corresponding field data is constructed in the database of the statistical system; wherein, the target field at least includes the field corresponding to the query data; finally, the query instruction is obtained and the target wide table is queried according to the query instruction to obtain the query data corresponding to the query instruction. The embodiment of the present application uniformly stores multiple business data tables in the database of the business system in the data warehouse. Since multiple business data tables have associated relationships, when querying, the query logic may involve multiple data tables at the same time, and the query logic is relatively complex. To this end, the fields of multiple business data tables in the data warehouse are used as the extraction basis, the fields are extracted as needed, and the extracted fields and field data are used to construct a new wide table in the statistical system. When querying, most of the query logic only involves the newly constructed wide table, which can avoid the query logic involving multiple data tables at the same time, making the query complexity high to generate the query timeout problem, simplifying the query logic and thus improving the data query efficiency.
[0069] In some specific embodiments, the acquisition storage module 11 is specifically used to synchronize the multiple business data tables with associated relationships in the database of the business system to the data warehouse using a data synchronization tool according to a first preset synchronization period.
[0070] In some specific embodiments, the data query device further includes:
[0071] A processing module, used for sequentially extracting, cleaning and converting the data in the plurality of business data tables, so as to store the finally processed plurality of business data tables in the data warehouse;
[0072] An integration module, used for integrating and calculating the data in the plurality of data tables according to the configuration logic stored in the data table format to obtain integrated field data;
[0073] In some specific embodiments, the determining construction module 12 specifically includes:
[0074] A determination unit, configured to determine a target field from fields corresponding to a plurality of business data tables stored in the data warehouse according to a query requirement;
[0075] A construction unit is used to construct the target wide table including the target field and the corresponding integrated field data in the database of the statistical system.
[0076] In some specific embodiments, the construction unit is specifically used to construct the target wide table containing the target field in the database of the statistical system, and update the integrated field data corresponding to the target field in the data warehouse in the target wide table by setting and running a scheduled task.
[0077] In some specific embodiments, the data query device further includes:
[0078] An account acquisition module, used to acquire a trigger account of the query instruction; wherein the trigger account is the first department account currently logged in in the statistical system;
[0079] An account determination module, used to determine the second department account corresponding to the trigger account in the business system, and query the field data related to the second department account in the target wide table according to the query instruction to obtain the query data corresponding to the query instruction;
[0080] An output module, used to output the query data corresponding to the query instruction to the manual interaction interface of the revenue dashboard for display;
[0081] The relationship building module is used to build a mapping relationship between the first department account in the statistical system and the second department account in the business system, so as to determine the second department account corresponding to the trigger account in the business system according to the mapping relationship.
[0082] Furthermore, an embodiment of the present application also provides an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0083] Figure 6The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data query method disclosed in any of the aforementioned embodiments.
[0084] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0085] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0086] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data query method performed by the electronic device 20 disclosed in any of the above embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. The data 223 can include data table data collected by the electronic device 20.
[0087] Furthermore, an embodiment of the present application also discloses a storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the data query method disclosed in any of the aforementioned embodiments are implemented.
[0088] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0089] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0090] The data query method, device, equipment and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data query method, characterized in that: include: Acquire multiple business data tables with associated relationships from a database of a business system, and store the multiple business data tables in a data warehouse; wherein, acquiring multiple business data tables with associated relationships from a database of a business system, and storing the multiple business data tables in a data warehouse, comprises: synchronizing the multiple business data tables with associated relationships in the database of the business system to the data warehouse according to a first preset synchronization period using a data synchronization tool; Integrate and calculate the data in the plurality of data tables according to the configuration logic stored in the data table format to obtain integrated field data; Determine a target field from fields corresponding to a plurality of business data tables stored in the data warehouse according to the query requirements, and construct a target wide table containing the target field and corresponding field data in a database of the statistical system; wherein the target field at least contains a field corresponding to the query data; The step of constructing a target wide table including the target field and corresponding field data in the database of the statistical system includes: constructing the target wide table including the target field and the corresponding integrated field data in the database of the statistical system; Wherein, constructing the target wide table including the target field and the corresponding integrated field data in the database of the statistical system includes: constructing the target wide table including the target field in the database of the statistical system; updating the integrated field data corresponding to the target field in the data warehouse in the target wide table by setting and running a scheduled task; Obtaining a query instruction and querying the target wide table according to the query instruction to obtain the query data corresponding to the query instruction; Obtaining a trigger account of the query instruction; wherein the trigger account is the first department account currently logged in the statistical system; Determine the second department account number corresponding to the trigger account number in the business system, and query the field data related to the second department account number in the target wide table according to the query instruction to obtain the query data corresponding to the query instruction; Outputting the query data corresponding to the query instruction to the manual interaction interface of the revenue dashboard for display; A mapping relationship between the first department account in the statistical system and the second department account in the business system is constructed, so as to determine the second department account corresponding to the trigger account in the business system according to the mapping relationship.
2. The data query method according to claim 1, characterized in that: After obtaining a plurality of business data tables having association relationships from the database of the business system, the method further includes: The data in the multiple business data tables are sequentially extracted, cleaned and converted, so that the multiple business data tables after final processing are stored in the data warehouse.
3. A data query device, characterized in that: include: An acquisition storage module is used to acquire a plurality of business data tables with associated relationships from a database of a business system, and store the plurality of business data tables in a data warehouse; wherein the acquisition storage module is specifically used to synchronize the plurality of business data tables with associated relationships in the database of the business system to the data warehouse using a data synchronization tool according to a first preset synchronization period; An integration module, used for integrating and calculating the data in the plurality of data tables according to the configuration logic stored in the data table format to obtain integrated field data; A determination construction module is used to determine a target field from fields corresponding to the plurality of business data tables stored in the data warehouse according to the query requirements, and to construct a target wide table containing the target field and corresponding field data in the database of the statistical system; wherein the target field at least contains the field corresponding to the query data; The determining of the building blocks specifically includes: A determination unit, configured to determine a target field from fields corresponding to a plurality of business data tables stored in the data warehouse according to a query requirement; A construction unit, configured to construct the target wide table including the target field and the corresponding integrated field data in a database of the statistical system; An acquisition query module, used for acquiring a query instruction and querying the target wide table according to the query instruction to obtain the query data corresponding to the query instruction; An account acquisition module, used to acquire a trigger account of the query instruction; wherein the trigger account is the first department account currently logged in in the statistical system; An account determination module, used to determine the second department account corresponding to the trigger account in the business system, and query the field data related to the second department account in the target wide table according to the query instruction to obtain the query data corresponding to the query instruction; An output module, used to output the query data corresponding to the query instruction to the manual interaction interface of the revenue dashboard for display; The relationship building module is used to build a mapping relationship between the first department account in the statistical system and the second department account in the business system, so as to determine the second department account corresponding to the trigger account in the business system according to the mapping relationship.
4. An electronic device, characterized in that: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the data query method according to any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that: Used to store computer executable instructions, which, when loaded and executed by a processor, implement the data query method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Data processing and report display method based on big data
CN110597851A