CN113449035B - Data synchronization method, device, computer equipment and readable storage medium - Google Patents

Data synchronization method, device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN113449035B
CN113449035B CN202110724266.0A CN202110724266A CN113449035B CN 113449035 B CN113449035 B CN 113449035B CN 202110724266 A CN202110724266 A CN 202110724266A CN 113449035 B CN113449035 B CN 113449035B
Authority
CN
China
Prior art keywords
data
service
derivative
information
request
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
CN202110724266.0A
Other languages
Chinese (zh)
Other versions
CN113449035A (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.)
Ping An Health Insurance Company of China Ltd
Original Assignee
Ping An Health Insurance Company of China 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 Ping An Health Insurance Company of China Ltd filed Critical Ping An Health Insurance Company of China Ltd
Priority to CN202110724266.0A priority Critical patent/CN113449035B/en
Publication of CN113449035A publication Critical patent/CN113449035A/en
Application granted granted Critical
Publication of CN113449035B publication Critical patent/CN113449035B/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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

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

Abstract

The invention relates to the field of big data, and discloses a data synchronization method, a device, computer equipment and a readable storage medium, wherein the method comprises the following steps: receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request; generating a derivative request according to the synchronous key clicked by the user side in the data source page; creating a derivative script according to the derivative request by a scheduling system, and creating a scheduling task according to the derivative script; and calling a dispatching system to execute dispatching tasks so as to synchronize the service data corresponding to the service information in the derivative request between the data source system and the user side. The present invention also relates to blockchain techniques in which information may be stored in blockchain nodes. The invention can realize data synchronization operation by only executing the data synchronization operation by the server without manually importing and exporting the data, thereby improving the data synchronization efficiency, simultaneously, orderly executing the scheduling task and ensuring the task execution efficiency.

Description

