Data export method, data system and computer program product

By completing column permission verification in the front-end application, the back-end database generates an export file based on user information, which solves the problems of high resource consumption and high memory usage in existing technologies and improves data export efficiency.

CN121479040APending Publication Date: 2026-02-06HANGZHOU ROBAM APPLIANCES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511620948.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing data export methods suffer from high resource consumption and memory usage, impacting system performance, especially when performing permission verification on the front end or back end.

Method used

After the column permission verification is completed in the front-end application, the column information is directly carried to the back-end database. The back-end database performs row permission verification based on the user information and generates an export file, avoiding repeated permission verification and data filtering.

Benefits of technology

It effectively reduces the computational resource consumption of the backend database, improves data export efficiency, and reduces the impact on system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121479040A_ABST
    Figure CN121479040A_ABST
Patent Text Reader

Abstract

The invention discloses a data exporting method, a data system and a computer program product, which are applied to the data system, and the data system comprises a front-end application and a back-end database. The method comprises the steps that a back-end database receives a data export request sent by a front-end application; the data export request comprises column information of to-be-exported data and user information; the back-end database performs row permission verification according to the user information and determines row information of the to-be-exported data; obtaining the to-be-exported data according to the column information and the row information of the to-be-exported data, and generating an export file based on the to-be-exported data; and sending acquisition information of the exported file to the front-end application. By adopting the method, the calculation resource occupation of the back-end database can be effectively reduced, and the data export efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data processing, and in particular to a data export method, a data system and a computer program product. BACKGROUND

[0002] In web applications and enterprise information systems, exporting data displayed or processed by the front end into a structured file is a technique commonly used by users, which is often applied to scenarios such as report downloading, data backup, result sharing, offline analysis, etc.

[0003] Currently, user permissions are often checked by the front end or the back end, and data is located based on the permission information corresponding to the user, and then data export is performed. However, the current data export method has problems such as large resource consumption, memory occupation, etc., which can easily affect the performance of the system. SUMMARY

[0004] In view of the above defects or deficiencies in the prior art, it is desirable to provide a data export method, a data system and a computer program product, which can effectively reduce the computing resource occupation of the back-end database and improve the data export efficiency.

[0005] In a first aspect, the present application provides a data export method applied to a data system, the data system comprising a front-end application and a back-end database. The method comprises: The back-end database receives a data export request sent by the front-end application; the data export request comprises column information of to-be-exported data and user information; The back-end database performs row permission verification according to the user information to determine row information of the to-be-exported data; Obtaining the to-be-exported data according to the column information of the to-be-exported data and the row information of the to-be-exported data, and generating an export file based on the to-be-exported data; Sending the obtaining information of the export file to the front-end application.

[0006] In combination with the first aspect, in a possible implementation manner, the data export request further comprises a number of rows displayed on a single page of the front-end application, and the obtaining the to-be-exported data according to the column information of the to-be-exported data and the row information of the to-be-exported data, and generating the export file based on the to-be-exported data comprises: obtaining a plurality of target arrays in sequence according to the number of rows displayed on a single page and the column information of the to-be-exported data; the number of rows of the target array is the number of rows displayed on a single page, and the number of columns is the number of columns represented by the column information of the to-be-exported data; and sequentially writing the plurality of target data groups into the export file.

[0007] In combination with the first aspect, in a possible implementation manner, if the column information of the to-be-exported data represents a multi-level column title, the method further comprises: when generating the export file, merging a plurality of writing positions corresponding to the column title with a plurality of sub-titles.

[0008] In a possible implementation manner of the first aspect, the data export request further includes an enumeration mapping relationship, the enumeration mapping relationship includes a mapping relationship between the data and an enumeration value, and generating the export file based on the data to be exported includes: the backend database searching for target data corresponding to the enumeration value in the data to be exported according to the enumeration mapping relationship, and generating the export file based on the data to be exported and the target data.

[0009] In a possible implementation manner of the first aspect, the data export method further includes: the backend database generating an export log according to the user information, the data export time and the acquisition information of the export file.

[0010] In a possible implementation manner of the first aspect, the data export method further includes: the backend database generating an export log according to the user information, the data export time and the acquisition information of the export file. The front-end application generates a data export request in response to a data export instruction; the data export request includes column information of data to be exported and user information; The front-end application sends the data export request to the backend database; The acquisition information of the export file sent by the backend database is received, and the export file is acquired based on the acquisition information.

[0011] In a possible implementation manner of the first aspect, the front-end application generates a data export request in response to a data export instruction, including: the front-end application acquires current page display data in response to the data export instruction; column information is filtered from the current page display data based on data attributes, and the data export request is generated based on the column information.

[0012] In a possible implementation manner of the first aspect, the front-end application generates a data export request in response to a data export instruction, including: the front-end application compares a number of rows of data to be exported with a number of rows displayed by a single page of the front-end application in response to the data export instruction; and the data export request is generated in a case where the number of rows of data to be exported is greater than the number of rows displayed by a single page.

