CN112115143A - 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
CN112115143A
CN112115143A CN202010958065.2A CN202010958065A CN112115143A CN 112115143 A CN112115143 A CN 112115143A CN 202010958065 A CN202010958065 A CN 202010958065A CN 112115143 A CN112115143 A CN 112115143A
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.)
Granted
Application number
CN202010958065.2A
Other languages
Chinese (zh)
Other versions
CN112115143B (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

Images

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: the method comprises the steps of obtaining an original data set from one or more source databases according to a timestamp 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 sending the target table to a specified terminal. The invention also provides a data automatic updating and synchronizing device, electronic equipment and a computer readable storage medium. The invention can solve the problem of high data updating 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 an apparatus for automatically updating and synchronizing data, an electronic device, and a computer-readable storage medium.
Background
Real-time data updating is becoming more and more important in daily life. As the data scale increases, the number of data sources increases, the data forms are various, and data of various channels generally need to be integrated. The traditional database technology cannot automatically update data, the manual data updating has higher delay, and meanwhile, the updated data may occupy a large amount of computer storage space as the updated data is more and more.
Disclosure of Invention
The invention provides a method and a device for automatically updating and synchronizing data and a computer readable storage medium, and mainly aims to solve the problem of high data updating delay.
In order to achieve the above object, the present invention provides an automatic data updating and synchronizing method, which includes:
acquiring an original data set from one or more source databases according to a timestamp 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;
establishing 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 specified terminal.
Optionally, the obtaining the raw data set from one or more source databases according to a timestamp that varies with time and a preset time interval includes:
acquiring standard time based on the preset time interval, and updating the timestamp according to the standard time to obtain an updated timestamp;
and extracting the data in the source database to the original table by using a preset open source tool based on the update timestamp.
Optionally, the extracting, by using a preset open source tool, data in the source database to the original table 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;
mapping the imported data into the original table in the target database.
Optionally, 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 updated data to obtain the updated data.
Optionally, after the 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;
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 includes:
acquiring a preset association transaction, and establishing an association relationship between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the incidence relation, and sending the target table to a specified terminal.
In order to solve the above problems, the present invention further provides an apparatus for automatically updating and synchronizing data, the apparatus comprising:
the data acquisition module is used for acquiring an original data set from one or more source databases according to a timestamp 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 specified terminal.
In order to solve the above problem, the present invention also provides an electronic device, 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 problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the above 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, and the data can be emptied after each data updating, so that 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 data automatic updating and synchronizing device, the electronic equipment and the computer readable storage medium can solve the problem of high data updating delay.
Drawings
Fig. 1 is a schematic flow chart illustrating an automatic data updating and synchronizing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a schematic flow chart showing another step of FIG. 1;
FIG. 4 is a functional block diagram of an apparatus for automatically updating and synchronizing data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the automatic data updating and synchronizing method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a method for automatically updating and synchronizing data. The execution subject of the data automatic updating and synchronizing method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, 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 the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a method for automatically updating and synchronizing data according to an embodiment of the present invention. 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 timestamp 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 insurance field, the service data may include: number of insuring, amount of insuring, type of insuring, etc., the financial data may include: the fund proportion of the insurance, the profit of the insurance and the return rate of the insurance, and the like, and the product data can comprise: the type of life insurance, the type of car insurance, the type of accident insurance, etc. The source database may be a database such as MySQL, oracle, etc., and in the embodiment of the present invention, a database (e.g., a Sql Server database) whose timestamp supports automatic update may be used.
Specifically, the acquiring the original data set from one or more source databases according to a timestamp that varies with time and a preset time interval includes:
acquiring standard time based on the preset time interval, and updating the timestamp according to the standard time to obtain an updated timestamp;
and extracting the data in the source database to the original table by using a preset open source tool based on the update timestamp.
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, executing S11, and importing the original data set into the target database;
if the data of the original data set cannot be directly imported, executing S12, converting the original data set into a text file, and importing the text file into the target database.
And 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 a currently disclosed Sqoop tool. The embodiment of the invention can set the time stamp to be automatically updated by using the standard time every preset time interval, and continuously extract the data in the source database to the hive database by using the preset open source tool and map the data to the original table by automatically updating the time stamp. Preferably, the preset time interval may be set to one minute, that is, the time stamp is updated every minute by using the standard time, and data is extracted to the original table.
Based on the implementation of the above embodiment, the original data set is imported into the hive database, and the original data set can be directly mapped into an original table, so that the data updating rate is improved.
S2, constructing a target table and an updated table in the target database, comparing the original table with the target table to obtain updated data, and extracting the updated data into the updated table.
The target table is a final summary data table, and the update table is used for recording data which needs to be updated each time.
The target table and the update table in the embodiment of the invention can set the table type as a dynamic table during creation. The dynamic table is a table type in which data can be dynamically extracted along with time and data change, wherein fields in the dynamic table are of indefinite length. In contrast, the fields in the conventional static table are fixed length, and the fields cannot be added by themselves along with the change of time and data, so that the overflow of data can be caused when the changed data exceeds the fixed length of the static table.
Furthermore, in the embodiment of the present invention, the original table and the updated table are set as temporary tables, and the data in the original table is cleared after being compared with the target table each time, so that the occupation of the storage space of the computer is greatly reduced.
Preferably, the comparing the original table with the target table to obtain the 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 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;
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 the 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.
Wherein the cursor is a method of processing data, the cursor providing the ability to browse data forward or backward one or more rows at a time in the updated original table and the target table. Treating the cursor as a pointer can specify any location in the updated original table and the target table, and then allow the user to process the data at the specified location. In the embodiment of the invention, the query statement can be Structured Query Language (SQL) which is disclosed at present, the SQL is the most extensive language used in data processing, a user is allowed to concisely and briefly declare required business logic, and the SQL belongs to a set language, only needs to clearly express the requirement and does not need to know the specific method; SQL can be optimized, various query optimizers are built in, and the various query optimizers can translate an optimal execution plan for SQL.
Furthermore, the invention stores the updated data through the update table, can conveniently inquire the data updated each time, can accurately acquire the updated data through the statement vernier, improves the accuracy of data update, and is more convenient to modify and maintain by utilizing the SQL statement.
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 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;
and S31, importing the updated data into the target table through the incidence relation, and sending the target table to a specified terminal.
Further, in this 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, the update data is synchronously exported to the target table. The designated terminal may be a large screen for displaying the business transaction in real time, for example, a large screen for updating the policy transaction in real time.
The invention implements the association through the association transaction, can synchronously export the updated data after the updated data is updated, and greatly reduces the delay of 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, and the data can be emptied after each data updating, so that 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 updating 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 can be installed in an electronic device. According to the realized functions, the automatic data updating and synchronizing device 100 may include a data acquiring module 101, a data updating module 102 and a data associating module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the data obtaining module 101 is configured to obtain an original data set from one or more source databases according to a timestamp changing with time and a preset time interval, 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 insurance field, the service data may include: number of insuring, amount of insuring, type of insuring, etc., the financial data may include: the fund proportion of the insurance, the profit of the insurance and the return rate of the insurance, and the like, and the product data can comprise: the type of life insurance, the type of car insurance, the type of accident insurance, etc. The source database may be a database such as MySQL, oracle, etc., and in the embodiment of the present invention, a database (e.g., a Sql Server database) whose timestamp supports automatic update may be used.
Specifically, the data updating module 101 obtains the original data set from one or more source databases according to a timestamp that varies with time and a preset time interval by:
acquiring standard time based on the preset time interval, and updating the timestamp according to the standard time to obtain an updated timestamp;
and extracting the data in the source database to the original table by using a preset open source tool based on the update timestamp.
Preferably, the data updating module 101 extracts the data in the source database to the original table by using a preset open source tool through the following operations:
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;
and 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.
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 a currently disclosed Sqoop tool. The embodiment of the invention can set the time stamp to be automatically updated by using the standard time every preset time interval, and continuously extract the data in the source database to the hive database by using the preset open source tool and map the data to the original table by automatically updating the time stamp. Preferably, the preset time interval may be set to one minute, that is, the time stamp is updated every minute by using the standard time, and data is extracted to the original table.
Based on the implementation of the above embodiment, the original data set is imported into the hive database, and the original data set can be directly mapped into an original table, so that the data updating rate is improved.
The data update 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 update data, and extract the update data into the update table.
The target table is a final summary data table, and the update table is used for recording data which needs to be updated each time.
The target table and the update table in the embodiment of the invention can set the table type as a dynamic table during creation. The dynamic table is a table type in which data can be dynamically extracted along with time and data change, wherein fields in the dynamic table are of indefinite length. In contrast, the fields in the conventional static table are fixed length, and the fields cannot be added by themselves along with the change of time and data, so that the overflow of data can be caused when the changed data exceeds the fixed length of the static table.
Furthermore, in the embodiment of the present invention, the original table and the updated table are set as temporary tables, and the data in the original table is cleared after being compared with the target table each time, so that the occupation of the storage space of the computer is greatly reduced.
Preferably, the data updating module 102 obtains the updated 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 updated data to obtain the updated data.
Specifically, the data updating module 102 extracts the updated data into the update table by:
acquiring a preset cursor, wherein the cursor comprises a query statement;
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 update 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 rows at a time in the updated original table and the target table. Treating the cursor as a pointer can specify any location in the updated original table and the target table, and then allow the user to process the data at the specified location. In the embodiment of the invention, the query statement can be Structured Query Language (SQL) which is disclosed at present, the SQL is the most extensive language used in data processing, a user is allowed to concisely and briefly declare required business logic, and the SQL belongs to a set language, only needs to clearly express the requirement and does not need to know the specific method; SQL can be optimized, various query optimizers are built in, and the various query optimizers can translate an optimal execution plan for SQL.
Furthermore, the invention stores the updated data through the update table, can conveniently inquire the data updated each time, can accurately acquire the updated data through the statement vernier, improves the accuracy of data update, and is more convenient to modify and maintain by utilizing the SQL statement.
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 designated 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 sends the target table to a designated terminal:
acquiring a preset association transaction, and establishing an association relationship between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the incidence relation, and sending the target table to a specified terminal.
Further, in this 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, the update data is synchronously exported to the target table. The designated terminal may be a large screen for displaying the business transaction in real time, for example, a large screen for updating the policy transaction in real time.
The invention implements the association through the association transaction, can synchronously export the updated data after the updated data is updated, and greatly reduces the delay of real-time update of the data.
Fig. 5 is a schematic structural diagram of an electronic device implementing an automatic data updating and synchronizing method 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 an automatic data 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, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, 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 also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and 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 to store 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 to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 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 (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be 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 a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally 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 device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The automatic data updating and synchronization program 12 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 timestamp 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;
establishing 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 specified terminal.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 3, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
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 attributes 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 block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An automatic data updating and synchronizing method, characterized in that the method comprises:
acquiring an original data set from one or more source databases according to a timestamp 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;
establishing 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 specified terminal.
2. The method for automatically updating and synchronizing data according to claim 1, wherein the obtaining of the original data set from one or more source databases according to a time-varying timestamp and a predetermined time interval comprises:
acquiring standard time based on the preset time interval, and updating the timestamp according to the standard time to obtain an updated timestamp;
and extracting the data in the source database to the original table by using a preset open source tool based on the update timestamp.
3. The method for automatically updating and synchronizing data according to claim 2, wherein the extracting the data in the source database to the original table by using a preset 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;
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 comprises:
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 updated data to obtain the updated data.
5. The method for automatically updating and synchronizing data according to claim 4, wherein after comparing the original table with the target table to obtain updated data, the method further comprises:
and clearing the data in the original table.
6. The method for automatically updating and synchronizing data according to any one of claims 1 to 5, wherein the extracting the updated data into the update table comprises:
acquiring a preset cursor, wherein the cursor comprises a query statement;
executing the query statement in the cursor in the original table and the target table, and extracting the update data to the update table.
7. The method according to any one of claims 1 to 5, wherein 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 designated terminal includes:
acquiring a preset association transaction, and establishing an association relationship between the update table and the target table by using the association transaction;
and importing the updated data into the target table through the incidence relation, and sending the target table to a specified terminal.
8. An apparatus for automatically updating and synchronizing data, the apparatus comprising:
the data acquisition module is used for acquiring an original data set from one or more source databases according to a timestamp 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 specified terminal.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
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 a method of automatic data update and synchronization according to any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a method for automatic update and synchronization of data according to any one of claims 1 to 7.
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 true CN112115143A (en) 2020-12-22
CN112115143B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579621A (en) * 2020-12-25 2021-03-30 平安银行股份有限公司 Data display method and device, electronic equipment and computer 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
WO2022179123A1 (en) * 2021-02-24 2022-09-01 深圳壹账通智能科技有限公司 Data update and presentation method and apparatus, and electronic device and storage medium
CN115599793A (en) * 2022-09-28 2023-01-13 北京亚控科技发展有限公司(Cn) Method, device and storage medium for updating data
CN116842030A (en) * 2023-09-01 2023-10-03 广州尚航信息科技股份有限公司 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

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579621A (en) * 2020-12-25 2021-03-30 平安银行股份有限公司 Data display method and device, electronic equipment and computer storage medium
CN112579621B (en) * 2020-12-25 2024-03-19 平安银行股份有限公司 Data display method and device, electronic equipment and computer storage medium
WO2022179123A1 (en) * 2021-02-24 2022-09-01 深圳壹账通智能科技有限公司 Data update and presentation method and apparatus, and electronic device 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
CN115599793A (en) * 2022-09-28 2023-01-13 北京亚控科技发展有限公司(Cn) Method, device and storage medium for updating data
CN115599793B (en) * 2022-09-28 2024-01-26 北京亚控科技发展有限公司 Method, device and storage medium for updating data
CN116842030A (en) * 2023-09-01 2023-10-03 广州尚航信息科技股份有限公司 Data synchronous updating method and system of server
CN116842030B (en) * 2023-09-01 2023-11-17 广州尚航信息科技股份有限公司 Data synchronous updating method and system of server

Also Published As

Publication number Publication date
CN112115143B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN112115143B (en) Automatic data updating and synchronizing method and device, electronic equipment and storage medium
CN112115152B (en) Data increment updating and inquiring method and device, electronic equipment and storage medium
CN112052370A (en) Message generation method and device, electronic equipment and computer readable storage medium
CN112052242A (en) Data query method and device, electronic equipment and storage medium
CN112883042A (en) Data updating and displaying method and device, electronic equipment and storage medium
CN111428458A (en) Universal report generation method and device and computer readable storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN111400363A (en) Index data processing method and device, electronic equipment and storage medium
CN112364107A (en) System analysis visualization method and device, electronic equipment and computer readable storage medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN114610747A (en) Data query method, device, equipment and storage medium
WO2022048362A1 (en) Data storage method and apparatus, electronic device, and storage medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN113590632A (en) Database index creating method, device, equipment and 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
CN114490586A (en) Medical information safe storage cooperation system based on block chain
CN112948380A (en) Data storage method and device based on big data, electronic equipment and storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN112506931A (en) Data query method and device, electronic equipment and storage medium
CN113254446A (en) Data fusion method and device, electronic equipment and medium
CN112328656A (en) Service query method, device, equipment and storage medium based on middle platform architecture
CN115758013A (en) Intelligent visual office method and device
CN113064928A (en) Report data query method and device, electronic equipment and storage medium
CN115114297A (en) Data lightweight storage and search 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