Data model synchronization method and device, computer equipment, readable storage medium and program product
By obtaining the metadata fingerprint of the data table for comparison and determining the change type, and by adopting a lightweight fingerprint comparison and differentiated synchronization strategy, the problem of low data model synchronization efficiency is solved, and fast and secure data model synchronization is achieved.
Patent Information
- Application Number
- CN202511786954.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, data model synchronization methods suffer from low synchronization efficiency. In particular, frequent changes in the underlying data source structure prevent timely synchronization to the intermediate layer, leading to errors and business interruptions when upper-layer applications query data.
By obtaining the metadata fingerprint of the data table and comparing it with historical fingerprints, the data change type is determined. Lightweight fingerprint comparison and synchronization strategies for different change types are used to synchronize the data model, replacing the traditional full comparison method.
It improved the efficiency of data model synchronization, reduced the performance impact on data sources, shortened the change awareness latency from hours to seconds, reduced the risk of business interruption, and improved operational efficiency.
Smart Images

Figure CN121579599A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a data model synchronization method and device, computer equipment, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the growth of enterprise data scale, data architecture usually adopts hierarchical design: the bottom layer is various heterogeneous data sources (such as various business databases), the middle layer is an abstract data model for unified semantics and definition of indicators, and the upper layer is a data application (such as data analysis service, intelligent query) built based on these models. Among them, the structure of the bottom layer data source will change frequently due to business needs, and these changes cannot be automatically and timely perceived by the middle layer data model. This leads to errors in the upper layer application when querying, causing business interruption. Therefore, changes to the bottom layer data source need to be synchronized to the data model in a timely manner.
[0003] The current data model synchronization method usually compares the structure of the data source with the structure of the data source synchronized last time in full to find the difference and notify the administrator to handle. However, the synchronization through the periodic full comparison method has high delay, resulting in low synchronization efficiency.
[0004] Therefore, the current method for synchronizing the data model has the defect of low synchronization efficiency. SUMMARY
[0005] Therefore, it is necessary to provide a data model synchronization method, device, computer equipment, computer readable storage medium and computer program product capable of improving synchronization efficiency in view of the above technical problems.
[0006] In a first aspect, the present application provides a data model synchronization method, comprising:
[0007] In response to a synchronization detection instruction, obtaining a data fingerprint of metadata of a data table to be detected;
[0008] If there is a difference between the data fingerprint and the historical data fingerprint of the metadata, determining a data change type corresponding to the metadata according to a comparison result of historical metadata corresponding to the metadata and the historical data fingerprint;
[0009] According to the synchronization strategy corresponding to the data table and the data change type, synchronizing the data model.
[0010] In a second aspect, the present application also provides a data model synchronization device, comprising:
[0011] The obtaining module is configured to obtain a data fingerprint of metadata of a data table to be detected in response to a synchronization detection instruction.
[0012] determining, if there is a difference between the data fingerprint and the historical data fingerprint of the metadata, a data change type corresponding to the metadata according to a comparison result of the metadata and historical metadata corresponding to the historical data fingerprint;
[0013] synchronizing, according to a synchronization strategy corresponding to the data change type, the data model.
[0014] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when executing the computer program.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method described above when executed by a processor.
[0016] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps of the method described above when executed by a processor.
[0017] The data model synchronization method, device, computer device, computer readable storage medium and computer program product described above, when detecting that there is a difference between the data fingerprint and the historical fingerprint of the metadata of the data table in response to a synchronization detection instruction, determining a data change type of the metadata based on a comparison result of the metadata and historical metadata corresponding to the historical data fingerprint, and synchronizing the data model based on a synchronization strategy corresponding to the data change type. Compared with the traditional synchronization detection by full comparison of the data source, the present application improves the efficiency of data model synchronization by using lightweight fingerprint comparison and different synchronization strategies for different data change types. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can be obtained without creative labor on the basis of these drawings.
[0019] Figure 1 It is a flowchart of the data model synchronization method in one embodiment;
[0020] Figure 2 It is a flowchart of the data model synchronization method in another embodiment;
[0021] Figure 3 Figure 1 is a structural block diagram of a data model synchronization device in an embodiment;
[0022] Figure 4 Figure 2 is an internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0023] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0024] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two and more. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.
[0025] In the related art, as the scale of enterprise data grows, the data architecture usually adopts a hierarchical design: the bottom layer is various heterogeneous data sources, the middle layer is an abstract data model for unified semantics and defining indicators, and the upper layer is data applications (such as data analysis services, intelligent queries) built based on these models. Among them, the structure of the bottom layer data source will frequently change due to business needs, and these changes cannot be automatically and timely perceived by the middle layer data model. This leads to errors in the upper layer application when querying, causing business interruption. The synchronization of the data model relies on the periodic polling of the data source system table or relies on manual notification, which has problems such as high delay, large resource consumption, and inability to automatically repair. It also includes a metadata comparison method based on periodic polling, which queries the system table of the database to obtain table structure information and compares it with the last metadata snapshot to find differences. After discovering the changes, the system usually notifies the administrator in the form of an alarm for manual processing.
[0026] However, the above-mentioned method has a long polling interval (usually hours or days), which cannot timely discover changes, causing the business system to be at risk for a long time. Among them, the full scan of the system table causes unnecessary performance pressure on the database server, especially in an environment with a large number of data tables. And only changes can be found, but the impact cannot be automatically evaluated and repaired, and business interruption is inevitable from discovering changes to manually repairing. In addition, it is also unable to automatically distinguish the change type (such as compatible change or destructive change), and lacks an effective decision-making mechanism to drive different repair strategies.
[0027] Based on this, the application improves the efficiency of data model synchronization by using lightweight fingerprint comparison and different synchronization strategies for different data change types.
[0028] In one embodiment, as shown in Figure 1 A data model synchronization method is provided. The embodiment is exemplified by the method applied to a server. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction of the terminal and the server, including the following steps S202 to S206. Among them:
[0029] Step S202, in response to a synchronization detection instruction, obtaining the data fingerprint of the metadata of the data table to be detected.
[0030] The server can be a network device deployed with a data model. The data architecture of the server adopts a hierarchical design: the bottom layer is various heterogeneous data sources (such as various business databases), the middle layer is an abstract data model (used for unified semantics and definition of indicators), and the upper layer is a data application constructed based on these models. To achieve data consistency between the data model and the underlying data source, the data model and the underlying data source need to be synchronized in time. The synchronization detection instruction can be an instruction triggered based on the call to the data model. For example, the upper layer data application calls the function of the data model, at which time the data model can determine to trigger the synchronization detection instruction, i.e. the synchronization detection instruction can be triggered in an event-driven manner.
[0031] The server can obtain the data fingerprint of the metadata of the data table to be detected in response to the synchronization detection instruction. The data table to be detected can be a data table in the underlying data source that needs to be detected for synchronization, such as a data table involved in the function called by the data model, which needs to be detected for synchronization to prevent data inconsistency between the data model and the underlying data source from causing call errors. The data fingerprint can be a unique and fixed-length string corresponding to the metadata. The change of the metadata will cause the change of the data fingerprint corresponding to the metadata, and the metadata has the characteristics of lightweight, so the server can use the data fingerprint of the metadata to implement synchronization detection.
[0032] Step S204, if there is a difference between the data fingerprint and the historical data fingerprint of the metadata, determining the data change type corresponding to the metadata according to the comparison result of the historical metadata corresponding to the historical data fingerprint of the metadata.
[0033] The server stores historical metadata of the data model at each synchronization time and historical data fingerprints of the historical metadata. To detect whether the data model needs to be synchronized with the data source, the server can compare the latest data fingerprint of the metadata with the historical data fingerprints of the metadata. If the server detects a difference between the new data fingerprint and the historical data fingerprints of the metadata, the server can determine that the data model needs to be synchronized. The server can use different synchronization strategies for different data change types. The server can determine the data change type corresponding to the metadata according to a comparison result of the metadata and historical metadata corresponding to the historical data fingerprint. The data change type includes at least one of a compatible change and a destructive change.
[0034] The compatible change represents the data change type when the comparison result is that the metadata adds data or changes data. For example, a data column is added or changed in a data table corresponding to the metadata. The destructive change represents the data change type when the comparison result is that the metadata deletes data. For example, a data column is deleted in a data table corresponding to the metadata.
[0035] In step S206, the data model is synchronized according to the synchronization strategy corresponding to the data table and the data change type.
[0036] The server can use different synchronization strategies for different data change types. After the server determines the synchronization strategy corresponding to the data change type, the server can synchronize the data model according to the synchronization strategy corresponding to the data table and the data change type. For example, the server synchronizes the data model according to the changed data in the data table and the synchronization strategy corresponding to the data change type.
[0037] In the data model synchronization method, when the data fingerprint and the historical fingerprint of the metadata of the data table are detected to be different in response to the synchronization detection instruction, the data change type of the metadata is determined based on a comparison result of the metadata and historical metadata corresponding to the historical data fingerprint. The data model is synchronized based on the synchronization strategy corresponding to the data change type. Compared with the traditional synchronization detection by full comparison of the data source, the present application improves the efficiency of data model synchronization by using lightweight fingerprint comparison and different synchronization strategies for different data change types.
[0038] In one embodiment, obtaining a data fingerprint of metadata of a data table to be detected includes: obtaining metadata of the data table; performing sorting processing on the metadata according to a preset sorting rule to obtain sorted metadata; and determining a data fingerprint corresponding to the metadata according to the sorted metadata and a target hash function.
[0039] In the embodiment, the data fingerprint of the metadata can be obtained by a specific function. For example, the server can obtain metadata of the data table, and perform sorting processing on the metadata according to a preset sorting rule to obtain sorted metadata. The preset sorting rule can include sorting according to the alphabetical order of column names of data columns in the metadata. The server can determine a data fingerprint corresponding to the metadata according to the sorted metadata and a target hash function. For example, the server inputs the sorted metadata into the target hash function, and obtains the data fingerprint corresponding to the metadata based on the output of the target hash function.
[0040] Specifically, when the server detects a call to a model or an application interface of a data model, the server determines to perform data synchronization detection. The server connects to a data source configured by a user through a metadata fingerprint perception module, reads data model fingerprints and metadata information (including table names, column names, data types, lengths, whether null, etc.) of specified data tables to generate a data fingerprint of the current model through event driving (such as model function calling). For example, the server can obtain metadata of a database through a database metadata interface in Java Database Connectivity (JDBC) or query a database system table, so as to obtain metadata of the database. Then, the server normalizes the metadata information according to a predetermined rule (such as arranging column names in alphabetical order), and inputs the metadata information into a hash function (such as MD5) to generate a unique and fixed-length string, so as to obtain a data fingerprint corresponding to the metadata. Then, the server can compare the current fingerprint with a stored historical data fingerprint. If the current fingerprint is inconsistent with the historical data fingerprint, the server triggers a change event and performs data synchronization.
[0041] Through the embodiment, the server uses a lightweight data fingerprint to replace a heavy full table scan, reduces the influence on the performance of the data source, and improves the efficiency of data model synchronization.
[0042] In an embodiment, the data model is synchronized according to the synchronization strategy corresponding to the data table and the data change type, including: if the data change type is a compatible change, adjusting the target field mapping information and / or the target structured query statement according to the new data and / or the changed data of the data table, so that the data model adapts to the data table after the data change; wherein the target field mapping information represents the field mapping information related to the data table in the data model; and the target structured query statement represents the structured query statement related to the data table in the data model.
[0043] In the embodiment, when the server detects that the data fingerprint of the metadata changes, the server can detect the data change type. It is determined whether the data change is a compatible change or a destructive change. If the server detects that the data change type is a compatible change, the server can adjust one or more of the target field mapping information and the target structured query statement according to the new data of the data table and the changed data of the data table, so that the data model adapts to the data table after the data change.
[0044] The target field mapping information represents the field mapping information related to the data table in the data model; and the target structured query statement represents the structured query statement related to the data table in the data model. For example, the server maps the field corresponding to the data table in the data model to the new data or the changed data, or changes the field related to the new or changed data in the structured query statement for the data table in the data model.
[0045] Specifically, the server can receive a change event through an intelligent analysis and decision module, analyze the specific change content (for example, A column is added, B column is deleted, and C column is changed from INT (integer) to BIGINT (super large integer)), and evaluate the influence on the upper data model. For example, the server calls a change classifier to determine the change type by analyzing the data fingerprint difference of the metadata. Then, according to the preset compatibility rule matrix (for example, INT to BIGINT is a compatible change, and VARCHAR (variable length string) to INT is a destructive change), a decision is made to determine whether to automatically synchronize, issue a warning, or freeze the model, to obtain the synchronization strategy.
[0046] The server implements data synchronization through a dynamic synchronization and execution module. The server executes specific synchronization actions according to the instructions of the decision module and the synchronization strategy through the dynamic synchronization and execution module, to ensure that the upper application query can continue to work normally. For example, for a compatible change (such as adding a column or changing a column), the server automatically adapts the change to the data model, so that it can be used for querying immediately.
[0047] Through the embodiment, the server synchronizes the data model by adopting different synchronization strategies for different change types, so that the data model can be quickly put into use again, thereby improving the efficiency of data model synchronization.
[0048] In one embodiment, the synchronization of the data model according to the data table and the synchronization strategy corresponding to the data change type includes: if the data change type is a destructive change, freezing the data model and outputting alarm information corresponding to the data table.
[0049] In the embodiment, when the server detects that the data fingerprint of the metadata has changed, the server can detect the data change type. It is determined whether the data change is a compatibility change or a destructive change. If the server detects that the data change type is a destructive change, the server can freeze the data model and output alarm information corresponding to the data table. The freezing can temporarily make the data model unavailable. The alarm information can include information such as the existence of a destructive change in the data model and the need for synchronization.
[0050] Specifically, the server implements data synchronization through the dynamic synchronization and execution module. For example, the server can freeze the data model and send an urgent alarm to the administrator of the data model through the dynamic synchronization and execution module in combination with the synchronization strategy for a destructive change (such as deleting a column).
[0051] Through the embodiment, the server synchronizes the data model by adopting different synchronization strategies for different change types, and adopts the synchronization mode of freezing and alarming for a destructive change, so that the abnormality of the data model can be repaired in time, thereby improving the security of data model synchronization.
[0052] In one embodiment, after the synchronization of the data model according to the data table and the synchronization strategy corresponding to the data change type, the method further includes: determining a synchronization history record corresponding to the data model according to the data model before synchronization and the data model after synchronization; and storing the synchronization history record.
[0053] In the embodiment, the server can record the synchronization process of the data model. The server can record and store the process of each synchronization. For example, the server determines a synchronization history record corresponding to the data model according to the data model before synchronization and the data model after synchronization. The synchronization history record includes but is not limited to the mapping rule of the field and the structured query language and the version change history of the data model. The server can store the synchronization history record.
[0054] Specifically, the server can store all mapping rules and version change history persistent records after each data synchronization, for auditing and rollback, through dynamic synchronization with the execution module.
[0055] Through the embodiment, the server can persistently store the synchronization records of the data model, thereby improving the data security of the data model.
[0056] In one exemplary embodiment, as shown in Figure 2 Figure 2 is a flowchart of a data model synchronization method in another embodiment. In this embodiment, it includes a metadata fingerprint perception module, an intelligent analysis and decision module, and a dynamic synchronization and execution module. The server realizes second-level perception of structural changes by generating lightweight digital fingerprints (MD5 hash) for data source structures; automatically assesses the impact of changes and makes decisions through the built-in intelligent rule engine; and finally automatically completes the synchronization and adaptation of the data model without interrupting the business through core technologies such as dynamic structured query statement rewriting and field mapping, upgrading the traditional "polling comparison, alarm, and manual repair" mode to an automated mode of "perception, decision, and self-repair". Among them:
[0057] The server detects a call to the model or application interface of the data model, and then determines to perform data synchronization detection. It includes a metadata fingerprint perception module. The server connects to the data source configured by the user through the metadata fingerprint perception module, reads the data model fingerprint and the metadata information (including table name, column name, data type, length, whether null, etc.) of the specified data table, and generates the data fingerprint of the current model through event-driven (such as model function call). For example, the server can achieve metadata acquisition of the database through the database metadata interface in the Java Database Connectivity (JDBC) or query the database system table. Thus, the server can normalize these metadata information according to the predetermined rules (such as arranging column names in alphabetical order), and input them into the hash function (such as MD5) to generate a unique, fixed-length string, obtaining the data fingerprint corresponding to the above metadata. Thus, the server can compare the current fingerprint with the stored historical data fingerprint. If they are inconsistent, the server triggers a change event and performs data synchronization.
[0058] The server can receive a change event through the intelligent analysis and decision module, analyze the specific change content (such as adding column A, deleting column B, and changing the type of column C from INT (integer) to BIGINT (super large integer)), and evaluate the impact on the upper-layer data model. For example, the server determines the change type by parsing the data fingerprint difference of the metadata and calling the change classifier. Then, according to the preset compatibility rule matrix (for example, INT to BIGINT is a compatible change, and VARCHAR (variable length string) to INT is a destructive change), the server makes a decision to automatically synchronize, issue a warning, or freeze the model, and obtains the synchronization strategy described above.
[0059] The server implements data synchronization through the dynamic synchronization and execution module. According to the instructions of the decision module, the server combines the synchronization strategy to perform specific synchronization actions, ensuring that the upper-layer application query can continue to work normally. For example, for compatible changes (such as adding a column or changing a column), the server automatically adapts the changes to the data model, making it immediately available for queries.
[0060] The server implements data synchronization through the dynamic synchronization and execution module. For example, the server, through the dynamic synchronization and execution module, combines the synchronization strategy described above, and for destructive changes (such as deleting a column), the server can freeze the data model and issue an urgent warning to the administrator of the data model.
[0061] The server can store all mapping rules and version change history records through the dynamic synchronization and execution module after each data synchronization, which can be used for auditing and rollback.
[0062] Through the embodiment, the server improves the efficiency of data model synchronization by using lightweight fingerprint comparison and different synchronization strategies for different data change types, reduces the change awareness delay from hours to seconds, and greatly shortens the risk exposure window. Moreover, by using dynamic structured query statement rewriting and automatic mapping technology in the synchronization of compatible changes, the system avoids business query interruption caused by database changes in most scenarios, ensuring the continuity and stability of the data platform. In addition, the system can automatically handle compatible changes and accurately alarm and degrade destructive changes, minimizing the need for human intervention and improving operational efficiency.
[0063] It should be understood that although each step in the flowchart involved in the embodiments described above is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.
[0064] Based on the same inventive concept, the embodiments of the present application also provide a data model synchronization device for implementing the above-mentioned data model synchronization method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more data model synchronization device embodiments provided below can refer to the limitations of the data model synchronization method described above, and will not be repeated here.
[0065] In one exemplary embodiment, as shown in Figure 3 A data model synchronization device is provided, comprising: an acquisition module 500, a determination module 502, and a synchronization module 504, wherein:
[0066] The acquisition module 500 is configured to acquire the data fingerprint of the metadata of the data table to be detected in response to a synchronization detection instruction.
[0067] The determination module 502 is configured to determine the data change type corresponding to the metadata according to the comparison result of the metadata and the historical metadata corresponding to the historical data fingerprint of the metadata if there is a difference between the data fingerprint and the historical data fingerprint of the metadata.
[0068] The synchronization module 504 is configured to perform synchronization processing on the data model according to the synchronization strategy corresponding to the data table and the data change type.
[0069] In one embodiment, the acquisition module 500 is configured to acquire the metadata of the data table; perform sorting processing on the metadata according to a preset sorting rule to obtain sorted metadata; and determine the data fingerprint corresponding to the metadata according to the sorted metadata and a target hash function.
[0070] In one embodiment, the synchronization module 504 is configured to, if the data change type is a compatibility change, adjust the target field mapping information and / or the target structured query statement according to the newly added and / or changed data in the data table, so that the data model adapts to the data table after the data change; wherein, the target field mapping information represents the field mapping information related to the data table in the data model; and the target structured query statement represents the structured query statement related to the data table in the data model.
[0071] In one embodiment, the synchronization module 504 is used to freeze the data model and output alarm information corresponding to the data table if the data change type is a destructive change.
[0072] In one embodiment, the apparatus further includes: a recording module, configured to determine the synchronization history corresponding to the data model based on the data model before synchronization and the data model after synchronization; and to store the synchronization history.
[0073] Each module in the aforementioned data model synchronization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0074] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores business data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a data model synchronization method.
[0075] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0076] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the data model synchronization method described above when executing the computer program.
[0077] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implementing the data model synchronization method described above when executed by a processor.
[0078] In an embodiment, a computer program product is provided, comprising a computer program, and the computer program implementing the data model synchronization method described above when executed by a processor.
[0079] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0080] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0081] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0082] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A data model synchronization method, characterized in that, The method includes: In response to the synchronous detection command, obtain the data fingerprint of the metadata of the data table to be detected; If there is a difference between the data fingerprint and the historical data fingerprint of the metadata, the data change type corresponding to the metadata is determined based on the comparison result between the metadata and the historical metadata corresponding to the historical data fingerprint. The data model is synchronized according to the synchronization strategy corresponding to the data table and the data change type.
2. The method according to claim 1, characterized in that, The process of obtaining the data fingerprint of the metadata of the data table to be detected includes: Obtain the metadata of the data table; The metadata is sorted according to a preset sorting rule to obtain sorted metadata; Based on the sorted metadata and the target hash function, the data fingerprint corresponding to the metadata is determined.
3. The method according to claim 1, characterized in that, The data change types include at least one of compatibility changes and destructive changes, wherein: The compatibility change characterizes the type of data change when the comparison result is the metadata with newly added data and / or changed data; The destructive change characterizes the type of data change when the comparison result is the metadata data deletion.
4. The method according to claim 3, characterized in that, The step of synchronizing the data model according to the synchronization strategy corresponding to the data table and the data change type includes: If the data change type is a compatibility change, then based on the new data and / or changed data in the data table, adjust the target field mapping information and / or the target structured query statement so that the data model can adapt to the data table after the data change; Wherein, the target field mapping information represents the field mapping information related to the data table in the data model; the target structured query statement represents the structured query statement related to the data table in the data model.
5. The method according to claim 3, characterized in that, The step of synchronizing the data model according to the synchronization strategy corresponding to the data table and the data change type includes: If the data change type is a destructive change, then the data model is frozen, and the alarm information corresponding to the data table is output.
6. The method according to any one of claims 1 to 5, characterized in that, After synchronizing the data model according to the synchronization strategy corresponding to the data table and the data change type, the process further includes: Based on the data model before and after synchronization, determine the synchronization history corresponding to the data model; The synchronization history is stored.
7. A data model synchronization device, characterized in that, The device includes: The acquisition module is used to obtain the data fingerprint of the metadata of the data table to be detected in response to the synchronous detection command; The determination module is used to determine the data change type corresponding to the metadata based on the comparison result between the metadata and the historical metadata corresponding to the historical data fingerprint if there is a difference between the data fingerprint and the historical data fingerprint of the metadata. The synchronization module is used to perform synchronization processing on the data model according to the synchronization strategy corresponding to the data table and the data change type.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.