[0013] In a possible implementation manner of the first aspect, the front-end application generates a data export request in response to a data export instruction, including: the front-end application compares a number of rows of data to be exported with a number of rows displayed by a single page of the front-end application in response to the data export instruction; and the data export request is generated in a case where the number of rows of data to be exported is greater than the number of rows displayed by a single page.

[0014] The embodiment of the present application provides a data export method, a data system and a computer program product. When data in a target page of a front-end application needs to be exported, a back-end database can receive a data export request sent by the front-end application and containing column information of to-be-exported data. Then, row permission verification is performed according to user information, and row information of the to-be-exported data is determined. Then, the to-be-exported data is directly obtained according to the row information of the to-be-exported data and the column information obtained from the front-end application, and an export file is generated based on the to-be-exported data. The method provided by the embodiment of the present application considers that column permission verification of a user has been completed when the target page of the front-end application is displayed, so when the to-be-exported data corresponding to the target page is exported, the column information of the to-be-exported data is directly obtained from the front-end, and the data corresponding to the column information is directly obtained, without the need to perform column permission verification and data filtering based on the user information again, thereby effectively reducing the computing resource occupation of the back-end database and improving the data export efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0015] Other features, objects, and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments thereof as taken in conjunction with the accompanying drawings: Figure 1 FIG. 1 is a structural schematic diagram of a data export system in one embodiment; Figure 2 FIG. 2 is a flow schematic diagram of a data export method in one embodiment; Figure 3 FIG. 3 is a page structure schematic diagram of a front-end application in one embodiment; Figure 4 FIG. 4 is an interface schematic diagram of a structured file; Figure 5 FIG. 5 is an interface schematic diagram of an export file in one embodiment; Figure 6 FIG. 6 is another flow schematic diagram of a data export method in one embodiment; Figure 7 FIG. 7 is another flow schematic diagram of a data export method in one embodiment; Figure 8 FIG. 8 is another flow schematic diagram of a data export method in one embodiment; Figure 9 FIG. 9 is another flow schematic diagram of a data export method in one embodiment. DETAILED DESCRIPTION

[0016] The present application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for the convenience of description.

[0017] It should be noted that the embodiments and features in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. In addition, the term "and / or" in this paper is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the existence of A alone, the existence of A and B together, and the existence of B alone. The terms "first" and "second" in the specification and claims of the embodiments of the present application are used to distinguish different objects, not to describe a specific order of the objects.

[0018] In web applications and enterprise information systems, it is a common technical requirement for users to export data displayed or processed by the front end (such as the browser end) to structured files such as Excel, Portable Document Format (PDF), Comma-Separated Values (CSV), etc. Common application scenarios of this technology include report downloading, data backup, result sharing, offline analysis, etc.

[0019] Currently, user permissions are often checked by the front end or the back end, and data is located based on the permission information corresponding to the user, and then data export is performed. However, there are certain problems in data export through the front end and / or the back end. When exporting data through the back end, the back end needs to perform permission verification based on user information, filter data that the user has no access to, and then generate a data file. The generated data file is transmitted to the front end for the user to download and view. The permission verification and data processing processes in this data export method have the problem of large consumption of computing resources. When exporting data through the front end, the front end needs to perform permission verification and other processing based on user information, which has a large security risk. In the case of a large amount of exported data, the front end consumes a large amount of memory, which can easily affect the performance of the front end. Currently, there is a hybrid solution to the problem of data export processing by the front end and the back end. The hybrid solution often switches between the front end and the back end based on simple rules such as data volume thresholds, for example, when the amount of exported data is small, the front end performs data export processing; when the amount of exported data is large, the back end performs data export processing. This method also has the problems of large consumption of computing resources and security risks, etc.

[0020] Based on this, the embodiments of the present application provide a data export method, a data system and a computer program product, which can effectively reduce the computing resource occupation of the back-end database and improve the data export efficiency.

[0021] The data export method provided by the embodiments of the present application can be applied to, for example, Figure 1The data system shown includes a front-end application 10 and a back-end database 20. The front-end application 10 can be a browser, an enterprise information system, or other web application; the back-end database 20 is used to provide data support for the front-end application 10 and can be integrated in a server or a server cluster.

[0022] In one embodiment, as shown in Figure 2 a data export method is provided. The method is described below by taking the back-end database 20 in Figure 1 as an example, which includes the following steps: Step 101, the back-end database 20 receives a data export request sent by the front-end application 10.

[0023] In response to a user instruction, the front-end application 10 requests data of a target page from the back-end database 20 for display when jumping to the target page, for the user to view. For example, when the target page is a product sales situation display page, the back-end database 20 queries product sales related data required by the target page and sends it to the front-end application 10 for display.

[0024] It can be understood that when the back-end database 20 queries 20 columns of 200 rows of product sales related data in response to the data request of the front-end application 10, it does not send all the data to the front-end application 10 for display at the same time, but only sends the amount of data that can be displayed on a single page of the target page to the front-end application 10. For example, the target page of the front-end application 10 displays 20 columns and 50 rows per page. The back-end database 20 only sends 20 columns and 50 rows of data to the front-end application 10. When the user needs to view other data, for example, the user clicks the "next page" button on the target page, the back-end database 20 sequentially sends another 20 columns and 50 rows of data to the front-end application 10 for display. Different columns of data in the page of the front-end application 10 often represent different data types, and different rows of data often represent different objects. For example, the product sales situation display page can include product retail price, product wholesale price, product sales, product model, customer name, sales channel, sales date, sales information status, and other data columns; it can include product 1, product 2, product 3, and other data rows.

[0025] While the back-end database 20 feeds back data to the front-end application 10, it also sends the user's permission information to the front-end application 10. The front-end application 10 excludes the data that the user cannot view from the received data according to the user's permission information, and only displays the data corresponding to the user's permission information on the target page. For example, the user's permission information indicates that the user cannot view 5 types of data with column titles "retail price" and "wholesale price" in the 20 columns of data, so the front-end application 10 excludes these five columns of data and only displays the remaining 15 columns and 50 rows of data on the target page.

[0026] In the case that the data system has a data export requirement, the backend database 20 needs to perform user permission verification again in response to the data export request of the front-end application 10. That is, after obtaining the data (for example, 20 columns and 200 rows of data) corresponding to the target page (for example, the product sales situation display page) of the front-end application 10, the data needs to be filtered again based on the user's permission information to retain the data within the user's permission range. However, the front-end application 10 has completed the column permission (that is, the data column that the user can view) verification of the data when the target page is displayed, that is, the column data displayed by the current page is the column data within the user's permission range. Therefore, to avoid the resource waste caused by the backend database 20 performing permission verification again for a large amount of data (for example, 200 rows of data, and some pages can reach more), in the embodiment of the present application, the front-end application 10 can directly carry the column information of the data in the target page in the data export request sent to the backend database 20. That is, the data export request in the embodiment of the present application includes the column information of the data to be exported and the user information.

[0027] In the case that the data system has a data export requirement, for example, the user clicks the “export” button on the target page, or the task currently executed by the data system has a data export requirement for the target page. Then the front-end application 10 generates a data export request based on the user information and the column information of the data of the target page, and sends the data export request to the backend database 20. So that the backend database 20 can obtain the column permission in the user's permission information, and directly obtain the corresponding column data based on the column permission, without the need for a complex column permission verification process.

[0028] The column permission is the data column that the user can view, that is, the column information of the data to be exported, which can include the column titles such as “product model”, “customer name”, “sales channel”, “sales date”, “sales information status” and the column names (that is, the field names of the column titles) of the column titles.

[0029] Step 102, the backend database 20 performs row permission verification according to the user information to determine the row information of the data to be exported.

[0030] The data to be exported is the data within the user's permission range corresponding to the target page. For example, 15 columns and 200 rows of data. In one possible implementation manner, as shown in FIG. 2, the data to be exported is the data within the user's permission range corresponding to the target page. Figure 3As shown, the front-end application 10 can provide multiple export modes, such as exporting the current page and exporting all data. When the user needs to export the current page data of the target page, the data to be exported is the data of a single page of the target page within the user's authority, such as the above-mentioned 15 columns and 50 rows of data. When the user needs to export all data of the target page, the data to be exported is the data within the user's authority in all data corresponding to the target page, such as the above-mentioned 15 columns and 200 rows of data.

[0031] In the embodiments of the present application, a specific data can be located based on column information and row information, for example, the specific retail price of product 1 can be determined based on the row information "product 1" and the column information "retail price". Therefore, after the front-end application 10 obtains the column information of the data to be exported from the back-end database 20, the row authority of the user (for example, the product object that the user can view) is also queried from the local data based on the user information to obtain the row information of the data to be exported. Specifically, the user information can include a user identifier, a password, and a user role (for example, an engineer, a financial staff, etc.). The back-end database 20 can verify the identity compliance of the user based on the user identifier and the password, and then query in a pre-defined authority table based on the user identifier and / or the user role to determine the row authority of the user. The pre-defined authority table can include the correspondence between different user identifiers and / or different user roles and different authorities.

[0032] Step 103: obtaining the data to be exported according to the column information of the data to be exported and the row information of the data to be exported, and generating an export file based on the data to be exported.

