Data change tracking method and device

By identifying business tracking annotations in applications, automating the monitoring and capture of data discrepancy records, and combining sliding window and knowledge graph technologies, the problem of development redundancy, storage inefficiency, and performance loss in existing technologies is solved, achieving efficient and accurate data change tracking and cross-system correlation analysis.

CN121785655APending Publication Date: 2026-04-03BEIJING JINGDONG QIANSHITECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-05
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing data change tracking technologies suffer from problems such as development redundancy, inefficient storage, limited traceability, and performance loss, making it difficult to meet the data integrity and traceability requirements of modern information systems.

Method used

By recognizing business tracking annotations in applications, it automatically identifies and parses business entity classes and fields, monitors operation types, captures records of business data discrepancies, and optimizes storage using a sliding window mechanism and knowledge graph technology.

Benefits of technology

It enables automated and precise business data tracking, reduces development complexity, improves storage efficiency and traceability, reduces performance overhead, and supports cross-system business data correlation analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785655A_ABST
    Figure CN121785655A_ABST
Patent Text Reader

Abstract

The invention discloses a data change tracking method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: identifying a service entity class marked with a specific service tracking annotation in an application program, and analyzing a service field marked with a specific field tracking annotation in the service entity class; code segments corresponding to the business entity classes and the business fields are determined from codes of the application program, and the code segments are analyzed to obtain business main keys of the business entity objects and operation types corresponding to data change of the business fields; and monitoring and intercepting an operation on the business entity object, determining a target business field corresponding to an operation type of the operation, capturing new and old version business data of the target business field before and after the operation, and generating a business data difference record in combination with the business main key. According to the embodiment of the invention, through an annotation-driven automatic identification and difference data capture mechanism, the purpose of automatic, precise and lightweight data change tracking is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a data change tracking method and apparatus. Background Technology

[0002] In modern information systems, data change tracking and historical management are key requirements. Existing data change tracking technologies mainly include three types: log appending, snapshot comparison, and triggering. However, these technologies suffer from problems such as development redundancy, inefficient storage, limited traceability, and performance loss. There is an urgent need for a more efficient data change tracking technology to solve these problems. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a data change tracking method and apparatus, which can at least solve the problems of development redundancy, storage inefficiency, traceability limitations and performance loss in the prior art.

[0004] To achieve the above objectives, according to one aspect of the present invention, a data change tracking method is provided, comprising: Identify business entity classes in the application that are annotated with specific business tracking annotations, and parse the business fields in the business entity classes that are annotated with specific field tracking annotations; Determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; Monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

[0005] To achieve the above objectives, according to another aspect of the present invention, a data change tracking device is provided, comprising: The identification module is used to identify business entity classes in the application that are marked with specific business tracking annotations, and to parse the business fields in the business entity classes that are marked with specific field tracking annotations; The determination module is used to determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; The capture module is used to monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type of the operation, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

[0006] To achieve the above objectives, according to another aspect of the present invention, a data change tracking electronic device is provided.

[0007] The electronic device of this invention includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the data change tracking methods described above.

[0008] To achieve the above objectives, according to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the data change tracking methods described above.

[0009] To achieve the above objectives, according to another aspect of the present invention, a computing program product is provided. One such computing program product includes a computer program that, when executed by a processor, implements the data change tracking method provided in this embodiment of the invention.

[0010] According to the solution provided by the present invention, one embodiment of the invention has the following advantages or beneficial effects: by automatically identifying business entity classes and tracking key business fields, the development complexity of manually writing tracing code is reduced; by capturing only the difference data of marked business fields rather than a complete snapshot, storage efficiency is improved and storage space usage is reduced; the precise data capture mechanism based on business primary keys and operation types enhances the accuracy and comprehensiveness of change tracing. Simultaneously, by accurately locating the target business fields, the performance overhead caused by full-data monitoring is avoided. This method achieves automated, precise, and lightweight business data tracing, effectively overcoming the limitations of existing log appending, snapshot comparison, and trigger-based technologies.

