CN110096620B - Mapping method and system for database table and XML message - Google Patents

Mapping method and system for database table and XML message Download PDF

Info

Publication number
CN110096620B
CN110096620B CN201910321833.0A CN201910321833A CN110096620B CN 110096620 B CN110096620 B CN 110096620B CN 201910321833 A CN201910321833 A CN 201910321833A CN 110096620 B CN110096620 B CN 110096620B
Authority
CN
China
Prior art keywords
xml message
message template
module
xml
main sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910321833.0A
Other languages
Chinese (zh)
Other versions
CN110096620A (en
Inventor
姚少扬
靳谊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FUJIAN RONGJI SOFTWARE CO LTD
Original Assignee
FUJIAN RONGJI SOFTWARE CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by FUJIAN RONGJI SOFTWARE CO LTD filed Critical FUJIAN RONGJI SOFTWARE CO LTD
Priority to CN201910321833.0A priority Critical patent/CN110096620B/en
Publication of CN110096620A publication Critical patent/CN110096620A/en
Application granted granted Critical
Publication of CN110096620B publication Critical patent/CN110096620B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion
    • G06F16/86Mapping to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion
    • G06F16/88Mark-up to mark-up conversion

Abstract

The invention discloses a mapping method and a system of a database table and an XML message, wherein the method comprises the following steps: presetting a field mapping table of a database field and an XML message node field; acquiring a target database; extracting a preset number of target data tables from the target database; judging whether a main sub-table relationship exists between the target data tables; if yes, determining at least one group of main sub-table relations; generating an XML message template corresponding to the relation group number of the main sub-tables according to the field mapping table and the main sub-table relation, wherein the XML message template comprises the hierarchical nested relation between the main sub-tables; and generating a corresponding XML message according to the XML message template and the corresponding target data table. The invention can realize the interconversion between the data table and the XML message, reduce the investment cost of project development, test and management, improve the message analysis efficiency and facilitate the management and maintenance.

Description

Mapping method and system for database table and XML message
The present application is a divisional application made by taking the invention patent with the application date of 2016, 06/06, and the application number of 201610396661, X, entitled "mapping processing method and system for database table and XML message" as a parent.
Technical Field
The present invention relates to the field of data processing, and in particular, to a mapping processing method and system for a database table and an XML message.
Background
In the traditional data exchange and message processing process, the message processing related to the structured XML file basically processes the message structures with different formats by means of writing down the hard code of the XML node or path structure, but the following disadvantages exist:
1. the standard specification is lacking. The application scenarios of the XML structure with more message messages are in the aspects of data exchange and service integration. Data exchange and service integration of messages among various systems easily cause lack of unification of formats and standards of message messages. The method is mainly embodied in the following layers: message format, character set coding, special characters, message node naming format, message attribute, message version, different types of databases, data source support and the like. The above disadvantages easily cause the format problem of message interaction between systems, and when a problem occurs, two parties of technical connection need to communicate and troubleshoot continuously, thereby increasing the complexity of problem troubleshooting.
2. The message parsing is inefficient. In the aspect of XML structured message analysis processing, a traditional message processing mode is mainly based on the analysis of open-source dom4j or jdom and the like, the analysis of a message template and a path is consumed in most of time in the aspect of message analysis, a corresponding cache loading strategy is lacked, and the technical advantage characteristics of one-time loading and everywhere use are not fully realized by using a cache technology. The message is easy to cause low analysis efficiency and long analysis processing time in the processing process of high concurrency and large data volume.
3. The code reuse rate is low. The conventional XML message parsing process mainly adopts a hard coding mode, and needs to perform adjustment in terms of codes when adding or deleting node processing and adding new message content to the XML message structure according to the development requirements of services, so that the investment cost of project development, test, management and the like is increased. In addition, when the project is online and is stably operated in an actual production environment, the adjustment has certain risks and costs, and the adjustment of the coding design easily causes instability of the system and brings corresponding risks.
4. Management and maintenance are difficult. In the aspect of complex data exchange or service integration, particularly in the data exchange scenes of a department level, a provincial bureau level and a local city level, for example, when the business requirements of a core system and the fields of a base table are changed. The peripheral systems associated therewith are subject to adjustment as they relate to these changes in service requirements or the addition of data fields. How to respond to the requirement of business development at the first time and how to control the compatibility of message template structures and versions among various systems is very critical and urgent and is also a problem to be mainly solved by the engine.
5. There is a lack of effective monitoring. The conventional message processing and analysis are basically designed and processed in a tightly coupled manner with the service codes, the monitoring is difficult in a typical application scene of data exchange and service integration, and the time for message analysis processing, abnormal processing conditions, automatic updating of message templates and unified monitoring and tracking of versions cannot be performed.
In a chinese patent publication No. CN105138613A, a method and a system for interconversion between a service object and an xml message are provided, wherein the method specifically includes the following steps: step 1: creating a message node mapping table, and importing message node and service object mapping information into the mapping table; step 2: receiving a reading request, and reading the message node and the service object mapping information into a cache; and step 3: carrying out format check on the message nodes and the service objects; and 4, step 4: the system converts the XML message into a service object according to the mapping relation; or the system converts the service object into XML message data according to the mapping relation. However, the scheme is based on the business object, is highly coupled with the business code, is based on a database configuration mode, and is difficult to manage and maintain.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the mapping processing method and the mapping processing system for the database table and the XML message are provided, the message analysis efficiency is improved, and management and maintenance are convenient.
In order to solve the technical problems, the invention adopts the technical scheme that: a mapping processing method for a database table and an XML message comprises the following steps:
presetting a field mapping table of a database field and an XML message node field;
acquiring a target database;
extracting a preset number of target data tables from the target database;
judging whether a main sub-table relationship exists between the target data tables;
if yes, determining at least one group of main sub-table relations;
generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the main sub-table relation, wherein the XML message template comprises the hierarchical nested relation between the main sub-tables;
and generating a corresponding XML message according to the XML message template and the corresponding target data table.
The invention also relates to a mapping processing system of the database table and the XML message, which comprises the following steps:
the first preset module is used for presetting a field mapping table of a database field and an XML message node field;
the first acquisition module is used for acquiring a target database;
the extraction module is used for extracting a preset number of target data tables from the target database;
the first judgment module is used for judging whether a main sub-table relationship exists between the target data tables;
the first determining module is used for determining at least one group of main sub-table relations if the first determining module is used for determining the main sub-table relations;
the first generation module is used for generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the relation of the main sub-tables, and the XML message template contains the hierarchical nested relation between the main sub-tables;
and the second generation module is used for generating the corresponding XML message according to the XML message template and the corresponding target data table.
The invention has the beneficial effects that: the mutual conversion between the data table and the XML message is realized through the XML message template, when the business logic changes, only the corresponding message template needs to be adjusted, the investment cost of project development, test and management can be reduced, the message analysis efficiency is improved, and the management and the maintenance are convenient.
Drawings
FIG. 1 is a flow chart of a mapping processing method for database tables and XML messages according to the present invention;
FIG. 2 is a flowchart of a method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a method according to a second embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a mapping processing system for database tables and XML messages according to the present invention;
fig. 5 is a schematic structural diagram of a third embodiment of the present invention.
Description of reference numerals:
1. a first preset module; 2. a first acquisition module; 3. an extraction module; 4. a first judgment module; 5. a first determination module; 6. a first generation module; 7. a second generation module; 8. a sending module; 9. an analysis module; 10. a publishing module; 11. a push module; 12. a second acquisition module; 13. a comparison module; 14. an update module; 15. a storage module; 16. an enabling module; 17. a second judgment module; 18. a third generation module; 19. an execution module; 20. a fourth generation module; 21. and a fifth generation module.
Detailed Description
In order to explain technical contents, objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
The most key concept of the invention is as follows: and realizing the interconversion between the data table and the XML message through the XML message template.
Referring to fig. 1, a method for mapping a database table and an XML message includes:
presetting a field mapping table of a database field and an XML message node field;
acquiring a target database;
extracting a preset number of target data tables from the target database;
judging whether a main sub-table relationship exists between the target data tables;
if yes, determining at least one group of main sub-table relations;
generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the main sub-table relation, wherein the XML message template comprises the hierarchical nested relation between the main sub-tables;
and generating a corresponding XML message according to the XML message template and the corresponding target data table.
From the above description, the beneficial effects of the present invention are: one or more arbitrary data tables can be converted into XML messages, the investment cost of project development, test and management can be reduced, the message analysis efficiency is improved, and the XML messages are convenient to manage and maintain.
Further, after the "generating the corresponding XML message", the method further includes:
sending the XML message to a communication node;
and the communication node receives the XML message and analyzes the XML message according to the XML message template to obtain the corresponding target data table.
As can be seen from the above description, the XML message can be written into one or more tables, thereby realizing the data analysis process from database to XML, from XML to database, from two-way ex-warehouse to in-warehouse.
Further, after the "generating the XML message template corresponding to the number of the relationship groups of the main sub-table", the method further includes:
issuing the update information of the XML message template to a service bus;
the service bus pushes the updating information to each communication node;
each communication node acquires the updating information;
comparing the unique identifier and the version number of the XML message template in the updating information with the unique identifier and the version number of the XML message template in use;
and if the unique identifiers are consistent but the version numbers are not consistent, updating the XML message template in use to the XML message template in the updated information.
Further, after the "updating the XML message template being used to the XML message template in the update information if the unique identifier is consistent but the version number is inconsistent", the method further includes:
saving a historical XML message template;
and if the updated XML message template has errors, starting the historical XML message template.
According to the description, the XML message template is updated, so that the parsing mechanism is kept consistent in the data processing process.
Further, before generating the XML message template corresponding to the number of relation groups of the main sub-table, the method further includes:
judging whether an XML message template corresponding to the main sub-table relationship exists or not;
if yes, generating an XML message corresponding to the target data table according to the XML message template and the corresponding target data table;
if not, executing the step of generating the XML message template corresponding to the relation group number of the main sub-table.
According to the description, when the target data tables in the target database have the corresponding XML message templates, the data tables can be directly converted into XML messages, and the analysis efficiency is improved.
Further, after the determining whether the main sub-table relationship exists between the target data tables, the method further includes:
if not, generating a corresponding XML message template according to each target data table and the field mapping table respectively;
and generating a corresponding XML message according to the target data table and the corresponding XML message template.
As can be seen from the above description, if there is no main sub-table relationship between the target data tables, it indicates that the extracted target data tables are all main tables, and since one packet only includes one main table, each target data table generates its own XML packet.
Referring to fig. 4, the present invention further provides a mapping processing system for a database table and an XML message, including:
the first preset module is used for presetting a field mapping table of a database field and an XML message node field;
the first acquisition module is used for acquiring a target database;
the extraction module is used for extracting a preset number of target data tables from the target database;
the first judgment module is used for judging whether a main sub-table relationship exists between the target data tables;
the first determining module is used for determining at least one group of main sub-table relations if the first determining module is used for determining the main sub-table relations;
the first generation module is used for generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the relation of the main sub-tables, and the XML message template contains the hierarchical nested relation between the main sub-tables;
and the second generation module is used for generating the corresponding XML message according to the XML message template and the corresponding target data table.
Further, still include:
the sending module is used for sending the XML message to a communication node;
and the analysis module is used for receiving the XML message by the communication node and analyzing the XML message according to the XML message template to obtain the corresponding target data table.
Further, still include:
the issuing module is used for issuing the update information of the XML message template to a service bus;
the pushing module is used for pushing the updating information to each communication node by the service bus;
the second acquisition module is used for acquiring the update information by each communication node;
the comparison module is used for comparing the unique identifier and the version number of the XML message template in the updating information with the unique identifier and the version number of the XML message template in use;
and the updating module is used for updating the XML message template in use to the XML message template in the updating information if the unique identifiers are consistent but the version numbers are not consistent.
Further, still include:
the storage module is used for storing a historical XML message template;
and the starting module is used for starting the historical XML message template if the updated XML message template has errors.
Example one
Referring to fig. 2, a first embodiment of the present invention is: a mapping processing method of database table and XML message includes the following steps:
s1: presetting a field mapping table of a database field and an XML message node field; for example, column is identified as the corresponding node in the corresponding XML packet by the name of the < table > node being "database table name"; the field mapping attribute description is shown in table 1; each table contains one or more fields, which have many attributes to be set, such as data type, display format, etc., wherein two important attributes are is _ pk and is _ bizpk, which are used to indicate whether the field is a primary key or a service primary key, the service primary key has a very large role, in the case of updating, the service primary key is used to locate records, and since the primary key may be of Sequence type, two databases have no way to share the same Sequence, problems may occur in locating records by using the primary key, therefore, each table is required to be configured with the service primary key, and sometimes a field may be used as both the primary key and the service primary key.
Figure GDA0002797321310000071
Figure GDA0002797321310000081
TABLE 1
S2: acquiring a target database; selecting a database connection format through a user name, a password and configuration database connection information, and entering a target database; a variety of relational databases based on standard SQL types may be supported, such as the popular relational databases in the industry, like oracle, sqlserver, mysql.
S3: extracting a preset number of target data tables from the target database; and determining the preset number according to the service requirement.
S4: judging whether a main sub-table relationship exists between the target data tables, if so, executing step S5, otherwise, executing step S9; whether the main sub-table relationship exists can be judged by judging whether field association exists between the target data tables.
S5: determining at least one group of main sub-table relationships; the main key of the main table is defined by is _ pk ═ true "in the < table > node attribute, and is _ bizpk ═ true" is defined as the foreign key relationship of the main sub-table.
S6: and judging whether the XML message template corresponding to the main sub-table relationship exists, if so, executing the step S8, and if not, executing the step S7.
S7: generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the main sub-table relation, wherein the XML message template comprises the hierarchical nested relation between the main sub-tables; that is, the hierarchical relationship between the main table and the sub-table is defined in the XML message template, and by analogy, the hierarchical relationship of the sub-table can also be defined in the sub-table; meanwhile, one XML message module corresponds to one main sub-table relationship, namely the XML message corresponds to one main table and a plurality of sub-tables in the database, and the sub-tables are allowed to be cascaded.
S8: generating a corresponding XML message according to the XML message template and a corresponding target data table; step S11 is executed.
S9: and if the main and sub-table relationship does not exist, namely the extracted preset number of target data tables are all main tables, generating a corresponding XML message template according to each target data table and the field mapping table respectively.
S10: generating corresponding XML messages according to the target data tables and the corresponding XML message templates; step S11 is executed.
S11: sending the XML message to a communication node;
s12: and a communication node receives the XML message and analyzes the XML message according to the XML message template to obtain the corresponding target data table.
Preferably, before generating the XML message, the specification is exchanged according to the message format, data exchange with other external systems is considered, the character set of the message is encoded, the unified UTF-8 design based on the standard is defaulted, and the flexible setting can be realized when other character sets require. The problem of message format generated during interaction among systems can be avoided by presetting the character set code of the standardized XML message, the standard specification of the message is kept uniform, and the overall maintainability is improved.
Optionally, the target data table may be selected first, and then the field mapping table may be configured according to the target data table; the main table may be selected first, followed by its associated sub-tables.
Preferably, the above steps are implemented by using a visualization tool management, and the database relationship setting, the mapping configuration of the fields, the selection of the field attributes, the selection of the format, and the like are performed by using a message visualization tool. If the main table information, the sub table information, the relation of the main and sub tables and the field attribute contained in the main and sub tables of the message are maintained through a visual maintenance interface, the message structure supports the dynamic generation of an XML message file; the visual tool can provide the query function of the table name and the Chinese name, and the message template information can be queried through the key field; providing a test function of the template, and testing the accuracy and the effectiveness of the template through test data; providing a function of loading a database table, and loading database field information; providing the functions of adding, modifying and deleting field columns, loading column functions and the like. Providing a multi-thread processing environment, supporting dynamic setting and adjustment of threads through a multi-thread mechanism, extracting and analyzing a service database to perform thread separation design, and improving the overall processing performance; the number of threads can be dynamically adjusted according to the hardware resource condition, so that the threads are in the optimal processing state. The method provides two service modes of an API calling mode and a web service mode, and facilitates calling of different development languages, wherein the API calling mode enables a user to expand an interface and re-interface a method, supports a user-defined function, and can greatly reduce redundancy of codes.
One specific example of the above steps is as follows: tables 2 and 3 are partial data in the extracted target data table, and the table relationship description is shown in table 4;
Figure GDA0002797321310000101
TABLE 2
GOODS_ID DECL_ID CIQ_CODE
938224C0C0A81D9D01DBC14491994985 111 5303900000999
TABLE 3
Figure GDA0002797321310000102
TABLE 4
The generated XML message template is as follows:
Figure GDA0002797321310000111
Figure GDA0002797321310000121
the XML message is generated as follows:
Figure GDA0002797321310000122
Figure GDA0002797321310000131
since the content of the field DECL _ ID is an identifier directly generated by the relevant component, it can be omitted when generating an XML message, and when another communication node receives the XML message, the relevant component will automatically supplement the content of the field.
The embodiment can realize the data analysis process from the database to the XML and from the XML to the database in two-way ex-warehouse and in-warehouse, carry out data analysis according to the predefined template rules, and support all the current standards of the XML, including Namespace, XPath, W3C schema, DTD, X-Query and the like, can realize the conversion of one or more arbitrary data tables into XML messages, and can also write the XML messages into one or more tables. With the development requirement of the service, the structure of the XML message can be subjected to node addition or deletion processing, and when a new message template is added, a zero coding processing mechanism is realized by providing a corresponding calling function, api and an interface adaptation strategy, so that the coupling degree with the service code is reduced, and the code reuse rate is improved.
Example two
Referring to fig. 3, the present embodiment is a further development of the embodiment, and the same points are not described again, except that after the step S7, the method further includes a template updating process, specifically including the following steps:
s13: and issuing the update information of the XML message template to a service bus.
S14: and the service bus pushes the updating information to each communication node.
S15: and each communication node acquires the updating information.
S16: comparing the unique identifier and the version number of the XML message template in the updating information with the unique identifier and the version number of the XML message template in use; preferably, the unique identifier is a template number.
S17: judging whether updating is needed, if yes, executing step S18, and if not, executing step S21; that is, when the unique identifiers are consistent, whether the version numbers are consistent or not is judged, if so, updating is not needed, and if not, updating is needed.
S18: and updating the XML message template in use to the XML message template in the updated information.
S19: saving a historical XML message template; after the XML message template is released, the historical XML message template needs to be tracked, the trace of modification is reserved, and meanwhile background backup is carried out on all the XML message templates.
S20: if the updated XML message template has errors, starting a historical XML message template; when the XML message template of the new version has problems, the old XML message template can be recovered and started at any time.
S21: and acquiring the next XML message template in the update information, and continuing to compare with the currently used XML message template, namely executing step S16.
When the integrated calling parties are more and more, and all calling parties use the same XML message template type, online remote automatic updating of the XML message template is supported, so that the resolution mechanism is kept consistent in the data processing process.
The service support for updating the XML message template is released to a service bus, through the message releasing and subscribing mode, when the XML message template changes, a new XML message template is pushed to each communication node (message subscribing end) through a message releasing and subscribing mode, and after the communication nodes synchronously update the service message template, the processing result is returned.
The XML message template adopts a cache mechanism, 20% of the time of the whole analysis process is occupied when the XML message template is analyzed each time, so that the 'once loading and everywhere available' are fully considered during design, and the XML message template does not need to be analyzed again when being called after being initialized and loaded for the first time, so that the processing performance and the analysis time of the whole process are improved.
The embodiment uniformly monitors and tracks the template version by automatically updating the XML message template, thereby improving the maintainability in the aspects of data exchange and service integration.
EXAMPLE III
Referring to fig. 5, this embodiment is a mapping processing system of a database table and an XML message corresponding to the foregoing embodiment, and includes:
the first preset module 1 is used for presetting a field mapping table of a database field and an XML message node field;
the first acquisition module 2 is used for acquiring a target database;
the extraction module 3 is used for extracting a preset number of target data tables from the target database;
the first judgment module 4 is used for judging whether a main sub-table relationship exists between the target data tables to obtain a first judgment result;
a first determining module 5, configured to determine at least one group of main sub-table relationships if the first determination result is yes;
the first generating module 6 is configured to generate an XML message template corresponding to the number of main and sub table relationship groups according to the field mapping table and the main and sub table relationships, where the XML message template includes a hierarchical nested relationship between the main and sub tables;
and the second generating module 7 is configured to generate a corresponding XML message according to the XML message template and the corresponding target data table.
Further comprising:
the sending module 8 is used for sending the XML message to a communication node;
and the analysis module 9 is configured to receive the XML message by the communication node, and analyze the XML message according to the XML message template to obtain the corresponding target data table.
Further comprising:
the issuing module 10 is configured to issue the update information of the XML message template to a service bus;
the pushing module 11 is used for pushing the update information to each communication node by a service bus;
a second obtaining module 12, configured to obtain, by each communication node, the update information;
a comparison module 13, configured to compare the unique identifier and the version number of the XML message template in the update information with the unique identifier and the version number of the XML message template in use;
and the updating module 14 is configured to update the XML message template being used to the XML message template in the update information if the unique identifiers are consistent but the version numbers are not consistent.
Further comprising:
the storage module 15 is used for storing a historical XML message template;
and the starting module 16 is used for starting the historical XML message template if the updated XML message template has errors.
Further comprising:
the second judging module 17 is configured to judge whether an XML message template corresponding to the main sub-table relationship exists, so as to obtain a second judgment result;
a third generating module 18, configured to generate a corresponding XML message according to the XML message template and the corresponding target data table if the second determination result is yes;
and the executing module 19 is configured to execute the first generating module 6 if the second determination result is negative.
Further comprising:
a fourth generating module 20, configured to generate, if the first determination result is negative, a corresponding XML message template according to each target data table and the field mapping table, respectively;
and a fifth generating module 21, configured to generate a corresponding XML message according to the target data table and the corresponding XML message template.
In summary, according to the mapping processing method and system for the database table and the XML message provided by the present invention, the mutual conversion between the database table and the XML message is realized through the XML message template, when the service logic changes, only the corresponding message template needs to be adjusted, which can reduce the investment cost of project development, test and management, improve the message parsing efficiency, and facilitate management and maintenance; the problem of message format generated during interaction among systems can be avoided by presetting the character set code of the standardized XML message, the standard specification of the message is kept uniform, and the overall maintainability is improved.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (4)

1. A mapping method of a database table and an XML message is characterized by comprising the following steps:
presetting a field mapping table of a database field and an XML message node field;
acquiring a target database;
extracting a preset number of target data tables from the target database;
judging whether a main sub-table relationship exists between the target data tables;
if yes, determining at least one group of main sub-table relations;
generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the main sub-table relation, wherein the XML message template comprises the hierarchical nested relation between the main sub-tables;
generating a corresponding XML message according to the XML message template and a corresponding target data table;
sending the XML message to a communication node;
the communication node receives the XML message and analyzes the XML message according to the XML message template to obtain the corresponding target data table;
after the "generating the XML message template corresponding to the number of the relation groups of the main sub-table", the method further includes:
issuing the update information of the XML message template to a service bus;
the service bus pushes the updating information to each communication node;
each communication node acquires the updating information;
comparing the unique identifier and the version number of the XML message template in the updating information with the unique identifier and the version number of the XML message template in use;
if the unique identifiers are consistent but the version numbers are not consistent, updating the XML message template in use to the XML message template in the updated information;
saving a historical XML message template;
and if the updated XML message template has errors, starting the historical XML message template.
2. The method for mapping database tables and XML messages according to claim 1, wherein before generating the XML message templates corresponding to the number of relation groups of the main sub-table, the method further comprises:
judging whether an XML message template corresponding to the main sub-table relationship exists or not;
if yes, generating an XML message corresponding to the target data table according to the XML message template and the corresponding target data table;
if not, executing the step of generating the XML message template corresponding to the relation group number of the main sub-table.
3. A system for mapping database tables and XML messages, comprising:
the first preset module is used for presetting a field mapping table of a database field and an XML message node field;
the first acquisition module is used for acquiring a target database;
the extraction module is used for extracting a preset number of target data tables from the target database;
the first judgment module is used for judging whether a main sub-table relationship exists between the target data tables to obtain a first judgment result;
the first determining module is used for determining at least one group of main sub-table relations if the first judging result is positive;
the first generation module is used for generating an XML message template corresponding to the number of relation groups of the main sub-tables according to the field mapping table and the relation of the main sub-tables, and the XML message template contains the hierarchical nested relation between the main sub-tables;
the second generation module is used for generating a corresponding XML message according to the XML message template and the corresponding target data table;
further comprising:
the sending module is used for sending the XML message to a communication node;
the analysis module is used for receiving the XML message by the communication node and analyzing the XML message according to the XML message template to obtain the corresponding target data table;
further comprising:
the issuing module is used for issuing the update information of the XML message template to a service bus;
the pushing module is used for pushing the updating information to each communication node by the service bus;
the second acquisition module is used for acquiring the update information by each communication node;
the comparison module is used for comparing the unique identifier and the version number of the XML message template in the updating information with the unique identifier and the version number of the XML message template in use;
the updating module is used for updating the XML message template in use to the XML message template in the updating information if the unique identifiers are consistent but the version numbers are not consistent;
further comprising:
the storage module is used for storing a historical XML message template;
and the starting module is used for starting the historical XML message template if the updated XML message template has errors.
4. The database table and XML message mapping system of claim 3, further comprising:
the second judgment module is used for judging whether the XML message template corresponding to the main sub-table relationship exists or not to obtain a second judgment result;
a third generating module, configured to generate a corresponding XML message according to the XML message template and the corresponding target data table if the second determination result is yes;
and the execution module is used for executing the first generation module if the second judgment result is negative.
CN201910321833.0A 2016-06-06 2016-06-06 Mapping method and system for database table and XML message Active CN110096620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910321833.0A CN110096620B (en) 2016-06-06 2016-06-06 Mapping method and system for database table and XML message

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910321833.0A CN110096620B (en) 2016-06-06 2016-06-06 Mapping method and system for database table and XML message
CN201610396661.XA CN106021594B (en) 2016-06-06 2016-06-06 The mapping treatment method and its system of database table and XML message

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610396661.XA Division CN106021594B (en) 2016-06-06 2016-06-06 The mapping treatment method and its system of database table and XML message

Publications (2)

Publication Number Publication Date
CN110096620A CN110096620A (en) 2019-08-06
CN110096620B true CN110096620B (en) 2021-02-26

Family

ID=57089846

Family Applications (4)

Application Number Title Priority Date Filing Date
CN201610396661.XA Active CN106021594B (en) 2016-06-06 2016-06-06 The mapping treatment method and its system of database table and XML message
CN201910321902.8A Active CN110222237B (en) 2016-06-06 2016-06-06 Method and system for converting database table and XML message
CN201910321828.XA Active CN110222236B (en) 2016-06-06 2016-06-06 Method and system for generating and updating XML message template
CN201910321833.0A Active CN110096620B (en) 2016-06-06 2016-06-06 Mapping method and system for database table and XML message

Family Applications Before (3)

Application Number Title Priority Date Filing Date
CN201610396661.XA Active CN106021594B (en) 2016-06-06 2016-06-06 The mapping treatment method and its system of database table and XML message
CN201910321902.8A Active CN110222237B (en) 2016-06-06 2016-06-06 Method and system for converting database table and XML message
CN201910321828.XA Active CN110222236B (en) 2016-06-06 2016-06-06 Method and system for generating and updating XML message template

Country Status (1)

Country Link
CN (4) CN106021594B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874493A (en) * 2017-02-23 2017-06-20 济南浪潮高新科技投资发展有限公司 A kind of data transfer device and device
CN110019116B (en) * 2017-09-26 2023-07-07 南京中兴新软件有限责任公司 Data tracing method, device, data processing equipment and computer storage medium
CN110110151B (en) * 2018-01-05 2022-05-10 北大方正集团有限公司 Method, system, computer equipment and storage medium for analyzing and warehousing resource packages
CN108595511B (en) * 2018-03-23 2022-04-01 中国人民解放军91977部队 Diversified meteorological hydrological data classification storage processing method and system
CN109446499A (en) * 2018-09-25 2019-03-08 平安科技(深圳)有限公司 Contract template generation method, device, equipment and medium based on XML
CN109582674B (en) * 2018-11-28 2023-12-22 亚信科技(南京)有限公司 Data storage method and system
CN109800331A (en) * 2018-12-19 2019-05-24 山东中创软件工程股份有限公司 Method for reading data and device, date storage method and device
CN110084525A (en) * 2019-05-05 2019-08-02 重庆天蓬网络有限公司 A kind of work management engine method and device based on business demand
CN110609842B (en) * 2019-09-19 2022-02-22 中国银行股份有限公司 Message composition method and system
CN110851137B (en) * 2019-10-31 2022-08-30 卡斯柯信号有限公司 Automatic realization universal method for ATC non-secure data configuration
CN111126025A (en) * 2019-12-11 2020-05-08 航天信息股份有限公司 Electronic document format file template management method and system
CN112147963A (en) * 2020-09-30 2020-12-29 深圳市天启宇通科技有限公司 Industrial field data interaction method
CN112256469A (en) * 2020-10-29 2021-01-22 贵州电网有限责任公司信息中心 Intelligent problem positioning method based on cross-system collaborative scene
CN112486991B (en) * 2020-11-26 2024-03-01 北京字跳网络技术有限公司 Database report processing method and device and electronic equipment
CN113037844B (en) * 2021-03-12 2023-01-31 北京京东振世信息技术有限公司 Identification updating method and device
CN112948480B (en) * 2021-04-21 2023-11-14 平安好医投资管理有限公司 Data extraction method, device, electronic equipment and storage medium
CN113568925B (en) * 2021-08-03 2022-08-16 中电金信软件有限公司 Message data conversion method and device, electronic equipment and storage medium
CN113689195A (en) * 2021-08-27 2021-11-23 北京市律典通科技有限公司 Case administration intelligent judgment method and device, electronic equipment and storage medium
CN114003230B (en) * 2021-09-28 2022-08-09 厦门国际银行股份有限公司 SQL script rapid compiling method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184567A1 (en) * 2001-10-09 2006-08-17 Microsoft Corporation System and method providing diffgram format
US20120078942A1 (en) * 2010-09-27 2012-03-29 International Business Machines Corporation Supporting efficient partial update of hierarchically structured documents based on record storage
CN103902539A (en) * 2012-12-25 2014-07-02 三星电子(中国)研发中心 Method and device for analyzing extensible markup language data
CN104598592A (en) * 2015-01-20 2015-05-06 北京仿真中心 XML (Extensive Markup Language)-based database custom method and system

Family Cites Families (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6725231B2 (en) * 2001-03-27 2004-04-20 Koninklijke Philips Electronics N.V. DICOM XML DTD/schema generator
EP1722307A1 (en) * 2005-05-09 2006-11-15 Amadeus s.a.s Dynamic method for XML documents generation from a database
US20070005657A1 (en) * 2005-06-30 2007-01-04 Bohannon Philip L Methods and apparatus for processing XML updates as queries
CN100458793C (en) * 2007-05-10 2009-02-04 浪潮集团山东通用软件有限公司 Mapping conversion method between data access level Xml format data and relational data
CN101217406B (en) * 2008-01-15 2011-05-11 中兴通讯股份有限公司 Collocation data backup and recovery method
US20090182703A1 (en) * 2008-01-16 2009-07-16 Microsoft Corporation Exposing relational database interfaces on xml data
CN101634942A (en) * 2008-07-24 2010-01-27 北大方正集团有限公司 Method and system for dynamically creating data tables
US8140558B2 (en) * 2009-05-22 2012-03-20 International Business Machines Corporation Generating structured query language/extensible markup language (SQL/XML) statements
CN101706716B (en) * 2009-09-08 2013-04-03 南京师范大学 VO-based form customization, configuration and parsing operation method
CN101770503B (en) * 2009-12-31 2013-04-17 深圳联友科技有限公司 File packing and unpacking method
CN102456053B (en) * 2010-11-02 2013-08-14 江苏大学 Method for mapping XML document to database
CN102096710A (en) * 2011-01-21 2011-06-15 周军 Extensive makeup language (XML) template-based message analysis method
US9128986B2 (en) * 2011-06-29 2015-09-08 Infosys Limited Method and system for managing a database having a plurality of tables
US9323589B2 (en) * 2012-05-15 2016-04-26 Oracle International Corporation Self registration of event—consumers/producers and auto discovery
CN103838740A (en) * 2012-11-21 2014-06-04 方欣科技有限公司 Report engine method
CN103049494B (en) * 2012-12-07 2017-05-24 华为技术有限公司 Method and device for storing table of extensible markup language (XML) file
CN103207902A (en) * 2013-03-27 2013-07-17 交通银行股份有限公司 Method and system for updating financial client side data
KR20150074611A (en) * 2013-12-24 2015-07-02 삼성에스디에스 주식회사 Relational Database, Translating Method and Apparatus From data to XML
CN104216952A (en) * 2014-08-20 2014-12-17 烽火通信科技股份有限公司 Universal report generation method and universal report generation system based on XML (extensive markup language) technology
CN104281447B (en) * 2014-09-01 2017-10-10 国家电网公司 The system and method that a kind of form is quickly generated and issued
CN105138613A (en) * 2015-08-07 2015-12-09 北京思特奇信息技术股份有限公司 Business object and xml message mutual conversion method and system
CN105631583A (en) * 2015-12-22 2016-06-01 南京南瑞集团公司 Data acquisition and processing method for power grid province-region integrated dispatching report
CN105472044B (en) * 2016-01-26 2019-11-12 云南电网有限责任公司电力科学研究院 A kind of DL/T645 based on XML and GOOSE mapping method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184567A1 (en) * 2001-10-09 2006-08-17 Microsoft Corporation System and method providing diffgram format
US20120078942A1 (en) * 2010-09-27 2012-03-29 International Business Machines Corporation Supporting efficient partial update of hierarchically structured documents based on record storage
CN103902539A (en) * 2012-12-25 2014-07-02 三星电子(中国)研发中心 Method and device for analyzing extensible markup language data
CN104598592A (en) * 2015-01-20 2015-05-06 北京仿真中心 XML (Extensive Markup Language)-based database custom method and system

Also Published As

Publication number Publication date
CN110222236B (en) 2021-05-04
CN106021594B (en) 2019-06-11
CN110222237B (en) 2021-01-19
CN110096620A (en) 2019-08-06
CN110222237A (en) 2019-09-10
CN106021594A (en) 2016-10-12
CN110222236A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110096620B (en) Mapping method and system for database table and XML message
US8032544B2 (en) Methods and apparatus for generating dynamic program files based on input queries that facilitate use of persistent query services
US8838655B2 (en) Type projection query of an instance space
US9280568B2 (en) Zero downtime schema evolution
US9171051B2 (en) Data definition language (DDL) expression annotation
US9361398B1 (en) Maintaining a relational database and its schema in response to a stream of XML messages based on one or more arbitrary and evolving XML schemas
US11334549B2 (en) Semantic, single-column identifiers for data entries
US20050050056A1 (en) Mechanism to enable evolving XML schema
CN110955714A (en) Method and device for converting unstructured text into structured text
CN111078205A (en) Modular programming method and device, storage medium and electronic equipment
CN109344306B (en) Method and system for customized online transaction and service of field multi-standard metadata
US8607201B2 (en) Augmenting visualization of a call stack
CN114138247A (en) Interface management method and system suitable for multiple systems
CN111222015B (en) Method for generating document by heterogeneous XML mapping
CN111241065A (en) Security multi-compatibility lightweight database adaptation development and operation device supporting domestic database
CN109144489B (en) State data processing method based on Yang language model
CN111752546A (en) Excel-based database object design management platform, system and method
CN112685379A (en) Data organization method, system and device and storage medium
CN110019522A (en) Multi-source heterogeneous data integrated system based on XML
EP4170516A1 (en) Metadata elements with persistent identifiers
CN112100207B (en) Sub-query processing method, device, equipment and storage medium
EP4155968A1 (en) Identification and import of metadata for extensions to database artefacts
CN117149775A (en) Data processing method and device for pull chain table
CN115309723A (en) Method for processing historical data version in relational database
CN113901090A (en) Real-time situation data leading and processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant