| With the development of computer and information technology,the traditional data recording method with manual paper as the main means is being replaced by information system in many fields.All of the information system will be unified storage in their computer database system after data acquisition.Database as the data storage center,to provide data support for the system and other system users.Because of the diversity of database products,different types of databases are used by different systems in the process of information construction,data sharing obstacles are caused by database heterogeneity when data sharing is needed.Therefore,a heterogeneous database synchronization system is needed to solve the problem of consistency of data in different databases,so that each system can work independently and share data at the same time,so as to improve the overall efficiency of the system.In this thesis,a heterogeneous database synchronization system is designed based on the data synchronous demand of equipment point inspection system and enterprise production system in the development of the Copper Smelting Equipment Point Inspection System Based on the Internet of Things.Realize the synchronous sharing of point inspection data,equipment information and personnel information between the database of the point inspection system and the database of the enterprise production system.XML file is a unified format for synchronous data transmission and data source information storage,which avoids the problem of data standard caused by database heterogeneity.A data extraction method based on trigger and identification table is used to store change information in the identification table,these change information from data table are captured by triggers,and use these information to find the changed data in the associated data table,and generate XML data documents.Based on XML data documents and data source relationship mapping documents,we determine the target database data tables that need to load in synchronous data,and build SQL statements to achieve DML operation of target tables by parsing.As the link of data synchronization in the whole system,XML documents not only solve the various conflicts between heterogeneous databases,but also improve the universality and expansion of the system,and further realize the value of the system.The system adopts Java development language,and designs the overall scheme of heterogeneous database synchronization system based on data synchronization basic process and system application background,and designs the functional modules of the system in detail.The whole system architecture includes five functional modules:data source management,data extraction,data writing,log management and user management.The functions of each module are realized by Java technology,front end technology and database technology.Based on the B/S architecture,users can enter a specific web site through a browser to login the system to achieve data synchronization management and user management.Finally,combined with the application of data synchronization in enterprise equipment inspection,the effectiveness of the system is given,and the feasibility and feasibility of the whole system is verified by the application of the overall system function and performance test.Different test cases are designed to test the function modules of the system in detail,and the system performance is optimized by testing to improve the system synchronization efficiency.The test shows that the design of heterogeneous database synchronization system can effectively realize the data synchronization between different databases,and achieve the goal of the design of the system. |