[0011] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0012] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is a schematic diagram of the main process of a data change tracking method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an optional data change tracking method according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating another optional data change tracking method according to an embodiment of the present invention; Figure 4This is a schematic diagram of the main modules of a data change tracking device according to an embodiment of the present invention; Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present invention, such as a mobile device or server. Detailed Implementation

[0013] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0014] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0015] Where there is no conflict, the embodiments and features in the embodiments of this invention can be combined with each other. The acquisition, transmission, storage, use, and processing of data in the technical solutions of this invention comply with the relevant provisions of national laws and regulations, are used for legal and reasonable purposes, and are not shared, disclosed, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities.

[0016] Regarding user information, necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access such data comply with relevant laws and regulations, and safeguard the security of user personal information. Once this user personal information data is no longer needed, risks should be minimized by restricting or even prohibiting data collection and / or deleting the data. Where applicable, including in certain relevant applications, user privacy should be protected through data de-identification, such as by removing specific identifiers (e.g., date of birth), controlling the amount or specificity of stored data (e.g., collecting location data at the city level rather than the specific address level), controlling how data is stored, and / or other de-identification methods.

[0017] In modern information systems, data change tracking and historical data management are critical requirements. As business complexity increases, enterprises have higher demands for data integrity and traceability, especially in industries with stringent data security and auditing requirements such as finance, e-commerce, and healthcare. Existing data change tracking technologies are mainly divided into three categories: log appending, snapshot comparison, and trigger-based. Log appending technology captures data changes by parsing database transaction logs (such as MySQL binlog). While it can obtain data change records in real time, it often requires secondary parsing to understand business semantics, increasing processing complexity. Snapshot comparison technology restores historical states by periodically performing full backups and difference comparisons. Although relatively simple to implement, it has high storage costs and poor timeliness. Trigger-based technology uses database trigger mechanisms to record changes, automatically recording relevant information when data changes, but it generates redundant intermediate tables, increasing system complexity.

[0018] Furthermore, existing technologies have several shortcomings in practical applications. First, there is redundancy at the development level, requiring separate triggers or log parsing logic to be written for each data table, resulting in a large development workload and difficult maintenance. Second, storage efficiency is poor; snapshot comparison technologies require more than 200% of storage space, while log appending technologies, due to the need to maintain the integrity of the transaction context, are difficult to compress effectively. Third, data traceability capabilities are limited; existing technologies typically only support linear rollback operations on a single table, making it difficult to meet the traceability needs of complex business entity associations across systems and tables, such as the complete tracking of business processes like orders, payments, and logistics. Finally, in terms of system performance, trigger-based technologies, in particular, place a significant performance burden on the database, leading to increased database load and impacting overall system performance.

[0019] Therefore, there is an urgent need for a data change tracking and history management technology solution that can solve the above problems, reduce development complexity, reduce storage overhead, and improve traceability and system performance while ensuring the integrity and accuracy of data tracking.

[0020] See Figure 1 The diagram shows the main flowchart of a data change tracking method provided by an embodiment of the present invention, which includes the following steps: S101: Identify the business entity class in the application that is marked with a specific business tracking annotation, and parse the business fields in the business entity class that are marked with a specific field tracking annotation; S102: Determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; S103: Monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type of the operation, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

[0021] In the above implementation, for step S101, the application, such as a Java program, scans all business entity classes in the Java program based on bytecode enhancement technology (or bytecode enhancement probe) during the monitoring of the Java program's startup or operation. This is done to identify business entity classes marked with specific business tracking annotations, and these identified business entity classes are the objects to be monitored. A business entity is a class in the code that represents a specific business concept, such as the Order class or the User class. A business entity class includes multiple business entity objects. Taking the Order class as an example, its business entity objects may include Order 1, Order 2, ..., Order n.