[0033] In the embodiments of the present application, the data export request sent by the front-end application 10 can also include interface information corresponding to the target page, and the back-end database 20 can obtain the data to be exported by accessing the interface. Specifically, after the back-end database 20 determines the column information and the row information of the data to be exported, it accesses the interface corresponding to the target page and directly finds and obtains the data corresponding to the column information to obtain the candidate data. For example, 15 columns and 240 rows of data are obtained.

[0034] Then, the back-end database 20 filters the candidate data based on the row information to filter out the data in the candidate data that is not within the authority range represented by the row information. For example, the row information represents that the user cannot view the sales information of products 201-240, and then the back-end database 20 filters out the 40 rows of data corresponding to products 201-240 to obtain the data to be exported within the user's authority corresponding to the target page, that is, the remaining 15 columns and 200 rows of data. Finally, the back-end database 20 writes the data to be exported into the file template according to the row and column to generate an export file.

[0035] In a possible implementation, the front-end application 10 can also receive a query operation of the user on the target page and record the query condition. Then, the data export request is generated based on the query condition, the column information and the user information. When the back-end database 20 obtains the data to be exported in response to the data export request, the data corresponding to the target page and within the user's authority range needs to be further filtered according to the query parameters, and the data meeting the query condition is filtered to obtain the data to be exported.

[0036] In a possible implementation, the column information of the data to be exported can include a first-level title, for example, the above-mentioned "product model", "customer name", "sales channel", "sales date", "sales information status" and the like. Figure 4 As shown in the figure, the column information can also include a multi-level column title, and the multi-level column title includes a column title with multiple sub-titles. For example, the column information includes first-level column titles "first quarter" and "second quarter", and the first-level column titles correspond to two second-level column titles "sales amount" and "quantity", and the second-level column titles are sub-titles of the first-level column titles. In this case, the back-end database 20 combines multiple write positions corresponding to the column title with multiple sub-titles when generating the export file based on the data to be exported.

[0037] In this implementation, based on the setting of the file template, the column title with multiple sub-titles has multiple write positions, and the number of write positions is the same as the number of sub-titles. For example, the first-level column title "first quarter" corresponds to two write positions. In order to ensure the readability of the export file and the consistency with the front-end target page, the multiple write positions corresponding to the column title with multiple sub-titles need to be combined, and the column title is written into the combined write position. For example, as shown in the figure, the two write positions corresponding to the first-level column title "first quarter" are combined, and "first quarter" is written into the combined write position; the two write positions corresponding to the first-level column title "second quarter" are combined, and "second quarter" is written into the combined write position. Figure 5

[0038] In step 104, the front-end application 10 is sent the acquisition information of the export file.

[0039] In the embodiment of the application, after the back-end database 20 generates the export file, the export file is stored locally, and then the acquisition information based on the address information of the export file is generated and sent to the front-end application 10, so that the front-end application 10 can acquire the export file from the back-end database 20 according to the acquisition information.

[0040] ​In a possible implementation, the backend database 20 may obtain data from the local database or obtain part of the data from the external data system based on the data requirement of the target page when obtaining the data corresponding to the target page. To ensure the security of the data, after the obtained data is filtered, a file is generated, and the like, and the export file is obtained, the time limit information of the export file can be set, that is, the time limit for obtaining the export file is specified, for example, one week. Then, the backend database 20 generates the obtaining information of the export file based on the address information and the time limit information of the export file, and sends the obtaining information to the front-end application 10. In this way, it is ensured that the front-end application 10 can only obtain the export file within the time limit indicated by the time limit information.

[0041] In a possible implementation, when the backend database 20 detects that the front-end application 10 obtains the export file based on the obtaining information, the backend database 20 can generate the export log according to the user information, the data export time, and the obtaining information of the export file.

[0042] In this implementation, the backend database 20 can record the data export related information corresponding to the target page. For example, the user information for obtaining the export file, the time (that is, the data export time) for obtaining the export file by the user, the obtaining information of the export file, the interface information corresponding to the target page, and the like are recorded. Then, the recorded data is generated into the export log in a predetermined format, so that when a data security problem occurs subsequently, the security review can be performed based on the export log.

[0043] In the data export method provided by the embodiment of the present application, when data in the target page of the front-end application needs to be exported, the backend database can receive the data export request sent by the front-end application and containing the column information of the data to be exported. Then, the row permission verification is performed according to the user information, and the row information of the data to be exported is determined. Then, the data to be exported is directly obtained according to the row information of the data to be exported and the column information obtained from the front-end application, and the export file is generated based on the data to be exported. The method provided by the embodiment of the present application considers that the column permission verification of the user has been completed when the target page of the front-end application is displayed, so that when the data to be exported corresponding to the target page is exported, the column information of the data to be exported is directly obtained from the front-end, and the data corresponding to the column information is directly obtained, without the need to perform the column permission verification and the data filtering and the like based on the user information again, thereby effectively reducing the occupation of the computing resources of the backend database and improving the data export efficiency.

