Method and system device for synchronizing json data into relational database

A data synchronization and database technology, applied in relational databases, database models, database distribution/replication, etc., can solve problems such as reducing development efficiency and increasing code redundancy, and achieve the effect of improving development efficiency

Inactive Publication Date: 2018-05-08
武汉优品楚鼎科技有限公司
View PDF4 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Every time you do this kind of development, you need to write the code of the synchronization process separately for the actual json data form, and if there ar

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system device for synchronizing json data into relational database
  • Method and system device for synchronizing json data into relational database
  • Method and system device for synchronizing json data into relational database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0039] like figure 1 As shown, a method for synchronizing json data to a relational database, the method includes:

[0040] Step 101, the configuration file editing module obtains the synchronization requirements of the synchronization data, and creates a configuration file containing json data source file information, target database information and field relationship mapping;

[0041] Step 102, the configuration file parsing module reads the configuration file, parses and identifies the json data source and the unique target database of each synchronized data according to the parsed configuration file, and establishes a database connection;

[0042] Step 103, the json data reading module obtains the parsed json data source to read json data, and generates batch synchronized SQL statements according to the data field mapping relationship in the configuration;

[0043] Step 104, the relational database writing module writes json data to the target database in batches accordin...

Embodiment 2

[0046] like figure 2 As shown, the configuration file contains the following contents:

[0047] 1. Original json data source file information, such as file type (filetype), file path (path), file encoding format (charset), etc.;

[0048] 2. Synchronized target database information, mainly including the database type identifier dbtype (mainly Oracle, Microsoft SQL Server, MySql, etc.) and the host, port number (port), and username (username) of the target database to be synchronized to. , password (password), encoding format (charset), database (database) and other connection information and write data table (datatable).

[0049] 3. The data mapping relationship mainly includes the one-to-one mapping between each sub-property of the json data object and the corresponding data table field (field) in the relational database.

[0050] The method and system can simultaneously perform multiple data synchronization tasks. The json data source file, target database information and...

Embodiment 3

[0052] like image 3 As shown, the present invention provides a system for synchronizing json data to a relational database, the system comprising:

[0053] The configuration file editing module is used to edit and modify the configuration file. After the modification, restart the synchronization system to take effect;

[0054] The configuration file parsing module is used to automatically read the configuration file and perform accurate analysis, identify the source data and target database of each synchronized data, and establish a connection;

[0055] The json data reading module is used to automatically read the json data source, and generate batch synchronization SQL statements according to the data field mapping relationship of the configuration file;

[0056] A relational database writing module is used to write json data in batches to the target database according to the database connection;

[0057] The data synchronization process control module is used to control th...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and a device for synchronizing json data into a relational database. The method comprises the following steps that: a configuration file editing module obtains the synchronization requirements of synchronous data, and creates a configuration file; a configuration file analysis module reads the configuration file, analyzes and identifies the json data source of eachpiece of synchronous data and a unique target database, and establishes database connection; a json data reading module obtains the analyzed json data source to read json data, and generates mass synchronous SQL (Structured Query Language) statements according to a dat field mapping relationship in the configuration; and a relational database writing module writes the json data to a target database on batch according to the database connection. By use of the method, the configuration file can be flexibly and quickly edited and revised, data synchronization is automatically carried out according to the configuration file, a synchronization process is controlled, a synchronization log is recorded, a synchronization progress is monitored, and a synchronization result is subjected to statistics. By use of the method, the json data is conveniently, flexibly, quickly and efficiently synchronized into the relational database, and development efficiency is greatly improved.

Description

technical field [0001] The invention relates to the field of computer program development, in particular to a data synchronization method and system for synchronizing data in json format to a relational database. Background technique [0002] JSON is a lightweight data format based on a subset of ECMAScript, and its flexible data organization is favored by developers, so it is widely used in program development. [0003] The characteristic of storing data in relational database is usually that a database contains several data tables, each data table contains several data fields, and each field represents an attribute of the current data entity. [0004] During the development process, there are often times when json data needs to be synchronized to the relational database. Every time you do this kind of development, you need to write the synchronization process code separately for the actual json data form, and if there are multiple similar data synchronizations, you need t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
CPCG06F16/27G06F16/284
Inventor 夏述林
Owner 武汉优品楚鼎科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products