[0022] Bytecode enhancement technology is used to dynamically modify the bytecode of loaded classes at runtime using Java Agent technology, without modifying the source code or recompiling. In other words, this technology can achieve non-intrusive enhancement of business logic without changing the application's source code, keeping the source code unaware of the changes, thus enabling the implantation of data tracing functionality without affecting the normal operation of the system.

[0023] After identifying the business entity class that needs to be monitored, an annotation parser can be used to parse all business fields marked with specific tracking annotations under that business entity class. These business fields can then be used as the business fields to be monitored, such as order status and order amount. Example: @BizTrack(domain="Order", key="orderNo") public class Order { private String orderNo; / / Primary key @TrackField(name="amount") private BigDecimal amount; / / Tracking field } In the example, the annotation for specific business tracking is `@BizTrack`, and the annotation for specific field tracking is `@TrackField`. This operation identifies the business entity class to be monitored as the `Order` class and the business field to be monitored as `amount`. In other words, developers who want to record data changes only need to add the `@BizTrack` annotation to the business entity class and the `@TrackField` annotation to the business field where the changed data needs to be recorded. The entire process requires no modification to the business logic code and no recording of underlying SQL (Structured Query Language) statements (such as `UPDATE orders SET amount=100`), achieving completely non-intrusive data tracking.

[0024] It's important to note that for business entity classes without specific business tracking annotations such as `@BizTrack`, the system will skip them entirely; these business entity classes are not within the monitoring scope. Furthermore, for business entity classes identified as needing monitoring, not all business fields are monitored; only those marked with specific field tracking annotations such as `@TrackField` are monitored. Through this precise annotation-driven mechanism, the system can automatically identify business entity classes and the business fields that need to be tracked, significantly reducing the workload of manually writing tracking code and effectively lowering development complexity and maintenance costs.

[0025] For step S102, the business semantic parser (AST, not code AST, but an abstract syntactic expression of business semantics) is used to determine the code segments corresponding to the business entity classes and business fields to be monitored from the application code. The business semantics of these code segments are then parsed to determine the business primary keys of all business entity objects in the business entity class, as well as the operation types corresponding to data changes in the business fields. Here, business entity objects refer to entity objects at the business level, distinct from database-level record entries, focusing on the expression of business semantics and domain concepts. Taking the Order class as an example, by parsing the business entity class code, the orderNo order number is determined as the business primary key, and the createOrder method corresponds to CREATE, the updateStatus method corresponds to UPDATE, and the cancelOrder method corresponds to DELETE.

[0026] In one alternative implementation, the code segment can also be parsed to obtain related business fields affected by these business fields. Subsequent data capture will also capture the business data of these related business fields before and after the operation, enabling more comprehensive data change tracking. Taking a product order as an example, by parsing the `setDiscount` method code of the `Order` class, it was found that changes to the discount field trigger a recalculation of the order amount. Therefore, the `amount` order amount field was identified as a related business field to the `discount` field.

[0027] In another alternative implementation, the code segment can be parsed to obtain the associated business entity classes of these business entity classes, thereby establishing a cross-entity business relationship mapping. Taking an order management system as an example, by parsing the code call relationship between the Order class and the Customer class, a business relationship between the order entity and the customer entity can be identified, and the customerId field in the order is associated with the customer entity.

[0028] For step S103, this solution sets up a change sniffing module to intercept the `Repository.save()` method via Spring AOP when it detects CRUD operations on identified business entity objects in the Data Access Layer (DAO). This module determines the target business field corresponding to the operation type, as some business fields may not require changes to their data. After determining the target business field, it captures the business data of the target business field before and after the operation, such as the old value: "Li Si" and the new value: "Zhang San".

[0029] In terms of technical implementation, after identifying annotations, bytecode manipulation tools such as ASM (Abstract State Machine) can be used to modify the bytecode of the business entity class. For example, a getter method can be added to the orderNo field (if it does not exist); monitoring logic can be inserted before and after the Repository.save() method call to record the old and new values ​​of the field. The modified bytecode is executed directly by the JVM, and the business code is unaware of it.