[0044] The above embodiments introduce a scheme in which the backend database 20 obtains the data to be exported based on the column information and the row information of the data to be exported. In another embodiment of the present application, the front-end application 10 can also carry the number of rows displayed on a single page (for example, 50 rows) of the target page to the data export request sent to the backend database 20, so that the backend database 20 can perform data acquisition and data writing operations synchronously in units of the number of rows displayed on a single page. For example, the above-mentioned "obtaining the data to be exported based on the column information and the row information of the data to be exported, and generating an export file based on the data to be exported" can include the steps shown in Figure 6 Step 201: obtaining a plurality of target arrays in sequence based on the number of rows displayed on a single page and the column information of the data to be exported.

[0045] The target array can include the amount of data displayed on a single page of the target page, that is, the target data includes M columns N rows of data, where M is the number of rows displayed on a single page of the target page, and N is the number of columns represented by the column information of the data to be exported.

[0046] In the embodiment of the present application, the front-end application 10 can generate a data export request based on the number of rows displayed on a single page of the target page, the column information of the data to be exported, and the user information, and send it to the backend database 20. The backend database 20 can determine the number of columns of the data to be exported based on the column information of the data to be exported, for example, the number of column titles in the column information can be used as the number of columns of the data to be exported. Then, the backend database 20 obtains M rows of data corresponding to the column information in sequence to obtain a group of target arrays. Until the number of rows of the obtained target arrays is less than the number of rows displayed on a single page, the acquisition of the data to be exported is stopped, and a plurality of target arrays are obtained.

[0047] Step 202: writing the plurality of target data groups into the export file in sequence.

[0048] In the embodiment of the present application, the backend database 20 can write the data in the target array into the file template each time a group of target arrays is obtained, and obtain the next group of target arrays according to the number of rows displayed on a single page, until the last group of target arrays is obtained and written into the file template to obtain the export file.

[0049] In the method provided in the embodiment of the present application, the backend database can obtain a plurality of target arrays in sequence based on the number of rows displayed on a single page and the column information of the data to be exported, and obtain a plurality of target arrays in sequence based on the number of rows displayed on a single page and the column information of the data to be exported. That is, in the embodiment of the present application, the backend database can obtain the target array and write it into the file template at the same time, which can avoid writing all the data to be exported into the file template after obtaining all the data to be exported, so as to avoid occupying a large amount of memory of the data to be exported before the export file is generated, which affects the performance of the backend database. At the same time, the export file generation method of obtaining and writing at the same time can effectively improve the data export efficiency.​

[0050] The foregoing embodiments introduce a scheme of generating an export file based on acquired data to be exported. In another embodiment of the present application, the data export request further includes an enumeration mapping relationship, and the enumeration mapping relationship includes a mapping relationship between data and an enumeration value. In this case, to ensure consistency between the export file and the target page, the backend database 20 needs to generate the export file based on the enumeration mapping relationship and the conversion of the data to be exported. That is, the "generating an export file based on data to be exported" referred to in the foregoing can include the following steps: The backend database 20 finds the target data corresponding to the enumeration value in the data to be exported according to the enumeration mapping relationship, and generates an export file based on the data to be exported and the target data.

[0051] In the embodiments of the present application, to ensure display flexibility, the front-end application 10 or the backend database 20 can maintain the enumeration mapping relationship of the data in the target page. For example, the column title "sales information status" can correspond to the enumeration mapping relationship of 0-input; 1-pending; and 2-verified. Among them, "0", "1", and "2" are enumeration values, and "input", "pending", and "verified" are data corresponding to the enumeration values.

[0052] In the case where the front-end application 10 or the backend database 20 maintains the enumeration mapping relationship, the backend database 20 accesses the interface to obtain the enumeration value of the data. Therefore, after the backend database 20 obtains the data to be exported, the enumeration value in the data to be exported is converted into the corresponding target data according to the enumeration mapping relationship, the enumeration value in the data to be exported is replaced based on the target data, the data-replaced data to be exported is written into the file template, and the data to be exported file is generated.

[0053] In a possible implementation manner, before the backend database 20 obtains the data to be exported or obtains each target array, fills each column data into a pre-established JSON object, and adds attribute information such as a column serial number index index, a column title name, a column width wide, and a data type field_type (such as a number, a string, etc.) to each column data, and then writes the data to be exported added with the attribute information into the file template to generate the data to be exported file, so that subsequent processing such as searching column data and formula operation on the data can be performed based on the attribute information of the data.

[0054] The method provided in the embodiments of the present application can convert the data to be exported based on the enumeration mapping relationship of the data in the target page, ensure that the data to be exported written into the file template is consistent with the data seen by the user on the target page of the front-end application 10, that is, ensure the consistency between the export file and the target page, and ensure the quality of the export file.

[0055] In one embodiment, as shown in Figure 7 A data export method is provided, which is applied to the front-end application 10 in the system 1000 as an example, and includes the following steps. Figure 1 Step 301, the front-end application 10 generates a data export request in response to a data export instruction.

[0056] The data export request includes column information of the data to be exported and user information.

[0057] In the embodiment, when the data system has a data export requirement, for example, the user clicks the "export" button on the target page, or the task currently executed by the data system has a data export requirement for the target page, etc. The front-end application 10 generates a data export request based on the user information and the column information of the data of the target page.

[0058] The column permission is the data column that the user can view according to the user's permission information, that is, the column information of the data to be exported. For example, it can include the column titles "product model", "customer name", "sales channel", "sales date", "sales information status", etc. It can also include the column names (i.e. field names) of each column title.

[0059] Step 302, the front-end application 10 sends the data export request to the back-end database 20.

[0060] In the embodiment, the front-end application 10 sends the data export request to the back-end database 20. So that the back-end database 20 can obtain the column permission in the user's permission information, and directly obtain the corresponding column data based on the column permission, without going through a complex column permission verification process.

[0061] Step 303, receiving the acquisition information of the export file sent by the back-end database 20, and acquiring the export file based on the acquisition information.

[0062] In the embodiment, the front-end application 10 sends the data export request to the back-end database 20. Specifically, the back-end database verifies the identity compliance of the user according to the user identifier and password in the user information, and then queries in the pre-defined permission table based on the user identifier and / or user role in the user information to determine the row permission of the user. Then access the interface corresponding to the target page, and directly find and acquire the data corresponding to the column information to obtain the candidate data. The candidate data is filtered based on the row information, and the data in the candidate data that is not within the permission range represented by the row information is filtered out. The data to be exported is written into the file template according to the row and column, and the export file is generated. Finally, the export file is stored locally, and then the acquisition information based on the address information of the export file is generated and sent to the front-end application 10.

[0063] ​After the front-end application 10 receives the acquisition information sent by the back-end database 20, the front-end application 10 can access the address in the acquisition information to acquire the export file from the back-end database 20.

[0064] In the data export method provided by the embodiments of the present application, when data in a target page of a front-end application needs to be exported, the front-end application can actively send a data export request containing column information of the data to be exported to the back-end database. In this way, the back-end database can perform row permission verification based on user information, determine row information of the data to be exported, and then directly acquire the data to be exported based on the row information of the data to be exported and the column information acquired from the front-end application. Finally, an export file is generated based on the data to be exported, and acquisition information of the export file is fed back to the front end. The method provided by the embodiments of the present application takes into account that the column permission verification of the user has been completed when the target page of the front-end application is displayed. Therefore, when the data to be exported corresponding to the target page is exported, the front-end application actively provides the column information of the data to be exported to the back-end database, so that the back-end database can directly acquire the data corresponding to the column information, without the need to perform column permission verification and data filtering based on user information again, thereby effectively improving the data export efficiency.

[0065] The foregoing embodiments introduce a scheme in which the front-end application 10 generates a data export request based on column information. In another embodiment of the present application, the front-end application 10 can generate a data export request based on data in a target page that represents column information based on attribute information. That is, the “the front-end application 10 generates a data export request in response to a data export instruction” referred to in the foregoing can include the steps shown in FIG. 4: Figure 8 Step 401: The front-end application 10 acquires current page display data in response to a data export instruction.

[0066] In the embodiments of the present application, the user clicks a “export” button in a target page, or a task currently executed by a data system has a data export requirement for the target page, to generate a data export instruction. The front-end application 10 generates a data export request based on column information of data to be exported in response to the data export instruction. The column information can be acquired from current page display data of the front-end application 10. It can be understood that the current page display data of the front-end application 10 includes data corresponding to the target page, column information of the data, and page data such as “next page” and “export”. Therefore, the front-end application 10 can acquire the column information of the data to be exported from the current page display data.

[0067] Step 402: Column information is filtered out from the current page display data based on data attributes, and a data export request is generated based on the column information.

[0068] ​In the embodiments of the present application, considering that the attributes of different data in the current page display data are different, the attributes of page data such as "next page" and "export" can be page parameters, and the attributes of column information can be column parameters. Therefore, the front-end application 10 can filter the column information from the current page display data based on the data attributes of the column information, and then generate a data export request based on the column information and the user information.

[0069] In the method provided by the embodiments of the present application, the front-end application 10 can obtain the column information of the data to be exported from the current page display data based on the data attributes, and generate a data export request. In this way, the corresponding data to be exported can be directly obtained based on the column information by the back-end database, without the need for column permission verification again, thereby saving computing resources and improving the data export efficiency.

