Business document generation method and device, computer device and storage medium
By directly determining the mapping relationship between the target field and the source field in the business data and synchronizing the business data to the target field, the inefficiency caused by the intermediate data table in traditional technology is solved, and efficient generation of business documents is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- KINGDEE SOFTWARE(CHINA) CO LTD
- Filing Date
- 2022-12-21
- Publication Date
- 2026-06-05
AI Technical Summary
Traditional techniques increase the complexity of data flow and result in low efficiency in generating business documents when synchronizing business data to business documents through intermediate data tables.
By acquiring business data from the source system, determining the target fields based on the metadata of the document domain model, extracting the data corresponding to the source fields from the business data, and directly synchronizing them to the target fields, a business document corresponding to the document domain model is generated, avoiding the use of intermediate data tables.
It reduces the complexity of data flow, improves the efficiency of generating business documents, saves storage space in the business system, and shortens the generation time.
Smart Images

Figure CN116226117B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for generating business documents. Background Technology
[0002] With the development of computer technology, big data clusters are often used to process business data. A key issue is how to import the data processed by the big data cluster into business documents within the business system. Traditionally, the data generated by the big data cluster is first imported into an intermediate data table in the business system. Then, each business entity queries the data from the intermediate data table and stores it into its business documents. However, this traditional method of transferring synchronized data through an intermediate data table increases the complexity of data flow, leading to low efficiency in generating business documents. Summary of the Invention
[0003] Therefore, it is necessary to provide a business document generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve efficiency in addressing the aforementioned technical problems.
[0004] Firstly, this application provides a method for generating business documents. The method includes:
[0005] Obtain business data from the source system;
[0006] Based on the metadata of the document domain model, determine the target field for data synchronization, and determine the source field corresponding to the target field in each field corresponding to the business data;
[0007] Extract the data corresponding to the source field from the business data, and synchronize the extracted data to the target field;
[0008] Based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated.
[0009] In one embodiment, determining the target field for data synchronization based on the metadata of the document domain model and determining the source field corresponding to the target field among the fields corresponding to the business data includes:
[0010] The target field for data synchronization, and the field mapping relationship between the target field and the source field are determined based on the metadata of the document domain model.
[0011] Based on the field mapping relationship, the source field corresponding to the target field is determined among the fields corresponding to the business data.
[0012] In one embodiment, the target field includes fields stored in multiple types of databases, and the step of extracting data corresponding to the source field from the business data and synchronizing the extracted data to the target field includes:
[0013] Through the system interface of the business system, the data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field stored in various types of databases.
[0014] In one embodiment, the method further includes:
[0015] Obtain the configuration data corresponding to the business data;
[0016] Write the business data into the object storage file according to the configuration data;
[0017] The step of extracting the data corresponding to the source field from the business data includes:
[0018] Extract the data corresponding to the source field from the business data stored in the object storage file.
[0019] In one embodiment, the configuration data and the object storage file are stored in different storage areas.
[0020] In one embodiment, the business document includes a document header, a document body, and a sub-document body; generating the business document corresponding to the document domain model based on the target field and the data synchronized to the target field includes:
[0021] Within the target field, determine the document header field, document body field, and sub-document body field;
[0022] Generate a document header based on the document header field and the data synchronized to the document header field;
[0023] Generate the document body under the document header based on the document body fields and the data synchronized to the document body fields;
[0024] A sub-document body is generated under the document body based on the sub-document body fields and the data synchronized to the sub-document body fields;
[0025] The business document consists of the document header, the document body, and the sub-document bodies.
[0026] In one embodiment, after synchronizing the extracted data to the target field, the method further includes:
[0027] A synchronization event message is sent to the event center so that the event center can push the synchronization event message to each business party based on the business party identifier extracted from the synchronization event message.
[0028] Secondly, this application also provides a business document generation device. The device includes:
[0029] The acquisition module is used to acquire business data from the source system.
[0030] The determination module is used to determine the target field for data synchronization based on the metadata of the document domain model, and to determine the source field corresponding to the target field among the fields corresponding to the business data;
[0031] The synchronization module is used to extract the data corresponding to the source field from the business data and synchronize the extracted data to the target field.
[0032] The generation module is used to generate a business document corresponding to the document domain model based on the target field and the data synchronized to the target field.
[0033] In one embodiment, the determining module is further configured to include:
[0034] The target field for data synchronization, and the field mapping relationship between the target field and the source field are determined based on the metadata of the document domain model.
[0035] Based on the field mapping relationship, the source field corresponding to the target field is determined among the fields corresponding to the business data.
[0036] In one embodiment, the target field includes fields stored in multiple types of databases, and the synchronization module is further configured to:
[0037] Through the system interface of the business system, the data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field stored in various types of databases.
[0038] In one embodiment, the apparatus further includes:
[0039] The acquisition module is also used to acquire configuration data corresponding to the business data;
[0040] The writing module is used to write the business data into an object storage file according to the configuration data;
[0041] The synchronization module is also used to extract the data corresponding to the source field from the business data stored in the object storage file.
[0042] In one embodiment, the configuration data and the object storage file are stored in different storage areas.
[0043] In one embodiment, the business document includes a document header, a document body, and a sub-document body; the generation module is further configured to:
[0044] Within the target field, determine the document header field, document body field, and sub-document body field;
[0045] Generate a document header based on the document header field and the data synchronized to the document header field;
[0046] Generate the document body under the document header based on the document body fields and the data synchronized to the document body fields;
[0047] A sub-document body is generated under the document body based on the sub-document body fields and the data synchronized to the sub-document body fields;
[0048] The business document consists of the document header, the document body, and the sub-document bodies.
[0049] In one embodiment, the apparatus further includes:
[0050] The sending module is used to send a synchronization event message to the event center, so that the event center can push the synchronization event message to each business party based on the business party identifier extracted from the synchronization event message.
[0051] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0052] Obtain business data from the source system;
[0053] Based on the metadata of the document domain model, determine the target field for data synchronization, and determine the source field corresponding to the target field in each field corresponding to the business data;
[0054] Extract the data corresponding to the source field from the business data, and synchronize the extracted data to the target field;
[0055] Based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated.
[0056] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0057] Obtain business data from the source system;
[0058] Based on the metadata of the document domain model, determine the target field for data synchronization, and determine the source field corresponding to the target field in each field corresponding to the business data;
[0059] Extract the data corresponding to the source field from the business data, and synchronize the extracted data to the target field;
[0060] Based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated.
[0061] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0062] Obtain business data from the source system;
[0063] Based on the metadata of the document domain model, determine the target field for data synchronization, and determine the source field corresponding to the target field in each field corresponding to the business data;
[0064] Extract the data corresponding to the source field from the business data, and synchronize the extracted data to the target field;
[0065] Based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated.
[0066] The aforementioned business document generation method, apparatus, computer equipment, storage medium, and computer program products acquire business data from the source system; determine the target field for data synchronization based on the metadata of the document domain model, and identify the source field corresponding to the target field among the fields corresponding to the business data. Extract the data corresponding to the source field from the business data and synchronize the extracted data to the target field; based on the target field and the data synchronized to the target field, generate the business document corresponding to the document domain model. This allows for the configuration of synchronized source and target fields through the document domain model, and the direct synchronization of business data from the big data cluster to the business documents in the business system using the configured source and target fields. The data synchronization process does not require the use of intermediate data tables for transfer, reducing data flow complexity and improving the efficiency of business document generation. Furthermore, since intermediate data tables are not stored in the business system, storage space is saved. In addition, since each business party can directly obtain synchronized data from the big data cluster without querying intermediate data tables, the query speed reduction caused by multiple business parties simultaneously querying intermediate data tables is avoided, shortening the time for generating business documents. Attached Figure Description
[0067] Figure 1 This is an application environment diagram of a business document generation method in one embodiment;
[0068] Figure 2 This is a flowchart illustrating a business document generation method in one embodiment;
[0069] Figure 3 This is a schematic diagram of a big data cluster and a business system in one embodiment;
[0070] Figure 4 This is a schematic diagram of the structure of a business document in one embodiment;
[0071] Figure 5a This is a schematic diagram of a business system in one embodiment;
[0072] Figure 5b This is a schematic diagram illustrating a business document in one embodiment.
[0073] Figure 6 This is a flowchart illustrating a method for determining source fields in one embodiment;
[0074] Figure 7a This is a schematic diagram illustrating the field mapping relationship in one embodiment;
[0075] Figure 7b This is a schematic diagram of a list of business association schemes in one embodiment;
[0076] Figure 8 This is a schematic diagram illustrating the configuration of separate storage of data and object storage files in one embodiment;
[0077] Figure 9 This is a schematic diagram of a business document generation system in one embodiment;
[0078] Figure 10 This is a flowchart illustrating the business document generation method in another embodiment;
[0079] Figure 11 This is a structural block diagram of a business document generation device in one embodiment;
[0080] Figure 12 This is a structural block diagram of a business document generation device in another embodiment;
[0081] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0082] 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.
[0083] The business document generation method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, server 102 acquires business data from the source system; determines the target field for data synchronization based on the metadata of the document domain model, and identifies the source field corresponding to the target field among the fields corresponding to the business data; extracts the data corresponding to the source field from the business data and synchronizes the extracted data to the target field; and generates a business document corresponding to the document domain model based on the target field and the data synchronized to the target field. Server 102 can be an independent physical server or a service node in a blockchain system. The service nodes in this blockchain system form a peer-to-peer (P2P) network, and the P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).
[0084] In addition, server 102 can also be a server cluster consisting of multiple physical servers, which can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0085] In one embodiment, such as Figure 2 As shown, a method for generating business documents is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0086] S202, Obtain business data from the source system.
[0087] Business data refers to data related to the business processes handled by the business system. A business system is a system used to execute business operations; it can be an enterprise management system, such as ERP (Enterprise Resource Planning), CRM (Customer Relationship Management), OA (Office Automation), or warehouse management systems. For example, business data can be sales data for target objects such as materials or products, including sales quantity, type, or buyer identification. It can also be attendance data for those being tracked, including check-in time, check-out time, and attendance duration. Furthermore, business data can be transaction data, including transaction party identification, transaction time, or account balance.
[0088] In one embodiment, business data can also be data generated based on historical business data. For example, business data can be predictive data obtained by forecasting the development trend of related businesses based on historical business data. For example, when the historical business data is sales data, the business data can be predicted sales volume; when the historical business data is attendance data, the business data can be predicted attendance time; when the historical business data is transaction data, the business data can be transaction risk data, etc. Historical business data is business data generated by the business system within a historical period. The historical period is the time period before the current time and can be set according to business needs. For example, the historical period can be a period within two weeks of the current time. Another example is that the historical period can be from 12:00:00 on May 5, 2022 to 12:00:00 on May 8, 2022.
[0089] In one embodiment, the business data is text-based data consisting of strings. For example, the business data can be in JSON (JavaScript Object Notation) format; or it can be in Extensible Markup Language (Extended Markup Language) format. JSON is a lightweight data-interchange format consisting of key-value pairs, where the key and value are stored in corresponding fields.
[0090] In one embodiment, S202 specifically includes: the big data cluster obtaining historical business data from the business system, predicting the historical business data based on a prediction model, and obtaining business data. The server obtains the business data from the big data cluster. Here, the big data cluster is a computer cluster used to store large datasets. The prediction model can be a machine learning model, for example, a neural network model, a deep learning model, etc. The neural network model can be, for example, a convolutional neural network model, a residual convolutional neural network model, or a feedforward neural network model, etc.
[0091] In one embodiment, such as Figure 3 As shown, the big data cluster includes a non-relational database (e.g., Hive) and distributed cloud storage. Business systems access the big data cluster through a system API (Application Program Interface). Specifically, S202 includes: the big data cluster retrieving historical business data from the business system and storing it in the non-relational database; predicting the historical business data in the non-relational database using a predictive model to obtain business data, which is then stored in distributed cloud storage. For example, the distributed cloud storage could be S3 (Simple Storage Service) or HBase (Hadoop Database). The business system's servers retrieve business data from the distributed cloud storage through the system API. Storing business data in distributed cloud storage improves storage reliability and fault tolerance.
[0092] S204. Based on the metadata of the document domain model, determine the target field for data synchronization, and determine the source field corresponding to the target field in each field of the business data.
[0093] The document domain model is an object model used to define business documents; it is also known as the conceptual model, domain object model, or analysis object model. A document domain model can define one or more business document objects. For example, it can define various types of business documents such as "sales forecast document," "inventory document," or "tax document." Metadata is data used to describe business documents, including document type, document identifier, associated data table identifier, primary key, primary key type, or field identifier. Documents defined in the document domain model can be structured data with multiple levels. Specifically, such as... Figure 4 As shown, a business document may include a document header, a document body, and sub-document bodies. Each document header may contain one or more document bodies, and each document body may contain one or more sub-document bodies.
[0094] The target field is a field in the business document used to store the business data to be synchronized. For example, the target field could be the material identifier field, sales volume field, or forecast time field in a sales forecast document. The source field is the field from which the synchronized data originates. For example, the source field could be the forecast sales volume field or forecast time field in the business data.
[0095] S206: Extract the data corresponding to the source field from the business data and synchronize the extracted data to the target field.
[0096] After identifying the source field as the data source for synchronization, the server extracts the corresponding data from the business data and synchronizes the extracted data to the target field. For example, the server synchronizes the predicted sales volume from the predicted sales field of the business data to the predicted sales field of the document. Similarly, the server synchronizes the transaction balance from the transaction balance field of the business data to the predicted balance field of the document.
[0097] In one embodiment, the target field includes fields stored in multiple types of databases. S206 specifically includes: extracting data corresponding to the source field from the business data through the system interface of the business system, and synchronizing the extracted data to the target field stored in multiple types of databases.
[0098] The system interface is a data access interface provided by the business system that is compatible with multiple databases; it can be a system API interface. These database types can include relational databases and non-relational databases. Relational databases could be, for example, SQL Server or Oracle. When a business system supports multiple database types, its server can achieve compatibility with these database types through the system interface. This eliminates the need to develop separate data access interfaces for each database type, allowing for a simple and convenient import of data corresponding to source fields into multiple database types, thus improving data synchronization efficiency.
[0099] S208 generates business documents corresponding to the document domain model based on the target field and the data synchronized to the target field.
[0100] After the server imports business data from the big data cluster, it generates business documents corresponding to the document domain model based on the target fields and the data synchronized to those fields. For example, Figure 5a As shown, the generated business document includes multiple target fields such as prediction model identifier, prediction model name, prediction time, material code, material name, prediction time type, and prediction value. The data in each target field comes from the business data of the big data cluster.
[0101] In one embodiment, S208 specifically includes: generating a business data table based on the target field and the data synchronized to the target field, and generating a business document corresponding to the document domain model based on the business data table. Figure 5b As shown, the server synchronizes the source fields of the business data to the target fields of the corresponding business data tables of each business entity. Then, it generates business documents based on the data in each field of the business data tables. For example, the server of the business system can read business data from the big data cluster via a network interface. This network interface can be a URL connection abstract class, which can read business data from the big data cluster using relevant network request methods of the HTTP (Hypertext Transfer Protocol) protocol.
[0102] In one embodiment, after S208, the method further includes: sending a synchronization event message to the event center, so that the event center pushes the synchronization event message to each business party based on the business party identifier extracted from the synchronization event message.
[0103] The event center, a message middleware within the event-driven architecture (EDA), listens for events and distributes them to event consumers. Synchronization event messages notify business stakeholders that data synchronization is complete, including identifiers of each business staker that has subscribed to the message. When the server synchronizes business data from the big data cluster to business documents, it pushes synchronization event messages through the event center to each business staker using the data. This allows each business staker to be promptly notified that data synchronization is complete and to process the synchronized data. Furthermore, each business staker can also check the success of data synchronization and take remedial measures in case of failure.
[0104] In one embodiment, after S208, the process further includes: the business system performing business processing based on the generated business documents, including warehousing business processing, attendance business processing, or transaction business processing. For example, if the business data is sales data, when importing sales data into business documents in the business system, the business party can perform material procurement or inventory management based on the sales data in the business documents. As another example, if the business data is transaction risk value, when importing transaction risk value into business documents in the business system, the business party can assess transaction risk based on the transaction risk value in the business documents.
[0105] In the above embodiments, business data generated based on historical business data is obtained; the target field for data synchronization is determined according to the metadata of the document domain model, and the source field corresponding to the target field is determined in each field corresponding to the business data. Data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field; based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated. Thus, the source and target fields for synchronization can be configured through the document domain model, and the business data of the big data cluster can be directly synchronized to the business documents of the business system through the configured source and target fields. The data synchronization process does not require the use of intermediate data tables for transfer, reducing the complexity of data flow and improving the efficiency of generating business documents. Furthermore, since intermediate data tables do not need to be stored in the business system, storage space of the business system is saved. In addition, since each business party can directly obtain synchronized data from the big data cluster without querying intermediate data tables, the query speed reduction caused by multiple business parties querying intermediate data tables simultaneously is avoided, shortening the time for generating business documents.
[0106] In one embodiment, such as Figure 6 As shown, S204 specifically includes the following steps:
[0107] S602, determine the target field for data synchronization and the field mapping relationship between the target field and the source field based on the metadata of the document domain model.
[0108] The field mapping relationship refers to the correspondence between the imported source fields and the target fields in the business documents. For example, ... Figure 7a As shown, the "Prediction Model" source field is mapped to the "Model Identifier" target field; the "Prediction Model Name" source field is mapped to the "Model Name" target field, etc.
[0109] In one embodiment, S602 specifically includes: the server determining the target fields contained in the business document to be generated based on the metadata of the document domain model; then configuring corresponding source fields for each target field; generating a business association scheme based on the target fields and the configured source fields; and recording the field mapping relationship between the source fields and target fields in the business association scheme. The server can generate corresponding business association schemes based on the document domain model corresponding to the business documents of each business party and store the business association schemes in an association scheme list. Figure 7b As shown, the list of association schemes includes association schemes for sales forecast documents and association schemes for ordinary documents.
[0110] S604, based on field mapping relationships, determines the source field corresponding to the target field among the fields corresponding to the business data.
[0111] Based on field mapping relationships, the server queries each field corresponding to the business data, and then queries the source field corresponding to the target field within each field of the business data, thereby importing the data from the source field into the target field. Since the field mapping relationship determines the mapping between the source and target fields, the server can directly map text-formatted business data in a big data cluster to hierarchical business documents based on this relationship, without needing to consider the differences between the two data structures, thus improving data synchronization efficiency.
[0112] In the above embodiments, the server determines the target fields for data synchronization and the field mapping relationship between the target fields and the source fields based on the metadata of the document domain model. This allows fields from the business data in the big data cluster to be directly imported into the fields of the document based on the field mapping relationship, eliminating the need for transfer through intermediate data tables, reducing data flow complexity, and improving the efficiency of generating business documents. Furthermore, through the metadata of the document domain model, the server can map text-formatted business data to hierarchical business documents and uniformly determine field mapping relationships for various business documents, without requiring separate development for each business party's business documents, further improving the efficiency of generating business documents.
[0113] In one embodiment, before S206, the method further includes: obtaining configuration data corresponding to the business data; writing the business data into an object storage file based on the configuration data; S206 specifically includes: extracting data corresponding to the source field from the business data stored in the object storage file.
[0114] The configuration data defines the field identifiers contained in the object storage file. These field identifiers correspond to fields imported through data synchronization. For example, the configuration data can define predictive time field identifiers and predictive sales field identifiers in the object storage file. The server can generate configuration data based on business needs. For instance, if the sales business requires sales forecasting, the configuration data will include predictive sales field identifiers. Similarly, if the attendance business requires attendance rate forecasting, the configuration data will include predictive attendance rate field identifiers.
[0115] In one embodiment, the server generates an ETL (Extract-Transform-Load) script based on the configuration data, and writes the business data to an object storage file using the ETL script.
[0116] In one embodiment, configuration data and object storage files are stored in different storage areas. For example, ... Figure 8As shown, configuration data and object storage files are stored separately. When business requirements change, the configuration data can be modified accordingly, improving the ease of modification and enhancing the scalability of the underlying storage.
[0117] In the above embodiments, configuration data corresponding to business data is obtained, business data is written to an object storage file based on the configuration data, and field identifiers contained in the object storage file are configured according to business requirements—that is, field identifiers introduced through data synchronization—thus improving the flexibility of data synchronization. Furthermore, configuration data and object storage files can be stored separately, enhancing the scalability of the underlying storage.
[0118] In one embodiment, a business document includes a document header, a document body, and a sub-document body; S208 specifically includes: determining the document header field, document body field, and sub-document body field within the target fields; generating a document header based on the document header field and the data synchronized to the document header field; generating a document body under the document header based on the document body field and the data synchronized to the document body field; generating a sub-document body under the document body based on the sub-document body field and the data synchronized to the sub-document body field; and the document header, document body, and sub-document body constitute a business document.
[0119] In a business document, the document header, document body, and sub-document bodies are all components. The document header records the table header of the business document, the document body records the details under the table header, and the sub-document bodies record the details under the document body. The server can use a master data table to record the document header and a sub-data table to record the document body and sub-document bodies. Both the master and sub-data tables have multiple fields; the fields in the master data table are document header fields, and the fields in the sub-data tables are document body fields and sub-document body fields. The document header, document body, and sub-document bodies form a hierarchical structure for the business document.
[0120] In the above embodiments, the server imports data from the source fields into the document header field, document body field, and sub-document body field, respectively, forming a business document composed of the document header, document body, and sub-document body. This allows text-formatted business data to be mapped to hierarchical business documents, masking differences between data structures and improving data synchronization efficiency.
[0121] In one embodiment, such as Figure 9As shown, the big data cluster retrieves historical business data from the business system and stores it in a non-relational database. Based on a predictive model, it forecasts the historical business data to obtain the actual business data, which is then written to an object storage file in the distributed cloud storage according to configuration data. The business system configures a business association scheme based on the document domain model, recording field mapping relationships. The business system determines the source field corresponding to the target field in the business document based on the business association scheme, extracts the data corresponding to the source field from the business data, and imports the extracted data into the target field of the corresponding business document for each business party. Each business document may include multiple data tables. After importing the business data into the business document, the server sends a synchronization event message to the event center. The event center pushes synchronization event messages to each business party based on the business party identifier extracted from the synchronization event message, reminding each business party to promptly process the synchronized data.
[0122] In one embodiment, such as Figure 10 As shown, the business document generation method includes the following steps:
[0123] S1002, Obtain business data from the source system.
[0124] S1004, determine the target field for data synchronization and the field mapping relationship between the target field and the source field based on the metadata of the document domain model.
[0125] S1006: Obtain the configuration data corresponding to the business data, and write the business data to the object storage file according to the configuration data.
[0126] S1008, based on field mapping relationships, extracts the data corresponding to the source fields from the business data stored in object storage files.
[0127] S1010 extracts data corresponding to source fields from business data through the system interface of the business system, and synchronizes the extracted data to the target fields stored in various types of databases.
[0128] S1012, within the target fields, determine the document header field, document body field, and sub-document body field.
[0129] S1014, Generate document header based on document header fields and data synchronized to document header fields.
[0130] S1016, Generate the document body under the document header based on the document body fields and the data synchronized to the document body fields.
[0131] S1018 generates a sub-document body under the document body based on the sub-document body fields and the data synchronized to the sub-document body fields, and the business document is composed of the document header, document body and sub-document bodies.
[0132] S1020, send a synchronization event message to the event center so that the event center can push the synchronization event message to each business party based on the business party identifier extracted from the synchronization event message.
[0133] For details of S1002 to S1020 above, please refer to the specific implementation process described above.
[0134] 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.
[0135] Based on the same inventive concept, this application also provides a business document generation apparatus for implementing the business document generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more business document generation apparatus embodiments provided below can be found in the limitations of the business document generation method described above, and will not be repeated here.
[0136] In one embodiment, such as Figure 11 As shown, a business document generation device is provided, including: an acquisition module 1102, a determination module 1104, a synchronization module 1106, and a generation module 1108, wherein:
[0137] Module 1102 is used to acquire business data from the source system;
[0138] The determination module 1104 is used to determine the target field for data synchronization based on the metadata of the document domain model, and to determine the source field corresponding to the target field among the fields corresponding to the business data.
[0139] Synchronization module 1106 is used to extract data corresponding to the source field from business data and synchronize the extracted data to the target field;
[0140] The generation module 1108 is used to generate business documents corresponding to the document domain model based on the target field and the data synchronized to the target field.
[0141] In the above embodiments, business data from the source system is acquired; based on the metadata of the document domain model, the target field for data synchronization is determined, and the source field corresponding to the target field is determined among the fields corresponding to the business data. Data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field; based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated. Thus, the source and target fields for synchronization can be configured through the document domain model, and the business data from the big data cluster can be directly synchronized to the business documents in the business system using the configured source and target fields. The data synchronization process does not require the use of intermediate data tables for transfer, reducing the complexity of data flow and improving the efficiency of generating business documents. Furthermore, since intermediate data tables do not need to be stored in the business system, storage space in the business system is saved. In addition, since each business party can directly obtain synchronized data from the big data cluster without querying intermediate data tables, the query speed reduction caused by multiple business parties simultaneously querying intermediate data tables is avoided, shortening the time for generating business documents.
[0142] In one embodiment, the determining module 1104 is further configured to include:
[0143] The target fields for data synchronization, as well as the field mapping relationship between the target fields and the source fields, are determined based on the metadata of the document domain model.
[0144] Based on the field mapping relationship, determine the source field corresponding to the target field among the fields corresponding to the business data.
[0145] In one embodiment, the target field includes fields stored in multiple types of databases, and the synchronization module 1106 is further used for:
[0146] Through the system interface of the business system, the data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field stored in various types of databases.
[0147] In one embodiment, such as Figure 12 As shown, the device also includes:
[0148] The acquisition module 1102 is also used to acquire configuration data corresponding to business data;
[0149] The writing module 1110 is used to write business data to an object storage file according to the configuration data;
[0150] The synchronization module 1106 is also used to extract data corresponding to the source fields from business data stored in object storage files.
[0151] In one embodiment, configuration data and object storage files are stored in different storage areas.
[0152] In one embodiment, the business document includes a document header, a document body, and sub-document bodies; the generation module 1108 is further configured to:
[0153] Within the target fields, define the document header fields, document body fields, and sub-document body fields;
[0154] Generate a document header based on the document header fields and the data synchronized to the document header fields;
[0155] Generate the document body under the document header based on the document body fields and the data synchronized to the document body fields;
[0156] Generate a sub-document body under the document body based on the sub-document body fields and the data synchronized to the sub-document body fields;
[0157] A business document consists of a document header, a document body, and sub-document bodies.
[0158] In one embodiment, the apparatus further includes:
[0159] The sending module 1112 is used to send synchronization event messages to the event center, so that the event center can push synchronization event messages to each business party based on the business party identifier extracted from the synchronization event message.
[0160] Each module in the aforementioned business document generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0161] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 13 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores business document generation data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a business document generation method.
[0162] Those skilled in the art will understand that Figure 13 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.
[0163] In one embodiment, a computer device is 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-described method embodiments.
[0164] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0165] 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.
[0166] 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 shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0167] 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, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical 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, etc., and are not limited to these.
[0168] 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 specification.
[0169] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent 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 method for generating business documents, characterized in that, The method includes: Business data is obtained from a big data cluster; the business data is obtained by the big data cluster from historical business data obtained from the business system and by making predictions on the historical business data based on a prediction model. The target fields for data synchronization are determined based on the metadata of the target business party's document domain model, as well as the field mapping relationship between the target fields and the source fields; based on the field mapping relationship, the source fields corresponding to the target fields are determined in each field corresponding to the business data; the field mapping relationship is recorded in the pre-generated business association scheme corresponding to the document domain model. Extract the data corresponding to the source field from the business data, and synchronize the extracted data to the target field; Based on the target field and the data synchronized to the target field, a business document corresponding to the document domain model is generated.
2. The method according to claim 1, characterized in that, The target field includes fields stored in various types of databases. The step of extracting data corresponding to the source field from the business data and synchronizing the extracted data to the target field includes: Through the system interface of the business system, the data corresponding to the source field is extracted from the business data, and the extracted data is synchronized to the target field stored in various types of databases.
3. The method according to claim 1, characterized in that, The method further includes: Obtain the configuration data corresponding to the business data; Write the business data into the object storage file according to the configuration data; The step of extracting the data corresponding to the source field from the business data includes: Extract the data corresponding to the source field from the business data stored in the object storage file.
4. The method according to claim 3, characterized in that, The configuration data and the object storage file are stored in different storage areas.
5. The method according to claim 1, characterized in that, The business document includes a document header, a document body, and a sub-document body; generating the business document corresponding to the document domain model based on the target field and the data synchronized to the target field includes: Within the target field, determine the document header field, document body field, and sub-document body field; Generate a document header based on the document header field and the data synchronized to the document header field; Generate the document body under the document header based on the document body fields and the data synchronized to the document body fields; A sub-document body is generated under the document body based on the sub-document body fields and the data synchronized to the sub-document body fields; The business document consists of the document header, the document body, and the sub-document bodies.
6. The method according to claim 1, characterized in that, After synchronizing the extracted data to the target field, the method further includes: A synchronization event message is sent to the event center so that the event center can push the synchronization event message to each business party based on the business party identifier extracted from the synchronization event message.
7. A business document generation device, characterized in that, The device includes: The acquisition module is used to acquire business data from the big data cluster; the business data is obtained by the big data cluster acquiring historical business data from the business system and making predictions on the historical business data based on the prediction model. The determination module is used to determine the target field for data synchronization and the field mapping relationship between the target field and the source field based on the metadata of the document domain model of the target business party; based on the field mapping relationship, determine the source field corresponding to the target field in each field corresponding to the business data; the field mapping relationship is recorded in the pre-generated business association scheme corresponding to the document domain model; The synchronization module is used to extract the data corresponding to the source field from the business data and synchronize the extracted data to the target field. The generation module is used to generate a business document corresponding to the document domain model based on the target field and the data synchronized to the target field.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A 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 6.
10. A computer program product, comprising a computer program, 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 6.