[0030] This operation only requires monitoring the business entity classes marked with business tracking annotations and the business fields marked with field tracking annotations, eliminating the need to scan irrelevant code. It also automatically records the values ​​of these business fields before and after the operation, achieving zero intrusion into business code. The generated business data difference record can be in the form of a triple, such as <business entity object's primary key + operation type + target business field, old value, new value>. In addition to these factors, it can also include the operation source, such as UserService.update(), and the modification timestamp, such as 2023-08-01 14:00:00. In an optional implementation, contextual information such as the operator and call chain can also be included to facilitate post-event tracing and auditing.

[0031] Assume the complete process of a user purchasing goods online is as follows: user creates an order (order number: ORD001, status: pending payment, amount: 100 yuan), user completes payment (payment number: PAY001, associated order ORD001, status: successful), merchant ships the goods (logistics tracking number: EXP001, associated order ORD001, status: in transit), user confirms receipt (order status updated to: completed). Traditional methods require setting triggers or parsing database logs for the order table, payment table, and logistics table separately. This solution, however, uses business tracking annotations to uniformly manage data changes throughout the entire shopping process. During the order creation phase: The Order class is annotated with @BizTrack, and key business fields such as status and amount are annotated with @TrackField. The order creation operation is automatically recorded, and a difference record is generated: {Business primary key: ORD001, Operation type: CREATE, Business field: status, Old value: null, New value: Pending payment}; Payment completion stage: Mark the Payment class with the @BizTrack annotation and the paymentStatus field with the @TrackField annotation to automatically capture payment status changes and generate a difference record: {Business primary key: PAY001, Operation type: UPDATE, Business field: status, Old value: Processing, New value: Success}; Merchant shipping stage: Mark the Express class with @BizTrack annotation and the expressStatus field with @TrackField annotation to automatically record changes in logistics status and generate difference records: {Business primary key: EXP001, Operation type: UPDATE, Business field: status, Old value: Pending shipment, New value: In transit}; Confirmation of receipt stage: When the user confirms receipt, the order status change is automatically captured and a difference record is generated: {Business primary key: ORD001, Operation type: UPDATE, Business field: status, Old value: In transit, New value: Completed}.

[0032] It is understood that the specific values ​​listed in the above hypothetical description of data change tracking are merely illustrative and not restrictive. In practice, other values ​​can be set according to needs. Similarly, the specific values ​​listed in the subsequent embodiments are also just examples and are not the only limitation.

[0033] The method provided in the above embodiments effectively solves key problems of existing data change tracking technologies, such as development redundancy, inefficient storage, limited traceability, and performance loss, through annotation-driven automated identification and parsing mechanisms. Compared with traditional technologies, this solution significantly reduces the workload of manually writing tracking code and lowers development complexity by automatically identifying the business entity classes and business fields to be monitored; it adopts a differential data capture mechanism, recording only the change information of these business fields instead of a complete data snapshot, significantly improving storage efficiency and reducing space consumption; it provides more accurate and comprehensive change traceability capabilities based on precise data capture of business primary keys and operation types; and it avoids the performance overhead of full data monitoring by accurately locating target business fields, achieving lightweight business data tracking. This method achieves automated, accurate, and efficient business data change tracking management.

[0034] See Figure 2 The diagram illustrates an optional data change tracking method according to an embodiment of the present invention, comprising the following steps: S201: Based on the sliding window mechanism, the business data difference records whose operation timestamps are within the current sliding window time range are taken as hot data, and the hot data is encoded. S202: Records of business data differences whose operation timestamps are outside the current sliding window time range are treated as cold data, and the cold data is compressed.

[0035] In existing technologies, each data change requires saving a complete record or the original database log, consuming a significant amount of storage space. To address this issue, this solution employs a sliding window mechanism for categorized optimization after acquiring business data difference records, thereby reducing resource consumption. A fixed-size sliding window is pre-maintained (e.g., a default of 1024 fields and 30 days, configurable via @CompressStrategy). Based on the sliding window mechanism, business data difference records with operation timestamps within the current sliding window are designated as hot data, while those outside the current sliding window are designated as cold data.