[0070] The foregoing embodiments introduce a scheme for generating a data export request by the front-end application. In another embodiment of the present application, in the case that the amount of data to be exported is small, the front-end application 10 can directly generate an export file without generating a data export request for sending to the back-end database 20. For example, the "generating a data export request by the front-end application 10 in response to a data export instruction" as described in the foregoing embodiments includes the steps as shown in Figure 9 Step 501: The front-end application 10 compares the number of rows of data to be exported with the number of rows displayed per page by the front-end application 10 in response to a data export instruction.

[0071] In the embodiments of the present application, the front-end application 10 can first determine whether the data to be exported has been completely displayed in the current page in response to a data export instruction. Specifically, the number of rows of data to be exported can be compared with the number of rows displayed per page by the front-end application 10. If the number of rows of data to be exported is greater than the number of rows displayed per page, it indicates that the data to be exported is displayed in pages in the target page. If the number of rows of data to be exported is less than or equal to the number of rows displayed per page, it indicates that the data to be exported has been completely displayed in the current page of the target page.

[0072] In a possible implementation manner, as shown in Figure 3 In the case that the front-end application 10 provides multiple export modes, the front-end application 10 can directly determine whether the data to be exported has been completely displayed in the current page according to the specific content of the export instruction. For example, when the export instruction is "export the current page", it indicates that the data to be exported has been completely displayed in the current page of the target page. When the export instruction is "export all data", it indicates that the data to be exported is displayed in pages in the target page.

[0073] Step 502: A data export request is generated in the case that the number of rows of data to be exported is greater than the number of rows displayed per page.

[0074] ​In this embodiment, when all the data to be exported is already displayed on the current page of the target page, the front-end application 10 can directly fill the file template based on the data of the current page to generate the export file without sending a data export request to the back-end database 20. When the data to be exported is displayed paginated on the target page, since the front-end application 10 has not obtained data from other pages outside the current page, the front-end application 10 needs to generate a data export request based on column information, user information, etc., to instruct the back-end database 20 to query data within the user's permission range and generate the export file.

[0075] In the method provided in this application embodiment, the front-end application can determine the amount of data to be exported. Only when the data to be exported is not fully displayed on the current page will it request the back-end database to perform the data export operation. This data export method improves the flexibility of the data system.

[0076] In one embodiment, such as Figure 1 As shown, a data system is provided, comprising a front-end application 10 and a back-end database 20. The front-end application 10 generates a data export request in response to a data export instruction and sends the data export request to the back-end database 20. The back-end database 20 receives the data export request sent by the front-end application 10; performs row permission verification based on user information to determine the row information of the data to be exported; obtains the data to be exported based on the column and row information of the data to be exported, and generates an export file based on the data to be exported; sends export file retrieval information to the front-end application 10; the front-end application 10 receives the export file retrieval information sent by the back-end database 20 and retrieves the export file based on the retrieval information.

[0077] The data export request includes column information and user information of the data to be exported.

[0078] In this embodiment, when the data system has a data export requirement, such as when a user clicks the "Export" button on the target page, or when the task currently being executed by the data system has a data export requirement for the target page, the front-end application 10 generates a data export request based on user information and the column information of the target page data, and sends the data export request to the back-end database 20.

[0079] Among them, column permissions refer to the data columns that a user can view, as specified by the user's permission information; that is, the column information of the data to be exported. For example, it can include column headers such as "Product Model", "Customer Name", "Sales Channel", "Sales Date", and "Sales Information Status" mentioned above, and can also include the column names of each column header (i.e., the field names of the column headers).

[0080] After the backend database 20 obtains the column information of the to-be-exported data from the front-end application 10, the backend database 20 also needs to query the row authority (for example, the product object that can be viewed by the user) of the user from the local data according to the user information, to obtain the row information of the to-be-exported data. Specifically, the user information can include a user identifier, a password, and a user role (for example, an engineer, a financial staff, and the like). The backend database 20 can verify the identity compliance of the user based on the user identifier and the password, and then query in a predefined authority table based on the user identifier and / or the user role to determine the row authority of the user. The predefined authority table can include a correspondence between different user identifiers and / or different user roles and different authorities.

[0081] Then, the backend database 20 directly finds and obtains the data corresponding to the column information, to obtain candidate data. The candidate data is filtered based on the row information, to filter out data in the candidate data that is not within the authority range represented by the row information, to obtain the to-be-exported data in the authority range of the user corresponding to the target page. Then, the to-be-exported data is written into the file template according to the row and column, to generate an export file. Finally, the export file is stored locally, and then address information of the export file is generated to generate an acquisition information that is sent to the front-end application 10.

[0082] After the front-end application 10 receives the acquisition information sent by the backend database 20, the front-end application 10 can access the address in the acquisition information, to obtain the export file from the backend database 20.

