CN112115143B - Automatic data updating and synchronizing method and device, electronic equipment and storage medium - Google Patents

Automatic data updating and synchronizing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112115143B
CN112115143B CN202010958065.2A CN202010958065A CN112115143B CN 112115143 B CN112115143 B CN 112115143B CN 202010958065 A CN202010958065 A CN 202010958065A CN 112115143 B CN112115143 B CN 112115143B
Authority
CN
China
Prior art keywords
data
original
target
update
updating
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
CN202010958065.2A
Other languages
Chinese (zh)
Other versions
CN112115143A (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.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance Technology 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202010958065.2A priority Critical patent/CN112115143B/en
Publication of CN112115143A publication Critical patent/CN112115143A/en
Application granted granted Critical
Publication of CN112115143B publication Critical patent/CN112115143B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to big data technology, and discloses a method for automatically updating and synchronizing data, which comprises the following steps: obtaining an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, mapping to obtain an original table, constructing a target table and an updated table in the target database, comparing the original table with the target table to obtain updated data, extracting the updated data into the updated table, associating the updated table with the target table, importing the updated data into the target table according to the association, and transmitting the target table to a designated terminal. The invention also provides a device for automatically updating and synchronizing data, electronic equipment and a computer readable storage medium. The invention can solve the problem of higher data update delay.

Description

Automatic data updating and synchronizing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method and apparatus for automatically updating and synchronizing data, an electronic device, and a computer readable storage medium.
Background
Data real-time updating is increasingly important in daily work and life. As the data size increases, the data sources increase, the data formats are diverse, and it is often necessary to integrate the data of each channel. The traditional database technology cannot automatically update data, the data update is performed manually with high delay, and meanwhile, as updated data is more and more, the updated data may occupy a large amount of computer storage space.
Disclosure of Invention
The invention provides a method, a device and a computer readable storage medium for automatically updating and synchronizing data, which mainly aim to solve the problem of higher data updating delay.
In order to achieve the above object, the present invention provides a method for automatically updating and synchronizing data, comprising:
acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table;
constructing a target table and an update table in the target database, comparing the original table with the target table to obtain update data, and extracting the update data into the update table;
associating the update table with the target table, importing the update data into the target table according to the association, and transmitting the target table to a designated terminal;
wherein the comparing the original table with the target table to obtain updated data includes: acquiring data in the original table and the target table; comparing the data, if the data are the same, not updating the data, and if the data are different, updating the data; and summarizing all the updated data to obtain the updated data.
Optionally, the obtaining the original data set from one or more source databases according to a time-varying time stamp and a preset time interval includes:
acquiring standard time based on the preset time interval, and updating the time stamp according to the standard time to obtain an updated time stamp;
and based on the update time stamp, extracting data in the source database to the original table by using a preset open source tool.
Optionally, the extracting the data in the source database to the original table by using a preset open source tool includes:
judging whether the original data set can be directly imported into the target database;
if the data of the original data set can be directly imported, importing the original data set into the target database;
if the data of the original data set can not be directly imported, converting the original data set into a text file, and importing the text file into the target database;
and mapping the imported data into the original table in the target database.
Optionally, after comparing the original table with the target table to obtain the updated data, the method further includes:
and clearing the data in the original table.
Optionally, the extracting the update data into the update table includes:
acquiring a preset cursor, wherein the cursor comprises a query statement;
and executing the query statement in the cursor in the original table and the target table, and extracting the update data to the update table.
Optionally, the associating the update table with the target table, importing the update data into the target table according to the association, and sending the target table to a specified terminal, including:
acquiring a preset association transaction, and establishing an association relation between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the association relation, and sending the target table to a designated terminal.
In order to solve the above problems, the present invention further provides an automatic data update and synchronization device, which includes:
the data acquisition module is used for acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table;
the data updating module is used for constructing a target table and an updating table in the target database, comparing the original table with the target table to obtain updating data, and extracting the updating data into the updating table;
and the data association module is used for associating the update table with the target table, importing the update data into the target table according to the association, and sending the target table to a designated terminal.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the automatic data updating and synchronizing method.
In order to solve the above-mentioned problems, the present invention also provides a computer readable storage medium having at least one instruction stored therein, the at least one instruction being executed by a processor in an electronic device to implement the above-mentioned method for automatically updating and synchronizing data.
According to the invention, the data in the original data set is imported into the target database, so that the data can be directly mapped into the original table, the data updating speed is greatly improved, the original table is a temporary table, the data can be emptied after each data updating, the occupation of the storage space of a computer is reduced, and meanwhile, the updating table is associated with the target table, so that the data updating speed is further improved. Therefore, the data automatic updating and synchronizing method, the device, the electronic equipment and the computer readable storage medium can solve the problem of higher data updating delay.
Drawings
FIG. 1 is a flow chart illustrating a method for automatically updating and synchronizing data according to an embodiment of the present invention;
FIG. 2 is a detailed flow chart of one of the steps shown in FIG. 1;
FIG. 3 is a detailed flow chart of another step of FIG. 1;
FIG. 4 is a functional block diagram of an automatic data update and synchronization device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the method for automatically updating and synchronizing data according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a method for automatically updating and synchronizing data. The execution subject of the automatic data updating and synchronizing method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the data automatic updating and synchronizing method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flow chart of a method for automatically updating and synchronizing data according to an embodiment of the invention is shown. In this embodiment, the method for automatically updating and synchronizing data includes:
s1, acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table.
In at least one embodiment of the invention, the raw data set comprises: business data, financial data, and/or product data, etc. For example, in the area of security, the business data may include: an amount of the application, a type of the application, etc., the financial data may include: the fund duty cycle of the application, the profit of the application, the rate of return of the application, etc., the product data may include: life risk category, car risk category, accident risk category, etc. The source database may be a database such as MySQL or oracle, and in the embodiment of the present invention, a database (e.g., sql Server database) with a timestamp supporting automatic update may be used.
Specifically, the obtaining the original data set from one or more source databases according to a time stamp changing with time and a preset time interval includes:
acquiring standard time based on the preset time interval, and updating the time stamp according to the standard time to obtain an updated time stamp;
and based on the update time stamp, extracting data in the source database to the original table by using a preset open source tool.
Preferably, referring to fig. 2, the extracting the data in the source database to the original table by using a preset open source tool includes:
s10, judging whether the original data set can be directly imported into the target database;
if the data of the original data set can be directly imported, S11 is executed to import the original data set into the target database;
if the data of the original data set can not be directly imported, S12 is executed, the original data set is converted into a text file, and the text file is imported into the target database.
S13, mapping the imported data into the original table in the target database.
In detail, the target database may be a hive database. The preset open source tool may use the currently disclosed Sqoop tool. The embodiment of the invention can set every preset time interval, automatically update the time stamp by using the standard time, continuously extract the data in the source database to the hive database by using the preset open source tool by automatically updating the time stamp, and map the data to the original table. Preferably, the preset time interval may be set to one minute, that is, the time stamp is updated with the standard time every minute, and data is extracted into the original table.
Based on the implementation mode, the method and the device for updating the data of the hive database are used for importing the original data set into the hive database, and the original data set can be directly mapped into an original table, so that the data updating speed is improved.
S2, constructing a target table and an update table in the target database, comparing the original table with the target table to obtain update data, and extracting the update data into the update table.
The target table is a final summarized data table, and the update table is used for recording data which need to be updated each time.
The target table and the update table in the embodiment of the invention can be set as a dynamic table when being created. The dynamic table refers to a table type in which data can be dynamically extracted along with time and change of the data, wherein fields in the dynamic table are of indefinite length. In comparison, the fields in the conventional static table are fixed in length, the fields cannot be added automatically along with the change of time and data, and when the changed data exceeds the fixed length of the static table, the data overflow can be caused.
Further, the embodiment of the invention sets the original table and the updated table as temporary tables, and simultaneously clears the original table after comparing the data of the original table with the target table each time, thereby greatly reducing the occupation of the storage space of the computer.
Preferably, the comparing the original table with the target table to obtain updated data includes:
acquiring data in the original table and the target table;
comparing the data, if the data are the same, not updating the data, and if the data are different, updating the data;
and summarizing all the updated data to obtain the updated data.
Specifically, the extracting the update data into the update table includes:
acquiring a preset cursor, wherein the cursor comprises a query statement;
and executing the query statement in the cursor in the original table and the target table, and extracting the update data to the update table.
Further, after comparing the original table with the target table to obtain updated data, the method further includes:
and clearing the data in the original table.
Wherein the cursor is a method of processing data, the cursor providing the ability to browse data forward or backward one or more lines at a time in the updated original table and the target table. The cursor is treated as a pointer that can designate any location in the updated original table and the target table and then allow the user to process the data at the designated location. In the embodiment of the invention, the query statement can be a currently disclosed Structured Query Language (SQL), which is the most widely used language in data processing, allows a user to concisely and concisely explain required business logic, and the SQL belongs to a set language, so that only the requirement expression is clear and the specific practice is not required to be known; SQL can be optimized, and a plurality of query optimizers are built in, and can translate an optimal execution plan for SQL.
Furthermore, the invention stores the updated data through the updated table, can conveniently inquire the data updated each time, and simultaneously declares the cursor through the inquiry statement, so that the updated data can be accurately obtained, the accuracy of data updating is improved, and the SQL statement is utilized, so that the modification and maintenance are more convenient.
And S3, associating the update table with the target table, importing the update data into the target table according to the association, and sending the target table to a designated terminal.
Preferably, referring to fig. 3, the step S3 includes:
s30, acquiring a preset association transaction, and establishing an association relation between the update table and the target table by using the association transaction;
s31, importing the updated data into the target table through the association relation, and sending the target table to a specified terminal.
Further, in the embodiment of the present invention, the association transaction may be written by an SQL statement, and is used to associate the update table with the target table, and when the update data in the update table is updated, synchronously export the update data to the target table. The designated terminal may be a large screen that displays business transactions in real time, such as a large screen that updates policy transactions in real time.
The invention can synchronously derive the update data after the update of the update data is completed by carrying out the association through the association transaction, thereby greatly reducing the delay of the real-time update of the data.
According to the invention, the data in the original data set is imported into the target database, so that the data can be directly mapped into the original table, the data updating speed is greatly improved, the original table is a temporary table, the data can be emptied after each data updating, the occupation of the storage space of a computer is reduced, and meanwhile, the updating table is associated with the target table, so that the data updating speed is further improved. Therefore, the embodiment of the invention can solve the problem of higher data update delay.
Fig. 4 is a functional block diagram of an apparatus for automatically updating and synchronizing data according to an embodiment of the present invention.
The automatic data updating and synchronizing device 100 of the present invention may be installed in an electronic apparatus. The automatic data updating and synchronizing device 100 may include a data acquisition module 101, a data updating module 102, and a data association module 103, depending on the functions implemented. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the data acquisition module 101 is configured to acquire an original data set from one or more source databases according to a time stamp that changes with time and a preset time interval, and import the original data set into a target database, and map the original data set to obtain an original table.
In at least one embodiment of the invention, the raw data set comprises: business data, financial data, and/or product data, etc. For example, in the area of security, the business data may include: an amount of the application, a type of the application, etc., the financial data may include: the fund duty cycle of the application, the profit of the application, the rate of return of the application, etc., the product data may include: life risk category, car risk category, accident risk category, etc. The source database may be a database such as MySQL or oracle, and in the embodiment of the present invention, a database (e.g., sql Server database) with a timestamp supporting automatic update may be used.
Specifically, the data update module 102 obtains the original data set from one or more source databases according to a time-varying time stamp and a preset time interval by:
acquiring standard time based on the preset time interval, and updating the time stamp according to the standard time to obtain an updated time stamp;
and based on the update time stamp, extracting data in the source database to the original table by using a preset open source tool.
Preferably, the data updating module 102 extracts the data in the source database to the original table by using a preset open source tool by:
judging whether the original data set can be directly imported into the target database;
if the data of the original data set can be directly imported, importing the original data set into the target database;
if the data of the original data set can not be directly imported, converting the original data set into a text file, and importing the text file into the target database.
And mapping the imported data into the original table in the target database.
In detail, the target database may be a hive database. The preset open source tool may use the currently disclosed Sqoop tool. The embodiment of the invention can set every preset time interval, automatically update the time stamp by using the standard time, continuously extract the data in the source database to the hive database by using the preset open source tool by automatically updating the time stamp, and map the data to the original table. Preferably, the preset time interval may be set to one minute, that is, the time stamp is updated with the standard time every minute, and data is extracted into the original table.
Based on the implementation mode, the method and the device for updating the data of the hive database are used for importing the original data set into the hive database, and the original data set can be directly mapped into an original table, so that the data updating speed is improved.
The data updating module 102 is configured to construct a target table and an update table in the target database, compare the original table with the target table to obtain updated data, and extract the updated data into the update table.
The target table is a final summarized data table, and the update table is used for recording data which need to be updated each time.
The target table and the update table in the embodiment of the invention can be set as a dynamic table when being created. The dynamic table refers to a table type in which data can be dynamically extracted along with time and change of the data, wherein fields in the dynamic table are of indefinite length. In comparison, the fields in the conventional static table are fixed in length, the fields cannot be added automatically along with the change of time and data, and when the changed data exceeds the fixed length of the static table, the data overflow can be caused.
Further, the embodiment of the invention sets the original table and the updated table as temporary tables, and simultaneously clears the original table after comparing the data of the original table with the target table each time, thereby greatly reducing the occupation of the storage space of the computer.
Preferably, the data update module 102 obtains the update data by:
acquiring data in the original table and the target table;
comparing the data, if the data are the same, not updating the data, and if the data are different, updating the data;
and summarizing all the updated data to obtain the updated data.
Specifically, the data update module 102 extracts the update data into the update table by:
acquiring a preset cursor, wherein the cursor comprises a query statement;
and executing the query statement in the cursor in the original table and the target table, and extracting the update data to the update table.
Further, the data updating module 102 further includes:
and clearing the data in the original table.
Wherein the cursor is a method of processing data, the cursor providing the ability to browse data forward or backward one or more lines at a time in the updated original table and the target table. The cursor is treated as a pointer that can designate any location in the updated original table and the target table and then allow the user to process the data at the designated location. In the embodiment of the invention, the query statement can be a currently disclosed Structured Query Language (SQL), which is the most widely used language in data processing, allows a user to concisely and concisely explain required business logic, and the SQL belongs to a set language, so that only the requirement expression is clear and the specific practice is not required to be known; SQL can be optimized, and a plurality of query optimizers are built in, and can translate an optimal execution plan for SQL.
Furthermore, the invention stores the updated data through the updated table, can conveniently inquire the data updated each time, and simultaneously declares the cursor through the inquiry statement, so that the updated data can be accurately obtained, the accuracy of data updating is improved, and the SQL statement is utilized, so that the modification and maintenance are more convenient.
The data association module 103 is configured to associate the update table with the target table, import the update data into the target table according to the association, and send the target table to a specified terminal.
In detail, the data association module 103 associates the update table with the target table, imports the update data into the target table according to the association, and transmits the target table to a designated terminal by:
acquiring a preset association transaction, and establishing an association relation between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the association relation, and sending the target table to a designated terminal.
Further, in the embodiment of the present invention, the association transaction may be written by an SQL statement, and is used to associate the update table with the target table, and when the update data in the update table is updated, synchronously export the update data to the target table. The designated terminal may be a large screen that displays business transactions in real time, such as a large screen that updates policy transactions in real time.
The invention can synchronously derive the update data after the update of the update data is completed by carrying out the association through the association transaction, thereby greatly reducing the delay of the real-time update of the data.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a method for automatically updating and synchronizing data according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data auto-update and synchronization program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the data automatic update and synchronization program 12, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (e.g., automatic data update and synchronization programs, etc.) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 5 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The automatic update and synchronization program 12 of data stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, can implement:
acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table;
constructing a target table and an update table in the target database, comparing the original table with the target table to obtain update data, and extracting the update data into the update table;
and associating the update table with the target table, importing the update data into the target table according to the association, and sending the target table to a designated terminal.
Specifically, the specific implementation method of the above instructions by the processor 10 may refer to descriptions of related steps in the corresponding embodiments of fig. 1 to 3, which are not repeated herein.
Further, the integrated modules/units of the electronic device 1 may be stored in a non-volatile computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. A method for automatically updating and synchronizing data, the method comprising:
acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table;
constructing a target table and an update table in the target database, comparing the original table with the target table to obtain update data, and extracting the update data into the update table;
associating the update table with the target table, importing the update data into the target table according to the association, and transmitting the target table to a designated terminal;
wherein the comparing the original table with the target table to obtain updated data includes: acquiring data in the original table and the target table; comparing the data, if the data are the same, not updating the data, and if the data are different, updating the data; and summarizing all the updated data to obtain the updated data.
2. The method for automatically updating and synchronizing data according to claim 1, wherein said obtaining the original data set from one or more source databases according to a time-varying time stamp and a predetermined time interval comprises:
acquiring standard time based on the preset time interval, and updating the time stamp according to the standard time to obtain an updated time stamp;
and based on the update time stamp, extracting data in the source database to the original table by using a preset open source tool.
3. The method for automatically updating and synchronizing data according to claim 2, wherein said extracting data in said source database to said original table using a predetermined open source tool comprises:
judging whether the original data set can be directly imported into the target database;
if the data of the original data set can be directly imported, importing the original data set into the target database;
if the data of the original data set can not be directly imported, converting the original data set into a text file, and importing the text file into the target database;
and mapping the imported data into the original table in the target database.
4. The method for automatically updating and synchronizing data according to claim 1, wherein the comparing the original table with the target table to obtain updated data further comprises:
and clearing the data in the original table.
5. The method for automatically updating and synchronizing data according to any one of claims 1 to 4, wherein the extracting the updated data into the update table comprises:
acquiring a preset cursor, wherein the cursor comprises a query statement;
and executing the query statement in the cursor in the original table and the target table, and extracting the update data to the update table.
6. The automatic data updating and synchronizing method according to any one of claims 1 to 4, wherein the associating the updated table with the target table, importing the updated data into the target table according to the association, and transmitting the target table to a designated terminal, includes:
acquiring a preset association transaction, and establishing an association relation between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the association relation, and sending the target table to a designated terminal.
7. An automatic data updating and synchronizing apparatus for implementing the automatic data updating and synchronizing method according to any one of claims 1 to 6, characterized in that the apparatus comprises:
the data acquisition module is used for acquiring an original data set from one or more source databases according to a time stamp changing along with time and a preset time interval, importing the original data set into a target database, and mapping to obtain an original table;
the data updating module is used for constructing a target table and an updating table in the target database, comparing the original table with the target table to obtain updating data, and extracting the updating data into the updating table;
and the data association module is used for associating the update table with the target table, importing the update data into the target table according to the association, and sending the target table to a designated terminal.
8. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of automatically updating and synchronizing data as claimed in any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method for automatically updating and synchronizing data according to any one of claims 1 to 6.
CN202010958065.2A 2020-09-15 2020-09-15 Automatic data updating and synchronizing method and device, electronic equipment and storage medium Active CN112115143B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010958065.2A CN112115143B (en) 2020-09-15 2020-09-15 Automatic data updating and synchronizing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010958065.2A CN112115143B (en) 2020-09-15 2020-09-15 Automatic data updating and synchronizing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112115143A CN112115143A (en) 2020-12-22
CN112115143B true CN112115143B (en) 2024-02-06

Family

ID=73801991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010958065.2A Active CN112115143B (en) 2020-09-15 2020-09-15 Automatic data updating and synchronizing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112115143B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579621B (en) * 2020-12-25 2024-03-19 平安银行股份有限公司 Data display method and device, electronic equipment and computer storage medium
CN112883042A (en) * 2021-02-24 2021-06-01 深圳壹账通智能科技有限公司 Data updating and displaying method and device, electronic equipment and storage medium
CN113034243A (en) * 2021-04-23 2021-06-25 浙江吉利控股集团有限公司 Wiring harness configuration design method, wiring harness configuration design system, electronic equipment and medium
CN113779141A (en) * 2021-08-10 2021-12-10 携程商旅信息服务(上海)有限公司 Business and hotel information synchronous storage method, electronic equipment and medium
CN115599793B (en) * 2022-09-28 2024-01-26 北京亚控科技发展有限公司 Method, device and storage medium for updating data
CN116842030B (en) * 2023-09-01 2023-11-17 广州尚航信息科技股份有限公司 Data synchronous updating method and system of server

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209728A (en) * 2019-04-22 2019-09-06 凯通科技股份有限公司 A kind of Distributed Heterogeneous Database synchronous method, electronic equipment and storage medium
CN111538779A (en) * 2020-03-25 2020-08-14 平安健康保险股份有限公司 Incremental data synchronization method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209728A (en) * 2019-04-22 2019-09-06 凯通科技股份有限公司 A kind of Distributed Heterogeneous Database synchronous method, electronic equipment and storage medium
CN111538779A (en) * 2020-03-25 2020-08-14 平安健康保险股份有限公司 Incremental data synchronization method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112115143A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN112115143B (en) Automatic data updating and synchronizing method and device, electronic equipment and storage medium
WO2021189826A1 (en) Message generation method and apparatus, electronic device, and computer-readable storage medium
CN112115152B (en) Data increment updating and inquiring method and device, electronic equipment and storage medium
CN112883042A (en) Data updating and displaying method and device, electronic equipment and storage medium
CN108073688B (en) Data migration method and device
CN112364107A (en) System analysis visualization method and device, electronic equipment and computer readable storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN112417503A (en) Method and device for authorizing post authority, electronic equipment and storage medium
CN113590632B (en) Database index creation method, device, equipment and medium
WO2022048362A1 (en) Data storage method and apparatus, electronic device, and storage medium
CN114610747A (en) Data query method, device, equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN112579621A (en) Data display method and device, electronic equipment and computer storage medium
CN114880368A (en) Data query method and device, electronic equipment and readable storage medium
CN113722533B (en) Information pushing method and device, electronic equipment and readable storage medium
CN112506931B (en) Data query method, device, electronic equipment and storage medium
CN115758013B (en) Intelligent visual office method and device
CN113590856B (en) Label query method and device, electronic equipment and readable storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN115481145A (en) Data query method, device, equipment and medium based on search engine
CN111553133B (en) Report generation method and device, electronic equipment and storage medium
CN114490137A (en) Service data real-time statistical method and device, electronic equipment and readable storage medium
CN113064928A (en) Report data query method and device, electronic equipment and storage medium

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