Database-based data processing method and device, equipment and storage medium
By constructing target data tables and utilizing the relationships between detailed data and business departments and projects, the problem of low efficiency caused by data redundancy in the data warehouse was solved, and efficient data processing and management was achieved.
Patent Information
- Application Number
- CN202511300703.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-12
AI Technical Summary
The high degree of data redundancy between data tables in traditional data warehouses leads to low database data processing efficiency.
By obtaining the data set of the preset business in the preset usage scenario, building the target data table, and utilizing the relationship between detailed data and business departments and business projects, the number of query operations can be reduced and data processing efficiency can be improved.
By aggregating target detailed data, the number of operations during the query process is reduced, data processing and management efficiency is improved, and data table maintenance costs are reduced.
Smart Images

Figure CN120804152A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer data processing, and particularly relates to a database-based data processing method and device, equipment and a storage medium. BACKGROUND
[0002] With the explosive growth of enterprise data, data needs to be stored to meet data analysis requirements.
[0003] In a traditional data warehouse, the degree of data redundancy between data tables is high, resulting in low efficiency of database data processing (such as database addition, deletion, modification, and query operations).
[0004] Therefore, how to optimize the storage of data in the database to improve the efficiency of database data processing has become a technical problem to be solved. SUMMARY
[0005] The embodiments of the present application provide a database-based data processing method, device, equipment and storage medium to achieve the technical effect of improving the efficiency of database data processing.
[0006] In a first aspect, the embodiments of the present application provide a database-based data processing method, comprising:
[0007] Obtaining a data set generated by a preset business in a preset use scenario; wherein the preset business includes a plurality of business links, the business links include at least one of a business item and a business department, and the data set includes a plurality of detailed data of the business department on the business item within a preset first time period;
[0008] For each business department and each business item, determining a target detail of the business department on the business item within the preset first time period; wherein the target detail represents a plurality of detailed data of the business department on the business item.
[0009] According to the target details of each business department on each business item, a target data table is constructed; wherein the data stored in the target data table is used to generate a data report of the preset business.
[0010] In a possible implementation, the data set includes environment information and identification information corresponding to the business link, and the environment information represents a detailed explanation of the business link; before determining the target detail of the business department on the business item within the preset first time period, the method further comprises:
[0011] generate a first data table according to the multiple pieces of detail data of the business department on the business item, the identification information of the business department, and the identification information of the business item; wherein a row in the first data table represents a preset time; the preset time is located in a preset first time period; the preset time represents a generation time of the detail data; the first data table comprises at least a first column, a second column, and a third column; the first column represents the business department, the second column represents the business item, and the third column represents the detail data; a field value corresponding to the row and the first column represents the identification information of the business department, a field value corresponding to the row and the second column represents the identification information of the business item, and a field value corresponding to the row and the third column represents the detail data;
[0012] determine a second data table according to the identification information of the business link and the environment information corresponding to the business link; wherein the second data table comprises at least a fourth column and a fifth column; the fourth column represents the identification information of the business link, and the fifth column represents the environment information of the business link.
[0013] In a possible implementation, the determining, for each business department and each business item, a target detail of the business department on the business item in the preset first time period comprises:
[0014] obtain the detail data of each business department on each business item from the first data table;
[0015] determine, for each business department and each business item, a target detail of the business department on the business item according to the multiple pieces of detail data.
[0016] In a possible implementation, the constructing a target data table according to the target details of each business department on each business item comprises:
[0017] obtain the identification information of each business link and the environment information of each business link from the second data table;
[0018] construct a target data table according to the identification information of each business link, the environment information of each business link, and the target details of each business department on each business item; wherein the target data table comprises a sixth column, a seventh column, and an eighth column; the sixth column represents the identification information of the business link; the seventh column represents the environment information of the business link; and the eighth column represents the target details; a row of the target data table represents a preset use scenario.
[0019] In a possible implementation, the generating a first data table according to the multiple pieces of detail data of the business department on the business item, the identification information of the business department, and the identification information of the business item comprises:
[0020] According to a preset first data processing rule, a plurality of detail data of the business department on the business item, the identification information of the business department, and the identification information of the business item are respectively processed;
[0021] According to the processed data, the first data table is obtained.
[0022] In a possible implementation, after the target data table is constructed according to the target details of each business department on each business item, the method further comprises:
[0023] According to the target data table, a plurality of target details of each business department are obtained based on a preset second time period; the preset second time period comprises at least one first time period;
[0024] According to the identification information of the business department and the plurality of target details of the business department, a third data table is constructed; wherein a row in the third data table represents the preset second time period; the third data table comprises at least a ninth column and a tenth column; the ninth column represents the identification information of the business department; and the tenth column represents the sum of the plurality of target details corresponding to the business department.
[0025] In a possible implementation, the method further comprises:
[0026] From the third data table, the sum of the plurality of target details of the business department within the preset second time period is obtained;
[0027] From the target data table, the plurality of target details of the business department within the preset second time period are obtained;
[0028] According to the sum of the plurality of target details and the plurality of target details, a fourth data table corresponding to the business department is constructed; wherein a row in the fourth data table represents the preset first time period; the fourth data table comprises at least an eleventh column and a twelfth column; the eleventh column represents the target detail of the business department; and the twelfth column represents a ratio; the ratio represents the ratio of the target detail to the sum of the plurality of target details.
[0029] In a possible implementation, the method further comprises:
[0030] Real-time generated data of the preset business in each business link is obtained;
[0031] According to the real-time generated data and the fourth data table, a data report of the preset business is generated.
[0032] In a possible implementation, the method further comprises:
[0033] In response to the data table query instruction, a to-be-queried data table is determined; wherein the to-be-queried data table is at least one of the first data table, the second data table, the third data table, the fourth data table, and the target data table;
[0034] Starting from the fourth data table, the to-be-queried data table is obtained based on a preset data table query order.
[0035] In a second aspect, an embodiment of the present application provides a data processing device based on a database, comprising:
[0036] The acquisition module is configured to acquire a data set generated by a preset service in a preset use scenario; wherein the preset service comprises a plurality of service links, the service links comprise at least one of a service item and a service department, and the data set comprises a plurality of detailed data of the service department on the service item in a preset first time period;
[0037] The determination module is configured to determine, for each service department and each service item, a target detail of the service department on the service item in the preset first time period; wherein the target detail represents the plurality of detailed data of the service department on the service item.
[0038] The construction module is configured to construct a target data table according to the target details of the service departments on the service items; wherein data stored in the target data table is used to generate a data report of the preset service.
[0039] In a third aspect, an embodiment of the present application provides a data processing device based on a database, comprising a memory and a processor.
[0040] The memory stores computer execution instructions.
[0041] The processor executes the computer execution instructions stored in the memory, so that the processor executes the first aspect and / or various possible implementation manners of the first aspect.
[0042] In a fourth aspect, an embodiment of 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 first aspect and / or various possible implementation manners of the first aspect.
[0043] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which is executed by a processor to implement the first aspect and / or various possible implementation manners of the first aspect.
[0044] The database-based data processing method, device, equipment and storage medium provided by the embodiments of the present application, by obtaining a data set generated by a preset business in a preset use scenario, wherein the preset business includes a plurality of business links, the business link includes at least one of a business item and a business department, and the data set includes a plurality of detailed data of the business department on the business item in a preset first time period; since the detailed data is associated with the business department and the business item, the association relationship can be used for subsequent construction of a data table, so that the data table contains the association relationship information. For each business department and each business item, determine the target details of the business department on the business item in the preset first time period, wherein the target details represent the plurality of detailed data of the business department on the business item, and the plurality of detailed data can be preliminarily aggregated, so that the aggregated target details meet the data requirements of subsequent generation of data reports, and the aggregated target details can also reduce the query process, thereby improving the data processing efficiency. According to the target details of each business department on each business item, a target data table is constructed; wherein the data stored in the target data table is used to generate a data report of the preset business. Since the detailed data is associated with the business department and the business item, and the target details represent the plurality of detailed data, the target details are also associated with the business department and the business item. The target data table constructed according to the target details can aggregate the target details, the business department, and the business item, so that when generating a data report subsequently, only a single table needs to be scanned and filtered to obtain accurate data, thereby reducing the number of query operations and improving the data processing and management efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0045] 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.
[0046] Figure 1 Flowchart of the database-based data processing method provided by the present application Figure One
[0047] Figure 2 Flowchart of the database-based data processing method provided by the present application Figure Two
[0048] Figure 3 Schematic diagram of the first data table provided by the present application
[0049] Figure 4 Schematic diagram of the target data table provided by the present application
[0050] Figure 5 Flowchart of the database-based data processing method provided by the present application Figure Three
[0051] Figure 6 The flowchart of the database-based data processing method provided in the present application Figure Four ;
[0052] Figure 7 The structural diagram of the database provided in the present application
[0053] Figure 8 The structural diagram of the database-based data processing apparatus provided in the present application
[0054] Figure 9 The structural diagram of the database-based data processing device provided in the present application
[0055] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0056] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, the same drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they only represent examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.
[0057] First, the terms involved in the present application are explained:
[0058] Data lake: a centralized storage system, which is used to store raw, unprocessed data;
[0059] Data warehouse: a highly structured, integrated data storage system, which is used to store data processed by data processing operations such as processing, cleaning, and modeling.
[0060] The application scenarios of the present application include storing data of enterprises (industries, especially enterprises with large data output such as oil).
[0061] In the era of big data, the data volume of enterprise data grows explosively, and these data include highly structured data, semi-structured data, and unstructured data, which can be saved using a database.
[0062] In the related art, data lakes and data warehouses are used to store data. The data lake can store structured, semi-structured, and unstructured data, and the data warehouse can store structured data. Tables are created in the data lake and the data warehouse, and the created tables are used to store data. Different tables in the data lake and the data warehouse are associated with each other, and a large amount of redundant data can be stored between different tables. For example, a department table is created in the data lake to store department information data, and a project table is also created to store project information data. When obtaining project information, the corresponding department information of the project can also be obtained, and complete department information is also stored in the project table, resulting in a large amount of redundant data stored in the department table and the project table. For another example, when creating a database, the data warehouse copies a large amount of data unrelated to the business from the data lake and stores it in the data table in order to facilitate data copying, resulting in a large amount of redundant data in the data warehouse.
[0063] Since the data lake does not need to perform data processing (such as data modeling) on data, it can directly store raw data, and therefore, the data lake has high flexibility and can store data in multiple formats. However, multiple structured data also leads to low query efficiency of the data lake. Since the data warehouse stores structured data, it can quickly perform aggregation and scanning operations on a large amount of data, and therefore, has high query efficiency. However, highly structured data also leads to poor flexibility of the data warehouse, which cannot store data in multiple data formats. In the related art, data tables are not designed by taking advantage of the respective advantages of the data lake and the data warehouse, but a large number of data tables are created according to business requirements. This leads to low data management efficiency, high data maintenance cost, and low operation efficiency of data.
[0064] The present application provides a database-based data processing method to solve the above technical problems.
[0065] 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.
[0066] Figure 1 Flowchart of the database-based data processing method provided by the present application Figure One As shown in the figure, the method comprises the following steps. Figure 1
[0067] S101, obtaining a data set generated by a preset business in a preset use scenario; wherein the preset business includes a plurality of business links, the business links include at least one of a business project and a business department, and the data set includes a plurality of detailed data of the business department on the business project within a preset first time period.
[0068] It should be noted that the execution subject of the present application can be a business management system of an enterprise, or other electronic devices, and the present application does not make any requirements thereon. Hereinafter, the execution subject is taken as a business management system for illustration.
[0069] Illustratively, in response to a data storage instruction sent by a user, the data storage instruction can indicate to save data generated by a preset business in a preset scenario to a database, the database being configured to store data, and the business management system acquires a data set generated by a preset business in a preset use scenario; wherein the preset business includes a plurality of business links, the business link including at least one of a business item and a business department, and the data set including a plurality of detailed data of the business department on the business item within a preset first time period.
[0070] The preset business can be any business of an enterprise, such as a software development business of an enterprise. The preset use scenario can be a use scenario corresponding to the data set. Each piece of data in a data set can be generated in different preset use scenarios. For example, the software development business generates human cost data, and the use scenario corresponding to the human cost data is to pay remuneration to software developers. The software development business also generates procurement cost data, and the use scenario corresponding to the procurement cost data is to configure hardware devices for software development. The human cost data and the procurement cost data are data in the data set, and therefore, the data in the data set includes data generated in at least two preset use scenarios, which are the use scenario of paying remuneration to software developers and the use scenario of configuring hardware devices for software development, respectively.
[0071] The business item represents a project in the preset business, such as a software development project, an oil field exploitation project, etc. The business department represents a department that executes the business item, such as a department that executes software development, a department that executes oil field exploitation, etc. When a data table is subsequently constructed, the data in the data table can be sorted according to the business link. For example, if the business link includes the business item and the business department, the detailed data corresponding to the business item and the business department can be recorded in the data table, i.e., the detailed data corresponds to the business item and the business department at the same time. If the business link includes the business department but not the business item, the detailed data corresponding to the business department can be recorded in the data table, i.e., the detailed data corresponds to the business department. If the business link includes the business item but not the business department, the detailed data corresponding to the business item can be recorded in the data table, i.e., the detailed data corresponds to the business item.
[0072] The first time period can be a preset time length in the process of business execution, for example, if a data report of a preset business needs to be generated according to subsequent requirements, the data in the data report needs to be accurate to at least daily data, at this time, the first time period can be 24 hours of a day. The first time period is 24 hours of a day in the process of business execution.
[0073] Each piece of detailed data can be a piece of detailed data of a business department on a business project at any moment in the first time period. For example, the detailed data can be obtained from a business bill, if a cost expense in the business bill is a single expenditure expense, such as purchase cost expense data at 9 o'clock in the morning of a day, the obtained detailed data is the purchase cost expense data. If a cost expense in the business bill is a cumulative expenditure expense, such as the sum of purchase cost expense data from the beginning of the business to 9 o'clock in the morning of a day, the obtained detailed data is the sum of the purchase cost expense data.
[0074] S102, for each business department and each business project, determining a target detail of the business department on the business project in a preset first time period; wherein the target detail represents a plurality of detailed data of the business department on the business project.
[0075] For example, for each business department and each business project, determining a target detail of the business department in executing the business project in a preset first time period; wherein the target detail represents a plurality of detailed data of the business department on the business project.
[0076] For example, for any business department and any business project, if the detailed data is a single expenditure expense, the sum of a plurality of detailed data of the business department on the business project in a preset first time period can be calculated, and the obtained sum is determined as the target detail of the business department on the business project in a preset first time period.
[0077] If the detailed data is the sum of a plurality of expenditure expenses, for any business department and any business project, the maximum value of a plurality of detailed data of the business department on the business project in a preset first time period can be calculated, and the obtained maximum value is determined as the target detail of the business department on the business project in a preset first time period. That is, one piece of detailed data is the sum of a plurality of expenses, one piece of detailed data in the plurality of detailed data is the target detail, and the piece of detailed data is the maximum value in the plurality of detailed data.
[0078] S103, constructing a target data table according to the target details of each business department on each business project; wherein the data stored in the target data table is used to generate a data report of a preset business.
[0079] Exemplarily, after obtaining the target details of each business department on each business project, a target data table can be constructed according to the target details of each business department on each business project. The data stored in the target data table is used to generate a data report of the preset business. The target data table can be constructed in a data lake or a data warehouse.
[0080] For example, according to the target details of each business department on each business project, a target data table is constructed in a data warehouse. The data in the target data table includes each target detail. The data in the target data table can also include the business department and the business project corresponding to the target detail. For example, the constructed target data table includes multiple rows and multiple columns. A row represents a preset use scenario. Different rows can correspond to the same use scenario or can correspond to different use scenarios respectively. Any column of the multiple columns represents any one of the target detail, the business department, and the business project. If the column represents the target detail, the field value corresponding to the row and the column represents the target detail. If the column represents the business department, the field value corresponding to the row and the column represents the business department. If the column represents the business project, the field value corresponding to the row and the column represents the business project. Wherein, each target detail is recorded in different rows of the same column in the target data table, that is, for each row under the column, the field value corresponding to the row and the column represents the target detail. Each business department is recorded in different rows of the same column in the target data table, that is, the column is not the same as the column corresponding to the target detail, for each row under the column, the field value corresponding to the row and the column represents the business department, for example, the field value of the first row under the column is the department performing software development, and the field value of the second row under the column is the department performing oil field exploitation. Each business project is recorded in different rows of the same column in the target data table, the column is not the same as the column corresponding to the target detail or the column corresponding to the business department, for each row under the column, the field value corresponding to the row and the column represents the business project, for example, the field value of the first row under the column is the software development project, and the field value of the second row under the column is the oil field exploitation project. For each row, the target detail in the row corresponds to the target detail of the business department in the row on the business project in the row.
[0081] When generating a data report of the preset business, the data in the target data table can be obtained by using a query code statement of a database, such as the target details, and the business department and the business project corresponding to the target details. According to the obtained data, the data report is generated. The content in the data report includes the target details, and the business department and the business project corresponding to the target details. Specifically, all target details of a target business project in the target data table can be obtained by using a software query code statement of a database. According to the obtained all target details, the data report is generated. The content in the generated data report includes at least one target detail of the target business project.
[0082] The data processing method based on a database provided by the embodiments of the present application comprises the following steps: obtaining a data set generated by a preset business in a preset use scenario, wherein the preset business comprises a plurality of business links, the business links comprise at least one of a business item and a business department, and the data set comprises a plurality of detailed data of the business department on the business item in a preset first time period; since the detailed data is associated with the business department and the business item, the association relationship can be used to construct a data table, so that the data table contains the association relationship information; for each business department and each business item, a target detail of the business department on the business item in the preset first time period is determined, wherein the target detail represents the plurality of detailed data of the business department on the business item, the plurality of detailed data can be preliminarily aggregated, so that the aggregated target detail meets the data requirement of generating a data report table in the future, and the aggregated target detail can also reduce the query process, thereby improving the data processing efficiency; and a target data table is constructed according to the target details of the business departments on the business items, wherein the data stored in the target data table is used to generate a data report table of the preset business. Since the detailed data is associated with the business department and the business item, and the target detail represents the plurality of detailed data, the target detail is also associated with the business department and the business item. The target data table constructed according to the target details can aggregate the target details, the business departments, and the business items, so that when the data report table is generated in the future, only the single table needs to be scanned and filtered, and accurate data can be obtained, thereby reducing the number of query operations and improving the data processing efficiency.
[0083] In some specific embodiments, the data set comprises environment information and identification information corresponding to the business links, and the environment information represents a detailed explanation of the business links. Before determining the target detail of the business department on the business item in the preset first time period, the above method further comprises the following steps:
[0084] Firstly, a first data table is generated according to the plurality of detailed data of the business department on the business item, the identification information of the business department, and the identification information of the business item, wherein a row in the first data table represents a preset time; the preset time is located in the preset first time period; the preset time represents the generation time of the detailed data; the first data table comprises at least a first column, a second column, and a third column, the first column represents the business department, the second column represents the business item, and the third column represents the detailed data; the field value corresponding to the row and the first column represents the identification information of the business department, the field value corresponding to the row and the second column represents the identification information of the business item, and the field value corresponding to the row and the third column represents the detailed data;
[0085] Secondly, a second data table is determined according to the identification information of the business link and the environment information corresponding to the business link; the second data table at least includes a fourth column and a fifth column; the fourth column represents the identification information of the business link, and the fifth column represents the environment information of the business link.
[0086] Figure 2 Flowchart of the database-based data processing method provided in the present application Figure Two As shown in Figure 2 , the method comprises:
[0087] S201, a data set generated by a preset business in a preset use scenario is acquired; the preset business comprises a plurality of business links, the business link comprises at least one of a business item and a business department, and the data set comprises a plurality of detailed data of the business department on the business item within a preset first time period.
[0088] The execution process of S201 is consistent with that of S101, and thus will not be described herein.
[0089] S202, for each business department and each business item, a first data table is generated according to the plurality of detailed data of the business department on the business item, the identification information of the business department, and the identification information of the business item; a row in the first data table represents a preset time; the preset time is located within the preset first time period; the preset time represents the generation time of the detailed data; the first data table at least includes a first column, a second column, and a third column; the first column represents the business department, the second column represents the business item, and the third column represents the detailed data; the field value corresponding to the row and the first column represents the identification information of the business department, the field value corresponding to the row and the second column represents the identification information of the business item, and the field value corresponding to the row and the third column represents the detailed data; the target detailed data represents the plurality of detailed data of the business department on the business item.
[0090] For example, the data set comprises environment information and identification information corresponding to the business link. The environment information represents a detailed explanation of the business link. The identification information is a unique identifier of the business link. For example, if the business link comprises a business department and a business item, the environment information comprises department code information and department name information corresponding to the business department, and the department code information represents a string defined for information management of the business department. It also includes business item code information and business item name corresponding to the business item, and the business item code information represents a string defined for information management of the business item. The identification information comprises identification information of the business department and identification information of the business item. The identification information of the business department is a unique identifier of the business department. The identification information of the business item is a unique identifier of the business item.
[0091] For each business department and each business project, a first data table is generated according to the multiple pieces of detail data of the business department on the business project, the identification information of the business department, and the identification information of the business project. The row in the first data table represents a preset time, and the first data table includes multiple rows. The preset time is located within a preset first time period, and represents the generation time of the detail data. There are multiple preset times, i.e., multiple preset times within the first time period, and one piece of detail data is generated for each preset time.
[0092] The first data table includes at least a first column, a second column, and a third column. The first column represents the business department, the second column represents the business project, and the third column represents the detail data. The field value corresponding to the row and the first column represents the identification information of the business department, such as a business department ID (Identity document, identity document). The field value corresponding to the row and the second column represents the identification information of the business project, such as a business project ID. The field value corresponding to the row and the third column represents the detail data. The target detail represents the multiple pieces of detail data of the business department in the business project.
[0093] Figure 3 The first data table provided in the present application is shown in the following table. Figure 3 As shown in the table, the first column of the first data table is used to save the business department ID, the second column is used to save the business project ID, and the third column is used to save the detail data. The first data table further includes two columns, one of which is used to save the preset time, and the other is used to save the use scenario. The first data table has multiple rows. For each row, the detail data in the row is the detail data of the corresponding business department in the corresponding business project at the preset time in the use scenario. For example, the detail data “500” is the human cost of 500 yuan of the business department 001 on the business project 001 at 9:00 am on January 1, 2025.
[0094] S203, determining a second data table according to the identification information of the business link and the environment information corresponding to the business link; wherein the second data table includes at least a fourth column and a fifth column; the fourth column represents the identification information of the business link, and the fifth column represents the environment information of the business link.
[0095] For example, a second data table is determined according to the identification information of the business link and the environment information corresponding to the business link. The second data table includes at least a fourth column and a fifth column. The fourth column represents the identification information of the business link, and the fifth column represents the environment information of the business link. There can be multiple second data tables, and the second data table can have multiple rows and include multiple fifth columns.
[0096] For example, if the environment information of the business link includes department code information and department name information corresponding to the business department, and project code information and project name information corresponding to the business project, there are two second data tables. The first second data table is used to save the environment information corresponding to the business department, and the second second data table is used to save the environment information corresponding to the business project.
[0097] For example, for the first second data table, the second data table includes multiple rows, and the second data table includes a fourth column and two fifth columns. The fourth column of the second data table is used to save the identification information of the business department, the first fifth column of the second data table is used to save the department code information of the business department, and the second fifth column of the second data table is used to save the department name information of the business department. The second data table can also include multiple other columns, which are used to save other environment information of the business department, such as the creation time of the business department.
[0098] S204, according to the target details of each business department on each business project, a target data table is constructed; wherein the data stored in the target data table is used to generate a data report of a preset business.
[0099] The execution process of S204 is consistent with that of S103, and will not be repeated here.
[0100] In these embodiments, according to the multiple detail data of the business department on the business project, the identification information of the business department, and the identification information of the business project, a first data table is generated, which saves the original data in the data set, including the detail data, the department identification information, and the project identification information. Through the first data table, the detail data and its corresponding department identification information and project identification information can be found, which provides original data for subsequent aggregation of detail data. According to the identification information of the business link and the environment information corresponding to the business link, a second data table is determined, which saves the original identification information of the business department and its corresponding environment information, and the project identification information of the business project and its corresponding environment information. Through the second data table, the business department and its corresponding environment information, or the business project and its corresponding environment information can be quickly found. The first data table and the second data table save the original information, and the saved data will not change with the change of historical data, thereby ensuring the reliability of the data.
[0101] In some specific embodiments, the target details of the business department on the business project in the preset first time period include:
[0102] S1021, obtaining the detail data of each business department on each business project from the first data table.
[0103] For example, after obtaining the plurality of detail data, the detail data of each business department on each business item is obtained from the first data table.
[0104] For example, for each business department and each business item, the data matching is performed in the first data table according to the identification information of the business department and the identification information of the business item, at least one row in the first data table which matches the identification information of the business department and the identification information of the business item is found, and the detail data in the at least one row is obtained, the detail data in the at least one row being the detail data of the business department on the business item obtained from the first data table.
[0105] S1022, for each business department and each business item, the target detail of the business department on the business item is determined according to the plurality of detail data.
[0106] For example, after obtaining the plurality of detail data, the detail data of each business department on each business item is obtained from the first data table.
[0107] For example, for any business department and any business item, if the detail data is a single expenditure cost, the sum of at least one piece of detail data obtained according to S1031 is determined to obtain the target detail.
[0108] If the detail data is the sum of multiple expenditure costs, for any business department and any business item, the maximum value of at least one piece of detail data obtained according to S1021 is determined to be the target detail.
[0109] In these embodiments, for each business department and each business item, the detail data of the business department and the business item is obtained from the first data table, and the target detail is determined according to the obtained detail data. The target detail can be obtained by preliminarily aggregating the detail data, and the target detail can meet the data requirements of generating the data report of the preset business subsequently, that is, the data used by the data report of the preset business subsequently is the target detail, rather than the detail data. Therefore, the determined target detail provides a basis for generating a high-quality data table subsequently.
[0110] In some specific embodiments, the above S103 includes the following sub-steps:
[0111] S1031, obtaining the identification information of each business link and the environmental information of each business link from the second data table.
[0112] For example, after constructing the first data table and the second data table, the identification information of each business link and the environmental information of each business link are obtained from the second data table.
[0113] For example, the identification information of the business item and the environment information corresponding to the business item, such as the item code information and the item name of the business item, can be obtained from the first data table, and the fifth data table is generated according to the obtained identification information of the business item and the environment information corresponding to the business item. The row of the fifth data table represents a business department, and the column of the fifth data table represents environment information.
[0114] The identification information of the business item and the environment information corresponding to the business item are saved in the fifth data table. For example, the identification information of the business item is saved in a column of the fifth data table, the identification information of each business item is saved in different rows of the same column in the fifth data table, the item code information of the business item is saved in a column, the code information of each business item is saved in different rows of the same column in the fifth data table, and the item name of the business item is saved in a column, and the item name of each business item is saved in different rows of the same column in the fifth data table.
[0115] The identification information of the business department and the environment information corresponding to the business department can be obtained from the first data table, and the sixth data table is generated according to the obtained identification information of the business department and the environment information corresponding to the business department, such as the department code information and the department name of the business department. The row of the sixth data table represents a business department, and the column of the sixth data table represents environment information.
[0116] The identification information of the business department and the environment information corresponding to the business department are saved in the sixth data table. For example, the identification information of the business department is saved in a column of the sixth data table, the identification information of each business department is saved in different rows of the same column in the sixth data table, the department code information of the business department is saved in a column, the code information of each business department is saved in different rows of the same column in the sixth data table, and the department name of the business department is saved in a column, and the department name of each business item is saved in different rows of the same column in the sixth data table.
[0117] S1032, according to the identification information of each business link, the environment information of each business link, and the target details of each business department in each business item, a target data table is constructed; wherein the target data table includes a sixth column, a seventh column, and an eighth column; the sixth column represents the identification information of the business link; the seventh column represents the environment information of the business link; the eighth column represents the target details; and the row of the target data table represents a preset use scenario.
[0118] Exemplarily, after obtaining the identification information of each business link and the environmental information of each business link, a target data table is constructed based on the identification information of each business link, the environmental information of each business link, and the target details of each business department in each business project; wherein, the target data table includes a sixth column, a seventh column, and an eighth column; the sixth column characterizes the identification information of the business link; the seventh column characterizes the environmental information of the business link; the eighth column characterizes the target details; the rows of the target data table represent preset usage scenarios.
[0119] For example, a target data table can be constructed based on the identification information and environmental information of each business project obtained from the fifth data table, the identification information and environmental information of each business department obtained from the sixth data table, and the target details determined according to S1022.
[0120] Figure 4 This is a schematic diagram of the target data table provided for this application. Figure 4 As shown, the target data table includes multiple columns, one column for storing the business department ID, and each business department ID is stored in a different row of the same column in the target data table; one column for storing the business department code, and each business department code is stored in a different row of the same column in the target data table; one column for storing the business department name, and each business department name is stored in a different row of the same column in the target data table; one column for storing the business project ID, and each business project ID is stored in a different row of the same column in the target data table; one column for storing the business project code, and each business project code is stored in a different row of the same column in the target data table; one column for storing the business project name, and each business project name is stored in a different row of the same column in the target data table; one column for storing target details, and each target detail is stored in a different row of the same column in the target data table; one column for storing the time period (i.e., the first time period), and each time period is stored in a different row of the same column in the target data table; and one column for storing the application scenario, and each application scenario is stored in a different row of the same column in the target data table. The target data table contains multiple rows. Each row contains target details for the corresponding business department under the corresponding business project during the first time period of the usage scenario. For example, target detail 800 represents the procurement cost of the software R&D department (with ID 001 and code A) for the software R&D project (with ID 001 and code C) on January 1, 2025.
[0121] In the embodiments, by obtaining the identification information of each business link and the environment information of each business link from the second data table, the identification information of the business link and the environment information of the business link can be modeled, that is, the data information required for generating the data report is extracted from the original data in the second data table, and the unnecessary data information is removed, thereby reducing data redundancy. By constructing a target data table according to the identification information of each business link, the environment information of each business link, and the target details of each business department in each business project, the target data table contains a variety of information. For subsequent generation of data reports, the data in the target data table can meet most of the data requirements for generating data reports. Therefore, when generating data reports subsequently, data can be obtained from the target data table, thereby reducing the number of queries to the original data, improving the data query efficiency, and greatly reducing the maintenance cost of the data table.
[0122] In some specific embodiments, the generating, in S202, the first data table according to the plurality of detail data of the business department on the business project, the identification information of the business department, and the identification information of the business project includes the following sub-steps:
[0123] S2021, converting the plurality of detail data of the business department on the business project, the identification information of the business department, and the identification information of the business project respectively according to a preset first data processing rule.
[0124] For example, after obtaining the data set, the plurality of detail data of the business department on the business project, the identification information of the business department, and the identification information of the business project can be converted respectively according to a preset first data processing rule. The first data processing rule is used for data processing of the detail data, the identification information of the business department, and the identification information of the business project, so as to unify the data format.
[0125] For example, after obtaining the data set, the sixth data table and the seventh data table can be constructed according to the data in the data set. The row in the sixth data table represents a preset time; the sixth data table includes at least a thirteenth column, a fourteenth column, and a fifteenth column. The thirteenth column represents a business department, the fourteenth column represents a business project, and the fifteenth column represents detail data. The field value corresponding to the row and the thirteenth column represents the identification information of the business department without conversion processing, the field value corresponding to the row and the fourteenth column represents the identification information of the business project without conversion processing, and the field value corresponding to the row and the fifteenth column represents the detail data without conversion processing.
[0126] The seventh data table includes at least a sixteenth column and a seventeenth column; the sixteenth column represents the identification information of the business link without conversion processing, and the seventeenth column represents the environment information of the business link without conversion processing.
[0127] The first data processing rules may include: adjusting unconverted detailed data in the sixth data table based on the detailed data being numerical data with two decimal places; adjusting unconverted business department identification information in the sixth and seventh data tables based on the business department identification information being a string of a preset first length; and adjusting unconverted business item identification information in the sixth and seventh data tables based on the business item identification information being a string of a preset second length. The first data processing rules may also include correcting erroneous data, unifying data types, adding modification time for data, and updating user information for added data.
[0128] S2022. Obtain a first data table based on the processed data.
[0129] Exemplarily, after the data is converted, a first data table is obtained based on the processed data.
[0130] For example, after the data in the first data table is converted, the first data table is obtained. Meanwhile, after the data in the second data table is converted, the second data table is obtained.
[0131] In these embodiments, a plurality of detailed data items of a business department, identification information of the business department, and identification information of the business item are converted and processed according to a preset first data processing rule, and a first data table is obtained based on the processed data. Data processing can be performed on the data in the data set to standardize the data format, reduce erroneous data, and thus improve data quality.
[0132] In some specific embodiments, after constructing a target data table based on the target details of each business department in each business project, the method further includes:
[0133] First, according to the target data table, based on the preset second time period, multiple target details of each business department are obtained.
[0134] Second, construct a third data table based on the identification information of the business department and multiple target details of the business department; wherein the preset second time period includes at least one first time period; the rows in the third data table represent the preset second time period; the third data table includes at least ninth and tenth columns, the ninth column characterizing the identification information of the business department; and the tenth column characterizing the sum of multiple target details corresponding to the business department.
[0135] Figure 5 Schematic diagram of the process of the database-based data processing method provided in this application Figure Three ,like Figure 5 As shown, the method includes:
[0136] S501, acquire a data set generated by a preset service in a preset use scenario; wherein the preset service comprises a plurality of service links, the service link comprises at least one of a service item and a service department, and the data set comprises a plurality of detailed data of the service department on the service item in a preset first time period.
[0137] The execution process of S501 is consistent with that of S101, which will not be repeated here.
[0138] S502, for each service department and each service item, determine the target details of the service department on the service item in the preset first time period; wherein the target details represent a plurality of detailed data of the service department on the service item.
[0139] The execution process of S502 is consistent with that of S102, which will not be repeated here.
[0140] S503, according to the target details of each service department on each service item, construct a target data table; wherein the data stored in the target data table is used to generate a data report table of the preset service.
[0141] The execution process of S503 is consistent with that of S103, which will not be repeated here.
[0142] S504, according to the target data table, based on a preset second time period, acquire a plurality of target details of each service department; the preset second time period comprises at least one first time period.
[0143] For example, after determining the target data table, according to the target data table, based on a preset second time period, a plurality of target details of each service department are acquired; the preset second time period comprises at least one first time period.
[0144] For example, if the first time period is a day, and the data report table needs to count the plurality of target details of each service department in a week within a month, the second time period is a week. Then the plurality of target details of each week from Monday to Sunday in the month are acquired from the target data table.
[0145] S505, according to the identification information of the service department and the plurality of target details of the service department, construct a third data table; wherein the row of the third data table represents the preset second time period; the third data table comprises at least a ninth column and a tenth column, the ninth column represents the identification information of the service department, and the tenth column represents the sum of the plurality of target details corresponding to the service department.
[0146] Exemplarily, after obtaining the multiple target details, a third data table is constructed according to the identification information of the business department and the multiple target details of the business department; wherein a row in the third data table represents a preset second time period; the third data table at least includes a ninth column and a tenth column, the ninth column represents the identification information of the business department, and the tenth column represents the sum of the multiple target details corresponding to the business department.
[0147] For example, in the third data table, a week represents a week, the first row represents the first week, the second row represents the second week, the third row represents the third week, and the fourth row represents the fourth week. The ninth column saves the department ID of the business department. The tenth column saves the sum of the multiple target details of each week.
[0148] It should be noted that the multiple target details of each business project can also be obtained, and a data table of the second preset period of the business project can be generated according to the multiple target details of the business project. The multiple target details of the business department and the business project can also be obtained, and a data table of the second preset period of the business department and the business project can be generated according to the multiple target details of the business department and the business project.
[0149] In these embodiments, according to the target data table, the multiple target details of each business department are obtained based on the preset second time period, and the third data table is constructed according to the identification information of the business department and the multiple target details of the business department. The third data table further aggregates the target details based on the target data table, so that the data is more suitable for the subsequent generation of data report requirements. When generating a data report subsequently, if the third data table can meet the data requirements of the data report, data can be obtained from the third data table first, without the need to obtain data from the target data table and then integrate the data. In this way, the efficiency of data query is improved.
[0150] In some specific embodiments, the above method further comprises:
[0151] First, from the third data table, the sum of the multiple target details of the business department in the preset second time period is obtained.
[0152] Second, the multiple target details of the business department in the preset second time period are obtained from the target data table.
[0153] Third, a fourth data table corresponding to the business department is constructed according to the sum of the multiple target details and the multiple target details; wherein a row of the fourth data table represents a preset first time period; the fourth data table at least includes an eleventh column and a twelfth column; the eleventh column represents the target details of the business department; and the twelfth column represents a ratio; the ratio represents the ratio of the target details to the sum of the multiple target details.
[0154] Figure 6Flowchart of the database-based data processing method provided in the present application Figure Four As shown in Figure 6 , the method comprises:
[0155] S601, acquiring a data set generated by a preset service in a preset use scenario; wherein the preset service comprises a plurality of service links, the service link comprises at least one of a service item and a service department, and the data set comprises a plurality of detailed data of the service department on the service item within a preset first time period.
[0156] The execution process of S601 is consistent with that of S501, which will not be repeated here.
[0157] S602, for each service department and each service item, determining a target detail of the service department on the service item within the preset first time period; wherein the target detail represents a plurality of detailed data of the service department on the service item.
[0158] The execution process of S602 is consistent with that of S502, which will not be repeated here.
[0159] S603, constructing a target data table according to the target details of each service department on each service item; wherein the data stored in the target data table is used to generate a data report of the preset service.
[0160] The execution process of S603 is consistent with that of S503, which will not be repeated here.
[0161] S604, acquiring a plurality of target details of each service department based on a preset second time period according to the target data table; the preset second time period comprises at least one first time period.
[0162] The execution process of S604 is consistent with that of S504, which will not be repeated here.
[0163] S606, constructing a third data table according to the identification information of the service department and the plurality of target details of the service department; wherein a row in the third data table represents the preset second time period; the third data table comprises at least a ninth column and a tenth column, the ninth column represents the identification information of the service department, and the tenth column represents the sum of the plurality of target details corresponding to the service department.
[0164] The execution process of S605 is consistent with that of S505, which will not be repeated here.
[0165] S606, acquiring the sum of the plurality of target details of the service department within the preset second time period from the third data table.
[0166] For example, after the third data table is generated, the sum of the multiple target details of the business department in the preset second time period is obtained from the third data table.
[0167] If more department information needs to be displayed in the data report according to the needs of the subsequent data report, the sum of the multiple target details of the business department (for example, the software development department) in the second time period (for example, one week) can be obtained from the third data table.
[0168] S607, obtaining the multiple target details of the business department in the preset second time period from the target data table.
[0169] For example, after the third data table is generated, the sum of the multiple target details of the business department in the preset second time period is obtained from the third data table.
[0170] If more target detail information needs to be displayed in the data report according to the needs of the subsequent final use user for the data report, the multiple target details of the business department (for example, the software development department) in the second time period (for example, one week) can be obtained from the target data table.
[0171] S608, constructing a fourth data table corresponding to the business department according to the sum of the multiple target details and the multiple target details; wherein the rows of the fourth data table represent the preset first time period; the fourth data table at least includes an eleventh column and a twelfth column; the eleventh column represents the target details of the business department; and the twelfth column represents a ratio; the ratio represents the ratio of the target details to the sum of the multiple target details.
[0172] For example, after the sum of the multiple target details and the multiple target details are obtained, the fourth data table corresponding to the business department is constructed according to the sum of the multiple target details and the multiple target details; wherein the rows of the fourth data table represent the preset first time period; the fourth data table at least includes an eleventh column and a twelfth column; the eleventh column represents the target details of the business department; and the twelfth column represents a ratio; the ratio represents the ratio of the target details to the sum of the multiple target details.
[0173] The eleventh column of the fourth data table is used to save the obtained multiple target details; and the twelfth column is used to save the ratio of the target details to the sum of the multiple target details. The fourth data table has multiple rows, and for each row, the row corresponding field includes a target detail and the ratio of the target to the sum of the multiple target details.
[0174] In the embodiments, the fourth data table is constructed according to the sum of the plurality of target details and the plurality of target details, and the fourth data table is a data table customized according to a specific application scenario, and the fourth data table is directly for the end user of the data table, thereby reducing the access frequency of the end user to other data tables and improving the data response efficiency of the end user.
[0175] In some specific embodiments, the method further includes:
[0176] First, real-time generated data of the preset business in each business link is obtained.
[0177] For example, in response to receiving a data report instruction sent by a user, the data report instruction indicates that data is obtained from the data table, and a data report is generated according to the obtained data and in combination with the implementation data. Real-time generated data of the preset business in each business link is obtained.
[0178] For example, the preset business is a software development business of a software development department, the software development business has not been completed, and the software development business generates real-time generated data such as human cost expenses on the same day. The human cost expenses on the same day are obtained.
[0179] Second, a data report of the preset business is generated according to the real-time generated data and the fourth data table.
[0180] For example, after the real-time generated data is obtained, a data report of the preset business can be generated according to the real-time generated data and the fourth data table.
[0181] For example, target detail data and ratio data of each business project of the software development department in the previous three weeks are obtained from the fourth data table, and in combination with real-time generated target detail data and ratio data of this week, a data report of the software development project is generated, and the data report includes target detail data and ratio data of each business project of the software development department in the previous three weeks and target detail data and ratio data of this week.
[0182] In the embodiments, by obtaining real-time generated data of the preset business in each business link, a data report of the preset business can be generated according to the real-time generated data and the fourth data table, so as to enrich the content of the data report.
[0183] It should be noted that the generated data table is saved in the database. Figure 7 A structural diagram of the database provided in the present application is shown in FIG. 1. Figure 7As shown, the data of the database comes from a data source, and the data source stores the most original data generated from a plurality of preset businesses, including historical data and real-time generated data.
[0184] The fifth data table and the sixth data table are stored in the data lake, and the fifth data table and the sixth data table obtain the most original data from the data source. The first data table and the second data table are also stored in the data lake, and the first data table and the second data table respectively obtain data from the fifth data table and the sixth data table and perform conversion processing on the data. The first data table and the fifth data table are associated through corresponding identification information (such as identification information of a business project and identification information of a business department), and the second data table and the sixth data table are associated through corresponding identification information (such as identification information of a business project or identification information of a business department).
[0185] The seventh data table and the eighth data table are stored in the data warehouse, the seventh data table processes and models the data in the second data table according to business requirements, and the second data table and the seventh data table are associated through corresponding identification information. The eighth data table processes and models the data in the second data table, and the second data table and the eighth data table are associated through corresponding identification information.
[0186] The target data table is stored in the data warehouse, and the target data table obtains data from the seventh data table and the eighth data table, and the first data table, aggregates the obtained data, and the target data table, the seventh data table, the eighth data table, and the first data table are associated through corresponding identification information.
[0187] The third data table is stored in the data warehouse, the third data table obtains data from the target data table, and further aggregates the obtained data, and the third data table and the target data table are associated through corresponding identification information.
[0188] The fourth data table is stored in the data warehouse, the fourth data table obtains data from the third data table, and combines real-time data to generate a poem for a final user. The real-time data is data generated by the data source in real time. The fourth data table and the third data table are associated through corresponding identification information. The real-time data can include identification information, such as identification information of a business department or identification information of a business project, and the identification information in the real-time data is associated with the data in the fourth data table.
[0189] The fourth data table is used to provide data for the final user.
[0190] The final user sends a query instruction, and the query instruction instructs the software query code statement of the database to obtain data from the database. The obtained data can be stored in at least one table in the database. The execution process of the query instruction of the database is:
[0191] First, in response to the data table query instruction, determine the to-be-queried data table; wherein, the to-be-queried data table is at least one of the first data table, the second data table, the third data table, the fourth data table, and the target data table.
[0192] For example, the query instruction indicates to obtain data in the target data table, and the to-be-queried data table is determined as the target data table. The to-be-queried data table can also be at least one of the first data table, the second data table, the third data table, the fourth data table, and the target data table.
[0193] Second, starting from the fourth data table, obtain the to-be-queried data table based on a preset data table query order.
[0194] For example, after determining the to-be-queried data table, starting from the fourth data table, obtain the to-be-queried data table based on a preset data table query order. The preset data table query order is determined according to the association properties of the tables.
[0195] For example, the fourth data table is associated with the third data table, so the third data table can be accessed starting from the fourth data table. Since the third data table is associated with the target data table, the target data table can be accessed from the third data table. Thus, the final data required by the end user is returned from the target data table. At this time, the preset data table query order is to query the fourth data table first, then query the third data table, and finally query the target data table.
[0196] In these embodiments, the data tables are saved in the database, wherein the first data table, the second data table, the fifth data table, and the sixth data table are saved in the data lake, and the third data table, the target data table, the seventh data table, and the eighth data table are saved in the data warehouse. The advantages of the data lake and the data warehouse are combined to provide unified data storage and analysis capabilities. Raw, unorganized data is saved in the data lake to meet the data storage needs of a large number of data sources, and these data do not directly face the end users. The organized data is saved in the data warehouse, and the data in the data warehouse is aggregated to different degrees, so that the data saved in the data warehouse can meet all data needs. Further, by generating the target data table, most of the data is aggregated in the target data table, so that the target data table can meet most of the data needs. The third data table further aggregates the data in the target data table, which can meet more data needs. The fourth data table further aggregates the data in the third data table, which can meet part of the specific data needs. The data in the data warehouse directly provides data for the end users according to different data needs, thereby reducing redundant data and forming a database with efficient storage and efficient calculation.
[0197] Figure 8 A structure schematic diagram of the database-based data processing apparatus provided in the present application is shown in FIG. 1. As shown in FIG. 1, the database-based data processing apparatus 80 provided in the present embodiment comprises: Figure 8
[0198] The acquisition module 801 is configured to acquire a data set generated by a preset service in a preset use scenario; wherein the preset service comprises a plurality of service links, the service link comprises at least one of a service item and a service department, and the data set comprises a plurality of detailed data of the service department on the service item in a preset first time period.
[0199] The determination module 802 is configured to determine, for each service department and each service item, a target detail of the service department on the service item in the preset first time period; wherein the target detail represents the plurality of detailed data of the service department on the service item.
[0200] The construction module 803 is configured to construct a target data table according to the target details of the service departments on the service items; wherein the data stored in the target data table is used to generate a data report of the preset service.
[0201] In a possible implementation, the data set comprises environment information and identification information corresponding to the service link, and the environment information represents a detailed explanation of the service link; before determining the target details of the service department on the service item in the preset first time period, the determination module 902 is further configured to:
[0202] generate a first data table according to the plurality of detailed data of the service department on the service item, the identification information of the service department, and the identification information of the service item; wherein a row in the first data table represents a preset time; the preset time is located in the preset first time period; the preset time represents a generation time of the detailed data; the first data table comprises at least a first column, a second column, and a third column; the first column represents the service department, the second column represents the service item, and the third column represents the detailed data; a field value corresponding to the row and the first column represents the identification information of the service department, a field value corresponding to the row and the second column represents the identification information of the service item, and a field value corresponding to the row and the third column represents the detailed data.
[0203] determine a second data table according to the identification information of the service link and the environment information corresponding to the service link; wherein the second data table comprises at least a fourth column and a fifth column; the fourth column represents the identification information of the service link, and the fifth column represents the environment information of the service link.
[0204] In a possible implementation, the determination module 802 is further configured to:
[0205] Obtaining detailed data of each business department on each business item from the first data table;
[0206] For each business department and each business item, determining a target detail of the business department on the business item according to the plurality of detailed data.
[0207] In a possible implementation, the constructing module 803 is further configured to:
[0208] Obtaining identification information of each business link and environment information of each business link from the second data table;
[0209] According to the identification information of each business link, the environment information of each business link, and the target details of each business department on each business item, constructing a target data table; wherein the target data table includes a sixth column, a seventh column, and an eighth column; the sixth column represents the identification information of the business link; the seventh column represents the environment information of the business link; the eighth column represents the target details; and a row of the target data table represents a preset use scenario.
[0210] In a possible implementation, the determining module 802 is further configured to:
[0211] According to a preset first data processing rule, performing conversion processing on the plurality of detailed data of the business department on the business item, the identification information of the business department, and the identification information of the business item respectively;
[0212] According to the processed data, obtaining the first data table.
[0213] In a possible implementation, the database-based data processing apparatus 80 further includes a second constructing module configured to:
[0214] According to the target data table, obtaining a plurality of target details of each business department based on a preset second time period; wherein the preset second time period includes at least one first time period;
[0215] According to the identification information of the business department and the plurality of target details of the business department, constructing a third data table; a row in the third data table represents a preset second time period; and the third data table includes at least a ninth column and a tenth column, the ninth column represents the identification information of the business department, and the tenth column represents a sum of the plurality of target details corresponding to the business department.
[0216] In a possible implementation, the database-based data processing apparatus 80 further includes a third constructing module configured to:
[0217] From the third data table, obtaining the sum of the plurality of target details of the business department within the preset second time period;
[0218] obtaining a plurality of target details of the business department in a preset second time period from the target data table;
[0219] constructing a fourth data table corresponding to the business department according to the sum of the plurality of target details and the plurality of target details; wherein a row of the fourth data table represents the preset first time period; the fourth data table at least includes an eleventh column and a twelfth column; the eleventh column represents the target details of the business department; and the twelfth column represents a ratio; the ratio represents a ratio of the target details to the sum of the plurality of target details.
[0220] In a possible implementation, the database-based data processing apparatus 90 further includes a report module, configured to:
[0221] obtaining real-time generated data of the preset business in each business link;
[0222] generating a data report of the preset business according to the real-time generated data and the fourth data table.
[0223] In a possible implementation, the database-based data processing apparatus 80 further includes a query module, configured to:
[0224] determining a to-be-queried data table in response to a data table query instruction; wherein the to-be-queried data table is at least one of the first data table, the second data table, the third data table, the fourth data table and the target data table;
[0225] obtaining the to-be-queried data table based on a preset data table query order from the fourth data table.
[0226] The database-based data processing apparatus provided in this embodiment can execute the method provided in the method embodiments, and has similar implementation principles and technical effects, which will not be described here in detail.
[0227] Figure 9 A structural schematic diagram of the database-based data processing device provided in this application is shown in FIG. 1. Figure 9 As shown in FIG. 1, the database-based data processing device 90 provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the database-based data processing device 90 further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected through a bus.
[0228] In the specific implementation process, the at least one processor 901 executes the computer execution instructions stored in the memory 902, so that the at least one processor 901 executes the method described above.
[0229] The specific implementation process of the processor 901 can refer to the method embodiments described above, which has similar implementation principles and technical effects, and will not be described here in detail.
[0230] In the above embodiments, 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 any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0231] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.
[0232] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0233] The present application also provides a computer program product, comprising a computer program, which is executed by a processor to implement the above method.
[0234] The present application also provides a computer readable storage medium, which stores computer execution instructions, and when the processor executes the computer execution instructions, the above method is implemented.
[0235] The above readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0236] An example readable storage medium is coupled to the processor such that the processor can read information from the readable storage medium and can write information to the readable storage medium. Of course, the readable storage medium can also be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0237] The division of units is only a logical functional division, and in actual implementation, there can be another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0238] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0239] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0240] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0241] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes various media capable of storing program codes, such as ROM, RAM, magnetic disk, or optical disk.
[0242] Finally, it should be noted that other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the present application disclosed herein. The present application is intended to include all such variations as fall within the general scope of the application, and includes the generic principles disclosed and the best mode known to the inventors to be currently practiced as well as variations thereof, without departing from the scope of the present application as defined by the claims. The specification and examples give the best application of the present application as currently known, and together with the description of the application serve to best illustrate the principles of the application. The scope of the application is expressly set forth by the claims.
Claims
1. A data processing method based on a database, characterized in that: include: Obtaining a data set generated by a preset business in a preset usage scenario; wherein the preset business includes multiple business links, each of which includes at least one of a business project and a business department, and the data set includes multiple detailed data on the business project of the business department within a preset first time period; For each business department and each business project, determining target details of the business department in the business project within the preset first time period; wherein the target details represent multiple pieces of detailed data of the business department in the business project; A target data table is constructed based on the target details of each business department in each business project; wherein the data stored in the target data table is used to generate data reports for preset businesses.
2. The method according to claim 1, characterized in that The data set includes environmental information and identification information corresponding to the business link, wherein the environmental information represents a detailed explanation of the business link; before determining the target details of the business project by the business department within the preset first time period, the data set further includes: A first data table is generated based on a plurality of detailed data items of the business department, identification information of the business department, and identification information of the business item; wherein a row in the first data table represents a preset time; the preset time is within a preset first time period; the preset time represents the time when the detailed data is generated; the first data table includes at least a first column, a second column, and a third column, the first column represents the business department, the second column represents the business item, and the third column represents the detailed data; the field value corresponding to the row and the first column represents the identification information of the business department, the field value corresponding to the row and the second column represents the identification information of the business item, and the field value corresponding to the row and the third column represents the detailed data; A second data table is determined based on the identification information of the business link and the environmental information corresponding to the business link; wherein the second data table includes at least a fourth column and a fifth column; the fourth column characterizes the identification information of the business link, and the fifth column characterizes the environmental information of the business link.
3. The method according to claim 2, characterized in that For each business department and each business project, determining the target details of the business department for the business project within the preset first time period includes: Obtain detailed data of each business department on each business item from the first data table; For each business department and each business project, the target details of the business department in the business project are determined based on multiple pieces of detailed data.
4. The method according to claim 3, characterized in that According to the target details of each business department in each business project, a target data table is constructed, including: Obtaining identification information of each business link and environmental information of each business link from the second data table; A target data table is constructed based on the identification information of each business link, the environmental information of each business link, and the target details of each business department in each business project; wherein the target data table includes a sixth column, a seventh column, and an eighth column; the sixth column represents the identification information of the business link; the seventh column represents the environmental information of the business link; the eighth column represents the target details; and the rows of the target data table represent preset usage scenarios.
5. The method according to claim 2, characterized in that The first data table is generated according to the plurality of detailed data of the business department on the business project, the identification information of the business department, and the identification information of the business project, including: According to a preset first data processing rule, converting and processing the plurality of detailed data of the business department on the business project, the identification information of the business department, and the identification information of the business project respectively; The first data table is obtained according to the processed data.
6. The method according to any one of claims 1 to 5, characterized in that After constructing a target data table based on the target details of each business department in each business project, the method further includes: According to the target data table, based on a preset second time period, a plurality of target details of each business department are obtained; the preset second time period includes at least one first time period; A third data table is constructed based on the identification information of the business department and the multiple target details of the business department; wherein the rows in the third data table represent a preset second time period; the third data table includes at least a ninth column and a tenth column, the ninth column represents the identification information of the business department; and the tenth column represents the sum of the multiple target details corresponding to the business department.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining, from the third data table, a sum of multiple target details of the business department within a preset second time period; Obtaining multiple target details of the business department within a preset second time period from the target data table; Based on the sum of the multiple target details and the multiple target details, a fourth data table corresponding to the business department is constructed; wherein, the rows of the fourth data table represent a preset first time period; the fourth data table includes at least an eleventh column and a twelfth column; the eleventh column represents the target details of the business department; the twelfth column represents a ratio; the ratio represents the ratio of the target details to the sum of the multiple target details.
8. The method according to claim 7, characterized in that The method further comprises: Obtaining real-time generated data of the preset business in each business link; A data report table for the preset business is generated according to the real-time generated data and the fourth data table.
9. The method according to claim 8, characterized in that The method further comprises: In response to a data table query instruction, determining a data table to be queried; wherein the data table to be queried is at least one of the first data table, the second data table, the third data table, the fourth data table, and the target data table; Starting from the fourth data table, based on a preset data table query order, the data table to be queried is obtained.
10. A data processing device based on a database, characterized in that: include: an acquisition module, configured to acquire a data set generated by a preset business in a preset usage scenario; wherein the preset business includes multiple business links, each of which includes at least one of a business project and a business department, and the data set includes multiple detailed data on the business projects of the business department within a preset first time period; A determination module is configured to determine, for each business department and each business project, target details of the business department for the business project within the preset first time period; wherein the target details represent multiple pieces of detailed data of the business department in the business project; The construction module is used to construct a target data table based on the target details of each business department in each business project; wherein the data stored in the target data table is used to generate a data report for a preset business.
11. A data processing device based on a database, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when the computer program is executed by a processor.
Citation Information
Patent Citations
Method and device for accessing large-object set table in data warehouse
CN102129425A
Index creation method, device and apparatus based on service identifier
CN110347674A
Research and development additional project management method and device, storage medium and electronic equipment
CN113506092A
Data processing method and related device
CN114185942A
Determination method and device of testability index, storage medium and electronic device
CN119884204A