[0036] For hot data, Delta-of-Delta (DoD) encoding or other encoding techniques known to those skilled in the art are used to encode the differences between adjacent versions of business data records. For cold data, an improved LZ77 compression algorithm or other compression algorithms known to those skilled in the art are used to efficiently compress the differences between adjacent versions of business data records. It should be noted that the compression here targets multiple versions of business data change records with the same business primary key. Redundancy is reduced through differential storage, but the data is always stored in isolation at the business entity object level. There is no cross-entity mixed compression, ensuring data isolation and query efficiency.

[0037] Table 1

[0038] It's important to note that while both encoding and compression aim to improve storage efficiency, they differ significantly in purpose, method, and application scenarios. Encoding primarily uses specific algorithms to re-represent and transform the format of data. For example, Delta-of-Delta encoding converts absolute values ​​into relative differences, aiming to optimize data storage format and improve access efficiency. Encoded data typically retains some structured characteristics for fast decoding. Compression, on the other hand, uses algorithms to eliminate data redundancy, significantly reducing storage space usage. For instance, the LZ77 algorithm achieves a high compression ratio by finding and replacing repeating patterns. Compressed data requires complete decompression to recover the original information, prioritizing maximizing storage space savings.

[0039] Therefore, in this solution, hot data is encoded to ensure access efficiency, while cold data is compressed to maximize storage space savings. The combination of these two techniques achieves a balanced optimization of storage efficiency and access performance. Furthermore, hot data is stored using a B+ tree index structure to ensure efficient random access performance, while cold data is transferred to Object Storage Service (OSS) to reduce storage costs and achieve long-term preservation of massive amounts of data.

[0040] The method provided in the above embodiments distinguishes between hot data and cold data based on a sliding window mechanism. Hot data is encoded to maintain good data readability and processing efficiency, while cold data is compressed to maximize storage space savings. This achieves an optimal balance between storage cost and data processing efficiency, avoiding the resource waste caused by using a single storage method for all data in traditional solutions.

[0041] See Figure 3 The diagram illustrates another optional data change tracking method according to an embodiment of the present invention, including the following steps: S301: Using the business entity object as a node and the business data difference record as a node instance, construct the association edge relationship between the node and the node instance according to the operation type of the operation, so as to update the knowledge graph corresponding to the business entity object and display it visually; S302: Integrate the knowledge graphs of all business entity objects under the business entity class to construct a comprehensive knowledge graph corresponding to the business entity class and display it visually; S303: Based on the relationships between various business entity classes within the same system, integrate the comprehensive knowledge graphs of the corresponding business entity classes to construct a comprehensive knowledge graph of the same system and display it visually; S304: Based on the relationships between various business entity classes across systems, integrate the comprehensive knowledge graphs of the corresponding business entity classes to construct a cross-system comprehensive knowledge graph and display it visually; S305: Receive a query request, construct query conditions based on the business primary key and time range in the query request, query node instances that meet the query conditions from the knowledge graph and return them.

[0042] This solution also constructs a knowledge graph to achieve visualized management of business data change records. Specifically, business entity objects are treated as independent nodes, and their version-wise business data difference records (or the results after sliding window optimization) are treated as node instances, such as <business entity object's business primary key, version number generated based on operation timestamp, business data difference information>. Furthermore, it establishes association edges between nodes and node instances based on different operation types, with the edge relationships including <business entity object's business primary key, operation type, operation timestamp>.

[0043] Then, based on nodes, node instances, and the relationships between nodes and their instances, a visual knowledge graph reflecting the evolution of business data for the business entity object is constructed. For example, an order entity class may contain n orders, which are the business entity objects, resulting in n visual knowledge graphs. This knowledge graph supports dynamic updates and can reflect changes in business data in real time.

