CN114385758A - Database-based data synchronization method and device, electronic equipment and storage medium - Google Patents

Database-based data synchronization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114385758A
CN114385758A CN202210036572.XA CN202210036572A CN114385758A CN 114385758 A CN114385758 A CN 114385758A CN 202210036572 A CN202210036572 A CN 202210036572A CN 114385758 A CN114385758 A CN 114385758A
Authority
CN
China
Prior art keywords
write
class
interface
class name
interface class
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.)
Pending
Application number
CN202210036572.XA
Other languages
Chinese (zh)
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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou 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 Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202210036572.XA priority Critical patent/CN114385758A/en
Publication of CN114385758A publication Critical patent/CN114385758A/en
Pending legal-status Critical Current

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/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
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

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

Abstract

The embodiment of the application provides a database-based data synchronization method, a database-based data synchronization device, an electronic device and a storage medium, wherein the method comprises the following steps: marking the interface class of which the execution data needs to be synchronized; storing the class name corresponding to the marked interface class into a cache class; acquiring a write-in interface class name corresponding to the write-in method; and if the write-in interface class name exists in the cache class, synchronizing the execution data to obtain a synchronization result. By implementing the embodiment of the application, the query data of the database and the full-text retrieval data can be synchronized, the problem of overlarge pressure in the query process of the database is avoided, and the writing and distinguishing of fields in the database are simplified.

Description

