General data exchange system based on configurable label structure
By using a general data exchange system based on a configurable tag structure, the problems of strong coupling between business logic and code and multi-database adaptation in existing technologies are solved, realizing the flexibility and self-optimization capabilities of the data exchange system and reducing maintenance costs.
Patent Information
- Application Number
- CN202610084454.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2046-01-22
AI Technical Summary
Existing data exchange systems suffer from problems such as strong coupling between business logic and code, difficulty in adapting to various database types and business standards, lack of automated environment deployment capabilities, and high maintenance costs.
A general data exchange system based on a configurable tag structure is adopted, including a parameter module, a business document module, a document logic module, and a standard adaptation module. By parsing the end solution title tags of both parties, an identity authentication mechanism is established, a data interaction parameter network is constructed, logic parsing and code decoupling are performed, and markup language script code is generated to realize the mapping between database physical fields and memory logical variables. Data extraction, cleaning, transformation, and transmission processing are performed, and a verification rule base is built to compare and verify the data content.
It decouples business logic from program code, improves system flexibility and versatility, enables rapid adaptation to heterogeneous systems, shortens interface development cycle, has the ability to self-optimize data quality, and reduces maintenance costs.
Smart Images

Figure CN121579581A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing and information integration, and in particular to a general data exchange system based on a configurable tag structure. BACKGROUND
[0002] In the era of enterprise digital transformation, there are a large number of data exchange requirements between various data carriers and information systems (such as ERP, WMS, POS, etc.). However, at present, enterprise data is mostly in an island state, and the data structures, database types (such as Oracle, MySQL, etc.) and business logics between different systems are different. The existing data exchange method often relies on hard-coded interface development, and whenever the business logic changes or new business documents are added, the source code needs to be modified and recompiled and published, resulting in high maintenance cost and slow response speed. In addition, based on the data asset management needs of enterprises, text data and file data (audio and video files, graphic image files, office documents, pdf documents, CAD documents, 3D documents, virtual simulation models, AR / VR documents, program codes and documents, etc.) and other data on various different media carriers need to be quickly stored into the system and reused between systems. At present, although there are some ETL tools or middleware, they are usually black boxes and lack explicit description ability of business logic, and cannot flexibly respond to complex business rule changes. The existing technology cannot simultaneously solve the problems of logical decoupling, multi-database adaptation, automated environment deployment and standard verification, especially in complex scenarios involving multi-party heterogeneous system interaction, there is a lack of a general system that can uniformly describe and execute exchange logic.
[0003] At present, the Chinese invention patent with application number CN201310716493.4 discloses a method and system for realizing general data exchange using xml, which includes the steps of: describing the structure of data in xml format, the data description includes field name and preset length field value and field start position information; when serializing, according to the xml description information, set the data field value to the specified position, and get the binary stream of the data after setting; when deserializing, according to the xml description information, read the corresponding field value from the binary stream using the field name of the data. The general design is adopted to deserialize the binary data stream, or to serialize the data into a binary data stream. The method of the invention makes it more convenient to maintain data in the CS architecture system, and even if a data structure is modified, the entire system does not need to be recompiled, and unnecessary network traffic is also reduced. However, the existing data exchange system has the problems of strong coupling between business logic and code, difficulty in adapting to multiple database types and business standards, lack of automated environment deployment capability, and high maintenance cost. SUMMARY
[0004] The technical problem solved by the present application is that the existing data exchange system has the problems of strong coupling between business logic and code, difficulty in adapting to multiple database types and business standards, lack of automated environment deployment capability, and high maintenance cost.
[0005] To solve the above technical problems, the present application provides the following technical solution: a general data exchange system based on a configurable label structure, comprising a parameter module, a business document module, a document logic module, and a standard adaptation module: The parameter module is used to parse the end scheme title label of both exchange parties, establish an identity authentication mechanism for both exchange parties, and establish a basic running environment for data exchange; The business document module is used to construct a data interaction parameter network for identifying data interaction paths based on preset exchange requirements, and establish a data structure definition based on the data interaction parameter network; The document logic module is used to perform logical analysis and code decoupling on the data structure definition, generate tokenization language script code and execution instructions, the logical analysis includes identifying logical step action labels and execution code categories according to logical step sequence numbers, and constructing an execution matrix through an action execution unit to realize the mapping of database physical fields and memory logical variables, and performing extraction, cleaning, conversion, and transmission processing on exchange data based on the execution instructions; The standard adaptation module is used to read end scheme standard related labels, construct a verification rule library to generate data content comparison and verification, and feed back the verification result to the parameter module to correct exchange rules and parameter configurations.
[0006] Preferably, the parameter module includes a header identification unit and an environment adaptation unit: Both exchange parties include a sender information system and a receiver information system involved in data interaction, the sender information system is the output source of data, including end system owner ID, end system owner name, and end system name, and the receiver information system is the target system entity to which the data is finally transmitted and stored; The header identification unit is used to parse the end scheme title label in the label structure file, extract the end scheme number, end scheme version number, end scheme standard related label, submitter information, and verification state, and establish an identity authentication mechanism for both exchange parties; The process of parsing the end scheme title label in the label structure file includes: using a label structure file parser to locate the first child node under the root node, and sequentially reading the text data wrapped inside the child node, the root node is an end exchange scheme, and the child node is an end scheme title, and the end scheme standard related label includes an end scheme execution standard number and an end scheme execution standard name; The submitter information includes an end scheme submitter ID, an end scheme submitter name and a scheme submitter phone, and the verification state is represented by a digital code for identifying the legality of the scheme; The identity authentication mechanism for the exchange parties includes: Step S001: reading an end system ID and an end system owner ID in a label structure file; Step S002: reading an end scheme submitter ID in the label structure file; Step S003: querying a user authority table and a system registry table in a local database to determine whether the end system ID in the label structure file is consistent with the end system ID registered in the local system and whether the end scheme submitter ID corresponds to the administrator authority or the data exchange authority in the local user authority table, and the identity authentication is passed only when the end system ID is consistent and the end scheme submitter ID corresponds to the administrator authority or the data exchange authority; When the end system ID is inconsistent or the end scheme submitter ID does not have the administrator authority or the data exchange authority, a label of an identity authentication failure exception is thrown.
[0007] Preferably, the environment adaptation unit is used to identify an end system database type label, the end system database type includes Oracle, MsSQL, MySQL and MongoDB, and to establish a connection session with a source end database and a target end database according to the end system owner ID and to configure the bottom-layer driving parameters for data interaction: The environment adaptation unit reads an end system database type and an end system owner ID in a label structure file, uses the end system owner ID as an index to find a database connection string corresponding to the index in an encryption configuration file or a registry table of the local system, and the database connection string specifically includes a database server IP address, a port number of the end system database type, a database instance name SID and a login username and password; According to the read end system database type, a corresponding Java database connection driving class is dynamically loaded; A connection method of the driving program is called, the URL, the login username and the password are input, a TCP handshake request is initiated to the database server, and the URL includes the Java database connection driving class, the database server IP address, the port number of the end system database type and the database instance name SID; After the TCP handshake succeeds, a database session object is created in the memory, the database session object is used to execute SQL statements, and the database session object is an instance of an implementation class of a Java interface.
[0008] Preferably, the business document module includes a data interaction parameter network construction unit, a structure definition unit and an additional item maintenance unit: The data interaction parameter network construction unit is configured to establish a data carrier mapping relationship set and construct a data interaction parameter network based on the data carrier mapping relationship set. The data interaction parameter network includes physical processes of data sending, data receiving, and intermediate table construction, and is configured to identify physical paths and logical associations of data flow directions between business documents. The establishment of the data carrier mapping relationship set specifically includes: The data carrier mapping relationship set is established by extracting a business theme keyword from a business document name of each business document node in the label structure file, extracting a database table name associated with the business document, extracting a prefix rule of the label structure file from a prefix of the business document name, and constructing a Map structure mapping set in the memory based on a dictionary combination format of the business theme keyword, the database table name, and the prefix rule. Based on the Map structure mapping set, the document flow direction label and the additional item creation label of each business document are parsed, discrete business documents are linked into a directed network, and specific physical processes are identified. The specific physical processes include a data sending physical process, a data receiving physical process, and an intermediate table construction physical process. The identification of the data sending physical process specifically includes: When the document flow direction labels of the first document and the second document are both sending, an outbound node is created in an initial empty network, and the initial pointing physical action of the outbound node is the initial pointing physical action of the initial empty network. The identification of the data receiving physical process specifically includes: When the document flow direction label of the third document is receiving, an inbound node is created in the network with the outbound node. The identification of the intermediate table construction physical process specifically includes: When the additional item creation labels of the first document and the third document are both 1, an environment initialization node is created in the network with the outbound node and the inbound node, and the environment initialization node is placed before the outbound node and the inbound node as a front-end dependency. The data interaction parameter network includes the outbound node, the inbound node, the environment initialization node, and pointers between the nodes.
[0009] Preferably, the structure definition unit is configured to establish a data structure definition based on the data interaction parameter network. The data structure definition includes configuration parameters of a business document serial number, a document file type, a document flow direction label, and an additional item creation label. The establishment of the data structure definition includes: A BusinessDocumentConfig object is instantiated in memory for each node in the data interaction parameter network, and the business document serial number, document file type, document flow direction label, and additional item creation label are extracted and stored in the corresponding BusinessDocumentConfig object in dictionary form. The structured data included in the BusinessDocumentConfig object of each node is output, and a structured configuration list is obtained, which is the completed data structure definition.
[0010] Preferably, the additional item maintenance unit is used to parse the create statement label in the label structure file and extract the SQL statement in the CDATA data segment. When the additional item creation label is activated, the additional item maintenance unit automatically executes the SQL statement in the client database to form a data table, view, sequence, trigger, and stored procedure. The additional item maintenance unit specifically includes: The configuration list of the data structure definition is traversed, and the value of the additional item creation label of each business document is checked. When the value of the additional item creation label is 0, the additional item maintenance unit is directly skipped without any operation. When the value of the additional item creation label is 1, the operation includes: The CDATA data segment is extracted using the label structure file parser. In the activated state, all text in the CDATA data segment is extracted and stored in the memory variable RawSQLScript as a long string. The create statement node in the label structure file is located. The long string is cut into a SQL statement list using the string splitting function split(";") with semicolons as boundaries. The SQL statement list is traversed, and the white space, line break, and tab characters before and after each statement are removed.
[0011] A multiplexing database session object is applied to the parameter module; A Connection.setAutoCommit(false) class is set, and a Statement object is instantiated to send SQL instructions; The SQL statement list is traversed, and each statement is executed with exception capture, execution instruction, and fault tolerance processing. The exception capture operation includes wrapping each execution operation in a try-catch block. The execution instruction operation includes calling Statement.execute(sqlString). The fault tolerance processing operation includes: When the exception of the existing table is captured when the CREATE TABLE is executed, the exception is handled according to the preset strategy; When all the SQL statements in the SQL statement list are tried to be executed, Connection.commit() is called, all the structure changes are permanently saved to the end system database, the Statement object is closed, and the cursor resource of the end system database is released.
[0012] Preferably, the document logic module comprises a logic step parsing unit and an action executing unit. The logic step parsing unit is used for loading the business logic in sequence according to the logic step serial number, identifying the logic step action label and the execution code category, the logic step action label comprising GET, CREATE_XML, UP_XML and DOWN_XML, and the execution code category comprising SQL and CODE, and identifying the following: The label structure file parser filters all the logic blocks with the business document serial number equal to the current business document ID by traversing the DOM tree, loads the logic blocks into the memory to form a list of logic nodes to be processed, reads the logic step serial number of each logic node, and rearranges the list of logic nodes by using a quick sorting algorithm. The sorted list of logic nodes is sequentially traversed, and each logic node is parsed, the parsing operation steps comprising: Step S201: reading the text value of the logic step action label; If the text value of the logic step action label is GET, the current logic step action label is marked as data extraction, and the database reading mode is entered; If the text value of the logic step action label is CREATE_XML, the current logic step action label is marked as file generation, and the XML builder is called; If the text value of the logic step action label is UP_XML, the current logic step action label is marked as file uploading, and the FTP client is called; If the text value of the logic step action label is DOWN_XML, the current logic step action label is marked as file downloading and warehousing, and the FTP downloader and the SQL inserter are called; Step S202: reading the text value of the execution code category label; If the execution code category label value is SQL, the SQL interpreter is activated, the SQL category label is read, the SQL category label comprising query and update, the judgment result of the query operation or the update operation is obtained, and the table view name is read; If the execution code category label value is CODE, the code segment interpreter is activated, and the function call instruction in the code segment label is parsed. Step S203: constructing a LogicStepContext object in the memory, the LogicStepContext object being used to encapsulate all metadata, including a logic step serial number, a logic step action label, an execution code category label, a table view name, and a field label; Step S204: based on the logic node list, outputting an ordered executable logic queue composed of metadata corresponding to each logic node.
[0013] Preferably, the action execution unit is configured to construct an execution matrix based on the analysis result of the logic step analysis unit, and the construction of the execution matrix comprises: The action execution unit receives a current logic step in the ordered executable logic queue output by the logic step analysis unit, and extracts original text content including a corresponding field label from the current logic step, the field label including a mapping string in the format of {table name, field name, field type, variable name}, parses and structurally stores each mapping string, and constructs a field variable mapping table, i.e., the execution matrix. The construction of the field variable mapping table comprises: The mapping string is disassembled into four independent metadata items, including a table name, a field name, a field type, and a variable name, using a comma separator, and the disassembly result is stored in a table structure in the memory to form the format of the execution matrix, wherein the rows of the execution matrix represent the physical field meanings of the disassembly result, and the lists of the execution matrix represent the meanings of the converted memory variables, i.e., the logic variables. The execution matrix is used to map the physical field values in the end system database to the logic variable values in the memory, and to reversely map the logic variable values in the memory to the physical field values in the end system database. The action execution unit reads the logic step action label and the execution code category in the logic step context. When the execution code category is SQL: For a query operation SELECT, when the logic step action label is GET, a SQL generator is called to automatically generate an executable SELECT statement using the corresponding relationship between the table name and the field name or the variable name extracted from the field variable mapping table, so as to read data from the end system database and store it in the memory variable. For an insertion operation INSERT, when the logic step action label is DOWN_XML and the end system database needs to be written, a SQL generator is called to automatically generate a parameterized INSERT statement using the table name and the field name or the variable name defined in the field variable mapping table, so as to write the memory variable into the end system database table. When the execution code category is CODE: The code segment label is parsed to extract the name of the end system built-in process. The corresponding process call instruction is initialized, and the process call instruction includes a label structure file generation and an FTP transmission operation.
[0014] Preferably, the action execution unit further comprises: The data extraction GET is executed, and the data extraction GET includes: After the end system database returns the result set after executing the SELECT statement, each row of data in the result set is traversed, and values read by the physical fields in the end system database are assigned to corresponding logical variables in the memory according to the execution matrix; The file generation CREATE_XML is executed, and the file generation CREATE_XML includes: The action type is identified as CREATE_XML, a preset label structure file generation process is called, corresponding logical variable values are read from the memory based on variable names defined in the execution matrix, the logical variable values are filled into nodes corresponding to the details part of the label structure file, and an exchange file conforming to a preset prefix rule is generated; The file download and storage DOWN_XML is executed, and the file download and storage DOWN_XML includes: The action type is identified as DOWN_XML, an FTP download operation is performed, the label structure file is downloaded to the local, the downloaded label structure file is parsed, logical nodes of the label structure file are traversed, data in the logical nodes of the label structure file is parsed and assigned to corresponding memory variables according to the mapping relationship in the execution matrix, and an INSERT statement is executed, wherein the memory variable values after the parsing are used as parameters and are automatically written into a database table defined by the business document module.
[0015] Preferably, the standard adaptation module comprises: The end scheme execution standard number is read by locating the end scheme standard related label in the parameter module through the label structure file parser, the corresponding verification rule set is loaded in the preset local rule repository according to the extracted end scheme execution standard number, and a verification rule library in the memory is formed; All specific verification rules in the local rule repository associated with the end scheme execution standard number are loaded, and the specific verification rules are stored in the verification rule library in an XML structured format; The verification rule library is imported into the rule engine in the memory for data comparison, and the specific comparison operation steps of the rule engine include: The standard adaptation module waits for the document logical module to complete the data generation and parsing operation, receives a reference of the exchange file generated by the action execution unit, receives a data object set parsed from the XML file by the action execution unit and stored in the memory, and obtains the to-be-verified data output; The content of the to-be-verified data is traversed, and each item is compared using the verification rule library: Traverse each data record in the data set, sequentially apply all rules in the rule library to each data record for rule comparison, when any rule check fails, record an error message, the error message includes: rule violation data record ID, rule violation field name, rule violation description and end scheme execution standard number; After the check is completed, according to the record situation of the error information, the subsequent data exchange process is decided, and the judgment basis includes: When there is no record of any error or only non-fatal error information is recorded, the result is marked as passing the check; When any fatal error information is recorded, the result is marked as failing the check, and the error information is packaged and fed back to the parameter module, after the parameter module receives the feedback of failing the check, the subsequent data exchange process is adjusted according to the control strategy, and the control strategy includes: When the sender fails the check, the single document logic module is blocked from executing the subsequent UP_XML instruction; When the receiver fails the check, the single document logic module is blocked from executing the subsequent INSERT instruction; Output detailed error information on the user interface and prompt the user to modify the business logic configuration and source data in the tag structure file according to the feedback error details.
[0016] The beneficial effects of the present application: the present application positions the logic root cause of data interaction parameter network by constructing, and implements innovative logic decoupling strategy, which fundamentally eliminates the strong coupling between business logic and program code, and avoids the maintenance difficulty brought by hard coding development, so that the generality and flexibility of the data exchange system are essentially improved. The system has the characteristics of structured insight and strong configurability, no longer depends on fixed interface code, but cooperates with data reading, environment deployment and file transmission, especially uses the self-description characteristics of nested tag structure to realize the rapid adaptation to heterogeneous systems, can effectively cope with database type change and other environmental disturbances, and greatly shortens the interface development cycle. Combined with standard adaptation check, the system can continuously optimize data quality, has strong self-adaptive ability to execution standard change and business rule adjustment, and guarantees the stability and compliance of long-term data interaction. The system has the advantage of strong explainability, the core logic is based on textual tag structure, and the configuration and execution process has clear business meaning, which is convenient for engineers to understand, diagnose and maintain. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A basic flowchart of a general data exchange system based on a configurable tag structure is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments.
[0019] With reference to Figure 1 For an embodiment of the present application, a general data exchange system based on a configurable tag structure is provided, including a parameter module, a business document module, a document logic module and a standard adaptation module: The parameter module is used to parse the end scheme title tag of the exchange parties, establish the identity authentication mechanism of the exchange parties, and establish the basic running environment of data exchange; The business document module is used to construct a data interaction parameter network for identifying data interaction paths based on preset exchange requirements, and establish a data structure definition based on the data interaction parameter network; The document logic module is used to logically parse and code decouple the data structure definition, generate tokenization language script code and execution instructions, the logical parsing includes identifying logical step action tags and execution code categories according to logical step sequence numbers, and constructing an execution matrix through an action execution unit to realize the mapping of database physical fields and memory logical variables, and based on the execution instructions, the exchange data is extracted, cleaned, converted and transmitted; The standard adaptation module is used to read the end scheme standard related tags, construct a verification rule library to generate data content comparison and verification, and feed back the verification result to the parameter module to correct the exchange rules and parameter configuration.
[0020] The present application constructs a closed-loop general data exchange system that can understand data from the structural level, intelligently configure, multi-dimensionally coordinate execution and continuously adapt standards, thereby realizing precise control of data exchange between heterogeneous systems. The core idea is to separate business logic and program code, realize dynamic configuration of data interaction logic, and the control object is the coordinated output of three control variables of system parameters, data structure and logical steps.
[0021] By introducing active, dynamic and accurate parsing of tag structure files, and coordinating this parsing capability with traditional database interaction through a logical decoupling model, the leap from hard-coded interfaces to configurable general exchange is realized. It can respond to business changes more quickly, adapt to different databases more flexibly, and intelligently follow industry standards, ultimately providing an ultimate solution for high-quality, low-cost enterprise data integration.
[0022] The parameter module includes a header identification unit and an environment adaptation unit: The exchange parties include a sender information system and a receiver information system participating in data interaction, the sender information system is a data output source, and includes an end system owner ID, an end system owner name and an end system name, and the receiver information system is a target system entity to which data is finally transmitted and which performs warehousing operation; The head identification unit is used for parsing an end scheme title tag in the label structure file, extracting an end scheme number, an end scheme version number, an end scheme standard related tag, submitter information and a check state, and establishing an identity authentication mechanism of the exchange parties; The process of parsing the end scheme title tag in the label structure file includes: locating to the first child node under the root node by using the label structure file parser, and reading text data wrapped in the child node in sequence, the root node is an end exchange scheme, the child node is an end scheme title, and the end scheme standard related tag includes an end scheme execution standard number and an end scheme execution standard name; The submitter information includes an end scheme submitter ID, an end scheme submitter name and a scheme submitter phone, and the check state is represented by a digital code for identifying the legality of the scheme; The identity authentication mechanism of the exchange parties includes: Step S001: reading an end system ID and an end system owner ID in the label structure file; Step S002: reading an end scheme submitter ID in the label structure file; Step S003: querying a user authority table and a system registration table in a local database, judging whether the end system ID in the label structure file is consistent with the end system ID registered in the local system, and judging whether the end scheme submitter ID corresponds to administrator authority or data exchange authority in the local user authority table, and the identity authentication is passed only when the end system ID is consistent and the end scheme submitter ID corresponds to the administrator authority or the data exchange authority; When the end system ID is inconsistent or the end scheme submitter ID does not have the administrator authority or the data exchange authority, a label of an identity authentication failure exception is thrown.
[0023] The reading of the text data wrapped in the child node includes: Step S011: identifying a data identification tag, and determining that the current is in a head information area when the value of the data identification tag is Header; Step S012: reading text 1 in an end scheme number tag; Step S013: reading text "Yunyin publishing ERP system_V1.0_circulation information" in an end scheme name tag; Step S014: reading text 1.0 in an end scheme version number tag; Step S015: read the text in the end scheme submission time tag, for example, "2021-06-17 07:00:01"; The read string is stored in the Header object in the memory for subsequent module calls; The tag structure file parser includes a DOM parser and a SAX parser; The verification state specifically includes: 0 represents unverified; 1 represents verification passed; 2 represents partial verification passed; 3 represents failed verification; 4 represents unknown state.
[0024] The identity authentication mechanism is a permission verification logic based on matching of the end system ID and the end system owner ID, which ensures that the imported tag structure file configuration scheme is created by a legal end system owner, and the currently running end system has the permission to execute the tag structure file configuration scheme.
[0025] The environment adaptation unit is used to identify the end system database type tag, the end system database types include Oracle, MsSQL, MySQL and MongoDB, and to establish a connection session with the source end database and the target end database according to the end system owner ID, and to configure the underlying driving parameters of data interaction: The environment adaptation unit reads the end system database type and the end system owner ID in the tag structure file, uses the end system owner ID as an index to find the database connection string corresponding to the index in the local system's encryption configuration file or registry, and the database connection string specifically includes the database server IP address, the port number of the end system database type, the database instance name SID and the login username and password; According to the read end system database type, the corresponding Java database connection driver class (such as oracle.jdbc.driver.OracleDriver) is dynamically loaded; The connection method (such as DriverManager.getConnection) of the driver is called, the URL, login username and password are passed in, a TCP handshake request is sent to the database server, and the URL includes the Java database connection driver class, the database server IP address, the port number of the end system database type and the database instance name SID; After the TCP handshake is successful, a database session object is created in the memory, the database session object is used to execute SQL statements, and the database session object is an instance of a Java interface implementation class.
[0026] The database session object is not just a simple network link, but a complex memory object containing network socket, transaction state, user permission context; In the embodiment, the creating of the database session object comprises: The class loader is called to load the Java database connection driver class in the previously configured underlying drive parameters into the method area of the Java virtual machine (JVM), the URL, the login username and the password are directly passed as parameters, the connection method of the driver program is called, the driver program initiates a network request immediately, initiates a TCP three-way handshake to the IP address and port specified in the URL, establishes a physical TCP data transmission channel at the operating system level, after the TCP channel is established, the driver program sends a protocol packet (TNS protocol) through the TCP channel, the server corresponding to the type of the end system database checks the legality of the account, if it is passed, a PGA area is allocated in the server memory, a unique Session ID is generated, after the authentication is passed, the driver program instantiates a Connection object in the heap memory of the client (i.e. the general data exchange system) through the new operator, the Connection object encapsulates the established TCP Socket reference, the Session ID returned by the server and the automatic commit state of the transaction, the Connection object is returned to the environment adaptation unit and is marked as active, all subsequent CREATE TABLE or SELECT instructions must be sent to the database by calling the methods of the Connection object.
[0027] This design provides the system with comprehensive environment perception ability and multi-dimensional connection adaptation ability, and is the basis for realizing general data exchange.
[0028] When the new system is first accessed or the scheme is initialized, the parameter identification stage is entered, the engineer inputs the end system ID, the owner name and the end system database type information, the basic running environment of the system is automatically established, the environment differences are identified, for example, the source end is Oracle and the target end is MySQL.
[0029] The intelligent exchange system provides high-quality, multi-dimensional environment input and powerful, multi-database adaptation ability, realizes general adaptation instead of customized development, expands the control object from a single system to multiple heterogeneous databases through unified tag description and dynamic driver loading, and is the premise of crossing from a special interface to general exchange.
[0030] The parameter module realizes environment perception and general adaptation of the system. By analyzing the end scheme title, version and submitter information, the system establishes an identity authentication mechanism based on ID matching, ensuring the execution safety of the configuration scheme. More importantly, through the environment adaptation unit, the Oracle and MsSQL heterogeneous database types are identified, and the driver is dynamically loaded to create a database session object containing transaction status, thereby providing multi-dimensional connection adaptation capability and solving the problem of rigid traditional interface and difficulty in adapting to multiple databases, which is the premise of realizing general exchange across.
[0031] The business document module includes a data interaction parameter network construction unit, a structure definition unit and an additional item maintenance unit: The data interaction parameter network construction unit is used to establish a data carrier mapping relationship set and construct a data interaction parameter network based on the data carrier mapping relationship set. The data interaction parameter network includes the physical processes of data sending, data receiving and intermediate table construction, and is used to identify the physical path and logical association of data flow between business documents. Establishing the data carrier mapping relationship set specifically includes: Traverse all business document nodes in the label structure file, extract the business theme keywords from the business document name of the business document node, extract the database table name associated with the business document, extract the prefix rule of the label structure file from the prefix of the business document name, and construct a Map structure mapping set in memory based on the dictionary combination format of the business theme keywords, database table name and prefix rule; The business theme keywords are, for example, book commodity information, book inventory information and purchase order information. The database table name is, for example, GDI_T_DS and GDI_T_ORDER. The prefix rule is, for example, sender code_receiver code_book commodity information. The Map structure mapping set is, for example: { "document 1": { "DB_Table": "GDI_T_DS", "File_Prefix": "book commodity information_"},...}. This establishes the binding relationship that book data must be stored in the GDI_T_DS table and transmitted through book commodity information_*.XML. The database table name associated with the business document is obtained by big data collection; Based on the Map structure mapping set, the document flow label and the additional item label of each business document are analyzed to link the discrete business documents into a directed network, identify specific physical processes, and the specific physical processes include data sending physical process, data receiving physical process and intermediate table construction physical process; The identification of the data sending physical process specifically includes: When the document flow direction tags of the first document and the second document are both sending, an outbound node is created in the initial empty network, and the initial pointing physical action of the outbound node is the initial pointing physical action of the initial empty network; The initial pointing physical action is, for example, "Database (GDI_V_DS) -> Tag Structure File Generator -> FTP Upload"; The identifying data receiving physical process specifically includes: When the document flow direction tag of the third document is receiving, an inbound node is created in the network with the outbound node; The pointing physical action of the inbound node is, for example, "FTP Download -> Tag Structure File Parser -> Database (GDI_T_ORDER)"; The identifying intermediate table construction physical process specifically includes: When the whether to create additional items tags of the first document and the third document are both 1, an environment initialization node is created in the network with the outbound node and the inbound node, and the environment initialization node is placed before the outbound node and the inbound node as a front-end dependency; The pointing physical action of the environment initialization node is, for example, "Execute SQL (CREATE TABLE...)"; The data interaction parameter net including the outbound node, the inbound node, the environment initialization node and the pointers between the nodes is obtained, and the data interaction parameter net is, for example, "Init Node -> [Outbound Node 1, Outbound Node 2, Inbound Node 3]".
[0032] The core task of this unit is to parse the static description in the tag structure file into a dynamic data network model in the memory with associated relationships.
[0033] The structure definition unit is used to establish a data structure definition based on the data interaction parameter net, and the data structure definition includes the configuration parameters of the business document serial number, the document file type, the document flow direction tag and the whether to create additional items tag, and the establishment of the data structure definition process includes: For each node in the data interaction parameter network, instantiate a BusinessDocumentConfig object in memory, extract the business document number, document file type, document flow label, and whether to create additional items label, and store the business document number, document file type, document flow label, and whether to create additional items label in the form of a dictionary into the corresponding BusinessDocumentConfig object. Output the structured data included in the BusinessDocumentConfig objects of all nodes to obtain a structured configuration list. The structured configuration list is the established data structure definition.
[0034] The business document sequence number determines the execution priority and index key of each node in the parameter network; The document file type is used to configure the serializer used by subsequent logic modules. Here, we specify the tag structure file generator instead of the JSON generator. The document flow direction label is used to set the direction flag of the data flow. If the document flow direction label is "send", the read-to-database and write-to-file mode is activated. If the document flow direction label is "receive", the read-to-file and write-to-database mode is activated. The "Whether to create an extra item" label is a Boolean switch. If the "create extra item" label is 1, extract the CDATA SQL script from the creation statement and mark the business document as needing to perform an environment self-check before running. If the additional item label is set to 0, the business document is marked as ready to run without any environment changes. A structured configuration list structure is as follows: { "ID": 1, "Type": "Tag structure file", "Direction": "SEND", "NeedInit":true, "SQL": "CREATE TABLE..."}; { "ID": 2, "Type": "Tag structure file", "Direction": "SEND", "NeedInit":false, "SQL": null}; { "ID": 3, "Type": "Tag structure file", "Direction": "RECV", "NeedInit":true, "SQL": "CREATE TABLE..."}; The task of this unit is to concretize the node attributes in the data interaction parameter network into configuration parameter objects that can be called by the program.
[0035] The additional item maintenance unit is used for parsing the create statement tag in the label structure file, extracting the SQL statement in the CDATA data segment, and automatically executing the SQL statement in the client database when the additional item creation tag is activated, to build the additional data table and view.
[0036] The document flow state is divided into sending and receiving, and the document file type is divided into label structure file and JSON. The traditional manual table building method is abandoned. By constructing a label-based description network, subsequent data structure maintenance has clear automatic execution capability. For example, the book commodity information document needs to create GDI_T_DS table and GDI_V_DS view. This makes the system more intelligent, self-sufficient, and easy to implement when deploying new businesses. It provides structural support for subsequent logic execution, avoids exchange failure due to missing table structure, and improves deployment accuracy and efficiency.
[0037] The additional item maintenance unit is used for parsing the create statement tag in the label structure file, extracting the SQL statement in the CDATA data segment, and automatically executing the SQL statement in the client database when the additional item creation tag is activated, to build the data table, view, sequence, trigger and stored procedure required to realize data exchange, realize the automatic deployment and maintenance of local data environment, and the additional item maintenance unit specifically includes: Traverse the configuration list defined by the data structure, check the value of the additional item creation tag of each business document, and when the value of the additional item creation tag is 0, directly skip the additional item maintenance unit without any operation; When the value of the additional item creation tag is 1, the operation includes: Use the label structure file parser to extract the CDATA data segment, and in the activated state, extract all the text in the CDATA data segment, store all the text as a long string in the memory variable RawSQLScript, and locate the create statement node in the label structure file; Use the string splitting function split(";") to cut the long string into a SQL statement list with semicolons as boundaries, traverse the SQL statement list, remove the white spaces, line breaks and tabs before and after each statement, and ensure that each statement is clean and executable instruction.
[0038] Since the extracted RawSQLScript may contain multiple SQL statements (separated by semicolons), the system cannot directly execute them at once and needs to be preprocessed.
[0039] Apply for a reusable database session object to the parameter module; Call DBManager.getConnection() to get the current active Oracle database connection handle.
[0040] Set the Connection.setAutoCommit(false) class, instantiate a Statement object, and send SQL instructions. To ensure the atomicity of table creation (either all successful or all failed), start a database transaction on the connection object.
[0041] Iterate through the SQL statement list and perform exception capture, execution instruction, and error handling operations. Exception capture operations include wrapping each execution operation in a try-catch block, execution instruction operations include calling Statement.execute(sqlString), and error handling operations include: When executing CREATE TABLE, capture the exception that the table already exists, and perform exception handling according to the preset policy (Drop first, then Create), or record a warning in the log to ensure that the process does not interrupt; The execution instruction operation process includes: executing CREATE TABLE PO.GDI_T_DS to create a single book table in the database, and executing CREATE OR REPLACE FORCE VIEW to create a view in the database. After all SQL statements in the SQL statement list have been attempted to execute, call Connection.commit() to permanently save all structure changes to the end system database, close the Statement object, and release the cursor resources of the end system database.
[0042] Through the above steps, without any manual intervention, the required table (GDI_T_DS) and view (GDI_V_DS) infrastructure for data exchange is automatically constructed in the client's Oracle database, achieving automated deployment of the local data environment.
[0043] The business document module realizes the structured insight of data structure and the automated deployment of the environment. By constructing a data interaction parameter network, the system can accurately identify the physical path and logical association of data, providing structural support for subsequent logical processing. In particular, the additional item maintenance unit, by parsing the CDATA SQL script in the label structure file, realizes the automatic execution of table creation, view creation, and other operations in the client database, abandoning the traditional manual table creation method, greatly improving the accuracy and efficiency of new business deployment, and is an important embodiment of the system's automation capability.
[0044] The document logic module comprises a logic step parsing unit and an action executing unit. The logic step parsing unit is used for loading service logic in sequence according to a logic step serial number, identifying a logic step action label and an executing code category, the logic step action label comprising GET, CREATE_XML, UP_XML and DOWN_XML, and the executing code category comprising SQL and CODE, and the identification comprising: The label structure file parser filters all logic blocks with a service document serial number equal to a current service document ID by traversing a DOM tree, loads the logic blocks into a memory to form a list of logic nodes to be processed, reads a logic step serial number of each logic node, and rearranges the list of logic nodes by a quick sorting algorithm. The list needs to be sorted in ascending order according to the logic step serial number label due to the fact that the node order in the label structure file is not strictly defined.
[0045] The list of logic nodes is sequentially traversed and sorted, and each logic node is parsed, the parsing operation steps comprising: Step S201: reading a text value of the logic step action label; If the text value of the logic step action label is GET, the current logic step action label is marked as data extraction, and a database reading mode is entered; If the text value of the logic step action label is CREATE_XML, the current logic step action label is marked as file generation, and an XML builder is called; If the text value of the logic step action label is UP_XML, the current logic step action label is marked as file uploading, and an FTP client is called; If the text value of the logic step action label is DOWN_XML, the current logic step action label is marked as file downloading and warehousing, and an FTP downloader and a SQL inserter are called; Step S202: reading a text value of the executing code category label; If the text value of the executing code category label is SQL, a SQL interpreter is activated, a SQL category label is read, the SQL category label comprising query and update, a judgment result of a query operation or an update operation is obtained, a table view name (GDI_V_DS) is read, and an operation object is locked; If the text value of the executing code category label is CODE, a code segment interpreter is activated, and a function call instruction (XML_START_PRO) in a code segment label is parsed; Step S203: a LogicStepContext object is built in the memory, the LogicStepContext object being used for encapsulating all metadata, the metadata comprising a logic step serial number, a logic step action label, an executing code category label, a table view name and a field label; Step S204: Based on the logical node list, output the ordered executable logic queue composed of metadata corresponding to each logical node.
[0046] The field tag is the original input for decoupling mapping analysis by the action execution unit, which is derived from the configuration of a specific logical step in the tag structure file. The logical step parsing unit uses a tag structure file parser to locate the business document logical node corresponding to the business document ID being processed in the tag structure file. When traversing the logical block, the parser reads the field tags involved under each logical step, which internally contain the original text content of the mapping string in the format of {table name, field name, field type, variable name}. The logical step parsing unit encapsulates this original text content as part of the metadata into the in-memory LogicStepContext object. This context object containing the field tags is output as part of the ordered executable logic queue and passed to the action execution unit, which further analyzes and constructs the execution matrix.
[0047] An ordered executable logic queue is output, such as "[Step1(GET, SQL), Step2(CREATE_XML, CODE), Step3(UP_XML, CODE)]". This queue will be passed to the action execution unit to actually run.
[0048] In form, a logical step is an atomic operation of data exchange, and by combining the actions of GET, CREATE_XML, and UP_tag structure files, complex exchange processes can be described with a simple sequence of tags.
[0049] The action execution unit is used to construct an execution matrix based on the parsing results of the logical step parsing unit, which includes: The action execution unit receives the current logical step in the ordered executable logic queue output by the logical step parsing unit and extracts the original text content including the corresponding field tags from the current logical step. The field tags include mapping strings in the format of {table name, field name, field type, variable name}. Each mapping string is parsed and structuredly stored to construct a field variable mapping table, which is the execution matrix. In this embodiment, the field tag {GDI_V_DS, BNAME, C, V_BNAME} is identified and extracted. The field tag tells the action execution unit which physical fields need to be processed in the current logical step, and which logical variable in memory should be mapped to these fields. The table name and field name guide the SQL generator to build the correct SELECT or INSERT statement, and the variable name guides the data binding process. The field tag completely separates the physical definition of the data field (table and field name in the database) from the logical definition (variable name in memory). Developers or business configuration personnel no longer need to directly write underlying SQL code. They only need to configure the required mapping relationship in the field tag. The action execution unit is responsible for interpreting these tags and dynamically generating underlying code, thereby effectively weakening or even eliminating the impact of hard coding.
[0050] Building the field variable mapping table includes: The mapping string is split into four independent metadata items using the comma separator. The metadata items include the table name, field name, field type, and variable name. The split results are stored in a table structure in memory to form the execution matrix format. The rows of the execution matrix represent the physical field meaning of the split results, and the columns represent the meaning of the converted memory variables. The memory variables are the logical variables. The execution matrix is used to map the physical field values in the end system database to the logical variable values in memory and to map the logical variable values in memory to the physical field values in the end system database. Mapping the physical field values in the end system database to the logical variable values in memory includes GET and DOWN_XML parsing. Mapping the logical variable values in memory to the physical field values in the end system database includes generating INSERT statements based on CREATE_XML and DOWN_XML.
[0051] The action execution unit executes the SELECT statement to read data from the physical fields and assigns the values to the corresponding logical variables. The action execution unit executes the INSERT statement to write the values stored in the logical variables to the corresponding physical fields. The action execution unit calls the built-in process to fill the values stored in the logical variables into the corresponding nodes of the tag structure file. This phase is used to establish the correspondence between the physical meaning of the data field and the logical meaning of the memory variable, i.e., to build the execution matrix.
[0052] The action execution unit reads the logical step action tag and the execution code category in the logical step context. When the execution code category is SQL: For the query operation SELECT, when the logical step action label is GET, the SQL generator is called to automatically generate an executable SELECT statement using the corresponding relationship between the table name and the field name or variable name extracted from the field variable mapping table, to read data from the end system database and store it in a memory variable; For the insert operation INSERT, when the logical step action label is DOWN_XML and the end system database needs to be written, the SQL generator is called to automatically generate a parameterized INSERT statement using the table name and field name or variable name defined in the field variable mapping table, to write the memory variable to the end system database table; When the execution code category is CODE: Parse the code segment label to extract the name of the end system built-in process (e.g., XML_XM_PRO); Initialize the corresponding process call instruction, which includes label structure file generation and FTP transmission operations.
[0053] In this phase, the logic step description is converted into computer executable instructions according to the action type and code category of the current logic step.
[0054] The document logic module supports logical reuse, allowing common data processing logic to be encapsulated as standardized code segments, which can be called and combined through the logic step sequence number to achieve modular construction of complex business logic.
[0055] The action execution unit also includes: Execution data extraction GET includes: After executing the SELECT statement and the end system database returning the result set, each row of data in the result set is traversed, and the values read from the physical fields in the end system database are assigned to the corresponding logical variables in memory based on the execution matrix, completing the conversion from the database to the memory; Execution of file generation CREATE_XML includes: Identify the action type as CREATE_XML, call the pre-set label structure file generation process (such as XML_XM_PRO), read the corresponding logical variable values from memory based on the variable names defined in the execution matrix, fill the logical variable values into the corresponding nodes in the detail part of the label structure file, and generate an exchange file that meets the pre-set prefix rules; Execution of file download and storage DOWN_XML includes: The action type is DOWN_XML, the FTP download operation is executed, the tag structure file is downloaded to the local, the downloaded tag structure file is parsed, the logical nodes of the tag structure file are traversed, the data in the logical nodes of the tag structure file are parsed and assigned to corresponding memory variables according to the mapping relationship in the execution matrix (such as parsing the purchase order number node data into V_PNO), the INSERT statement is executed, the parsed memory variable value is taken as a parameter, and the file-to-database conversion is completed.
[0056] Through the above detailed steps, the action execution unit as an interpreter realizes efficient conversion of the business rules defined by the tags into computer executable code, greatly improving the development efficiency and adaptability of the system.
[0057] In this stage, data extraction, conversion, generation or writing are completed according to the initialized script and mapping table.
[0058] In terms of technology, the action execution unit is an interpreter that converts the business rules defined by the tags into computer executable code (SQL language and script), greatly simplifying the development work; In this embodiment, the logical step 1 is to take out the new product data of the book commodity, the action type is GET, the execution code category is SQL, the field tags involved are parsed, and a SELECT statement is automatically generated to read data from the view GDI_V_DS and store it in a variable.
[0059] The logical step 2 is to generate a tag structure file, the action type is CREATE_XML, the built-in process XML_XM_PRO is called, and the variable obtained in the previous step is used to fill the tag structure file nodes; The logical step 3 is to download the purchase order and write data to the table, the action type is DOWN_XML, the tag structure file is parsed, and the mapping table GDI_T_ORDER, PNO, C, V_PNO is used to automatically generate an INSERT statement.
[0060] Through the decoupling operation of this action execution unit, the influence of hard coding can be effectively weakened or even eliminated, while the flexibility of business logic is preserved. This process not only improves the development efficiency of the system, but also significantly enhances its maintainability and adaptability.
[0061] The bill logic module only needs to manage a few independent and well-defined logical steps, and its work becomes extremely simple and efficient. How to coordinate and mobilize all underlying resources to accurately implement data reading and writing is perfectly completed by this execution matrix.
[0062] In this way, the system realizes a fundamental change from passive, rigid code writing to active, flexible configuration generation, thereby achieving stronger adaptability and response speed.
[0063] The document logic module realizes the core creative effect of the application, that is, complete decoupling and dynamic execution of business logic. The logic step analysis unit atomizes a complex business process into an ordered logic queue (GET, CREATE_XML, DOWN_XML). The action execution unit, as a core interpreter, constructs a field variable mapping table (execution matrix) by analyzing field tags, and performs bidirectional mapping between database physical fields and memory logical variables. This mechanism enables the system to dynamically generate executable SQL statements or built-in process call instructions, thereby efficiently converting business rules defined by tags into computer code, effectively weakening or even eliminating the impact of hard coding, and significantly enhancing the maintainability and adaptability of the system.
[0064] The standard adaptation module includes: Through the tag structure file parser, the end scheme standard related tags in the parameter module are located, the text value of the end scheme execution standard number is read, the corresponding verification rule set in the preset local rule repository is loaded according to the extracted end scheme execution standard number, and a verification rule library in memory is formed; All specific verification rules in the local rule repository associated with the end scheme execution standard number are loaded, and the specific verification rules are stored in the verification rule library in an XML structured format; An example of the content of the specific verification rule is as follows: The data type rule is that the field V_ISBN must be 13 digits; The value range rule is that the field V_PRICE must be greater than 0; The mandatory rule is that the field V_BNAME cannot be empty; The verification rule library is imported into the rule engine in memory for data comparison, and the specific comparison operation steps of the rule engine include: The standard adaptation module waits for the document logic module to complete the data generation and analysis operation, receives the reference of the exchange file generated by the action execution unit, receives the data object set parsed from the XML file by the action execution unit and stored in the memory, and obtains the output data to be verified; The contents of the data to be verified are traversed, and each item is compared using the verification rule library: Each data record in the data set is traversed, and all rules in the verification rule library are applied to each data record for rule comparison. When any rule verification fails, an error message is recorded, including the rule violation data record ID, the rule violation field name, the rule description, and the end scheme execution standard number; For example, for the field V_ISBN, the rule of length equal to 13 and all digits is executed; if the value of V_PRICE is negative, an error message is recorded immediately; After the check is completed, the subsequent data exchange process is determined according to the record of the error message, and the judgment basis includes: When there is no record of any error or only non-fatal error information is recorded, the result is marked as passing the check (corresponding to the check status code "1" or "2"); When any fatal error information is recorded, the result is marked as failing the check (corresponding to the check status code "3"), and the error information is packaged and fed back to the parameter module. After receiving the feedback of failing the check, the parameter module adjusts the subsequent data exchange process according to the control strategy, and the control strategy includes: When the sender fails the check, the single document logic module is blocked from executing the subsequent UP_XML instruction; When the receiver fails the check, the single document logic module is blocked from executing the subsequent INSERT instruction; Detailed error information is output on the user interface, and the user is prompted to modify the business logic configuration and source data in the tag structure file according to the feedback error details to correct the configuration, thereby realizing real-time control and guaranteeing compliance of data quality.
[0065] Non-fatal error information indicates error information that does not affect the identification, storage, and continued execution of core business processes of data records, and fatal error information indicates error information that must be corrected, otherwise data exchange will cause business processes to be interrupted, data integrity to be damaged, or legal compliance to be severely lacking.
[0066] The check rule library structure is a set of XML Schema Definition (XSD) files, which are used to constrain the structure and data content of the tag structure file. When the CREATE_XML file is executed, the standard adaptation module calls the XML Schema checker to compare the generated tag structure file with the XSD defined in the rule library to ensure that the data structure conforms to the industry standard. For content checking (such as numerical range, enumeration value), it is implemented by executing the pre-defined business checking script.
[0067] Significantly improve data quality and compliance, automatic checking reduces the omissions and errors of manual inspection; real-time feedback greatly shortens the error correction time, directly improves the exchange success rate. At the same time, unified standard adaptation helps to break down the industry data barriers and promote information sharing. This feature brings direct and significant management benefits and interconnection benefits to the system.
[0068] The nested label structure file supports physically separating the data logic specific to the information system participating in the data exchange from the business logic, and independently storing the data reading logic, writing logic and field mapping relationship in the form of text or markup language text, without modifying the source code of the application system to adapt to different business rules.
[0069] The label structure file adopts an XML language format, which includes an end scheme title, identity authentication information (identity authentication mechanism), environment adaptation information, business document definition (data structure definition), field mapping (input of the execution matrix) and additional item maintenance (CDATA SQL script); When the data conversion is mainly completed in the SELECT statement through database functions (such as type conversion and formatting), the conversion logic can be implemented through the SQL function in the SELECT statement dynamically generated by the action execution unit; When the complex business logic conversion (such as unit conversion and data verification) is implemented through the CODE class, the system built-in process (such as XML_XM_PRO) called by the CODE class integrates the data cleaning and conversion functions, which are completed by reading the field type in the execution matrix or the preset conversion function instruction; When the logic step action label is CODE, the CODE execution class calls the system internally precompiled standardized program. For example, the CODE execution class is used to call the standard function interface for file serialization (such as XML_XM_PRO) and network communication (such as FTP client) preinstalled in the system core runtime environment (such as Java virtual machine), instead of executing the user-defined and uncompiled external code. This defines the function and avoids unnecessary security and implementation complexity issues.
[0070] The system realizes general adaptation and dynamic control of data exchange between heterogeneous systems through structured insight and logical decoupling strategy. The mutual correlation between the modules includes: the parameter module is responsible for analyzing the label structure file, establishing the identity authentication of the exchange parties, and dynamically creating the database connection session with the source end and the target end according to the database type, providing the basic running environment for the system. Subsequently, the business document module uses these environment parameters to analyze the business document information in the file, constructs a data interaction parameter network that identifies the data flow direction and physical path, and generates a structured data structure definition configuration list, and simultaneously realizes the automatic deployment of the data exchange environment (such as automatic table building) through the additional item maintenance unit. The document logic module receives the configuration list, converts it into an ordered executable logic queue, and through the core action execution unit, uses the mapping relationship (execution matrix) parsed from the field label to dynamically generate and execute the underlying SQL statement or built-in process call, completes the extraction, cleaning, conversion and transmission of data, and realizes the complete decoupling of business logic and program code. The standard adaptation module performs standard consistency checking on the exchange results, and feeds back the checking results to the parameter module.
[0071] The present application realizes the fundamental change from passive and rigid code writing to active and flexible configuration generation by constructing a general data exchange system based on a configurable label structure, and the core creative effect lies in the complete decoupling and dynamic execution of business logic. The system abstracts complex business rules into configurable label sequences (GET, CREATE_XML, etc. atomic actions) through the action execution unit in the document logic module, and constructs a field variable mapping table (execution matrix) using field labels to accurately map the database physical fields and memory logical variables in both directions. This mechanism enables the system to dynamically generate executable SQL statements or system built-in process call instructions, thereby efficiently converting business rules into computer code and completely eliminating the hard-coded coupling of business logic and program code. At the same time, combined with the dynamic environment adaptation of the parameter module to heterogeneous databases and the automatic deployment capability of the business document module to the data environment, the system greatly improves the generality, flexibility and maintainability of data exchange, and provides an ultimate solution for high-quality and low-cost enterprise data integration.
[0072] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (or computer- readable storage media) having computer-usable program code embodied in the medium. The medium can be any available medium or combination thereof that is accessible by a general purpose or special purpose computer. By way of example, such computer-usable storage media can include a volatile memory, a non-volatile memory, a hard disk drive, a solid state drive, a magnetic diskette, an optical disk (e.g., a compact disk (CD) or a digital versatile disk (DVD)), or a floppy disk, all of which are tangible of computer- readable media. The computer-usable program code, when executed, can enable a general purpose computer, special purpose computer, or other programmable data processing apparatus to perform a method in accordance with the article of manufacture containing the computer program code. The software is able to operate in Figure 1 one or more functions specified in the flow or flows and / or blocks Figure 1 one or more functions specified in the flow or flows and / or blocks
[0073] It should be noted that the above-mentioned embodiments are only used to illustrate but not to limit the technical solutions of the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application, and they should be covered in the scope of the claims of the present application.
Claims
1. A general data exchange system based on a configurable tag structure, characterized in that, It includes a parameter module, a business document module, a document logic module, and a standard adaptation module: The parameter module is used to parse the end-scheme header tags of both parties, establish the identity authentication mechanism of both parties, and establish the basic operating environment for data exchange. The business document module is used to construct a data interaction parameter network for identifying data interaction paths based on preset exchange requirements, and to establish data structure definitions based on the data interaction parameter network; The document logic module is used to perform logical parsing and code decoupling on the data structure definition, generate markup language script code and execution instructions. The logical parsing includes identifying logical step action labels and execution code categories according to the logical step sequence number, constructing an execution matrix through action execution units, realizing the mapping between database physical fields and memory logical variables, and extracting, cleaning, transforming and transmitting exchanged data based on the execution instructions. The standard adaptation module is used to read relevant tags from the end solution standard, build a verification rule base to compare and verify the generated data content, and feed the verification results back to the parameter module to correct the exchange rules and parameter configuration.
2. The general data exchange system based on a configurable tag structure as described in claim 1, characterized in that, The parameter module includes a header identification unit and an environment adaptation unit: The two parties involved in the data exchange include a sending information system and a receiving information system. The sending information system is the source of the data output, including the end system owner ID, the end system owner name, and the end system name. The receiving information system is the target system entity to which the data is finally transmitted and entered into the database. The header identification unit is used to parse the end solution title tag in the tag structure file, extract the end solution number, end solution version number, end solution standard related tags, submitter information and verification status, and establish an identity authentication mechanism between the two parties exchanging information. The process of parsing the end-to-end scheme title tag in the tag structure file includes: using the tag structure file parser to locate the first child node under the root node, and sequentially reading the text data wrapped inside the child node. The root node is the end-to-end switching scheme, the child node is the end-to-end scheme title, and the end-to-end scheme standard related tags include the end-to-end scheme execution standard number and the end-to-end scheme execution standard name. The submitter information includes the end-to-end solution submitter ID, end-to-end solution submitter name, and solution submitter phone number; the verification status is represented by a numeric code used to identify the legality of the solution. Establishing an identity authentication mechanism for both parties involved in the exchange includes: Step S001: Read the end system ID and end system owner ID from the tag structure file; Step S002: Read the end-solution submitter ID from the tag structure file; Step S003: Query the user permission table and system registry in the local database, and determine whether the end system ID in the tag structure file is consistent with the end system ID registered in the local system. At the same time, determine whether the end solution submitter ID has corresponding administrator privileges or data exchange privileges in the local user permission table. The authentication is successful if and only if the end system ID is consistent and the end solution submitter ID has corresponding administrator privileges or data exchange privileges. If the end system ID is inconsistent or the end solution submitter ID does not have administrator privileges or data exchange privileges, an authentication failure exception will be thrown.
3. The general data exchange system based on a configurable tag structure as described in claim 2, characterized in that, The environment adaptation unit is used to identify the database type label of the end system. The end system database types include Oracle, MsSQL, MySQL, and MongoDB. It establishes connection sessions with the source and target databases based on the end system owner ID and configures the underlying driver parameters for data interaction. The environment adaptation unit reads the end system database type and end system owner ID from the tag structure file, and uses the end system owner ID as an index to search for the database connection string corresponding to the index in the encrypted configuration file or registry of the local system. The database connection string specifically includes the database server IP address, the port number of the end system database type, the database instance name SID, and the login username and password. Based on the type of database in the end system, dynamically load the corresponding Java database connection driver class; Call the driver's connection method, pass in the URL, login username and password, and initiate a TCP handshake request to the database server. The URL includes the Java database connection protocol header, the database server IP address, the port number of the end system's database type and the database instance name SID. After a successful TCP handshake, a database session object is created in memory. The database session object is used to execute SQL statements and is an instance of a Java interface implementation class.
4. The general data exchange system based on a configurable tag structure as described in claim 3, characterized in that, The business document module includes a data interaction parameter network construction unit, a structure definition unit, and an additional item maintenance unit: The data interaction parameter network construction unit is used to establish a data carrier mapping relationship set and construct a data interaction parameter network based on the data carrier mapping relationship set. The data interaction parameter network includes the physical processes of data sending, data receiving and intermediate table construction. The data interaction parameter network is used to identify the physical path and logical association of data flow between various business documents. Establishing a data carrier mapping relationship set specifically includes: Iterate through all business document nodes in the tag structure file, extract business theme keywords from the business document names of the business document nodes, extract the database table names associated with the business documents, extract the prefix rules of the tag structure file from the prefixes of the business document names, and construct a Map structure mapping set in memory based on the dictionary combination format of business theme keywords, database table names and prefix rules. Based on the Map structure mapping set, the document flow label and whether additional item is created label of each business document are parsed, the discrete business documents are linked into a directed network, and the specific physical process is identified. The specific physical process includes the physical process of data sending, the physical process of data receiving, and the physical process of intermediate table construction. The physical process of identifying data transmission specifically includes: When the document flow direction tag of the first and second documents is both sent, an outbound node is created in the initial empty network. The initial physical action of the outbound node is the initial physical action of the initial empty network. The physical process of identifying data reception specifically includes: When the document flow label of the third document is "received", create an inbound node in the network with outbound nodes. The physical process of identifying intermediate tables specifically includes: When the "Create Extra Item" tag is 1 for both the first and third documents, an environment initialization node is created in the network with outbound and inbound nodes, and the environment initialization node is placed before the outbound and inbound nodes as a prerequisite. Acquire data interaction parameters including outbound nodes, inbound nodes, environment initialization nodes, and pointers between nodes.
5. The general data exchange system based on a configurable tag structure as described in claim 4, characterized in that, The structure definition unit is used to establish a data structure definition based on the data interaction parameter network. The data structure definition includes configuration parameters such as business document serial number, document file type, document flow label, and whether to create additional item labels. The process of establishing the data structure definition includes: For each node in the data interaction parameter network, instantiate a BusinessDocumentConfig object in memory, extract the business document number, document file type, document flow label, and whether to create additional items label, and store the business document number, document file type, document flow label, and whether to create additional items label in the form of a dictionary into the corresponding BusinessDocumentConfig object. Output the structured data included in the BusinessDocumentConfig objects of all nodes to obtain a structured configuration list. The structured configuration list is the established data structure definition.
6. The general data exchange system based on a configurable tag structure as described in claim 5, characterized in that, The additional item maintenance unit is used to parse the creation statement tags in the tag structure file and extract the SQL statements from the CDATA data segment. When the creation additional item tag is activated, the additional item maintenance unit automatically executes the SQL statements in the client database to form data tables, views, sequences, triggers, and stored procedures. The additional item maintenance unit specifically includes: Iterate through the configuration list defined in the data structure, check the value of the "Create Extra Item" tag for each business document. When the value of the "Create Extra Item" tag is 0, skip the extra item maintenance unit directly and do nothing. When the value of the "Create Extra Item" label is 1, the following actions are performed: The tag structure file parser is used to extract the CDATA data segment. In the active state, all text in the CDATA data segment is extracted and stored as a long string in the memory variable RawSQLScript. The creation statement node in the tag structure file is located. Using the string splitting function split(";"), the long string is split into a list of SQL statements with semicolons as the delimiters. The list of SQL statements is then traversed to remove whitespace, newline characters, and tab characters before and after each statement. Request a reused database session object from the parameter module; Set the Connection.setAutoCommit(false) class to instantiate a Statement object for sending SQL commands; It iterates through the list of SQL statements and executes exception handling, command execution, and fault tolerance operations for each statement. Exception handling includes wrapping each execution operation in a try-catch block. Command execution includes calling `Statement.execute(sqlString)`. Fault tolerance operations include: When executing CREATE TABLE, if an exception is found that the table already exists, the exception will be handled according to the preset strategy. After all SQL statements in the SQL statement list have been executed, call Connection.commit() to permanently save all structural changes to the end system database, close the Statement object, and release the cursor resources of the end system database.
7. The general data exchange system based on a configurable tag structure as described in claim 6, characterized in that, The document logic module includes a logic step parsing unit and an action execution unit: The logical step parsing unit is used to load business logic sequentially according to the logical step sequence number, identify logical step action tags and execution code categories. The logical step action tags include GET, CREATE_XML, UP_XML, and DOWN_XML, and the execution code categories include SQL and CODE. The identification includes: The tag structure file parser traverses the DOM tree, filters out all logical blocks whose business document sequence number is equal to the current business document ID, loads the logical blocks into memory to form a list of logical nodes to be processed, reads the logical step sequence number of each logical node, and rearranges the list of logical nodes using the quicksort algorithm. Traverse the sorted list of logical nodes in order, and perform a parsing operation on each logical node. The parsing operation steps include: Step S201: Read the text value of the logical step action label; If the text value of the logical step action label is GET, mark the current logical step action label as data extraction and enter the database read mode; If the text value of the logical step action tag is CREATE_XML, mark the current logical step action tag as a file generated and call the XML builder; If the text value of the logical step action tag is UP_XML, mark the current logical step action tag as file upload and call the FTP client; If the text value of the logical step action tag is DOWN_XML, mark the current logical step action tag as file download and database insertion, and call the FTP downloader and SQL inserter; Step S202: Read the text value of the execution code category label; If the code category label value is SQL, activate the SQL interpreter, read the SQL category label (which includes query and update), obtain the judgment result of the query or update operation, and read the table / view name; If the code category label value is CODE, the code segment interpreter is activated to parse the function call instructions in the code segment label. Step S203: Construct a LogicStepContext object in memory. The LogicStepContext object is used to encapsulate all metadata, including logical step sequence number, logical step action label, execution code category label, table / view name, and field label. Step S204: Based on the list of logical nodes, output an ordered executable logical queue composed of the metadata corresponding to each logical node.
8. The general data exchange system based on a configurable tag structure as described in claim 7, characterized in that, The action execution unit is used to construct an execution matrix based on the parsing results of the logic step parsing unit. The construction of the execution matrix includes: The action execution unit receives the current logical step from the ordered executable logical queue output by the logical step parsing unit, and extracts the original text content including the corresponding field label from the current logical step. The field label includes a mapping string in the format {table name, field name, field type, variable name}. Each mapping string is parsed and structured to construct a field variable mapping table, which is the execution matrix. Building the field variable mapping table includes: The mapping string is decomposed into four independent metadata items using comma separators. The metadata items include table name, field name, field type and variable name. The decomposition results are stored in a table structure in memory to form the format of an execution matrix. The rows of the execution matrix represent the physical field meaning of the decomposition results, and the columns of the execution matrix represent the meaning of the converted memory variables. The memory variables are logical variables. The execution matrix is used to map physical field values in the end system database to logical variable values in memory, and to reverse-map logical variable values in memory to physical field values in the end system database. The action execution unit reads the logical step action label and execution code category from the logical step context; When the execution code type is SQL: For the SELECT query operation, when the logical step action label is GET, the SQL generator is called. It uses the correspondence between table names and field names or variable names extracted from the field variable mapping table to automatically generate an executable SELECT statement, reads data from the end system database and stores it into memory variables. For INSERT operations, when the logical step action tag is DOWN_XML and needs to be written to the end system database, the SQL generator is called to automatically generate parameterized INSERT statements by using the table names and field names or variable names defined in the field variable mapping table, and write the memory variables to the end system database table. When the execution code category is CODE: Parse code segment tags to extract the names of built-in procedures in the client system; Initialize the corresponding procedure call instructions, which include tag structure file generation and FTP transfer operations.
9. The general data exchange system based on a configurable tag structure as described in claim 8, characterized in that, The action execution unit further includes: Executing a GET request to extract data includes: After executing the SELECT statement and the end system database returns the result set, it iterates through each row of data in the result set and assigns the values read from the physical fields in the end system database to the corresponding logical variables in memory according to the execution matrix. The executable file generates CREATE_XML, which includes: The action type is identified as CREATE_XML. The preset tag structure file generation process is invoked. Based on the variable names defined in the execution matrix, the corresponding logical variable values are read from memory in a loop. The logical variable values are filled into the nodes corresponding to the details of the tag structure file to generate an exchange file that conforms to the preset prefix rules. The executable file download and storage DOWN_XML includes: If the action type is identified as DOWN_XML, an FTP download operation is performed to download the tag structure file to the local machine. The downloaded tag structure file is parsed, and the logical nodes of the tag structure file are traversed. According to the mapping relationship in the execution matrix, the data in the logical nodes of the tag structure file is parsed and assigned to the corresponding memory variables. An INSERT statement is executed, and the parsed memory variable values are used as parameters to automatically write to the database table defined in the business document module.
10. The general data exchange system based on a configurable tag structure as described in claim 9, characterized in that, The standard adapter module includes: The tag structure file parser locates the end-solution standard related tags in the parameter module, reads the text value of the end-solution execution standard number, and loads the corresponding set of verification rules in the preset local rule repository based on the extracted end-solution execution standard number to form a verification rule library in memory. Load all specific validation rules in the local rule repository associated with the end scheme execution standard number, and store the specific validation rules in the validation rule repository in XML structured format; The validation rule base is imported into the in-memory rule engine for data comparison. The specific comparison steps of the rule engine include: The standard adaptation module waits for the document logic module to complete the data generation and parsing operations, receives a reference to the exchange file generated by the action execution unit, receives a collection of data objects parsed from the XML file and stored in memory by the action execution unit, and obtains the output data to be verified. Iterate through the content of the data to be validated and perform item-by-item comparison using the validation rule base: Iterate through each data record in the dataset, and apply all the rules in the validation rule base to each data record for rule comparison. When any rule validation fails, record an error message. The error message includes: the ID of the violating data record, the name of the violating field, the description of the violated rule, and the execution standard number of the end solution. After verification, the subsequent data exchange process is determined based on the recorded error messages. The criteria for this determination include: If no errors are logged or only non-fatal error messages are logged, mark the result as valid. When any fatal error message is recorded, the result is marked as a verification failure, the error message is encapsulated, and fed back to the parameter module. Upon receiving the verification failure feedback, the parameter module adjusts the subsequent data exchange process according to the control strategy, which includes: If the sender's verification fails, prevent the document logic module from executing subsequent UP_XML instructions; If the recipient fails verification, prevent the document logic module from executing subsequent INSERT commands; The system outputs detailed error information to the user interface and prompts the user to modify the business logic configuration and source data in the tag structure file based on the error details.
Citation Information
Patent Citations
Method and system for utilizing xml to realize generalization data exchange
CN103699633A
XML-based data generation tool development method
CN110222318A
Configurable interface control dynamic analysis system
CN118132084A
Document exchange method and device, medium and equipment
CN118607477A
Data development system and method based on template configuration
CN120066468A
Cited By
Quantitative strategy three-layer decoupling configuration method based on financial heterogeneous logic
CN122196045A