[0044] In one optional implementation, a complete business domain data view corresponding to the business entity class is constructed by aggregating and analyzing the knowledge graph of all business entity objects under the same business entity class. In another optional implementation, association edges between business entities can be constructed based on the relationships between business entity classes within the same system and between different systems. This allows for the construction of a comprehensive knowledge graph within the same system and a comprehensive knowledge graph across systems, solving the problems of traditional solutions that only allow single-table backtracking and inefficient business-level association analysis. The edge relationships include <relationships between business entity objects, operation types, and operation timestamps>. These business entity classes can be associated based on global transaction IDs (such as XIDs). For example, order creation, payment completion, shipment, and confirmation of receipt—all cross-system operations are associated together.

[0045] After constructing the knowledge graph, the system provides a multi-dimensional query interface based on the business primary key and time range (which can also include business entity category, system identifier, etc.) of specific business entity objects. It supports the visualization of business data change records according to version sequence, such as displaying them in chronological order from newest to oldest, so as to realize the intuitive display and efficient tracing of business data change history.

[0046] The method provided in the above embodiments constructs a visual knowledge graph that can intuitively reflect the evolution of business data by using business entity objects as nodes, version difference records as node instances, and operation types as associated edges. It not only supports the tracking of the change history of a single business entity, but also forms a comprehensive knowledge graph within the same system and across systems through aggregation analysis. This enables multi-level business data insights from micro to macro and from local to global perspectives. At the same time, through multi-dimensional query interfaces and version sequence visualization, it greatly improves the efficiency of business data change tracing and user experience.

[0047] In summary, this invention achieves high storage efficiency, strong business relevance, and low performance loss in data change tracking by combining semantic differential compression (i.e., comparing values ​​before and after a change and storing only the differences (e.g., amount: 90→100)) with knowledge graph technology. The entire invention requires no modification to the application source code, enabling transparent monitoring without the awareness of business semantics. For acquired business data change records, a differentiated storage strategy based on a sliding window mechanism can be adopted, achieving a higher compression ratio compared to full snapshots or raw logs. Furthermore, by constructing a knowledge graph to associate business entity objects and business data change records and storing them in graph form, it facilitates the establishment of complete data evolution links within and across systems, providing strong technical support for business data analysis and traceability.

[0048] See Figure 4The diagram shows the main modules of a data change tracking device 400 provided in an embodiment of the present invention, including: The identification module 401 is used to identify business entity classes in the application that are marked with specific business tracking annotations, and to parse the business fields in the business entity classes that are marked with specific field tracking annotations; The determination module 402 is used to determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; The capture module 403 is used to monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type of the operation, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

[0049] In the apparatus of the present invention, the determining module 402 is further configured to: parse the code segment to determine the associated business fields affected by the business field; The capture module 403 is used to capture the old and new versions of business data of the related business fields affected by the target business field before and after the operation.

[0050] The apparatus for implementing this invention further includes a record management module, used for: Based on the sliding window mechanism, business data difference records whose operation timestamps fall within the current sliding window time range are treated as hot data, and the hot data is encoded; and Business data differences whose operation timestamps are outside the current sliding window time range are recorded as cold data, and the cold data is compressed.

[0051] The apparatus for implementing this invention further includes a knowledge graph module, used for: The business entity object is used as a node, and the business data difference record is used as a node instance. The association edge relationship between the node and the node instance is constructed according to the operation type of the operation, so as to update the knowledge graph corresponding to the business entity object and display it visually.

[0052] In the apparatus of this invention, the knowledge graph module is further used for: Integrate the knowledge graphs of all business entity objects under the business entity class to construct a comprehensive knowledge graph corresponding to the business entity class and display it visually; Based on the relationships between various business entity classes within the same system, a comprehensive knowledge graph of the corresponding business entity classes is integrated to construct a comprehensive knowledge graph of the same system and display it visually. Based on the relationships between various business entity classes across systems, a comprehensive knowledge graph of the corresponding business entity classes is integrated to construct a cross-system comprehensive knowledge graph and display it visually.