Data synchronization method, device, computer equipment and readable storage medium
Technical Field
The present invention relates to the field of data processing technologies for big data, and in particular, to a data synchronization method, a data synchronization device, a computer device, and a readable storage medium.
Background
In daily research and development and testing, the frequency of data synchronization of databases of different environments and different types is very frequent, so in order to ensure the data synchronism between a user terminal and a data source system, a great deal of time is usually required for a worker to perform manual data import and export operations so as to realize the synchronism.
However, the inventor realizes that such manual import/export operations generally require a great deal of effort from a worker to query the service data to be synchronized, and then perform the manual import/export operation to achieve data synchronization, which is not only tedious and time-consuming, but also greatly reduces the efficiency of data synchronization.
Disclosure of Invention
The invention aims to provide a data synchronization method, a data synchronization device, computer equipment and a readable storage medium, which are used for solving the problems that a great deal of effort is required to inquire service data to be synchronized, and data synchronization is realized by importing/exporting operation, so that the time is wasted and the data synchronization efficiency is reduced in the prior art.
In order to achieve the above object, the present invention provides a data synchronization method, including:
receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server for storing service data and service information, and the service information is used for describing the attribute of the service data;
generating a derivative request according to the synchronous key clicked by the user side in the data source page;
creating a derivative script according to the derivative request through a preset scheduling system, and creating a scheduling task according to the derivative script;
And calling the dispatching system to execute the dispatching task so as to enable the service data corresponding to the service information in the derivative request to perform data synchronization between the data source system and the user terminal.
In the above scheme, the step of sending the data source page with the service information to the user terminal according to the access request includes:
extracting identity information in the access request, and judging whether the identity information is authorized to access the data source system or not through a preset user library;
if yes, sending data source page information to the user side, and controlling the user side to render the data source page information to form a data source page;
if not, sending unauthorized access information to the user.
In the above solution, after the sending, according to the access request, the data source page with service information to the user side, the method further includes:
and receiving data maintenance information sent by the user terminal according to the data source page, and editing the service information, deleting the service information or adding the service information of the service data newly according to the data maintenance information.
In the above scheme, the step of generating the derivative request according to the step of clicking the synchronization key in the data source page by the user terminal includes:
According to an offline signal generated by clicking the offline synchronous key on a data source page by a user side, an interface form is sent to the user side, an import operation or an export operation selected by the user side in the interface form and a service label of selected service information are received, and a derivative request is generated according to the import operation or the export operation, the offline signal and the service label; or (b)
Sending an interface form to a user terminal according to a real-time signal generated by the user terminal clicking the real-time synchronous key on a data source page, receiving an import operation or an export operation selected by the user terminal in the interface form and a service label of selected service information, and generating a derivative request according to the import operation or the export operation, the real-time signal and the service label; or (b)
And sending an interface form to the user terminal according to the number of the user terminal and the service signals generated by clicking the service synchronous keys on a data source page by the user terminal, receiving the selected import operation or export operation of the user terminal in the interface form and the service label of the selected service information, and generating a derivative request according to the import operation or export operation, the service signals and the service label.
In the above scheme, the step of creating the derivative script according to the derivative request and creating the scheduling task according to the derivative script by a preset scheduling system includes:
Extracting parameter entering information from the derivative request, and extracting request information in the derivative request; the parameter entering information comprises the service tag, and the request information is the import operation or the export operation;
Acquiring a target template from a preset interface template according to the request information, and inputting the parameter entering information into the target template to generate the derivative script;
And calling the scheduling system to create a scheduling task for acquiring the service data from a database storing the service data or loading the service data into the database according to the derivative script.
In the above scheme, the step of calling the scheduling system to execute the scheduling task includes:
If the scheduling task has an offline signal, calling a derivative component in the scheduling system to execute the scheduling task according to a preset offline period or offline time period, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side;
If the scheduling task has a real-time signal, calling a derivative component in the scheduling system to execute the scheduling task, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side;
if the dispatching task has a service signal, a statement executing component is started through the dispatching system, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side.
In the above solution, after the scheduling task is executed by the scheduling system, the method further includes:
Acquiring an execution result of the scheduling task, importing the execution result into a preset efficiency analysis component, calling the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and sending the derivative analysis information to the user side to form an analysis page;
After the derivative analysis information is sent to the user side to form an analysis page, the method further comprises:
Uploading the analysis page into a blockchain.
In order to achieve the above object, the present invention further provides a data synchronization device, including:
The system comprises a page sending module, a service information sending module and a service information sending module, wherein the page sending module is used for receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server used for storing service data and service information, and the service information is used for describing the attribute of the service data;
The request generation module is used for generating a derivative request according to the synchronous key clicked by the user side in the data source page;
the task creation module is used for creating a derivative script according to the derivative request through a preset scheduling system and creating a scheduling task according to the derivative script;
And the task execution module is used for calling the dispatching system to execute the dispatching task and enabling the service data corresponding to the service information in the derivative request to perform data synchronization between the data source system and the user side.
To achieve the above object, the present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor of the computer device implementing the steps of the above-mentioned data synchronization method when executing the computer program.
To achieve the above object, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the above-described data synchronization method.
According to the data synchronization method, the data synchronization device, the computer equipment and the readable storage medium, the access request sent by the user side is received, the data source page with the service information is sent to the user side according to the access request, the technical effect of providing the visual page for the user side is achieved, and the convenience of maintaining the service data by the user side is improved.
By constructing the synchronous key on the data source page, the technical effect of automatically generating the derivative request is achieved, so that the user side can achieve the operation of the derivative request by clicking the synchronous key, and the operation of manually inquiring service data and manually importing or exporting the service data into or from the data source system is not needed, which results in complicated and time-consuming data synchronization operation.
The scheduling system creates the derivative script according to the derivative request, automatically generates the derivative script and automatically generates the scheduling task according to the derivative script in a mode of creating the scheduling task according to the derivative script, and once the scheduling task is formed, the data synchronization operation can be realized by only executing the scheduling task by the server without manually importing and exporting data, so that the data synchronization efficiency is improved.
The scheduling system is called to execute the scheduling tasks, so that the service data corresponding to the service information in the derivative request is subjected to data synchronization between the data source system and the user side, the scheduling tasks are orderly executed, and the task execution efficiency is ensured.
Drawings
FIG. 1 is a flowchart of a data synchronization method according to a first embodiment of the present invention;
FIG. 2 is an environmental application schematic diagram of a data synchronization method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a data synchronization method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a program module of a third embodiment of a data synchronization apparatus according to the present invention;
fig. 5 is a schematic hardware structure of a computer device in a fourth embodiment of the computer device of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. 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. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The data synchronization method, the data synchronization device, the computer equipment and the readable storage medium are suitable for the technical field of data processing of big data, and are based on a page sending module, a request generating module, a task creating module and a task executing module. According to the invention, the data source page is sent to the user terminal through the access request sent by the user terminal, the derivative request is generated according to the click of the synchronous key in the data source page by the user terminal, the derivative script is created through the scheduling system according to the derivative request, the scheduling task is created according to the derivative script, and the scheduling system is called to execute the scheduling task, so that the data synchronization is carried out between the data source system and the user terminal.
Embodiment one:
Referring to fig. 1, a data synchronization method of the present embodiment includes:
S101: receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server for storing service data and service information, and the service information is used for describing the attribute of the service data.
S103: and generating a derivative request according to the synchronous key clicked by the user side in the data source page.
S104: and creating a derivative script according to the derivative request through a preset scheduling system, and creating scheduling tasks according to the derivative script.
S105: and calling the dispatching system to execute the dispatching task so as to enable the service data corresponding to the service information in the derivative request to perform data synchronization between the data source system and the user terminal.
In an exemplary embodiment, by receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, the technical effect of providing a visual page for the user terminal is achieved, and convenience in maintaining service data by the user terminal is improved. Further, the data source page is Vue codes, wherein the Vue codes are page codes constructed based on Vue. Js, the page display is realized through rendering operation on a user side, the Vue. Js is a library for constructing a data-driven Web interface, and the core of the data binding system is a responsive data binding system. Therefore, the core library of the Vue.js only focuses on the view layer, is easy to integrate with other libraries or existing projects, and improves the integration effect of the page and the business information.
By constructing the synchronization key on the data source page through springboot, the technical effect of automatically generating the derivative request is achieved, so that the user side can achieve the operation of the derivative request only by clicking the synchronization key, and the operation of manually inquiring service data and manually importing or exporting the service data into or from the data source system is not needed, which results in complicated and time-consuming data synchronization operation.
By adopting DolphinScheduler as the dispatching system, a derivative script is created by the dispatching system according to the derivative request, and a dispatching task is automatically generated according to the derivative script and the derivative script, once the dispatching task is formed, the data synchronization operation can be realized by only executing the dispatching task by a server without manually importing and exporting data, and the data synchronization efficiency is improved.
And executing the scheduling task by calling the scheduling system to enable the service data corresponding to the service information in the derivative request to be subjected to data synchronization between the data source system and the user terminal, so that the scheduling task is orderly executed, and the task execution efficiency is ensured.
Embodiment two:
The present embodiment is a specific application scenario of the first embodiment, and by this embodiment, the method provided by the present invention can be more clearly and specifically described.
In the following, a method provided by this embodiment will be specifically described by taking, as an example, creating a derivative script according to a derivative request in a server running a data synchronization method, and synchronizing data between a data source system and a user terminal by service data corresponding to the derivative request. It should be noted that the present embodiment is only exemplary, and does not limit the scope of protection of the embodiment of the present invention.
Fig. 2 schematically illustrates an environmental application diagram of a data synchronization method according to a second embodiment of the present application.
In the exemplary embodiment, the servers 2 where the data synchronization method is located are respectively connected to the clients 4 through the network 3; the server 2 may provide services through one or more networks 3, and the networks 3 may include various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. The network 3 may include physical links such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like. The network 3 may include wireless links, such as cellular links, satellite links, wi-Fi links, and/or the like; the client 4 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, or other computer devices.
Fig. 3 is a flowchart of a specific method of a data synchronization method according to an embodiment of the present invention, where the method specifically includes steps S201 to S206.
S201: receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server for storing service data and service information, and the service information is used for describing the attribute of the service data.
In order to provide a visual page for a user terminal so as to facilitate the operation of the user terminal on business data to be adjusted or synchronized, the step improves the convenience of the user terminal for maintaining the business data by receiving an access request sent by the user terminal and sending a data source page with business information to the user terminal according to the access request.
In this step, the data source page is Vue codes, where the Vue code is a page code constructed based on vue.js, which implements page display through rendering operations on the user side, where vue.js is a library for constructing a data-driven Web interface, and the core is a responsive data binding system. Therefore, the core library of the Vue.js only focuses on the view layer, is easy to integrate with other libraries or existing projects, and improves the integration effect of the page and the business information.
In a preferred embodiment, the step of sending a data source page with service information to the user terminal according to the access request includes:
S11: extracting identity information in the access request, and judging whether the identity information is authorized to access the data source system or not through a preset user library;
In this step, the user library has an access mapping table reflecting the mapping relationship between the identity information of the user terminal and the authority information, and the authority information corresponding to the identity information of the user terminal is obtained through the mapping table.
S12: if yes, sending data source page information to the user side, and controlling the user side to render the data source page information to form a data source page;
In this step, the data source page information is sent to the client, and the rendering component controls the client to render the data source page information to form a data source page for display on the client.
S13: if not, sending unauthorized access information to the user.
S202: and receiving data maintenance information sent by the user terminal according to the data source page, and editing the service information, deleting the service information or adding the service information of the service data newly according to the data maintenance information.
In order to facilitate the maintenance of service information by a user side, the step is to edit the service information on a data source page by the user side through clicking data maintenance information with an editing instruction generated by an editing key on the data source page; receiving data maintenance information with a deleting instruction generated by a user side by clicking a deleting key on a data source page, and performing deleting operation on service information on the data source page; and receiving data maintenance information with a new instruction generated by the user side by clicking a new key on the data source page, wherein the data maintenance information is used for newly adding service information in the data source page, and realizing the technical effect of quickly and conveniently maintaining the service information.
In a preferred embodiment, the step of editing the service information, deleting the service information, or adding the service information of the service data according to the data maintenance information includes:
S21: and extracting an operation instruction in the data maintenance information, and judging the content of the operation instruction.
In this step, the content of the operation instruction includes an edit instruction, a delete instruction, and a new instruction.
S22: if the content of the operation instruction is an editing instruction, judging whether the user side has editing rights or not through a preset rights library; if yes, extracting editing target information in the data maintenance information, and modifying service information corresponding to the editing target information in the data source system into the service information in the data maintenance information; if not, sending unauthorized editing information to the user.
In this step, the rights library has an operation mapping table reflecting the mapping relationship between the identity information of the user terminal and the operation instruction, and the user terminal is judged whether to have editing rights by the operation mapping table.
S23: if the content of the operation instruction is a deletion instruction, judging whether the user side has a deletion authority or not through a preset authority library; if yes, extracting deletion target information in the data maintenance information, and deleting service information corresponding to the deletion target information in the data source system; if not, sending unauthorized deletion information to the user.
In this step, the rights library has an operation mapping table reflecting the mapping relationship between the identity information of the user terminal and the operation instruction, and the operation mapping table is used to determine whether the user terminal has the deletion rights.
S24: if the content of the operation instruction is a new instruction, judging whether the user side has the new permission or not through a preset permission library; if yes, inputting the business information in the data maintenance information into the data source system; if not, sending unauthorized new information to the user terminal.
In this step, the rights library has an operation mapping table reflecting the mapping relationship between the identity information of the user terminal and the operation instruction, and the operation mapping table is used to determine whether the user terminal has a new right.
S203: and generating a derivative request according to the synchronous key clicked by the user side in the data source page.
In order to automatically generate a derivative request for realizing data synchronization between the user terminal and the data source system, a synchronization key is constructed on the data source page through springboot in the step for realizing the technical effect of automatically generating the derivative request, so that the user terminal can realize the operation of the derivative request by clicking the synchronization key without manually inquiring service data and manually importing or exporting the service data into or from the data source system, and the data synchronization operation is complicated and time-consuming. Springboot is a default configuration springSpringBoot, which is a framework for servicing numerous frames of Spring by simplifying a large number of and cumbersome configuration files required by the numerous frames of Spring, and in this embodiment, dependencies required by a synchronization key can be constructed by performing simple configuration in springboot, and the dependencies are automatically configured, so that the construction efficiency of the synchronization key is improved.
In this embodiment, the synchronization key includes: an offline synchronization key, a real-time synchronization key, and a business synchronization key.
In a preferred embodiment, the step of generating the derivative request according to the user clicking the sync key in the data source page includes:
S31: and sending an interface form to the user terminal according to an offline signal generated by clicking the offline synchronous key on a data source page by the user terminal, receiving an import operation or an export operation selected by the user terminal in the interface form, and a service label of the selected service information, and generating a derivative request according to the import operation or the export operation, the offline signal and the service label.
In this step, the offline synchronization key is an interaction component configured on the basis of springboot keys on the data source page, and is configured to generate an offline signal and send an interface form to the user terminal.
S32: and sending an interface form to the user terminal according to a real-time signal generated by clicking the real-time synchronous key on a data source page by the user terminal, receiving an import operation or an export operation selected by the user terminal in the interface form, and a service label of the selected service information, and generating a derivative request according to the import operation or the export operation, the real-time signal and the service label.
In this step, the real-time synchronization key is an interaction component configured on the basis of springboot keys on the data source page, and is configured to generate a real-time signal and send an interface form to the user terminal.
S33: and sending an interface form to the user terminal according to the number of the user terminal and the service signals generated by clicking the service synchronous keys on a data source page by the user terminal, receiving the selected import operation or export operation of the user terminal in the interface form and the service label of the selected service information, and generating a derivative request according to the import operation or export operation, the service signals and the service label.
In this step, the service synchronization key is an interaction component configured on the basis of springboot keys on the data source page, and is configured to generate a service signal and send an interface form to the user terminal.
S204: and creating a derivative script according to the derivative request through a preset scheduling system, and creating scheduling tasks according to the derivative script.
In order to automatically generate a scheduling task for data synchronization and further achieve the technical effect of service data automatic synchronization, dolphinScheduler is adopted as the scheduling system, a derivative script is created through the scheduling system according to the derivative request, the scheduling task is automatically generated according to the derivative script and the derivative script, once the scheduling task is formed, the server is only required to execute the scheduling task, data synchronization operation is achieved without manually importing and exporting data, and data synchronization efficiency is improved.
It should be noted that DolphinScheduler is: apache DolphinScheduler, which is a distributed decentralized, easily-extensible and visual DAG workflow task scheduling system, the DolphinScheduler is used for solving the complicated dependency relationship in the data processing flow, so that the scheduling system can be used after being unpacked in the data processing flow, and the scheduling efficiency of derivative requests is improved.
In a preferred embodiment, the step of creating a derivative script from the derivative request by a preset scheduling system and creating a scheduling task from the derivative script comprises:
S41: extracting parameter entering information from the derivative request, and extracting request information in the derivative request; the parameter entering information comprises the service tag, and the request information is the import operation or the export operation.
S42: and acquiring a target template from a preset interface template according to the request information, and inputting the parameter entering information into the target template to generate the derivative script.
In this step, the interface template is a computer template that is left blank parameter, and the computer template makes the scheduling system create a task according to the computer template by calling the API of the scheduling system.
The interface template comprises an import template and an export template; if the request information is an import operation, the import template is set as a target template, after the import information is input into the target template parameter, a derivative script capable of calling the scheduling system through the API and generating a scheduling task is obtained, and the derivative script is used for importing service data corresponding to the service tag in the user side into the data source system.
If the request information is export operation, the export template is set as a target template, after the input parameter information is input into parameter of the target template, a derivative script capable of calling the scheduling system through the API and generating a scheduling task is obtained, and the derivative script is used for importing service data corresponding to the service tag in the data source system into the user side.
S43: and calling the scheduling system to create a scheduling task for acquiring the service data from a database storing the service data or loading the service data into the database according to the derivative script.
In this step, the scheduling task has a service tag, and an offline signal, a real-time signal, or a service signal. Specifically, the technical effect of calling the scheduling system is achieved by calling the API of the scheduling system; generating a scheduling task for acquiring service data corresponding to the service tag from the database according to the importing operation in the derivative script; generating a scheduling task for loading service data corresponding to the service tag into the database according to the export operation in the derivative script; if the derivative script is created according to the import template, the scheduling task is to load service data into the database; and if the derivative script is created according to the derived template, the scheduling task is to acquire service data from a database storing the service data.
S205: and calling the dispatching system to execute the dispatching task so as to enable the service data corresponding to the service information in the derivative request to perform data synchronization between the data source system and the user terminal.
In order to enable the dispatching tasks to be executed orderly, the situation that a large number of dispatching tasks are accumulated to cause task blocking is avoided, the dispatching tasks are executed by calling the dispatching system, so that service data corresponding to service information in the derivative request are subjected to data synchronization between the data source system and the user side, the dispatching tasks are executed orderly, and the task execution efficiency is guaranteed.
In a preferred embodiment, the step of invoking the scheduling system to perform the scheduling task comprises:
S51: and if the scheduling task has an offline signal, calling a derivative component in the scheduling system to execute the scheduling task according to a preset offline period or offline time period, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side.
In this step, for a data source system constructed based on a non-relational database and/or a user terminal having a non-relational database, the scheduling task may be executed by the derivative component to achieve the data synchronization; the offline period is a preset time period, and is aimed at enabling the derivative component to periodically execute the scheduling task, enabling service data corresponding to service information in the derivative request to perform data synchronization between the data source system and the user side; the offline time period is a preset time period, and the purpose of the offline time period is to enable the derivative component to execute the scheduling task in the offline time period, so that service data corresponding to the service label in the scheduling task is subjected to data synchronization between the data source system and the user side; wherein the data synchronization comprises: and loading the business data into the database and acquiring the business data from the database with the business data.
In this embodiment, dataX or sqoop is used as the derivative component;
The DataX is a tool for exchanging data between heterogeneous databases/file systems at high speed, enabling data exchange between arbitrary data processing systems (RDBMS/Hdfs/Local file systems).
The sqoop is a tool for importing and exporting data between hadoop and relational database. It can import data from a database (such as mysql, oracle) into hdfs through sqoop; data may also be exported from the hdfs into a relational database. The sqoop is imported and exported through MapReduce of Hadoop, so that high parallel performance and good fault tolerance are provided.
S52: and if the scheduling task has a real-time signal, calling a derivative component in the scheduling system to execute the scheduling task, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side.
In this step, for a data source system constructed based on a non-relational database and/or a user terminal having a non-relational database, therefore, when the scheduling task has a real-time signal, the scheduling system will cause a derivative component to execute the scheduling task in real time, so that service data corresponding to the service tag in the scheduling task is subjected to data synchronization between the data source system and the user terminal; wherein the data synchronization comprises: and loading the business data into the database and acquiring the business data from the database with the business data.
In this embodiment, dataX or sqoop is used as the derivative component;
The DataX is a tool for exchanging data between heterogeneous databases/file systems at high speed, enabling data exchange between arbitrary data processing systems (RDBMS/Hdfs/Local file systems).
The sqoop is a tool for importing and exporting data between hadoop and relational database. It can import data from a database (such as mysql, oracle) into hdfs through sqoop; data may also be exported from the hdfs into a relational database. The sqoop is imported and exported through MapReduce of Hadoop, so that high parallel performance and good fault tolerance are provided.
S53: if the dispatching task has a service signal, starting a statement executing component through the dispatching system to enable service data corresponding to service information in the derivative request to be subjected to data synchronization between the data source system and the user side;
In this step, JDBC (Java Data Base Connectivity, java database connection) is adopted as the statement execution component for the data source system constructed based on the relational database and the user side having the relational database, which is a Java API for executing SQL statements.
The method comprises the steps of connecting to a relational database of the user side and the data source system, creating SQL or MySQL sentences, executing the SQL or MySQL sentences in the relational database, and realizing the operation of loading business data into the database or the operation of acquiring the business data from the database stored with the business data, thereby realizing the data synchronization.
S206: and acquiring an execution result of the scheduling task, importing the execution result into a preset efficiency analysis component, calling the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and sending the derivative analysis information to the user side to form an analysis page.
In order to realize that a user side can accurately acquire the execution condition of a scheduling task, so that the user side can conveniently construct a new derivative request based on the execution condition, the execution result of the scheduling task is acquired, the execution result is imported into a preset efficiency analysis component, the efficiency analysis component is called to calculate the execution result to obtain derivative analysis information, and the derivative analysis information is sent to the user side to form an analysis page, so that the user side can acquire the execution condition of the scheduling task through the analysis page.
In a preferred embodiment, the step of obtaining the execution result of the scheduling task includes:
s61: judging whether the scheduling task runs successfully or not;
In the step, the execution condition of the scheduling task is monitored through the scheduling system, and if the execution of the scheduling task is completed, namely the data synchronization is completed between the data source system and the user side, the successful operation of the scheduling task is indicated; and if the dispatching task is not executed, namely the data synchronization between the data source system and the user side is interrupted, failed and the like, indicating that the dispatching task fails to operate.
S62: if yes, judging that the service data is successfully obtained or loaded, and generating an execution result with successful synchronization content;
s63: if not, judging that the service data acquisition fails or the loading fails, and generating an execution result with the content of synchronization failure.
Further, the execution result may further include: the content is synchronous interrupt, synchronous, waiting thread and other descriptions of the current execution condition of the scheduling task.
In a preferred embodiment, the step of calling the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and sending the derivative analysis information to the user side to form an analysis page includes:
S64: classifying the execution results according to the content of the execution results, and calculating the content and the quantity of the execution results in each category to obtain execution analysis information.
In this step, the number of execution results of successful synchronization and the number of execution results of failed synchronization are calculated. Further, the execution result may further include: the content is the current execution condition of the scheduling task, such as synchronous interrupt, synchronous, waiting thread and the like, and at the moment, the execution analysis information also comprises the execution result number of the synchronous interrupt, the execution result number of the synchronous interrupt and the execution result number of the waiting thread.
S65: and recording the execution analysis information into a preset analysis page template to obtain derivative analysis information, sending the derivative analysis information to the user terminal, and rendering the derivative analysis information on the user terminal to form an analysis page.
In this step, the analysis page template is a preset vue code, and the derivative analysis information is formed by entering the execution analysis information into the vue code, and the derivative analysis information is sent to the user terminal and rendered vue, so that the derivative analysis information forms an analysis page on the user terminal.
It should be noted that, the Vue code is a page code constructed based on Vue. Js, which realizes the presentation of a page through a rendering operation on a user side, where Vue. Js is a library for constructing a data-driven Web interface, and the core is a responsive data binding system. Therefore, the core library of the Vue.js only focuses on the view layer, is easy to integrate with other libraries or existing projects, and improves the integration effect of the pages and the execution analysis information.
Preferably, after the derivative analysis information is sent to the user side to form an analysis page, the method further includes:
Uploading the analysis page into a blockchain.
It should be noted that, the corresponding digest information is obtained based on the analysis page, specifically, the digest information is obtained by performing a hash process on the analysis page, for example, by using a sha256s algorithm. Uploading summary information to the blockchain can ensure its security and fair transparency to the user. The user device may download the summary information from the blockchain to verify whether the analysis page has been tampered with. The blockchain referred to in this example is a novel mode of application for computer technology such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information 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.
Embodiment III:
Referring to fig. 4, a data synchronization device 1 of the present embodiment includes:
The page sending module 11 is configured to receive an access request sent by a user terminal, and send a data source page with service information to the user terminal according to the access request, where the data source page is associated with a data source system, the data source system is a database server for storing service data and service information, and the service information is used for describing attributes of the service data;
the request generation module 13 is configured to generate a derivative request according to the user clicking the synchronization key in the data source page;
A task creation module 14, configured to create a derivative script according to the derivative request through a preset scheduling system, and create a scheduling task according to the derivative script;
And the task execution module 15 is used for calling the dispatching system to execute the dispatching task so as to synchronize the data between the data source system and the user side according to the service data corresponding to the service information in the derivative request.
Optionally, the data synchronization device 1 further includes:
The information management module 12 is configured to receive data maintenance information sent by the user side according to the data source page, edit the service information according to the data maintenance information, delete the service information, or add the service information of the service data.
Optionally, the data synchronization device 1 further includes:
and the derivative analysis module 16 is configured to obtain an execution result of the scheduling task, import the execution result into a preset efficiency analysis component, call the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and send the derivative analysis information to the user side to form an analysis page.
Optionally, the page sending module 11 includes:
A permission judging unit 111, configured to extract identity information in the access request, and judge, through a preset user library, whether the identity information is authorized to access the data source system;
The page rendering unit 112 is configured to send data source page information to the user side, and control the user side to render the data source page information to form a data source page;
And the unauthorized determination unit 113 is configured to send unauthorized access information to the user terminal.
Optionally, the request generating module 13 includes:
The first request unit 131 is configured to send an interface form to the user terminal according to an offline signal generated by the user terminal clicking the offline synchronization key on a data source page, receive an import operation or an export operation selected by the user terminal in the interface form, and a service tag of the selected service information, and generate a derivative request according to the import operation or the export operation, the offline signal and the service tag.
The second request unit 132 is configured to send an interface form to the user terminal according to a real-time signal generated by the user terminal clicking the real-time synchronization key on a data source page, receive an import operation or an export operation selected by the user terminal in the interface form, and a service tag of the selected service information, and generate a derivative request according to the import operation or the export operation, and the real-time signal and the service tag.
And the third request unit 133 is configured to send an interface form to the user terminal according to a service signal generated by clicking the service synchronization key on a data source page by the user terminal according to the number of user terminals, receive an import operation or an export operation selected by the user terminal in the interface form, and a service tag of the selected service information, and generate a derivative request according to the import operation or the export operation, the service signal and the service tag.
Optionally, the task creation module 14 includes:
An information extraction unit 141, configured to extract parameter information from the derivative request, and extract request information in the derivative request; the parameter entering information comprises the service tag, and the request information is the import operation or the export operation.
And the script generating unit 142 is configured to acquire a target template from a preset interface template according to the request information, and input the parameter entering information into the target template to generate the derivative script.
And a task generating unit 143, configured to invoke the scheduling system to create a scheduling task for acquiring service data from a database storing service data or loading service data into the database according to the derivative script.
Optionally, the task execution module 15 includes:
And the offline synchronization unit 151 is configured to, when the scheduled task has an offline signal, invoke a derivative component in the scheduling system to execute the scheduled task according to a preset offline period or offline time period, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user terminal.
And the real-time synchronization unit 152 is configured to, when the scheduling task has a real-time signal, call a derivative component in the scheduling system to execute the scheduling task, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user terminal.
And the service synchronization unit 153 is configured to, when a service signal is included in the scheduling task, start a statement execution component through the scheduling system, so that service data corresponding to service information in the derivative request is data-synchronized between the data source system and the user terminal.
The technical scheme is applied to the field of data processing of big data, and the method and the system realize complete synchronization between the data source system and the user side by sending a data source page with service information to the user side according to the access request, clicking a synchronous key in the data source page according to the user side to generate a derivative request, creating a derivative script according to the derivative request through a preset scheduling system, creating a scheduling task according to the derivative script, and calling the scheduling system to execute the scheduling task, so that the service data corresponding to the service information in the derivative request is completely synchronized between the data source system and the user side.
Embodiment four:
In order to achieve the above objective, the present invention further provides a computer device 5, where the components of the data synchronization apparatus of the third embodiment may be dispersed in different computer devices, and the computer device 5 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including a separate server or a server cluster formed by multiple application servers) that executes a program, or the like. The computer device of the present embodiment includes at least, but is not limited to: a memory 51, a processor 52, which may be communicatively coupled to each other via a system bus, as shown in fig. 5. It should be noted that fig. 5 only shows a computer device with components-but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
In the present embodiment, the memory 51 (i.e., readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 51 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 51 may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. that are provided on the computer device. Of course, the memory 51 may also include both internal storage units of the computer device and external storage devices. In this embodiment, the memory 51 is typically used to store an operating system installed in a computer device and various application software, such as program codes of the data synchronization apparatus of the third embodiment. Further, the memory 51 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 52 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 52 is typically used to control the overall operation of the computer device. In this embodiment, the processor 52 is configured to execute the program code stored in the memory 51 or process data, for example, execute the data synchronization device, so as to implement the data synchronization methods of the first embodiment and the second embodiment.
Fifth embodiment:
To achieve the above object, the present invention also provides a computer-readable storage medium such as a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by the processor 52, performs the corresponding functions. The computer readable storage medium of the present embodiment is for storing a computer program implementing the data synchronization method, which when executed by the processor 52 implements the data synchronization methods of the first and second embodiments.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1.A method of data synchronization, comprising:
receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server for storing service data and service information, and the service information is used for describing the attribute of the service data;
generating a derivative request according to the synchronous key clicked by the user side in the data source page;
Creating a derivative script according to the derivative request through a preset scheduling system, and creating a scheduling task according to the derivative script; wherein, include: extracting parameter entering information from the derivative request, and extracting request information in the derivative request; the parameter entering information comprises a service tag, and the request information is an import operation or an export operation; acquiring a target template from a preset interface template according to the request information, and inputting the parameter entering information into the target template to generate the derivative script; calling the dispatching system to create a dispatching task for acquiring service data from a database storing the service data or loading the service data into the database according to the derivative script;
invoking the dispatching system to execute the dispatching task so as to enable the service data corresponding to the service information in the derivative request to perform data synchronization between the data source system and the user terminal;
And acquiring an execution result of the scheduling task, importing the execution result into a preset efficiency analysis component, calling the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and sending the derivative analysis information to the user side to form an analysis page.
2. The method of claim 1, wherein the step of sending a data source page with service information to the client according to the access request includes:
extracting identity information in the access request, and judging whether the identity information is authorized to access the data source system or not through a preset user library;
if yes, sending data source page information to the user side, and controlling the user side to render the data source page information to form a data source page;
if not, sending unauthorized access information to the user.
3. The method for synchronizing data according to claim 1, wherein after the data source page with service information is sent to the user terminal according to the access request, the method further comprises:
and receiving data maintenance information sent by the user terminal according to the data source page, and editing the service information, deleting the service information or adding the service information of the service data newly according to the data maintenance information.
4. The method of claim 1, wherein the step of generating the derivative request according to the user clicking the sync key in the data source page comprises:
According to an offline signal generated by clicking an offline synchronous key on a data source page by a user side, an interface form is sent to the user side, an import operation or an export operation selected by the user side in the interface form and a service label of selected service information are received, and a derivative request is generated according to the import operation or the export operation, the offline signal and the service label; or (b)
Sending an interface form to a user terminal according to a real-time signal generated by clicking a real-time synchronous key on a data source page by the user terminal, receiving an import operation or an export operation selected by the user terminal in the interface form and a service label of selected service information, and generating a derivative request according to the import operation or the export operation, the real-time signal and the service label; or (b)
And sending an interface form to the user terminal according to a service signal generated by clicking a service synchronous key on a data source page by the user terminal, receiving an import operation or an export operation selected by the user terminal in the interface form, and a service label of the selected service information, and generating a derivative request according to the import operation or the export operation, the service signal and the service label.
5. The data synchronization method of claim 1, wherein the step of invoking the scheduling system to perform the scheduling task comprises:
If the scheduling task has an offline signal, calling a derivative component in the scheduling system to execute the scheduling task according to a preset offline period or offline time period, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side;
If the scheduling task has a real-time signal, calling a derivative component in the scheduling system to execute the scheduling task, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side;
if the dispatching task has a service signal, a statement executing component is started through the dispatching system, so that service data corresponding to service information in the derivative request is subjected to data synchronization between the data source system and the user side.
6. The method for synchronizing data according to claim 1, wherein,
After the derivative analysis information is sent to the user side to form an analysis page, the method further comprises:
Uploading the analysis page into a blockchain.
7. A data synchronization device, comprising:
The system comprises a page sending module, a service information sending module and a service information sending module, wherein the page sending module is used for receiving an access request sent by a user terminal, and sending a data source page with service information to the user terminal according to the access request, wherein the data source page is associated with a data source system, the data source system is a database server used for storing service data and service information, and the service information is used for describing the attribute of the service data;
The request generation module is used for generating a derivative request according to the synchronous key clicked by the user side in the data source page;
the task creation module is used for creating a derivative script according to the derivative request through a preset scheduling system and creating a scheduling task according to the derivative script;
The task creation module includes:
The information extraction unit is used for extracting the parameter entering information from the derivative request and extracting the request information in the derivative request; the parameter entering information comprises a service tag, and the request information is an import operation or an export operation;
The script generation unit is used for acquiring a target template from a preset interface template according to the request information, and inputting the parameter entering information into the target template to generate the derivative script;
The task generating unit is used for calling the scheduling system to create a scheduling task for acquiring service data from a database storing the service data or loading the service data into the database according to the derivative script;
the task execution module is used for calling the dispatching system to execute the dispatching task and enabling the service data corresponding to the service information in the derivative request to be subjected to data synchronization between the data source system and the user side;
and the derivative analysis module is used for acquiring an execution result of the scheduling task, importing the execution result into a preset efficiency analysis component, calling the efficiency analysis component to calculate the execution result to obtain derivative analysis information, and sending the derivative analysis information to the user side to form an analysis page.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor of the computer device implements the steps of the data synchronization method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium having a computer program stored thereon, characterized in that the computer program stored on the readable storage medium, when executed by a processor, implements the steps of the data synchronization method according to any of claims 1 to 6.
CN202110724266.0A 2021-06-29 2021-06-29 Data synchronization method, device, computer equipment and readable storage medium Active CN113449035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110724266.0A CN113449035B (en) 2021-06-29 2021-06-29 Data synchronization method, device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110724266.0A CN113449035B (en) 2021-06-29 2021-06-29 Data synchronization method, device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113449035A CN113449035A (en) 2021-09-28
CN113449035B true CN113449035B (en) 2024-06-04

Family

ID=77813682

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110724266.0A Active CN113449035B (en) 2021-06-29 2021-06-29 Data synchronization method, device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113449035B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942324A (en) * 2014-04-29 2014-07-23 北京中科启信软件技术有限公司 Data real-time synchronization system and method
CN105338037A (en) * 2014-08-07 2016-02-17 中兴通讯股份有限公司 Dynamic scheduling method and system
CN107766132A (en) * 2017-06-25 2018-03-06 平安科技(深圳)有限公司 Multi-task scheduling method, application server and computer-readable recording medium
CN108804697A (en) * 2018-06-15 2018-11-13 中国平安人寿保险股份有限公司 Method of data synchronization, device, computer equipment based on Spark and storage medium
EP3418919A1 (en) * 2017-06-23 2018-12-26 Palantir Technologies Inc. User interface for managing synchronization between data sources and cache databases

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942324A (en) * 2014-04-29 2014-07-23 北京中科启信软件技术有限公司 Data real-time synchronization system and method
CN105338037A (en) * 2014-08-07 2016-02-17 中兴通讯股份有限公司 Dynamic scheduling method and system
EP3418919A1 (en) * 2017-06-23 2018-12-26 Palantir Technologies Inc. User interface for managing synchronization between data sources and cache databases
CN107766132A (en) * 2017-06-25 2018-03-06 平安科技(深圳)有限公司 Multi-task scheduling method, application server and computer-readable recording medium
CN108804697A (en) * 2018-06-15 2018-11-13 中国平安人寿保险股份有限公司 Method of data synchronization, device, computer equipment based on Spark and storage medium

Also Published As

Publication number Publication date
CN113449035A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
CN112507027B (en) Kafka-based incremental data synchronization method, device, equipment and medium
US10678683B2 (en) System and method for automated service layer testing and regression
CN109669976B (en) ETL-based data service method and device
CN111737227B (en) Data modification method and system
CN114385759B (en) Configuration file synchronization method and device, computer equipment and storage medium
WO2022095518A1 (en) Automatic interface test method and apparatus, and computer device and storage medium
CN113535677B (en) Data analysis query management method, device, computer equipment and storage medium
CN108664625B (en) Cross-system data synchronization method and device
CN110737719A (en) Data synchronization method, device, equipment and computer readable storage medium
CN112882863A (en) Method, device and system for recovering data and electronic equipment
CN115858488A (en) Parallel migration method and device based on data governance and readable medium
CN111813418A (en) Distributed link tracking method, device, computer equipment and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN114443294B (en) Big data service component deployment method, system, terminal and storage medium
CN111552663A (en) File consistency verification method and device, computer equipment and storage medium
CN113449035B (en) Data synchronization method, device, computer equipment and readable storage medium
CN108959309B (en) Method and device for data analysis
CN115455020A (en) Incremental data synchronization method and device, computer equipment and storage medium
CN113610527B (en) Alliance chain transaction method, device, system, terminal equipment and storage medium
CN112256760B (en) Data prediction method and device, computer equipment and storage medium
CN113360172B (en) Application deployment method, device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN114925044A (en) Data synchronization method, device and equipment based on cloud storage and storage medium
CN114385503A (en) Interface test method, device, equipment and storage medium
CN110493326B (en) Zookeeper-based cluster configuration file management system and method

Legal Events

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