Database-based data synchronization method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a database-based data synchronization method and apparatus, an electronic device, and a computer-readable storage medium.
Background
In business development, data is generally required to be queried in a MySQL database, but MySQL is not good at full-text retrieval and data analysis of data, and when MySQL query and full-text retrieval are accessed simultaneously, database-based data synchronization of the MySQL query and the full-text retrieval has a great problem.
The traditional solution is that the MySQL service pressure is large because a passive synchronization mode or a mode of querying data in MySQL at regular time is adopted for frequently polling MySQL interfaces to acquire newly written data. In extreme cases, serious online problems are caused, each database table has different fields and is difficult to unify, and the writing of data which is not necessary to trigger is difficult to distinguish.
Disclosure of Invention
An object of the embodiments of the present application is to provide a database-based data synchronization method, apparatus, electronic device, and computer-readable storage medium, so that database query data and full-text search data can be synchronized, the problem of excessive pressure during database query is avoided, and writing and distinguishing of fields in a database are simplified.
In a first aspect, an embodiment of the present application provides a database-based data synchronization method, where the method includes:
marking the interface class of which the execution data needs to be synchronized;
storing the marked class name corresponding to the interface class into a cache class;
acquiring a write-in interface class name corresponding to the write-in method;
and if the write-in interface class name exists in the cache class, synchronizing the execution data to obtain a synchronization result.
In the implementation process, the class name corresponding to the interface class of the execution data and the write-in interface class name of the write-in method are stored in the cache class, so that the cache class is ensured to contain information corresponding to the execution data, the execution data can be actively synchronized, the problem of overlarge pressure in the query process of the database is avoided, and the writing and distinguishing of fields in the database are simplified.
Further, before the step of synchronizing the execution data, the method further includes:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write-in interface class name exists in the cache class.
In the implementation process, whether the write-in interface class name exists in the cache class is judged, if so, whether a value corresponding to the write-in interface class name exists in the cache class is further judged, and the class name corresponding to the interface class and the value corresponding to the write-in interface class name simultaneously exist in the cache class.
Further, after the step of querying whether a value corresponding to the write interface class name exists in the cache class, the method further includes:
if the value corresponding to the write-in interface class name does not exist, storing the write-in interface class name into the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
In the implementation process, if the value corresponding to the writing interface class name does not exist, the value corresponding to the writing interface class name is directly stored in the cache class, and if the value corresponding to the writing interface class name exists, the value corresponding to the writing interface class name is modified and then stored in the cache class, so that the accuracy of the value corresponding to the writing interface class name is ensured, and the synchronization efficiency of subsequent execution data is improved.
Further, the step of synchronizing the execution data to obtain a synchronization result includes:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
In the implementation process, whether the interface name corresponding to the query request exists in the cache class is judged, so that a synchronization result is obtained, and the efficiency and the accuracy of executing data synchronization are ensured.
In a second aspect, an embodiment of the present application further provides a database-based data synchronization apparatus, where the apparatus includes:
the marking module is used for marking the interface class of which the execution data needs to be synchronized;
the storage module is used for storing the marked class name corresponding to the interface class into a cache class;
the acquisition module is used for acquiring the write-in interface class name corresponding to the write-in method;
and the synchronization module is used for synchronizing the execution data to obtain a synchronization result if the write interface class name exists in the cache class.
In the implementation process, the class name corresponding to the interface class of the execution data and the write-in interface class name of the write-in method are stored in the cache class, so that the cache class is ensured to contain information corresponding to the execution data, the execution data can be actively synchronized, the problem of overlarge pressure in the query process of the database is avoided, and the writing and distinguishing of fields in the database are simplified.
Further, the apparatus further comprises a determining module configured to:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write-in interface class name exists in the cache class.
In the implementation process, whether the write-in interface class name exists in the cache class is judged, if so, whether a value corresponding to the write-in interface class name exists in the cache class is further judged, and the class name corresponding to the interface class and the value corresponding to the write-in interface class name simultaneously exist in the cache class.
Further, the determining module is further configured to:
if the value corresponding to the write-in interface class name does not exist, storing the write-in interface class name into the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
In the implementation process, if the value corresponding to the writing interface class name does not exist, the value corresponding to the writing interface class name is directly stored in the cache class, and if the value corresponding to the writing interface class name exists, the value corresponding to the writing interface class name is modified and then stored in the cache class, so that the accuracy of the value corresponding to the writing interface class name is ensured, and the synchronization efficiency of subsequent execution data is improved.
Further, the synchronization module is further configured to:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
In the implementation process, whether the interface name corresponding to the query request exists in the cache class is judged, so that a synchronization result is obtained, and the efficiency and the accuracy of executing data synchronization are ensured.
In a third aspect, an electronic device provided in an embodiment of the present application includes: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any of the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, cause the computer to perform the method according to any one of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on a computer, causes the computer to perform the method according to any one of the first aspect.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
The present invention can be implemented in accordance with the content of the specification, and the following detailed description of the preferred embodiments of the present application is made with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a database-based data synchronization method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a database-based data synchronization apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural component diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The following detailed description of embodiments of the present application will be described in conjunction with the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
Example one
Fig. 1 is a schematic flowchart of a database-based data synchronization method provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
s1, marking the interface class of the execution data needing synchronization;
s2, storing the class name corresponding to the marked interface class into a cache class;
s3, acquiring a write-in interface class name corresponding to the write-in method;
and S4, if the write interface class name exists in the cache class, synchronizing the execution data to obtain a synchronization result.
In the implementation process, the class name corresponding to the interface class of the execution data and the write-in interface class name of the write-in method are stored in the cache class, so that the cache class is ensured to contain information corresponding to the execution data, the execution data can be actively synchronized, the problem of overlarge pressure in the query process of the database is avoided, and the writing and distinguishing of fields in the database are simplified.
The embodiment of the application can be applied to the database which needs full-text retrieval and data analysis, can utilize the function and service of the search engine to carry out retrieval and data analysis in the database, and can synchronize the data of the database and the search engine, so that the efficiency is improved, the stability is improved, and the performance is improved. Illustratively, the database may be a MySQL database and the search engine may be Solr.
In S1, an interface class requiring synchronization is defined, and illustratively, an @ EsSycn annotation class may be provided for marking the DAO interface class requiring synchronization.
In S2, when the database service is started, the interface classes under all DAO packets are scanned, and the class names of all the annotation tags marked by the @ EsSycn are stored in the custom cache class EsSyncCache.
And when the user writes data into the MySQL, intercepting the write-in request and acquiring a write-in interface class name corresponding to the write-in method.
Further, before the step of synchronizing the execution data, the method further includes:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write interface class name exists in the cache class.
And judging whether the write interface class name exists in the cache class, if so, indicating that the MySQL write is completed and data synchronization needs to be triggered. If not, it indicates that data synchronization does not need to be triggered after the MySQL write is completed.
In the implementation process, whether the write-in interface class name exists in the cache class is judged, if so, whether a value corresponding to the write-in interface class name exists in the cache class is further judged, and the class name corresponding to the interface class and the value corresponding to the write-in interface class name simultaneously exist in the cache class.
Further, after the step of querying whether a value corresponding to the write interface class name exists in the cache class, the method further includes:
if the value corresponding to the write-in interface class name does not exist, the write-in interface class name is stored in the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
Inquiring whether a value corresponding to the write interface class name exists in the cache class, if not, storing the write interface class name as a key and 1 as a value into the cache class; and if so, adding 1 to the value corresponding to the write interface class name, and then storing the value into the cache class again.
In the implementation process, if the value corresponding to the writing interface class name does not exist, the value corresponding to the writing interface class name is directly stored in the cache class, and if the value corresponding to the writing interface class name exists, the value corresponding to the writing interface class name is modified and then stored in the cache class, so that the accuracy of the value corresponding to the writing interface class name is ensured, and the synchronization efficiency of subsequent execution data is improved.
Further, the step of synchronizing the execution data to obtain a synchronization result includes:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
In the implementation process, whether the interface name corresponding to the query request exists in the cache class is judged, so that a synchronization result is obtained, and the efficiency and the accuracy of executing data synchronization are ensured.
Calling a Solr interface for synchronization, after the synchronization is completed, inquiring a value corresponding to a write interface class name in the cache class, and if the value is 1, removing the write interface class name from the cache class, which indicates that the write interface class does not have the synchronization operation currently executed. If the value is not 1, the value is subtracted by 1 and stored in the buffer.
Intercepting the query request, judging whether the interface name corresponding to the query interface corresponding to the query request exists in the cache class, wherein the existence indicates that the execution data queried by the current interface is synchronized, and returning a synchronization result to the user to inform the user that the data is synchronized. If the query request does not exist, the data synchronization of the current query interface is not performed, and the query request of the Solr is released.
In the embodiment of the application, the passive synchronization mode of the Solr is changed into active trigger synchronization, and the data synchronization can be executed in the interval, called by the user, and the synchronization result is sent to the user to inform the user of the data synchronization state and result. And the user is prevented from acquiring wrong data in the Solr. By providing annotation classes to the user, the user is enabled to mark abstract methods that need to trigger synchronization, thereby avoiding frequent triggering of data synchronization.
The passive synchronization data is changed into active synchronization, so that the frequency of synchronizing data from MySQL to Solr can be reduced, and the pressure of MySQL is reduced. The data query error caused by the inconsistency of short MySQL data and Solr data in the data synchronization process is avoided.
Example two
In order to implement the corresponding method of the above-mentioned embodiments to achieve the corresponding functions and technical effects, the following provides a database-based data synchronization apparatus, as shown in fig. 2, the apparatus comprising:
the marking module 1 is used for marking the interface class of which the execution data needs to be synchronized;
the storing module 2 is used for storing the class name corresponding to the marked interface class into the cache class;
the acquisition module 3 is used for acquiring the write-in interface class name corresponding to the write-in method;
and the synchronization module 4 is configured to synchronize the execution data to obtain a synchronization result if the write interface class name exists in the cache class.
In the implementation process, the class name corresponding to the interface class of the execution data and the write-in interface class name of the write-in method are stored in the cache class, so that the cache class is ensured to contain information corresponding to the execution data, the execution data can be actively synchronized, the problem of overlarge pressure in the query process of the database is avoided, and the writing and distinguishing of fields in the database are simplified.
Further, the apparatus further includes a determining module configured to:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write interface class name exists in the cache class.
In the implementation process, whether the write-in interface class name exists in the cache class is judged, if so, whether a value corresponding to the write-in interface class name exists in the cache class is further judged, and the class name corresponding to the interface class and the value corresponding to the write-in interface class name simultaneously exist in the cache class.
Further, the judging module is further configured to:
if the value corresponding to the write-in interface class name does not exist, the write-in interface class name is stored in the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
In the implementation process, if the value corresponding to the writing interface class name does not exist, the value corresponding to the writing interface class name is directly stored in the cache class, and if the value corresponding to the writing interface class name exists, the value corresponding to the writing interface class name is modified and then stored in the cache class, so that the accuracy of the value corresponding to the writing interface class name is ensured, and the synchronization efficiency of subsequent execution data is improved.
Further, the synchronization module 4 is further configured to:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
In the implementation process, whether the interface name corresponding to the query request exists in the cache class is judged, so that a synchronization result is obtained, and the efficiency and the accuracy of executing data synchronization are ensured.
The database-based data synchronization apparatus can implement the method of the first embodiment. The alternatives in the first embodiment are also applicable to the present embodiment, and are not described in detail here.
The rest of the embodiments of the present application may refer to the contents of the first embodiment, and in this embodiment, details are not repeated.
EXAMPLE III
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the database-based data synchronization method according to the first embodiment.
Alternatively, the electronic device may be a server.
Referring to fig. 3, fig. 3 is a schematic structural composition diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. Wherein the communication bus 34 is used for realizing direct connection communication of these components. The communication interface 32 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The processor 31 may be an integrated circuit chip having signal processing capabilities.
The Processor 31 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 31 may be any conventional processor or the like.
The Memory 33 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 33 has stored therein computer readable instructions which, when executed by the processor 31, enable the apparatus to perform the various steps involved in the method embodiment of fig. 1 described above.
Optionally, the electronic device may further include a memory controller, an input output unit. The memory 33, the memory controller, the processor 31, the peripheral interface, and the input/output unit are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses 34. The processor 31 is adapted to execute executable modules stored in the memory 33, such as software functional modules or computer programs comprised by the device.
The input and output unit is used for providing a task for a user to create and start an optional time period or preset execution time for the task creation so as to realize the interaction between the user and the server. The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
It will be appreciated that the configuration shown in fig. 3 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 3 or have a different configuration than shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof.
In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the database-based data synchronization method according to the first embodiment.
Embodiments of the present application further provide a computer program product, which when running on a computer, causes the computer to execute the method described in the method embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A database-based data synchronization method, the method comprising:
marking the interface class of which the execution data needs to be synchronized;
storing the marked class name corresponding to the interface class into a cache class;
acquiring a write-in interface class name corresponding to the write-in method;
and if the write-in interface class name exists in the cache class, synchronizing the execution data to obtain a synchronization result.
2. The database-based data synchronization method of claim 1, further comprising, prior to the step of synchronizing the execution data:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write-in interface class name exists in the cache class.
3. The database-based data synchronization method according to claim 2, wherein after the step of querying whether the value corresponding to the write interface class name exists in the cache class, the method further comprises:
if the value corresponding to the write-in interface class name does not exist, storing the write-in interface class name into the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
4. The database-based data synchronization method of claim 1, wherein the step of synchronizing the execution data to obtain a synchronization result comprises:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
5. An apparatus for database-based data synchronization, the apparatus comprising:
the marking module is used for marking the interface class of which the execution data needs to be synchronized;
the storage module is used for storing the marked class name corresponding to the interface class into a cache class;
the acquisition module is used for acquiring the write-in interface class name corresponding to the write-in method;
and the synchronization module is used for synchronizing the execution data to obtain a synchronization result if the write interface class name exists in the cache class.
6. The database-based data synchronization apparatus of claim 5, wherein the apparatus further comprises a determining module configured to:
judging whether the write interface class name exists in the cache class;
and if so, inquiring whether a value corresponding to the write-in interface class name exists in the cache class.
7. The database-based data synchronization apparatus of claim 6, wherein the determining module is further configured to:
if the value corresponding to the write-in interface class name does not exist, storing the write-in interface class name into the cache class;
and if the value corresponding to the write-in interface class name exists, modifying the value corresponding to the write-in interface class name, and storing the modified value corresponding to the write-in interface class name into the cache class.
8. The database-based data synchronization apparatus of claim 5, wherein the synchronization module is further configured to:
acquiring a query request;
judging whether an interface name corresponding to the query request exists in the cache class;
if yes, a synchronization result is obtained according to the execution data corresponding to the query request.
9. An electronic device, comprising a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the database-based data synchronization method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the database-based data synchronization method according to any one of claims 1 to 4.
CN202210036572.XA 2022-01-11 2022-01-11 Database-based data synchronization method and device, electronic equipment and storage medium Pending CN114385758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210036572.XA CN114385758A (en) 2022-01-11 2022-01-11 Database-based data synchronization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210036572.XA CN114385758A (en) 2022-01-11 2022-01-11 Database-based data synchronization method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114385758A true CN114385758A (en) 2022-04-22

