Data exporting method and device, computer equipment and readable storage medium
By introducing a unified data export interface and dynamic calling mechanism into the ERP system, the problem of having to redevelop data for each new or changed data export requirement in the existing technology has been solved, achieving efficient data export interface reuse and improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN KEMAI TECH
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
AI Technical Summary
In existing ERP systems, whenever a new or changed data export requirement is added, the interface needs to be redeveloped and deployed, resulting in low development efficiency.
It provides a unified data export interface that dynamically calls the corresponding data query interface through the target business type identification information, thereby meeting the data export requirements of different business types and reducing redundant development work.
It improves the reusability and development efficiency of the data export interface, reduces maintenance costs, and enables flexible response to new or changed business requirements.
Smart Images

Figure CN121901323A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a data export method, apparatus, computer device, and computer-readable storage medium. Background Technology
[0002] With the continuous improvement of enterprise informatization and the popularization of data-driven decision-making models, the data export function of ERP (Enterprise Resource Planning) systems is being used more and more widely. This function allows users to easily convert tabular data in the system interface into offline file formats such as Excel for subsequent data analysis, report creation, or archiving, greatly improving the efficiency of information flow and utilization.
[0003] In related technologies, since the columns, data sources, and business rules required for export are completely different for different businesses, developers need to write separate front-end call code, back-end interfaces, and data export logic for each business's export requirements.
[0004] However, this model of developing each export requirement independently requires redeveloping and deploying the interface whenever a new or changed export requirement is added, resulting in low development efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a data export method, apparatus, computer device, and computer-readable storage medium that can improve development efficiency in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a data export method applied to a first terminal, wherein the first terminal provides a unified data export interface to a second terminal for different business types; the method includes:
[0007] The system receives a data export request sent by the second terminal through the unified data export interface, the data export request carrying target service type identification information; reads the data to be exported by calling the target data query interface corresponding to the target service type identification information; and sends the data to be exported to the second terminal.
[0008] In one embodiment, before reading the data to be exported by calling the target data query interface corresponding to the target business type identifier information, the method includes:
[0009] Querying the business type identifier information corresponding to the business type; marking the data query interface with an export tag that matches the business type identifier information; and reading the data to be exported by calling the target data query interface corresponding to the target business type identifier information, including:
[0010] Query the target export tag that matches the target business type identifier information; read the data to be exported by calling the target data query interface corresponding to the target export tag.
[0011] In one embodiment, the method further includes:
[0012] Upon receiving a new instruction for a business export requirement, the system obtains the business type information and data query interface corresponding to the business export requirement based on the new instruction. The business type information includes the business type and / or business type identification information. An export tag matching the business type information is then marked on the data query interface.
[0013] In one embodiment, sending the data to be exported to the second terminal includes:
[0014] Obtain column configuration information, including header information and column attribute information; generate an initial data table based on the header information and column attribute information; import the data to be exported into the initial data table to obtain a target data table; and send the target data table to the second terminal.
[0015] Secondly, this application provides a data export method applied to a second terminal, the method comprising:
[0016] When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported by calling the target data query interface corresponding to the target business type identification information when it receives the data export request, and to return the data to be exported. The first terminal then receives the data to be exported returned by the first terminal.
[0017] In one embodiment, when an export operation is detected on the business interface, sending a data export request carrying target business type identification information to the first terminal through a unified data export interface includes:
[0018] When an export operation is detected on the business interface, at least one target export column and / or target column attribute information is determined from the business interface; the column name of at least one target export column and / or the target column attribute information is used as the column configuration information; and a data export request carrying the target business type identifier information and the column configuration information is sent to the first terminal through a unified data export interface.
[0019] In one embodiment, the export option information corresponding to the business interface includes at least one exportable column, the at least one exportable column includes a recommended export column and / or a non-recommended export column, and at least one target export column includes the recommended export column and / or the non-recommended export column that are selected. The method includes:
[0020] Obtain user identification information and user role information; query global historical export records and personal historical export records corresponding to the user identification information; predict the probability that each exportable column will be selected as a recommended export column based on the global historical export records, the personal historical export records, and the user role information; determine the exportable columns with a probability greater than or equal to a preset probability threshold as recommended export columns.
[0021] In one embodiment, predicting the probability that each of the exportable columns will be selected as recommended export columns based on the global historical export records, the personal historical export records, and the user role information includes:
[0022] The global export frequency of each exportable column is calculated based on the global historical export records, and the personal export frequency of each exportable column is calculated based on the personal historical export records. The role-related export column corresponding to the user's role information is determined from each exportable column. The role export score of the role-related export column and the non-recommended export columns (excluding the role-related export column) are determined separately, wherein the role export score of the role-related export column is higher than the role export score of the non-recommended export columns (excluding the role-related export column). Based on a preset weight allocation, the global export frequency, personal export frequency, and role export score of each exportable column are weighted and fused, and the weighted fusion result is determined as the probability that each exportable column is selected as a recommended export column.
[0023] Thirdly, this application also provides a data export system, which includes a first terminal and a second terminal. For different business types, the first terminal provides a unified data export interface to the second terminal; wherein:
[0024] The second terminal is used to send a data export request carrying the target business type identification information to the first terminal through a unified data export interface when an export operation is detected on the business interface.
[0025] The first terminal is configured to receive a data export request sent by the second terminal through the unified data export interface, wherein the data export request carries target service type identification information; read the data to be exported by calling the target data query interface corresponding to the target service type identification information; and send the data to be exported to the second terminal.
[0026] The second terminal is used to receive the data to be exported from the first terminal.
[0027] Fourthly, this application also provides a computer device applied to a first terminal, wherein the first terminal provides a unified data export interface to a second terminal for different business types; the computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0028] The system receives a data export request sent by the second terminal through the unified data export interface, the data export request carrying target service type identification information; reads the data to be exported by calling the target data query interface corresponding to the target service type identification information; and sends the data to be exported to the second terminal.
[0029] Alternatively, the processor may execute the computer program by performing the following steps:
[0030] When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported by calling the target data query interface corresponding to the target business type identification information when it receives the data export request, and to return the data to be exported. The first terminal then receives the data to be exported returned by the first terminal.
[0031] Fifthly, this application also provides a computer-readable storage medium applied to a first terminal, wherein the first terminal provides a unified data export interface to a second terminal for different service types; the computer-readable storage medium stores a computer program, which, when executed by a processor, performs the following steps:
[0032] The system receives a data export request sent by the second terminal through the unified data export interface, the data export request carrying target service type identification information; reads the data to be exported by calling the target data query interface corresponding to the target service type identification information; and sends the data to be exported to the second terminal.
[0033] Alternatively, when the computer program is executed by the processor, it performs the following steps:
[0034] When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported by calling the target data query interface corresponding to the target business type identification information when it receives the data export request, and to return the data to be exported. The first terminal then receives the data to be exported returned by the first terminal.
[0035] Sixthly, this application also provides a computer program product applied to a first terminal, wherein the first terminal provides a unified data export interface to a second terminal for different business types; the computer program product includes a computer program, which, when executed by a processor, performs the following steps:
[0036] The system receives a data export request sent by the second terminal through the unified data export interface, the data export request carrying target service type identification information; reads the data to be exported by calling the target data query interface corresponding to the target service type identification information; and sends the data to be exported to the second terminal.
[0037] Alternatively, when the computer program is executed by the processor, it performs the following steps:
[0038] When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported by calling the target data query interface corresponding to the target business type identification information when it receives the data export request, and to return the data to be exported. The first terminal then receives the data to be exported returned by the first terminal.
[0039] The aforementioned data export method, apparatus, computer equipment, and computer-readable storage medium provide a unified data export interface for different business types in the first terminal. Each business type's export requirement is fulfilled through this unified interface. The unified interface receives data export requests carrying a target business type identifier and dynamically calls the corresponding data query interface based on the identifier to retrieve the data to be exported. This exported data is then returned to the second terminal, achieving data export interface reuse. All business types employ the same or similar data export logic for their respective export requirements. Furthermore, whether adding or changing export requirements for a new business, it is only necessary to confirm whether the association between the business type information (such as business type identifier information) and the data query interface needs to be configured. During data export, the unified data export interface is invoked to initiate a data export request. The target business type identifier carried in the data export request dynamically calls the corresponding data query interface to read the data to be exported. This eliminates the need to develop separate query interfaces, export interfaces, and write separate data export logic for new or changed business export requirements, reducing repetitive development work and improving development efficiency. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating a data export method in one embodiment of this application;
[0042] Figure 2 This is a flowchart illustrating the steps of generating a target data table in one embodiment of this application;
[0043] Figure 3 This is a flowchart illustrating the steps of filtering recommended export columns in one embodiment of this application;
[0044] Figure 4 This is a structural block diagram of a data export device in one embodiment of this application;
[0045] Figure 5 This is an internal structural diagram of a computer device in one embodiment of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0047] With the continuous improvement of enterprise informatization and the popularization of data-driven decision-making models, the data export function in ERP systems is becoming increasingly widely used. This function allows users to easily convert tabular data in the system interface into offline file formats such as Excel for subsequent data analysis, report creation, or archiving, greatly improving the efficiency of information flow and utilization. In ERP systems, data export is a common function on list pages. Traditional implementations typically require writing separate front-end call code, back-end interfaces, and developing corresponding data export logic for each business's export needs. For example, it requires setting up separate query interfaces, export interfaces, and writing data export logic for each business's export needs. This data export logic includes, but is not limited to, creating export classes, writing data query logic, and data conversion methods. When exporting data, one approach is to first query all data information corresponding to the target business and then export all the data. Another approach is to first query a portion of the data information under the target business and then export that portion. It should be noted that both of these data export methods require developing corresponding export logic separately.
[0048] Even when exporting partial data from the same business process, separate export logic is required if the exported data differs. For example, when exporting retail documents from order management, all information associated with a retail document includes: serial number, organization name, document number, document type (e.g., sales, returns), document status (e.g., processed, pending), shift, sales time, posting time, cash register number, cashier, payment amount, etc. The first part of the exported data can be organization name, document number, document type (e.g., sales, returns), and document status (e.g., processed, pending). Alternatively, the second part can be organization name, document number, document type (e.g., sales, returns), document status (e.g., processed, pending), sales time, posting time, and payment amount. In this case, separate export logic needs to be developed for each part of the retail document's information, including the first part and the second part.
[0049] Among them, exporting partial data information under the same business, when the data information to be exported is different, can be regarded as the export requirement of changing business.
[0050] It's easy to understand that different exported data can mean different exported data columns and / or different data sources. Different data sources mean the data originates from different systems, database tables, or backend services. For example, a user list might come from a user center database, while order data might come from a transaction system. Exporting different data often means connecting to different data sources and writing drastically different data query and processing logic.
[0051] For example, existing export implementations are shown in Table 1.
[0052] Table 1
[0053]
[0054] If you need to export order management related data, you need to first call the order management query interface to obtain the order management information, and then call the order management export interface to export the target order management information.
[0055] This model of developing each export requirement independently requires redeveloping and deploying the interface whenever a new or changed export requirement is added, resulting in low development efficiency.
[0056] In one exemplary embodiment, such as Figure 1 As shown, a data export method is provided, applied to a first terminal. It is understood that the first terminal can be, but is not limited to, a server, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.
[0057] Optionally, the method can also be applied to a system including a first terminal and a second terminal, and implemented through the interaction between the first terminal and the second terminal.
[0058] In some feasible embodiments, the first terminal can be a server and the second terminal can be a user terminal.
[0059] It should be noted that this method uses a unified data export interface to meet the export requirements of various business types. For ease of understanding, the following example is provided as shown in Table 2.
[0060] Table 2
[0061]
[0062] Regardless of whether the business type is order management, product management, brand management, or even other new business types, all export requirements can use this unified data export interface.
[0063] In this embodiment, the method includes the following steps S10-S30. Wherein:
[0064] Step S10: Receive a data export request sent by the second terminal through the unified data export interface, wherein the data export request carries target service type identification information.
[0065] The unified data export interface can refer to a shared or common interface provided by the first terminal for various business types. All business data export requests are implemented by calling this interface, without the need to set up a separate export interface for each business.
[0066] A data export request can refer to a network request initiated by a second terminal to a first terminal via HTTP (Hypertext Transfer Protocol) / HTTPS (Hypertext Transfer Protocol Secure) to trigger a data export operation.
[0067] The data export request carries target business type identification information. Business type identification information can refer to identifiers used to distinguish different business types. These identifiers can be represented by at least one of the following: letters, numbers, operators, punctuation marks, and other symbols, as well as functional symbols such as parameters, fields, strings, numbers, or enumeration values. They can also be directly represented by the business name, without limitation. The target business type identification information refers to the business type identification information corresponding to the business type of the data to be exported in the current data export request. For example, when the business type is "Order Management," the corresponding business type identification information can be "order"; when the business type is "Order Management / Retail Business," the corresponding business type identification information can be "PurchaseOrder"; when the business type is "Product Management," the corresponding business type identification information can be "item"; and when the business type is "Brand Management," the corresponding business type identification information can be "brand."
[0068] For example, when the front-end interface detects an export operation, such as clicking the export button or any other action corresponding to the export operation, a data export request is triggered and sent to the unified data export interface. This data export request carries business type identification information to identify the business type. Upon receiving the data export request, the first terminal first parses the content of the request, extracts the target business type identification information to determine the target data query interface, and then reads the data to be exported through the target query interface.
[0069] Optionally, the data export request may also include export information, such as column configuration information and data query information.
[0070] For example, assuming a data export request is received for exporting the second part of the data information of a retail document, parsing the content of the data export request will yield the target business type identifier, column configuration information, and data query information. The target business type identifier is, for example, the order management / retail business identifier "PurchaseOrder". The column configuration information includes, for example, the header information corresponding to the second part of the data information, such as the organization name, document number, document type (e.g., sales, returns), document status (e.g., processed, pending), sales time, posting time, and payment amount. The data query information includes, for example, the query condition being the second part of the data information of retail documents from 2025 / 07 / 01 to 2025 / 09 / 30.
[0071] Optionally, the export operation can be triggered by a manual click of the export button, or it can be triggered automatically, such as by a timer, or it can be based on other operations besides the export operation, such as when a data query operation is detected, etc. There are no limitations on this.
[0072] In some embodiments, to ensure high concurrency and response speed, after receiving a data export request, the first terminal can encapsulate the request into an independent export task entity and submit the export task entity to a background message queue. The main thread handling the export request is only responsible for receiving requests and submitting tasks. After submitting the export task entity to the background message queue, it can immediately end the processing of the current request and release resources, thereby quickly returning a response to the second terminal and avoiding thread blocking caused by the export operation. The specific execution of the export task is completed asynchronously by the message consumer, achieving decoupling between request processing and business execution.
[0073] Step S20: Read the data to be exported by calling the target data query interface corresponding to the target business type identifier information.
[0074] Here, the data query interface can refer to the programming interface or API (Application Programming Interface) used to obtain data. The target data query interface can refer to the data query interface corresponding to the business type indicated by the target business type identifier information.
[0075] For example, after obtaining the target service type identification information, the first terminal can query the target data query interface corresponding to the target service type identification information based on the pre-established mapping relationship between service type information (such as service type and / or service type identification information) and data query interface. Subsequently, the first terminal calls the target data query interface to read the corresponding data to be exported from the database or business service.
[0076] As an example, since the data export request can also carry export information, including column configuration information and data query information, the first terminal can call the target data query interface. The target data query interface uses the export information to construct an SQL (Structured Query Language) statement, and uses the constructed SQL statement to initiate a query to the database or business service, retrieving data from the database or business service that matches the export information as the data to be exported.
[0077] In one optional implementation, the data export method further includes:
[0078] Upon receiving a new instruction for a business export requirement, the system obtains the business type information and data query interface corresponding to the business export requirement based on the new instruction. The business type information includes the business type and / or business type identifier information. The system then associates and saves the business type information and the interface information of the data query interface.
[0079] During the development phase, it is often difficult to foresee all future business data export needs. Therefore, this embodiment provides a dynamically scalable export configuration solution.
[0080] For example, when the first terminal receives a new instruction for exporting a business, it can parse the business type information and data query interface corresponding to the business export requirement from the new instruction, thereby establishing the association between the business type information and the interface information of the data query interface, and saving it to the database or configuration center. In the future, when implementing the export requirement for a new business, the association between the business type information and the data query interface corresponding to the new business can be obtained from the database or configuration center. Based on the association, the data query interface corresponding to the business type information of the new business can be called to read the data to be exported.
[0081] Optionally, the interface information of the data query interface is a unique identifier used to determine the data query interface. For example, the interface information may be the interface name, interface path, or the encoding identifier corresponding to the interface, etc., without limitation.
[0082] In this embodiment, when a new business export requirement arises, the export capability of the export interface can be extended simply by configuring the business type information corresponding to the business export requirement and the data query interface, without the need for secondary development at the code level.
[0083] In some embodiments, the first terminal can perform data queries in batches based on pagination parameters, such as page number and page size. By repeatedly calling the corresponding target data query interface, it reads the data to be exported page by page and adds the data to be exported from each page to the dataset to be exported, until all pages have been read, ultimately forming a complete dataset to be exported. At this point, the dataset to be exported can be considered as the data to be exported. This method avoids memory overflow or response timeout issues caused by excessive data volume in a single query, improving the stability and reliability of exporting large amounts of data.
[0084] Step S30: Send the data to be exported to the second terminal.
[0085] Optionally, sending the data to be exported to the second terminal further includes: generating a target data table based on the data to be exported, and sending the target data table to the second terminal.
[0086] The target data table can refer to a table used to store the data to be exported, such as an Excel file (.xlsx) (a type of spreadsheet file), a CSV file (a type of text file format), etc.
[0087] Optionally, after obtaining the data to be exported, the first terminal can directly send the data to be exported to the second terminal, or generate a target data table from the data to be exported according to the export requirements, and then send the target data table to the second terminal.
[0088] Optionally, populating the target data table with the data to be exported may include standardized operations such as creating a file object, generating a table header based on the fields of the data object, and traversing the data list to populate the data row by row.
[0089] Optionally, after generating the target data table, the first terminal can also encapsulate the data table into a standard file format, such as .xlsx or .csv, set the HTTP response header, and write the generated file data into the response through the response output stream. The HTTP response is then returned to the second terminal that initiated the data export request, and the user can trigger the file download on the second terminal.
[0090] In the aforementioned data export method, the first terminal provides a unified data export interface for different business types. Each business type's export requirement is fulfilled through this unified interface. The unified interface receives data export requests carrying a target business type identifier and dynamically calls the corresponding data query interface based on that identifier to retrieve the data to be exported. This exported data is then returned to the second terminal, achieving data export interface reuse. Thus, for each business type's export requirement, a unified data export request is initiated by calling this interface, eliminating the need to develop a separate export interface for each business type. Furthermore, the target business type identifier carried in the data export request dynamically calls the corresponding data query interface to read the data to be exported, allowing all business types to use the same or similar data export logic for their respective export requirements.
[0091] Furthermore, it should be noted that in existing ERP systems, data export functions for different business operations are typically tightly coupled with specific business logic, lacking a unified identification and management mechanism. Developers must manually write corresponding export interfaces and logic for each business operation when implementing export functions, resulting in poor system scalability and high maintenance costs. When adding new business operations or adjusting export requirements, it is often necessary to modify the core export process code, which is prone to introducing errors and makes it difficult to achieve dynamic identification and automated invocation of export functions, leading to low development efficiency. In this embodiment, however, whether adding or changing export requirements for a business, it is only necessary to confirm whether the corresponding business type information (such as business type identifier information) and the association between the data query interface need to be configured. When implementing data export, a unified data export interface is called to initiate a data export request. The target business type identifier carried in the data export request dynamically calls the corresponding data query interface to read the data to be exported. There is no need to develop separate query interfaces, export interfaces, or write data export logic for the export requirements of new or changed businesses, reducing repetitive development work and improving development efficiency.
[0092] In an exemplary embodiment, before reading the data to be exported by calling the target data query interface corresponding to the target business type identifier information, the data export method further includes:
[0093] Step S21: Query the business type identifier information corresponding to the business type; mark the export tag that matches the business type identifier information on the data query interface.
[0094] Among them, export tags can refer to metadata used to describe and manage data query interfaces. Their content can be the same as or have the same meaning as business type identification information. For example, export tags can be the encoding of business type identification information, used to mark the data query interface as a target that can be called by a unified export interface.
[0095] As an example, export tags can be marked using custom annotations. For instance, suppose a data query interface is marked with the export tag "Exportable "brand", indicating that when the unified data export interface receives a data export request corresponding to the brand management business, it can call this data query interface to read the data.
[0096] Optionally, a unique business type identifier can be determined or assigned for different business types throughout the entire system. This business type identifier can be uniformly assigned according to a preset naming convention or a randomly generated string that does not conflict with existing identifiers; this embodiment does not impose any restrictions on this. Furthermore, an export tag is generated based on this business type identifier, and this export tag is bound to the configuration information of the corresponding data query interface. Specifically, an export tag field can be added to the configuration information of the data query interface, with the business type identifier as the content of the export tag field. This facilitates the subsequent determination of the export tag that matches the business type information, and then the data query interface is determined through the export tag.
[0097] Optionally, after the data query interface marks an export tag that matches the business type identification information, the association between the business type information (such as business type and / or business type identification information), the export tag, and the interface information corresponding to the data query interface can be saved. This will facilitate subsequent querying of export tags that match the business type information based on the association, and reading the data to be exported by calling the data query interface corresponding to the export tag.
[0098] In this embodiment, by marking export tags that match the business type identification information on the data query interface, a dynamic mapping mechanism between data export requests and data sources is established. Combined with a unified data export interface, the export requirements of each business type are realized, achieving the goal of flexible reuse of the unified data export interface.
[0099] In an exemplary embodiment, the data to be exported is read by calling the target data query interface corresponding to the target business type identifier information, including:
[0100] Step S22: Query the target export tag that matches the target business type identifier information; read the data to be exported by calling the target data query interface corresponding to the target export tag.
[0101] Optionally, when the first terminal receives a data export request carrying target business type identification information, it iterates through the contents of the export tags marked on each data query interface to find the target export tag that matches the target business type identification information. Then, it finds the target data query interface corresponding to the target export tag, obtains the interface instance of the target data query interface, and calls the data query method. Based on the column configuration information in the data query request, such as column names, and data query information such as filter conditions and pagination information, it obtains the data to be exported that meets the export requirements and returns all data under that business type that meets the export requirements as the data to be exported.
[0102] It should be noted that in practical applications, in order to meet users' data query and / or data analysis needs for different business types, corresponding data query interfaces are often built for different business types. Through the data query interface, you can query the full columns of the corresponding business. That is, the data query interface built for the target business type can query all the data information covered by the target business type, so as to view and analyze all the obtained data information.
[0103] In this embodiment, based on the data query interface originally built to meet data query needs, in order to meet the export requirements of different business types, export tags corresponding to different business types are marked on the built data query interface. Specifically, export tags matching the business type identifier information corresponding to the business type are marked on the data query interface, realizing the reuse of the originally built data query interface. Furthermore, when performing a data export operation based on a data export request, the target export tag is determined based on the target business type identifier information parsed from the data export request, and then the target data query interface marked by the target export tag is called to read the data to be exported. During the data export operation, by reusing the data query interface to read the data to be exported, the export requirements of the business are met.
[0104] In one optional implementation, the data export method further includes:
[0105] Upon receiving a new instruction for business export requirements, the system obtains the business type information and data query interface corresponding to the business based on the new instruction. The business type information includes the business type and / or business type identification information.
[0106] The data query interface is marked with an export tag that matches the business type information.
[0107] It should be noted that during the development phase, it is often difficult to foresee all future business data export needs. Therefore, this embodiment provides a dynamically scalable export configuration scheme.
[0108] For example, when the first terminal receives a new instruction for a business export requirement, it can parse the business type information and data query interface corresponding to the business with the new export requirement from the new instruction.
[0109] Optionally, the export tag that matches the business type information in the data query interface can be added as an export tag field in the configuration information of the data query interface, with the business type information as the content of the export tag field; or it can be to save the association between the business type information (such as business type and / or business type identification information), the export tag and the interface information corresponding to the data query interface. This embodiment does not limit this.
[0110] In this embodiment, when a new business type export requirement is added, there is no need to modify the unified export logic. Only an export tag matching the business type identifier information needs to be added to the new data query interface. This gives the system excellent scalability; adding a new export business requires almost no modification to existing code, significantly improving development efficiency and reducing maintenance complexity and risk.
[0111] In one exemplary embodiment, such as Figure 2 As shown, sending the data to be exported to the second terminal includes steps S31 to S34, wherein:
[0112] Step S31: Obtain column configuration information, which includes header information and column attribute information.
[0113] It's important to note that during a standard data export process, the table's style and structure, such as headers, column widths, and data formats, are typically hard-coded together with the data query logic. This means that any modification to the exported column display—such as adding a column, adjusting column widths, or changing column headers—requires developers to modify the code and redeploy the service, resulting in poor flexibility and maintainability in table style management.
[0114] The column configuration information includes header information and column attribute information. The header information can refer to the column headings displayed in the data table, used to identify the meaning of each column of data; it can also refer to the row headings displayed in the data table, used to identify the meaning of each row of data; or it can be both the column headings displayed in the data table and the column attributes displayed—there are no limitations on this. Optionally, the header information can be represented in the form of a string array or list. For example, for exporting inbound documents, the header information may include column field names such as "Document Number," "Supplier Name," and "Inbound Date."
[0115] Column attribute information refers to the attribute information and / or display information set for the table header information. Attribute information refers to the output format requirements set for the data, such as name, data type, allowed null values, default value, length, precision, and decimal places. Display information refers to the display style of the data output, such as table fill color, font color, column width, font size, and frozen panes.
[0116] It should be noted that the attribute information and / or display information set for the table header information can be the attribute information and / or display information set for the column data corresponding to the column headings contained in the table header information, and / or the attribute information and / or display information set for the row data corresponding to the row headings contained in the table header information. It is easy to understand that attribute information and display information can be set separately for the column data corresponding to each column heading and / or the row data corresponding to each row heading. The attribute information and display information set for the column data corresponding to different column headings can be the same or different. The same applies to the column attribute information set for the row data corresponding to the row headings, which will not be elaborated further here.
[0117] For example, when exporting inbound documents, if the column header in the table information is "Document Number", the corresponding attribute information may include the field name "docNo", the data type is integer, it cannot be empty, and the cell format is thousands separator, etc. The display information may include the table fill color being "none", the font color being "black", and the font display being set to "italic and bold", etc.
[0118] For example, when the second terminal detects an export operation, i.e., receives a data export request, the front-end business interface defines table header information based on a predefined JSON Schema configuration method. This header information is then used to form the header information in the initial data table. A complete column configuration list is dynamically assembled using JavaScript. This column configuration list reflects the selected data export requirements and includes attribute information such as name, data type, allowed null values, default value, length, precision, and decimal places, as well as display information such as table fill color, font color, column width, font size, and frozen panes. Subsequently, the second terminal sends the column configuration information from this list as part of the data export request to the first terminal via an HTTP request. Upon receiving the data export request, the first terminal can parse this column configuration information from the request body.
[0119] Optionally, different data export requests may obtain the same or different column configuration information. The specific column configuration information can be determined according to the export requirements, and this embodiment does not limit this.
[0120] Step S32: Generate an initial data table based on the header information and the column attribute information.
[0121] The initial data table can refer to a table that has created header rows based on the header information and set the basic style and structure based on the column attribute information, but has not yet been filled with data.
[0122] Optionally, after obtaining the column configuration information, the first terminal can call the spreadsheet processing component to create an empty data table and write the header information from the column configuration information into this empty data table. Simultaneously, it can initialize the settings for each column and / or row based on the column attribute information in the column configuration information, such as field mapping relationships, data format, and column width. For example, an Excel worksheet can be created, and the data table can be populated with header information for "Document Number," "Supplier," and "Inbound Time," with the "Inbound Time" column formatted as a date, forming an initial data table with complete headers and column attribute configurations but no business data.
[0123] Step S33: Import the data to be exported into the initial data table to obtain the target data table.
[0124] Step S34: Send the target data table to the second terminal.
[0125] Optionally, the first terminal obtains the data to be exported, such as a dataset to be exported, which is a collection of data composed of the data to be exported.
[0126] Optionally, the data to be exported is imported into the initial data table to obtain the target data table. This can be achieved by iterating through the dataset to be exported and filling each data value corresponding to the column name in the dataset into the corresponding target column name in the initial data table. The target data table is obtained when all data values to be exported from the dataset are filled into the initial data table. Here, the target column name refers to the column field name in the initial data table that is the same as the column name in the dataset to be exported. Alternatively, it can be achieved by iterating through the dataset to be exported, first identifying the column names corresponding to the data values to be exported, determining the corresponding target column name in the initial data table based on the column names, and then filling the data values to be exported into the target column name. There is no limitation on this method.
[0127] For example, the header information in the initial data table includes three column field names: "Document Number", "Supplier", and "Inbound Date". The dataset to be exported is represented in the form of {Document Number, Supplier, Inbound Date}, containing data values to be exported as {(001, Supplier 1, 2001 / 1 / 5), (002, Supplier 5, 2003 / 12 / 31)}. Traversing the dataset to be exported, the data value to be exported with document number "001" can be obtained first and filled into the list corresponding to the target column name "Document Number" in the initial data table. Then, the data value to be exported with supplier "Supplier 1" can be obtained and filled into the list corresponding to the target column name "Supplier" in the initial data table. The same process is used for other data values to be exported until all data values to be exported in the dataset to be exported are filled into the initial data table.
[0128] In conventional data export implementations, table header information is typically hard-coded by the backend or returns a fixed set of all columns. Users cannot flexibly select the data columns they actually need to export based on the current operation scenario and their own needs. This often results in exported files containing a large amount of redundant information, requiring users to manually perform secondary filtering and organization, reducing the efficiency and relevance of data export. Compared to the traditional method of hard-coding data column information into program logic, this embodiment extracts export requirements such as table header information and column attribute information from fixed code, transforming them into independently manageable external configuration information. Only by determining the column configuration information, i.e., clarifying the export requirements such as table header information and column attribute information, and forming an initial data table based on these requirements, can the data to be exported be imported into the initial data table, allowing the data to be output and displayed according to the export requirements. Furthermore, it is easy to understand that different data export requests can obtain different column configuration information, satisfying diverse user needs for data export and improving the flexibility of the export function. For example, when changes occur to the data columns to be exported in a business export requirement, simply adding, deleting, or modifying the column configuration information will take effect in real time without touching any program code.
[0129] Based on the same inventive concept, this application also provides a data export method applied to a second terminal. The solution provided by the data export method applied to the second terminal is similar to the solution described in the data export method applied to the first terminal described above. Therefore, the specific limitations in one or more embodiments of the data export method applied to the second terminal provided below can be found in the limitations in the data export method embodiments applied to the first terminal described above, and will not be repeated here. The data export method applied to the second terminal includes:
[0130] When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported by calling the target data query interface corresponding to the target business type identification information when it receives the data export request, and to return the data to be exported. The first terminal then receives the data to be exported returned by the first terminal.
[0131] The business interface refers to the user interface used to display business data, enabling data export operations based on the user interface to meet export requirements. The export operation can refer to the behavior of triggering a data export request through methods such as clicking buttons, menu items, timed operations, corresponding gestures, or shortcut keys.
[0132] Optionally, the business data displayed on the business interface can be all data information covered by a single business type, such as all data information covered by the target business corresponding to the target business type identifier information. It should be noted that in this example, the business data displayed on the business interface is data information originally obtained to meet the user's data query and / or data analysis needs for different business types. Since it is impossible to quickly and accurately obtain the data information that meets the needs from all the data information covered by the business, further, upon detecting an export operation on the business interface, the corresponding export options are displayed. Then, from the export options corresponding to the business interface, at least one target export column and / or target column attribute information is determined according to the export requirements to accurately obtain the data item information that meets the export requirements, achieving the goal of focusing only on the data information that meets the export requirements. Here, data item information can refer to table header information (such as column titles and / or row titles) and the attribute information and / or display information set for the table header information; that is, data item information can refer to column configuration information, which is subsequently used to generate the initial data table.
[0133] Optionally, based on the detection of an export operation on the business interface, the corresponding export options information of the business interface can be displayed. This can be done by directly embedding it into the current page, or by displaying it through various forms such as an independent optional interface or brief prompt information.
[0134] The exportable optional information includes at least one exportable column and / or column attribute information of the exportable column. For example, if the business type is order management, at least one exportable column includes all order management-related information such as organization (e.g., organization 1, organization 2... organization n), document number, document type (e.g., sales, returns), document status, sales time, posting time, cash register number, cashier, and amount payable. The column attribute information of the exportable column has been described in detail in the above embodiments and will not be repeated here. Exemplarily, the exportable optional information can be displayed in the form of checkboxes, listing the column name of at least one exportable column such as "organization", "organization 1", "organization 2"... "organization n", "document number", "document type", "sales", "returns", "sales time", "amount payable", etc., and / or the column attribute information corresponding to each exportable column, such as attribute information such as "data type", "allow null values", "default value", "length", "precision", "field merging", "field splitting", "date format", "text format", and "decimal places", and display information such as "table fill color", "font color", "column width", "font size", and "freeze panes", for selection.
[0135] Optionally, when each exportable column and / or corresponding column attribute information in the exportable optional information has at least two options, an optional list can be displayed in a collapsed and hidden manner, and expanded upon receiving a selection instruction. For example, if the exportable column is "Organization", n organizations are displayed in a collapsed and hidden optional list, and the optional list is expanded upon receiving a selection instruction for "Organization"; similarly, if the display information is "Font Color", all colors are displayed in a collapsed and hidden optional list, and the optional list is expanded upon receiving a selection instruction for "Font Color".
[0136] For example, upon detecting an export operation targeting the business interface, a data export request carrying the target business type identifier information is sent to the first terminal through a unified data export interface based on the export operation. Upon receiving the data export request, the first terminal reads the data to be exported by calling the target data query interface corresponding to the target business type identifier information, and then sends the read data back to the second terminal. The second terminal receives the data to be exported from the first terminal based on the data export request. In this example, the business data displayed on the business interface represents all data information covered by a single business type. There is a one-to-one correspondence between the business interface and the business type. Therefore, the target business type identifier information refers to the business type identifier information corresponding to the business type of the business interface.
[0137] Optionally, after receiving the data to be exported, the second terminal can render the data to be exported onto the current business interface.
[0138] Optionally, the business data displayed on the business interface, as an example, may include a business type and corresponding export options. In this example, by directly displaying the business type and corresponding export options, only one target export column and / or target column attribute information needs to be determined from the corresponding export options according to the export requirements for a business type. The operation is simple and can accurately obtain the data item information that meets the export requirements, achieving the goal of focusing only on the data information that meets the export requirements.
[0139] For example, during the detection and export operation on the business interface, based on the export operation, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. The target business type identification information is the business type identification information corresponding to the business displayed on the business interface.
[0140] Optionally, the business data displayed on the business interface, as an example, may also include at least one business type and export options corresponding to each business type. Specifically, the business data displayed on the business interface may include all business types and export options corresponding to each business type. It can comprehensively display all business types that can be exported, and allow users to flexibly and as needed select the target business type to be exported and the corresponding export options. This enables the selection of data items corresponding to at least one business type, thereby achieving the goal of selecting and exporting the target data information corresponding to at least one business type in one go. This improves the efficiency and convenience of data export. The target data information refers to the data that meets the export requirements and is determined from all the data information covered by the business.
[0141] Optionally, during the detection and export operation of the business interface, it is possible to determine at least one selected target business displayed on the business interface based on the export operation, generate a data export request carrying the corresponding target business type identification information for each target business, and send each data export request to the first terminal through a unified data export interface.
[0142] Optionally, during the detection and export operation in the business interface, a data export request carrying the target business type identification information can be sent to the first terminal through a unified data export interface. The target business type identification information refers to the business type identification information corresponding to at least one selected target business displayed in the business interface.
[0143] In this embodiment, the first terminal provides a unified data export interface for different business types, ensuring that all export requests for each business type are fulfilled through this unified interface. When the second terminal detects an export operation on the business interface, it can send a data export request carrying a target business type identifier to the first terminal by calling the unified data export interface. This allows the first terminal to dynamically call the corresponding data query interface based on the target business type identifier to read the data to be exported, thus obtaining the data to be exported as returned by the first terminal. This achieves data export interface reuse. In this way, for the export requests of each business type, the second terminal initiates data export requests by calling the unified data export interface, eliminating the need to develop separate export interfaces for each business type. Furthermore, by dynamically calling the corresponding data query interface to read the data to be exported using the target business type identifier carried in the data export request, the second terminal applies the same or similar data export logic to the export requests of all business types.
[0144] Furthermore, whether it's a new business or a change in business export requirements, it's only necessary to confirm whether the corresponding business type information (such as business type identifier information) needs to be configured to associate with the data query interface. When implementing data export, a unified data export interface is called to initiate a data export request. Through the target business type identifier carried in the data export request, the corresponding data query interface is dynamically called to read the data to be exported. There is no need to develop separate query interfaces, export interfaces, and write data export logic for the export requirements of new or changed businesses, which reduces repetitive development work and improves development efficiency.
[0145] In an exemplary embodiment, when an export operation is detected on the business interface, sending a data export request carrying target business type identification information to the first terminal through a unified data export interface includes:
[0146] When an export operation is detected on the business interface, at least one target export column and / or target column attribute information is determined from the business interface; the column name of at least one target export column and / or the target column attribute information is used as the column configuration information; and a data export request carrying the target business type identifier information and the column configuration information is sent to the first terminal through a unified data export interface.
[0147] For example, when the business interface detects an export operation, such as clicking the export button or any other action corresponding to the export operation, it obtains the column name and / or target column attribute information of the missing target export column uploaded through the export operation, and uses the column name and / or target column attribute information as column configuration information; it generates a data export request based on the target business type identifier information and the column configuration information, and sends the data export request to the first terminal through a unified data export interface.
[0148] Optionally, the column name and / or target column attribute information of at least one target exported column can be used as column configuration information. Based on the column name of at least one target exported column, the header information can be defined according to a predefined JSON Schema configuration method for use in the subsequent formation of the header information in the initial data table. Based on the column name and / or target column attribute information of at least one target exported column, a complete column configuration list can be dynamically assembled and generated by JavaScript. The column configuration information corresponding to the column configuration list can be sent to the first terminal as a component of the data export request.
[0149] Optionally, determining at least one target exported column and / or target column attribute information from the business interface means determining at least one target exported column and / or target column attribute information from the export optional information corresponding to the business interface.
[0150] It should be noted that the export options information corresponding to the business interface can be displayed when an export operation is detected on a business interface that displays all data information covered by a single business type; it can also be displayed directly on a business interface that displays one business type and its corresponding export options information; or it can be displayed directly on a business interface that displays at least one business type and its corresponding export options information. There are no restrictions on which one is displayed.
[0151] In this embodiment, by providing the option to select exportable columns in the export optional information, the target export columns that need to be selected can be flexibly selected according to the current analysis scenario, avoiding the export of redundant information and significantly improving the efficiency and experience of data processing.
[0152] In some embodiments, after an export operation is detected on the business interface, export option information corresponding to the business interface can be displayed. The export option information includes at least one exportable column and / or column attribute information of the exportable column.
[0153] Among them, exportable columns can refer to the column field names that can be selected for export as needed; the column field name is also the column name.
[0154] In some embodiments, after determining the exportable columns, at least one can be selected as a recommended exportable column from these exportable columns according to preset filtering rules. The preset filtering rules can be determined based on factors such as the user's personal historical export frequency, the global historical export frequency of all users, business importance, and user role information; this embodiment does not impose any limitations on these factors.
[0155] Among them, the recommended export column can refer to a subset selected from the complete set of exportable columns according to preset filtering rules, which aims to provide users with intelligent recommendation options.
[0156] In some embodiments, the second terminal may filter recommended export columns from at least one exportable column, and / or filter target column attribute information from the column attribute information of the exportable column.
[0157] As an example, after determining the exportable columns, the second terminal can first filter out recommended exportable columns, and then display these columns in the export options. The recommended exportable columns can be differentiated, for example, by automatically selecting the checkboxes corresponding to them. By automatically selecting and differentiating recommended columns, the system can intuitively guide users, simplify operations, and is particularly suitable for businesses with clearly defined default export scenarios, thereby improving user efficiency.
[0158] In this feature, the checkboxes corresponding to the recommended export columns are automatically selected. In this case, the recommended export columns are set to the selected state, while the non-recommended export columns are set to the unselected state.
[0159] As another example, all exportable columns can be displayed first in the export options information. Simultaneously, recommended exportable columns can be filtered, and a prompt message for the recommended exportable columns should appear after the filtering is complete. Simultaneously filtering recommended exportable columns during the display of exportable columns can speed up the display process, reduce user waiting time, and provide a more intelligent way to select exportable columns by offering suggested information, thus saving time spent filtering.
[0160] As another example, all exportable columns can be displayed in the export optional information. During the display of exportable columns, recommended exportable columns can be filtered simultaneously, and the filtered recommended exportable columns, along with the exportable columns selected by the user, can be determined as the target exportable columns. Intelligently merging system-recommended columns and user-selected columns into the target exportable columns can reduce user operations while ensuring that the output results meet both routine business needs and accommodate personalized choices.
[0161] In some embodiments, the exportable information can be displayed as a list of all exportable columns, with a checkbox control configured before each column. In the exportable information, the checkboxes corresponding to recommended export columns are set to the selected state, for example, displaying a "√" in the checkbox control, while the checkboxes corresponding to non-recommended export columns are set to the unselected state by default, for example, displaying a blank checkbox control. Here, non-recommended export columns refer to all exportable columns other than the recommended export columns.
[0162] In some embodiments, to enhance the visual priority of the recommended export column, it can be displayed at the top when the list is shown, while non-recommended export columns can be placed after the collapsed panel or the recommended export column by default, ensuring that users see the most important options first.
[0163] In some embodiments, in response to a confirmation export operation for each target recommended export column in the selected state, each target recommended export column in the selected state is determined as a target export column.
[0164] In this context, "confirm export" refers to the final submission of the export request after a column selection operation is detected. For example, after displaying recommended and non-recommended export columns in the export options information, clicking the "OK" or "Export" button in the export options information constitutes a "confirm export" operation.
[0165] In some feasible embodiments, in response to an export confirmation operation for each recommended export column in the selected state and / or a non-recommended export column in the unselected state, the target recommended export column and / or non-recommended export column that is in the selected state after the export confirmation operation is determined as the target export column.
[0166] For example, after viewing the recommended and non-recommended export columns displayed in the export options information, if the recommended export columns happen to be the data the user currently needs to export—neither containing redundant data that is not actually needed nor missing the data that is actually required—the user can directly click the "OK" or "Export" button in the export options information without editing the selected state of the exportable columns, thus triggering a confirmed export operation. After detecting the confirmed export operation, the second terminal can then determine all currently selected recommended export columns as the target export columns.
[0167] In other feasible embodiments, in response to a cancellation operation on at least one recommended export column in the selected state, the recommended export column corresponding to the cancellation operation is switched to an unselected state, and / or in response to a selection operation on a non-recommended export column in the unselected state, the non-recommended export column corresponding to the selection operation is switched to a selected state; furthermore, in response to a confirmation export operation, the recommended export column and / or non-recommended export column that is in the selected state after the export confirmation operation is determined as the target export column.
[0168] By providing recommended export columns, repetitive selection operations can be reduced, improving data export efficiency. At the same time, the solution retains full customization capabilities, allowing users to flexibly adjust options according to actual needs, thereby improving the accuracy and usability of data export.
[0169] It should be noted that the exportable information corresponding to the business interface includes at least one exportable column, the at least one exportable column includes a recommended export column and / or a non-recommended export column, and at least one of the target export columns includes the recommended export column and / or the non-recommended export column that are selected.
[0170] In one exemplary embodiment, such as Figure 3 As shown, the exportable information corresponding to the business interface includes at least one exportable column, the at least one exportable column includes a recommended export column and / or a non-recommended export column, and at least one target export column includes the recommended export column and / or the non-recommended export column that are selected. The method includes steps 302 to 308, wherein:
[0171] Step 302: Obtain user identification information and user role information.
[0172] User identification information refers to a number or code used to uniquely identify a user. It is the basic information that distinguishes different user identities and can be a user's login account, employee number, etc.
[0173] User role information can refer to the classification identifiers that describe a user's functions and permissions within an organization, such as financial specialist, sales manager, system administrator, etc.
[0174] A single user can correspond to multiple roles. User role information is used not only for access control but also for analyzing user operating habits and data focus. Different user roles typically focus on different dimensions of business data due to their varying responsibilities, leading to significant differences in their export requirements. For example, finance personnel are more concerned with fields related to amounts, settlement status, and invoice information, often needing to export them for reconciliation and report preparation; warehouse managers focus on information such as inventory quantity, storage location, and inbound / outbound times for inventory counting and logistics tracking; while purchasing specialists tend to export data such as supplier names, purchase prices, and delivery cycles for supplier evaluation and procurement planning. Therefore, providing differentiated export recommendations based on user roles can more accurately meet actual business needs.
[0175] For example, typically, after logging into their account, users can perform various business-related operations (such as data query operations, data export operations, etc.). When monitoring data export operations on the front-end interface, the identity information of the current operator can be directly verified and obtained. This identity information includes at least user identification information and user role information. For instance, after logging into their account, users can query the user identification information and user role information registered during account registration.
[0176] Step 304: Query the global historical export records and the personal historical export records corresponding to the user identification information.
[0177] The global historical export record refers to the collection of logs left by all users in the system when they performed data export operations in the past, which records the columns selected by each user for each export.
[0178] Personal export history records refer to the collection of logs left by the current operator when performing data export operations in the past, recording the column names selected by the current operator each time an export is performed.
[0179] Optionally, global historical export records and personal historical export records can be obtained directly from a preset database or the first terminal.
[0180] For example, the second terminal can execute two queries based on the current business type. One query does not include user conditions to obtain the global historical export records of all users under this business, which is used to analyze frequently occurring common fields; the other query includes the current user's user identification information as a condition to obtain the current operator's personal historical export records, which is used to extract their personal preferences.
[0181] Step 306: Based on the global historical export records, the personal historical export records, and the user role information, predict the probability that each of the exportable columns will be selected as a recommended export column.
[0182] For example, the second terminal can use the global historical export records, the personal historical export records, and the user role information as input, and employ a weighted statistical algorithm or machine learning model to calculate the probability that each exportable column is selected by the current user. The probability calculation comprehensively considers the frequency of the exportable column in the global historical export records, the frequency of its appearance in the user's personal historical export records, and its correlation with the user's role.
[0183] As an example, a weighted statistical algorithm for calculating the probability of each exportable column being selected by the current user can be used as follows: For each exportable column, data is collected from three dimensions and weighted accordingly: the historical export frequency of all users globally (e.g., weight set to 0.3), the group export frequency of the current user's role (e.g., "Sales Manager") (e.g., weight set to 0.4), and the user's personal historical export preference (e.g., weight set to 0.3). For each exportable column, the frequency of its occurrence in the above three dimensions can be counted and normalized to a percentage. Assuming the column has an occurrence rate of 60% in the global records, 85% in the "Sales Manager" role, and 90% in the current user's personal records, then its final recommendation probability is: (60% × 0.3) + (85% × 0.4) + (90% × 0.3) = 79%. After completing this calculation for all exportable columns, they can be sorted by score, and the top-ranked columns can be identified as recommended export columns. This method is logically transparent, computationally efficient, and can stably combine common patterns with individual preferences.
[0184] As another example, methods for calculating the probability of each exportable column being selected by the current user using machine learning models can include: using a large amount of historical data, including user identification information, user role information, global historical export records, and personal historical export records, as training samples. The labels of the samples can be the columns ultimately selected. A classification model is then trained using the training samples and their labels. In the application phase, user identification information, user role information, global historical export records, and personal historical export records can be used as input to the trained classification model to calculate the probability of each exportable column being selected.
[0185] Step 308: Derivable columns with probabilities greater than or equal to a preset probability threshold are identified as recommended derived columns.
[0186] For example, after predicting the probability that all exportable columns will be selected as recommended exportable columns, the second terminal can compare these probability values with a preset probability threshold. The higher the probability value of an exportable column, the higher its export frequency and the higher its probability of being selected. Therefore, exportable columns with probability values greater than or equal to the preset probability threshold can be identified as recommended exportable columns. These recommended exportable columns are then returned to the front end to be initialized as selected in the export optional information.
[0187] In this embodiment, by combining user identification information, user role information, global historical export records, and personal historical export records, the recommendation probability of each exportable column is dynamically predicted. Exportable columns with a probability greater than or equal to a preset probability threshold are identified as recommended exportable columns. This solution dynamically calculates the recommendation probability of each exportable column for the current user by integrating global common patterns (global historical records) and individual characteristics (personal historical records, user identification, and role). Exportable columns with a probability greater than or equal to the preset probability threshold are identified as recommended exportable columns. The recommendation results vary from user to user. Recommended exportable columns filtered based on user role information can adapt to the actual needs of different roles (such as showing different recommended exportable columns to sales and finance), while recommended exportable columns filtered based on personal historical export records can adapt to the historical preferences and operating habits of different individuals. This allows users to quickly obtain default column combinations that match their role and usage habits when exporting, reducing manual selection operations and improving export efficiency. Meanwhile, the system also has adaptive capabilities. The user's real-time operations will continuously update the user's personal historical export records, so that the recommended export columns filtered based on the user's personal historical export records can be aligned with the user's latest preferences and operating habits. The recommendation effect is continuously optimized as user behavior changes, which significantly improves the user experience and the system's intelligence level.
[0188] In an exemplary embodiment, based on the global historical export records, the personal historical export records, and the user role information, the probability of each of the exportable columns being selected as recommended export columns is predicted, including steps 3061 to 3062, wherein:
[0189] Step 3061: Calculate the global export frequency of each exportable column based on the global historical export records, calculate the personal export frequency of each exportable column based on the personal historical export records, determine the role-related export column corresponding to the user role information from each exportable column, and determine the role export score of the role-related export column and the non-recommended export column other than the role-related export column, wherein the role export score of the role-related export column is higher than the role export score of the non-recommended export column other than the role-related export column.
[0190] It's important to note that relying solely on historical data from a single dimension when implementing personalized recommendations often results in biased outcomes. For example, relying solely on global frequency ignores individual differences, while relying solely on personal history fails to address the cold start problem for new users or new businesses. This single-dimensional recommendation strategy struggles to comprehensively balance collective wisdom, individual preferences, and role characteristics, thus limiting recommendation accuracy. The cold start problem refers to the difficulty in making effective predictions or recommendations when sufficient historical data is lacking.
[0191] The global export frequency refers to the proportion of times a certain exportable column appears in all users' global history export records out of the total number of records. For example, if the "Product Name" column appears 850 times in 1000 global history export records, the global export frequency of the "Product Name" column is 0.85 or 85%.
[0192] Personal export frequency refers to the proportion of times a certain exportable column appears in the current user's personal export history out of the total number of personal records. For example, if the current user has exported 10 times, and the "Cost Price" column appears 8 times, then the personal export frequency of the "Cost Price" column is 0.8.
[0193] Role-related exported columns refer to exportable columns that are highly related to a specific user role based on predefined business rules. For example, for the "Finance" role, columns such as "Tax-inclusive Amount" and "Tax Rate" can be pre-configured as role-related exported columns.
[0194] Role-derived scores refer to the scores used to quantify the relevance of a specific derived column to the current user's role. Role-related derived columns have high scores, while other columns have low scores, reflecting role preferences in recommendation calculations. For example, a role-derived score of 1.0 for a role-related derived column, and a role-derived score of 0.1 for non-recommendation derived columns.
[0195] For example, the system can iterate through the global historical export records, count the number of times each exportable column is selected for export, and calculate its proportion relative to the total number of exports to obtain the global export frequency. Similarly, it can iterate through the current user's personal historical export records and calculate the personal export frequency for each exportable column. Simultaneously, based on the obtained user role information, the system queries a predefined mapping table between roles and associated export columns to determine the set of role-related export columns strongly associated with that role. Then, a higher fixed score, such as 1, is assigned to role-related export columns; and a lower fixed score, such as 0.1, is assigned to non-recommended export columns other than role-related export columns. Thus, each exportable column obtains a three-dimensional quantitative indicator.
[0196] In some embodiments, if the number of personal historical export records is less than a preset threshold, the representativeness of these records is insufficient. Therefore, the personal export frequency can be set to a preset fixed value. For new users or users with few operation records, their personal historical data may not be sufficient to accurately reflect usage preferences. If used directly for recommendation calculations, it may lead to biased recommendation results. To avoid misjudgments due to insufficient samples, using a preset fixed value can effectively reduce interference from individual data.
[0197] In some embodiments, the preset fixed value can be equal to a preset probability threshold. This setting ensures that when the individual export frequency is not statistically significant, the factor remains neutral in the weighted calculation, neither generating positive gain nor causing negative interference. This transfers the dominant power of recommendation decision-making to the global export frequency and role export score, ensuring the rationality and reliability of the recommendation results in the cold start phase.
[0198] In some embodiments, a time decay weight can be introduced to weight historical records when calculating global and individual export frequencies. Specifically, the time decay weight of each export record is negatively correlated with the time interval between its occurrence and the present; the longer the interval, the lower the time decay weight. This aims to give more influence to recent export behavior on the export frequency calculation results, thereby enabling the recommendation list to dynamically reflect the user's latest preferences and business trends. For example, suppose a sales manager frequently exported the "Number of Customers" column for the first 11 months of the past year, but recently switched to frequently exporting the "Contract Amount" column due to business adjustments. Without considering time decay, the system might still strongly recommend "Number of Customers" based on the full year's data. However, with the introduction of the time decay weight, the weight of the most recent month's export records will be significantly increased, while the weight of older records from several months ago will be correspondingly decreased. This significantly increases the influence of the new preference for "Contract Amount" in the calculation, allowing the system to promptly capture changes in user behavior and prioritize displaying the "Contract Amount" column in the recommendation list, ensuring that the recommendation results are consistent with the user's current work priorities.
[0199] Step 3062: Based on the preset weight allocation, the global export frequency, personal export frequency and role export score of each exportable column are weighted and fused, and the weighted fusion result is determined as the probability that each exportable column is selected as a recommended export column.
[0200] The preset weight allocation is used to balance the importance of global export frequency, personal export frequency, and character export rating. For example, the weight corresponding to global export frequency can be 0.2, the weight corresponding to personal export frequency can be 0.3, and the weight corresponding to character export rating can be 0.5. The specific weight can be determined according to the actual situation and test results, etc., and this embodiment does not impose any restrictions on it.
[0201] For example, for each exportable column, its global export frequency, personal export frequency, and role export rating can be multiplied by their respective weights, and then the three products can be summed to obtain the weighted fusion result of that exportable column. This weighted fusion result can be ultimately determined as the probability value of that exportable column being selected as a "recommended export column".
[0202] In this embodiment, by introducing a mechanism of multi-dimensional feature quantification and weighted fusion, the one-sidedness and cold start problem of single-dimensional recommendation strategies are effectively overcome. First, the global export frequency captures the common needs of all users, ensuring that the recommendations have a broad practical basis. Then, by exporting scores based on roles, key data columns directly related to the current user's role are strengthened, ensuring that the recommendation results conform to their role responsibilities and business specifications, providing professional assurance. Finally, by exporting individual export frequencies, unique user operating habits and historical preferences are precisely integrated, achieving personalized adaptation. For new users, reasonable recommendations can be provided based on role commonalities and global export frequencies; for existing users, recommendation content can be dynamically optimized based on their historical behavior. This effectively improves the predictive accuracy of the exported recommendation columns.
[0203] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0204] Based on the same inventive concept, this application also provides a data export apparatus for implementing the data export method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data export apparatus embodiments provided below can be found in the limitations of the data export method described above, and will not be repeated here.
[0205] In one exemplary embodiment, such as Figure 4 As shown, a data export system is provided, including a first terminal 402 and a second terminal 404. For different business types, the first terminal 402 provides a unified data export interface to the second terminal 404; wherein:
[0206] The second terminal 404 is used to send a data export request carrying the target business type identification information to the first terminal 402 through a unified data export interface when an export operation is detected on the business interface.
[0207] The first terminal 402 is configured to receive a data export request sent by the second terminal 404 through the unified data export interface, wherein the data export request carries target service type identification information; read the data to be exported by calling the target data query interface corresponding to the target service type identification information; and send the data to be exported to the second terminal 404.
[0208] The second terminal 404 is used to receive the data to be exported fed back by the first terminal 402.
[0209] In one exemplary embodiment, the first terminal 402 is further configured to:
[0210] Query the business type identifier information corresponding to the business type; mark the export tag that matches the business type identifier information on the data query interface.
[0211] In one exemplary embodiment, the first terminal 402 is further configured to:
[0212] Query the target export tag that matches the target business type identifier information; read the data to be exported by calling the target data query interface corresponding to the target export tag.
[0213] In one exemplary embodiment, the first terminal 402 is further configured to:
[0214] Upon receiving a new instruction for a business export requirement, the system obtains the business type information and data query interface corresponding to the business export requirement based on the new instruction. The business type information includes the business type and / or business type identification information. An export tag matching the business type information is then marked on the data query interface.
[0215] In one exemplary embodiment, the first terminal 402 is further configured to:
[0216] Obtain column configuration information, including header information and column attribute information; generate an initial data table based on the header information and column attribute information; import the data to be exported into the initial data table to obtain a target data table; and send the target data table to the second terminal.
[0217] In one exemplary embodiment, the second terminal 404 is further configured to:
[0218] When an export operation is detected on the business interface, at least one target export column and / or target column attribute information is determined from the business interface; the column name of at least one target export column and / or the target column attribute information is used as the column configuration information; and a data export request carrying the target business type identifier information and the column configuration information is sent to the first terminal through a unified data export interface.
[0219] In an exemplary embodiment, the export option information corresponding to the business interface includes at least one exportable column, the at least one exportable column includes a recommended export column and / or a non-recommended export column, and at least one of the target export columns includes the recommended export column and / or the non-recommended export column that are selected. The second terminal 404 is further configured to:
[0220] Obtain user identification information and user role information; query global historical export records and personal historical export records corresponding to the user identification information; predict the probability that each exportable column will be selected as a recommended export column based on the global historical export records, the personal historical export records, and the user role information; determine the exportable columns with a probability greater than or equal to a preset probability threshold as recommended export columns.
[0221] In one exemplary embodiment, the second terminal 404 is further configured to:
[0222] The global export frequency of each exportable column is calculated based on the global historical export records, and the personal export frequency of each exportable column is calculated based on the personal historical export records. The role-related export column corresponding to the user's role information is determined from each exportable column. The role export score of the role-related export column and the non-recommended export columns (excluding the role-related export column) are determined separately, wherein the role export score of the role-related export column is higher than the role export score of the non-recommended export columns (excluding the role-related export column). Based on a preset weight allocation, the global export frequency, personal export frequency, and role export score of each exportable column are weighted and fused, and the weighted fusion result is determined as the probability that each exportable column is selected as a recommended export column.
[0223] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a data export method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0224] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0225] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0226] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0227] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0228] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0229] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0230] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0231] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data export method, characterized in that, Applied to a first terminal, the first terminal provides a unified data export interface to a second terminal for different service types; the method includes: Receive a data export request sent by the second terminal through the unified data export interface, wherein the data export request carries target service type identification information; The data to be exported is read by calling the target data query interface corresponding to the target business type identifier information; The data to be exported is sent to the second terminal.
2. The method according to claim 1, characterized in that, Before reading the data to be exported by calling the target data query interface corresponding to the target business type identifier information, the method includes: Query the business type identifier information corresponding to the business type; The data query interface is marked with an export tag that matches the business type identification information; The step of reading the data to be exported by calling the target data query interface corresponding to the target business type identifier information includes: Query the target exported tags that match the target business type identifier information; The data to be exported is read by calling the target data query interface corresponding to the target export tag.
3. The method according to claim 2, characterized in that, The method further includes: Upon receiving a new instruction for a business export requirement, the system obtains the business type information and data query interface corresponding to the business export requirement based on the new instruction. The business type information includes the business type and / or business type identification information. The data query interface is marked with an export tag that matches the business type information.
4. The method according to claim 1, characterized in that, Sending the data to be exported to the second terminal includes: Obtain column configuration information, which includes header information and column attribute information; An initial data table is generated based on the header information and column attribute information; Import the data to be exported into the initial data table to obtain the target data table; The target data table is sent to the second terminal.
5. A data export method, characterized in that, Applied to a second terminal, the method includes: When an export operation is detected on the business interface, a data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface. This allows the first terminal to read the data to be exported and provide feedback on the data to be exported when it receives the data export request by calling the target data query interface corresponding to the target business type identification information. Receive the data to be exported from the first terminal.
6. The method according to claim 5, characterized in that, When an export operation is detected on the business interface, the data export request carrying the target business type identification information is sent to the first terminal through a unified data export interface, including: If an export operation is detected on the business interface, at least one target export column and / or target column attribute information is determined from the business interface. Use at least one of the target exported columns' column names and / or the target column attribute information as the column configuration information; The data export request, carrying the target business type identification information and the column configuration information, is sent to the first terminal through a unified data export interface.
7. The method according to claim 6, characterized in that, The export options information corresponding to the business interface includes at least one exportable column, the at least one exportable column includes a recommended export column and / or a non-recommended export column, and at least one target export column includes the recommended export column and / or the non-recommended export column that are selected. The method includes: Obtain user identification information and user role information; Query the global historical export records, as well as the personal historical export records corresponding to the user identification information; Based on the global historical export records, the personal historical export records, and the user role information, predict the probability that each of the exportable columns will be selected as a recommended export column; Exportable columns with probabilities greater than or equal to a preset probability threshold are identified as recommended exportable columns.
8. The method according to claim 7, characterized in that, The step of predicting the probability of each of the exportable columns being selected as recommended export columns based on the global historical export records, the personal historical export records, and the user role information includes: The global export frequency of each exportable column is calculated based on the global historical export records, the personal export frequency of each exportable column is calculated based on the personal historical export records, and the role-related export column corresponding to the user role information is determined from each exportable column. The role export scores of the role-related export column and the non-recommended export columns other than the role-related export column are determined respectively, wherein the role export score of the role-related export column is higher than the role export score of the non-recommended export columns other than the role-related export column. Based on the preset weight allocation, the global export frequency, personal export frequency and role export score of each exportable column are weighted and fused, and the weighted fusion result is determined as the probability that each exportable column is selected as a recommended export column.
9. A data export system, characterized in that, The system includes a first terminal and a second terminal. For different service types, the first terminal provides a unified data export interface to the second terminal; wherein: The second terminal is used to send a data export request carrying the target business type identification information to the first terminal through a unified data export interface when an export operation is detected on the business interface. The first terminal is configured to receive a data export request sent by the second terminal through the unified data export interface, wherein the data export request carries target service type identification information; read the data to be exported by calling the target data query interface corresponding to the target service type identification information; and send the data to be exported to the second terminal. The second terminal is used to receive the data to be exported from the first terminal.
10. A computer device or computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4 or the method according to any one of claims 5 to 8.