[0083] The data export system provided in the embodiments of the present application can be used when the data in the target page of the front-end application needs to be exported. The front-end application can actively send a data export request including column information of to-be-exported data to the backend database. The backend database can perform row authority verification according to user information, to determine the row information of the to-be-exported data. Then, the to-be-exported data is directly obtained according to the row information of the to-be-exported data and the column information obtained from the front-end application, and an export file is generated based on the to-be-exported data. The method provided in the embodiments of the present application considers that the column authority verification of the user has been completed when the target page of the front-end application is displayed. Therefore, when the backend database exports the to-be-exported data corresponding to the target page, the column information of the to-be-exported data is directly obtained from the front-end, and the data corresponding to the column information is directly obtained, without the need for performing column authority verification and data filtering based on the user information, to effectively reduce the occupation of computing resources and improve the data export efficiency of the data system.

[0084] It is to be noted that, although the operations of the inventive method are described in a particular order in the drawings, this is not required or implied in any particular order of execution. Further, it is not required that all operations be performed to achieve desirable results. Rather, steps depicted in the flowcharts can be changed, performed in an order other than that depicted, and / or performed concurrently.

[0085] As another aspect, the present application also provides a computer readable storage medium, which can be included in the computer device described in the above embodiments, or can exist separately without being assembled into the computer device. The computer readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application. For example, the computer readable storage medium can be used to execute Figure 2 each step of the method shown.

[0086] The embodiments of the present application provide a computer program product, which includes instructions that, when executed, cause the method described in the embodiments of the present application to be performed. For example, the computer program product can be used to execute Figure 2 each step of the method shown.

[0087] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0088] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0089] The above description is merely preferred embodiments of the present application and a description of the principles of the technology used. Those skilled in the art should understand that the scope of the application involved in the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by any combination of the above technical features or equivalent features without departing from the inventive concept. For example, the above features can be replaced with technical features disclosed in the present application (but not limited to) having similar functions to form technical solutions.

Claims

1. A data export method, characterized in that, Applied to a data system, which includes a front-end application and a back-end database, the method includes: The backend database receives a data export request sent by the frontend application; the data export request includes column information and user information of the data to be exported. The backend database performs row permission verification based on the user information to determine the row information of the data to be exported. The data to be exported is obtained based on the column information and row information of the data to be exported, and an export file is generated based on the data to be exported. Send the information for obtaining the exported file to the front-end application.

2. The method according to claim 1, characterized in that, The data export request also includes the number of rows displayed per page in the front-end application. The step of obtaining the data to be exported based on the column information and row information of the data to be exported, and generating an export file based on the data to be exported, includes: Based on the number of rows displayed on a single page and the column information of the data to be exported, multiple target arrays are obtained sequentially; the number of rows in the target array is the number of rows displayed on the single page, and the number of columns is the number of columns represented by the column information of the data to be exported; The multiple target data groups are sequentially written into the exported file.

3. The method according to claim 1, characterized in that, If the column information of the data to be exported represents multi-level column headers, the method further includes: When generating the exported file, multiple write locations corresponding to column headers with multiple subheadings are merged.

4. The method according to claim 1, characterized in that, The data export request also includes an enumeration mapping relationship, which includes a mapping relationship between data and enumeration values. The step of generating an export file based on the data to be exported includes: The backend database searches for the target data corresponding to the enumeration value in the data to be exported according to the enumeration mapping relationship, and generates the export file based on the data to be exported and the target data.

5. The method according to claim 1, characterized in that, The method further includes: The backend database generates an export log based on the user information, data export time, and the acquisition information of the exported file.

6. A data export method, characterized in that, Applied to a data system, which includes a front-end application and a back-end database, the method includes: The front-end application generates a data export request in response to a data export command; the data export request includes column information and user information of the data to be exported. The front-end application sends the data export request to the back-end database; Receive the information from the backend database about obtaining the exported file, and obtain the exported file based on the information.

7. The method according to claim 6, characterized in that, The front-end application generates a data export request in response to a data export command, including: The front-end application responds to the data export command and obtains the data displayed on the current page; Based on data attributes, column information is filtered from the data displayed on the current page, and the data export request is generated based on the column information.

8. The method according to claim 6, characterized in that, The front-end application generates a data export request in response to a data export command, including: In response to a data export command, the front-end application compares the number of rows of the data to be exported with the number of rows displayed on a single page of the front-end application. If the number of rows of data to be exported is greater than the number of rows displayed per page, a data export request is generated.

9. A data system, characterized in that, The data system includes a front-end application and a back-end database. The front-end application generates a data export request in response to a data export instruction and sends the data export request to the back-end database; the data export request includes column information and user information of the data to be exported. The backend database receives the data export request sent by the frontend application; Based on the user information, perform row permission verification to determine the row information of the data to be exported; The data to be exported is obtained based on the column information and the row information of the data to be exported, and an export file is generated based on the data to be exported. Send the information about obtaining the exported file to the front-end application; The front-end application receives the information from the back-end database about obtaining the exported file, and obtains the exported file based on the information.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1-5.