Family

ID=81202382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210036572.XA Pending CN114385758A (en) 2022-01-11 2022-01-11 Database-based data synchronization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114385758A (en)

Similar Documents

Publication Publication Date Title
CN111352902A (en) Log processing method and device, terminal equipment and storage medium
CN106407360B (en) Data processing method and device
CN107066519B (en) Task detection method and device
CN110162512B (en) Log retrieval method, device and storage medium
CN105373541A (en) Processing method and system for data operation request of database
CN112861501A (en) Report generation method and device, electronic equipment and computer readable storage medium
CN113268500B (en) Service processing method and device and electronic equipment
US9087137B2 (en) Detection of custom parameters in a request URL
CN112416710A (en) User operation recording method and device, electronic equipment and storage medium
KR20120037393A (en) Software extension analysis
CN108763524B (en) Electronic device, chatting data processing method, and computer-readable storage medium
CN114385758A (en) Database-based data synchronization method and device, electronic equipment and storage medium
JP4807364B2 (en) Information management device
CN115858668A (en) Distributed transaction processing method, device, electronic device and storage medium
CN114968726A (en) Method and system for monitoring system asset change, electronic device and storage medium
CN112860740B (en) Method and device for realizing trigger
CN111045983B (en) Nuclear power station electronic file management method, device, terminal equipment and medium
CN114020813A (en) Data comparison method, device and equipment based on Hash algorithm and storage medium
CN109254855B (en) Registration method and device of parameter transmission protocol and electronic equipment
US20080307395A1 (en) Providing Registration of a Communication
CN112445790B (en) Report data storage method, device, equipment and medium
CN108803975B (en) Instruction processing method and device and electronic equipment
CN108647042B (en) Module management method and device
CN107729013B (en) Method for managing operation buttons on web page and computer-readable storage medium
CN112612682A (en) Method, system and device for dynamically monitoring file 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