[0053] The apparatus for implementing this invention further includes a query module, used for: Receive a query request, construct query conditions based on the business primary key and time range in the query request, query node instances that meet the query conditions from the knowledge graph and return them.

[0054] Furthermore, the specific implementation details of the device described in the embodiments of the present invention have been described in detail in the above-described method, so the details will not be repeated here.

[0055] Figure 5 An exemplary system architecture 500 to which embodiments of the present invention can be applied is shown, including terminal devices 501, 502, 503, network 504, and server 505 (this is merely an example).

[0056] Terminal devices 501, 502, and 503 can be various electronic devices with displays and web browsing capabilities, and have various communication client applications installed. Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc.

[0057] Network 504 is a medium used to provide a communication link between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0058] Server 505 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 501, 502, and 503 (this is just an example). The backend management server can analyze and process received data such as product information query requests, and feed back the processing results (e.g., target push information, product information—this is just an example) to the terminal devices. It should be noted that the method provided in this embodiment of the invention is generally executed by server 505, and correspondingly, the apparatus is generally set in server 505.

[0059] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0060] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device of the present invention. Figure 6The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0061] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0062] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0063] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0064] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0065] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0066] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including an identification module, a determination module, and a capture module. The names of these modules do not necessarily limit the module itself; for example, a capture module can also be described as a "monitoring capture module."

[0067] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform any of the data change tracking methods described above.

[0068] The computer program product of the present invention includes a computer program that, when executed by a processor, implements the data change tracking method in the embodiments of the present invention.

[0069] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A data change tracking method, characterized in that, include: Identify business entity classes in the application that are annotated with specific business tracking annotations, and parse the business fields in the business entity classes that are annotated with specific field tracking annotations; Determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; Monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

2. The method according to claim 1, characterized in that, The method further includes: Parse the code segment to determine the associated business fields affected by the business field; Capture the old and new versions of business data of related business fields affected by the target business field before and after the operation.

3. The method according to claim 1, characterized in that, After generating the business data difference record, the method further includes: Based on the sliding window mechanism, business data difference records whose operation timestamps fall within the current sliding window time range are treated as hot data, and the hot data is encoded; and Business data differences whose operation timestamps are outside the current sliding window time range are recorded as cold data, and the cold data is compressed.

4. The method according to claim 1 or 3, characterized in that, After generating the business data difference record, the method further includes: The business entity object is used as a node, and the business data difference record is used as a node instance. The association edge relationship between the node and the node instance is constructed according to the operation type of the operation, so as to update the knowledge graph corresponding to the business entity object and display it visually.

5. The method according to claim 4, characterized in that, The method further includes: Integrate the knowledge graphs of all business entity objects under the business entity class to construct a comprehensive knowledge graph corresponding to the business entity class and display it visually; Based on the relationships between various business entity classes within the same system, a comprehensive knowledge graph of the corresponding business entity classes is integrated to construct a comprehensive knowledge graph of the same system and display it visually. Based on the relationships between various business entity classes across systems, a comprehensive knowledge graph of the corresponding business entity classes is integrated to construct a cross-system comprehensive knowledge graph and display it visually.

6. The method according to claim 4 or 5, characterized in that, The method further includes: Receive a query request, construct query conditions based on the business primary key and time range in the query request, query node instances that meet the query conditions from the knowledge graph and return them.

7. A data change tracking device, characterized in that, include: The identification module is used to identify business entity classes in the application that are marked with specific business tracking annotations, and to parse the business fields in the business entity classes that are marked with specific field tracking annotations; The determination module is used to determine the code segment corresponding to the business entity class and the business field, and parse the code segment to obtain the business primary key of the business entity object and the operation type corresponding to the data change of each of the business fields under the business entity object; The capture module is used to monitor and intercept operations on the business entity object, determine the target business field corresponding to the operation type of the operation, capture the old and new versions of the target business field before and after the operation, and combine them with the business primary key to generate a business data difference record.

8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-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 method as described in any one of claims 1-6.