A method and system for detecting data inconsistency in a distributed database system
By combining the PDT-net model and Petri nets, a state reachability graph is generated, which solves the problem of false alarms and false negatives in data inconsistency detection in distributed database systems, achieves more accurate judgment of data inconsistency errors, and improves the security and reliability of the system.
Patent Information
- Application Number
- CN202310635440.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-05-31
AI Technical Summary
Existing technologies in distributed database systems are prone to false negatives and false negatives when detecting data inconsistencies, especially in scenarios involving multi-table interactions and shared variable operations, where traditional methods struggle to accurately identify data inconsistency errors.
The PDT-net model is used to abstractly model the distributed database system. By combining the transition enable conditions of Petri nets and the computational tree logic formula, a state reachability graph is generated. By traversing the computational tree logic formula, inconsistent transition sets and state sets are found, realizing detection from both control flow and data flow perspectives.
This improves the accuracy of data inconsistency detection, reduces false alarms and false negatives, and ensures the security and high reliability of the distributed database system.
Smart Images

Figure CN116894042B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of model flow information, and particularly relates to a distributed database system data inconsistency detection method and system. BACKGROUND
[0002] With the rapid development of Internet technology and big data, the traditional centralized database system is difficult to meet the demand of high concurrency transaction processing, and the concurrency control of distributed database system can ensure that multiple transactions are executed efficiently and correctly, realize the automatic support and cooperative operation of the system, reduce the cost and improve the efficiency. In daily life, it has a wide range of applications, such as: cloud computing, intelligent medical treatment and intelligent rail transit and other fields. However, in the actual distributed database system, there are a large number of data interactions and concurrent data operations (read, write, delete) between transactions. Especially in the distributed database system, the shared variable is usually a variable commonly used by multiple tables. If there is an unreasonable data operation in the execution process, after modifying the shared variable, the value in the other database tables associated with the shared variable is not updated in time, which is easy to cause data inconsistency, thereby causing system errors. Therefore, how to ensure the safety and high reliability of such system is a research hotspot at present.
[0003] There are some researches on detecting data inconsistency errors in workflow systems based on Petri nets. Von Stackelberg et al. presented a method to detect data inconsistency errors in BPMN workflow models. They mapped BPMN workflow models to Petri nets and defined a set of anti-patterns for data flow errors in BPMN workflow models. They formalized the anti-patterns of BPMN using computation tree logic (CTL) and used tools to verify the CTL formulas. Some researchers proposed a basic definition of data inconsistency errors based on Petri nets. They detected data flow inconsistency errors in the model by establishing an activity data association matrix. In some workflow models, the routing of activities depends on specific data elements, which means that the correct execution of activities in some workflow models depends not only on the control flow but also on the data flow. If the data flow itself is incorrect due to design flaws or improper operation by staff, some researchers have proposed a more refined method to model data flow and detect data inconsistency errors, improving the correctness of the model. Although the above researches can solve the problem of data inconsistency detection to some extent, the detection methods are usually based on abstract data element operations (read, write, delete) or the execution of activities (input, output). In short, they can only qualitatively analyze data inconsistency errors. The drawback of this method is that it is prone to false positives and false negatives.
[0004] On the other hand, most of the research on database tables is focused on single database tables. The existing modeling methods are not sufficient to describe and express the interaction between multiple tables and the data operations between tables in distributed database systems. At the same time, existing data inconsistency detection methods are based on state reachable graphs. They detect unreasonable data operations by traversing all state reachable paths and qualitatively analyze errors. However, many activities between transactions in distributed database systems are based on background database tables or shared variable operations. Therefore, the traditional method of detecting data inconsistency errors is not rigorous and is prone to false positives and false negatives. The main reason is that when formalizing distributed database systems, researchers either focus on activities and consider data input or output from the control flow level, or focus on data and consider the execution of data elements (read, write, delete) from the data flow level.
[0005] To address this issue, a more granular model is needed to describe distributed database systems. This model should not only characterize the active data in the system from a control flow perspective but also provide a more detailed description of the operations on specific data item values in the persistent layer from a data flow perspective. When detecting data inconsistency errors, we utilize data item operations and corresponding changes in data item values to detect inconsistencies. This allows for accurate identification of data inconsistency errors from both qualitative and quantitative dimensions, mitigating the false negatives and false positives inherent in traditional methods. Summary of the Invention
[0006] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0007] In view of the aforementioned existing problems, this invention is proposed. Therefore, this invention provides a method for detecting data inconsistency in distributed database systems, to solve the problems of missed and false alarms in traditional detection methods in practical applications.
[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0009] In a first aspect, the present invention provides a method for detecting data inconsistency in a distributed database system, comprising:
[0010] The distributed database system is abstracted and modeled to form the PDT-net model;
[0011] The corresponding state reachability graph is generated by the transition enabling conditions and occurrence rules in the PDT-net model.
[0012] Based on the idea of model detection, the definition of data inconsistency is transformed into the corresponding computation tree logic formula;
[0013] Using the generated state reachability graph, traverse all states in the computation tree logic formula to find the transition set and state set with inconsistent data.
[0014] As a preferred embodiment of the distributed database system data inconsistency detection method described in this invention, the formation of the PDT-net model includes:
[0015] Based on the structural and data operation characteristics of distributed database systems, this paper analyzes the system from the perspectives of control flow and data flow, and models it using Petri nets with data and table operations.
[0016] In this context, a Petri net is defined as N' = (P, T, F, D, R, rd, wt, dt, opt, sel, ins, del, upd); P represents a finite set of places; T = T M ∪T W T represents a finite set of transitions. M T represents the set of main memory transitions. W It is a set of working memory transitions and The set is represented as arcs; D = {d1, d2, ..., dk} represents a finite set of data elements; Let R represent a set containing m initial tables, each containing n records, and a record R in the j-th table. j (r i )={d1,d2,...,d k} is composed of k attribute values, d i This is represented as the i-th attribute value in the record; j∈{1,2,...,m}, i∈{1,2,...,k}.
[0017] In a preferred embodiment of the distributed database system data inconsistency detection method described in this invention, the transition enabling conditions include:
[0018] The transition consists of three parts: the specific activity name, the operation on the abstract data element, and the operation on the specific data item value;
[0019] Here, the specific activity name refers to the activity name corresponding to the current change t; the operation on the abstract data element refers to performing read, write, and delete operations on the data in the current activity; and the operation on the specific data item value refers to performing select, insert, delete, and update operations on the data items associated with the table in the current activity.
[0020] As a preferred embodiment of the distributed database system data inconsistency detection method described in this invention, the method involves converting the data inconsistency definition into a corresponding computational tree logic formula, including:
[0021] Computational Tree Logic Formula Represented as:
[0022]
[0023] like If the result is true, it indicates that there is a data inconsistency error; in this case, the corresponding data inconsistency state set needs to be recorded; otherwise, it indicates that there is no data inconsistency error.
[0024] Where E represents the existence of certain paths; F represents starting from a certain state in a path from a certain state; X represents starting from the second state in a path from a certain state; this formula means that if there are concurrent paths, and transitions t1 and t2 in future states along these paths have the right to occur in states c1 and c2, then transitions t1 and t2 are operations on data item d, and the result is that the same data item d will have different values in different state tables; wt is the tag function for writing data items in main memory, rd is the tag function for reading data items in main memory, dt is the tag function for deleting data items in main memory, sel is the tag function for selecting records in the table, ins is the tag function for inserting records in the table, del is the tag function for deleting records in the table, and upd is the tag function for updating records in the table; transition t∈T in state It enables, denoted as m is the identifier function of N'; θ D :D→{⊥,T} indicates that in the current state, each data element d∈D is assigned a defined value (T) or an undefined value (⊥); in the initial state, each data element is an undefined value (⊥); when a read or write operation is performed on a data element, the data element is assigned a value, indicating that it is a defined value (T); if a delete operation is performed on a data element, the data element will be an undefined value (⊥); R→{⊥,T} represents the assignment status of each data item value in the current table, that is, a defined value (T) or an undefined value (⊥). If a data item value in a record in the table has not been assigned a value, then the data item is an undefined value (⊥). When an update or insert operation is performed on the data item value in a record in the table, it means that the data item value has been assigned a defined value (T).
[0025] As a preferred embodiment of the distributed database system data inconsistency detection method described in this invention, the method involves: utilizing the generated state reachability graph to traverse all states in the computation tree logic formula to find the data inconsistency transition set and state set, including:
[0026] Define the transition set sat(DI) under data inconsistency error, the data inconsistency state set sat(c_DI), and the transition set sat(T||) storing concurrency relationships. co At the same time, these sets are initialized separately.
[0027] In a preferred embodiment of the distributed database system data inconsistency detection method of the present invention, the following steps are performed: These sets are simultaneously initialized, including:
[0028] Store all concurrent transition pairs (t1, t2) in the system into sat(T|| co), sequentially select from set sat(T|| co Select transition pairs; if the data operations bound to the transition and the corresponding data item values are all performed on the same data item, it indicates that a data inconsistency error has occurred between the transition pairs; otherwise, there is no data inconsistency error; when it is determined that the transition pairs perform data operations on the same data item, further determine whether it meets the data inconsistency error definition formula.
[0029] In a preferred embodiment of the distributed database system data inconsistency detection method of the present invention, the formula for defining the data inconsistency error includes:
[0030] The formula for defining a data inconsistency error is expressed as follows:
[0031]
[0032] If the transition pair (t1, t2) satisfies the definition of a data inconsistency error when operating on the same data item value, then a data inconsistency error exists; iterative initialization processing continues until the set sat(T|| co All transition pairs in the table have been queried.
[0033] Secondly, the present invention provides a data inconsistency detection system for a distributed database system, comprising:
[0034] The preprocessing storage module is used to store table data and can also initialize transition sets and state sets.
[0035] The modeling module is used for abstract modeling of distributed database systems;
[0036] The judgment and detection module is used to judge data inconsistency, thereby detecting data inconsistency errors.
[0037] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any step of the above-described method.
[0038] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the above-described method.
[0039] Compared with the prior art, the beneficial effects of the invention are as follows: The invention transforms the distributed database system into the corresponding PDT-net model, binds the semantics of database operations to the transitions, thereby simulating the operations of various activities in the database system and generating the state reachability graph of the PDT-net; at the same time, based on the data inconsistency error detection algorithm under PDT-net, it traverses all states in the reachability graph, which can more accurately find data inconsistency errors. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0041] Figure 1 This is a flowchart illustrating the implementation of a distributed database system data inconsistency detection method according to an embodiment of the present invention.
[0042] Figure 2 This is an overall system flowchart of a distributed database system data inconsistency detection method according to an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram illustrating data inconsistency detection in a distributed database system data inconsistency detection method according to an embodiment of the present invention;
[0044] Figure 4 This is a schematic diagram of the PDT-net structure of the distributed database system data inconsistency detection method according to an embodiment of the present invention;
[0045] Figure 5 This diagram illustrates the development tool for a distributed database system data inconsistency detection method according to an embodiment of the present invention. Detailed Implementation
[0046] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0047] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0048] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0049] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0050] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0051] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0052] Example 1
[0053] Reference Figures 1 to 3 This is the first embodiment of the present invention, which provides a method for detecting data inconsistency in a distributed database system, including:
[0054] The distributed database system is abstracted and modeled to form the PDT-net model;
[0055] Furthermore, the PDT-net model is formed, including:
[0056] Based on the structural and data operation characteristics of distributed database systems, this paper analyzes the system from the perspectives of control flow and data flow, and models it using Petri nets with data and table operations.
[0057] The corresponding state reachability graph is generated by the transition enabling conditions and occurrence rules in the PDT-net model.
[0058] Furthermore, the definition, states, transition enabling conditions, and occurrence rules of PDT-net are explained below:
[0059] The definition of PDT-net is N' = (P, T, F, D, R, rd, wt, dt, opt, sel, ins, del, upd);
[0060] Where P is a finite set of places, and T = T M ∪T W It is a finite set of changes, T M It is the set of main memory transitions, T W It is a set of working memory transitions, and It is a set of arcs; D = {d1, d2, ..., d...} k} is a finite set of data elements; It is a set containing m initial tables, each containing n records. A record R in the j-th table... j (r i )={d1,d2,...,d k It consists of k attribute values, d i This represents the i-th attribute value in the record, j∈{1,2,...,m}, i∈{1,2,...,k}; rd:T M →2 D It is a tag function that reads data items from main memory; wt:T M →2 D It is a tag function that writes data items to main memory; dt:T M →2 D It is a tag function that deletes data items from main memory; opt:T w →2 D It is a tag function that calculates the tag of a data item in the working memory; sel: This is a label function that selects records from a table; ins: This is a label function that inserts records into a table; del: This is a label function that deletes records from a table; upd: It is a tag function that updates records in a table;
[0061] The state of PDT-net is: m is the identifier function of N'; θ D :D→{⊥,T} indicates that in the current state, each data element d∈D is assigned a defined value (T) or an undefined value (⊥); in the initial state, each data element is an undefined value (⊥); when a read or write operation is performed on a data element, the data element is assigned a value, indicating that it is a defined value (T); if a delete operation is performed on a data element, the data element will be an undefined value (⊥); R→{⊥,T} represents the assignment status of each data item value in the current table, that is, a defined value (T) or an undefined value (⊥); if the data item value of a record in the table has not been assigned a value, then the data item is an undefined value (⊥); when an update or insert operation is performed on the data item value of a record in the table, it means that the data item value is assigned a defined value (T);
[0062] It should be noted that in PDT-net, the given initial table is usually defined, that is, the value of each data item in the table is a defined value (T);
[0063] The transition enabling conditions and occurrence rules of PDT-net are as follows:
[0064] Let N' be a PDT-net, where transitions t∈T occur in state N'. It is enabled, denoted as c[t>, and the enabling condition is as follows:
[0065] (1)
[0066] (2)
[0067] (3)
[0068] (4)
[0069]
[0070] It should be noted that if transition t is enabled under c, then t can be triggered, resulting in a new state. Let c[t>c'] be the denoted c[t>c'], where c' satisfies the following condition:
[0071] (1) m[t>m′;
[0072] (2)
[0073] (3)
[0074] (4)
[0075] (5)
[0076] (6)
[0077] (7)
[0078] (8)
[0079] (9)
[0080] (10)
[0081] (11)
[0082] (12)
[0083] Based on the idea of model detection, the definition of data inconsistency is transformed into the corresponding computation tree logic formula;
[0084] Furthermore, computation tree logic formulas Represented as:
[0085]
[0086] like If the result is true, it indicates that there is a data inconsistency error; in this case, the corresponding data inconsistency state set needs to be recorded; otherwise, it indicates that there is no data inconsistency error.
[0087] Where E represents the existence of certain paths; F represents starting from a certain state in a path from a certain state; X represents starting from the second state in a path from a certain state; this formula means that if there are concurrent paths, and in the future states on these concurrent paths, transitions t1 and t2 will have the right to occur in states c1 and c2, then transitions t1 and t2 are operations on data item d, and the result is that the same data item d will produce unequal values in different state tables;
[0088] Using the generated state reachability graph, traverse all states in the computation tree logic formula to find the transition set and state set for data inconsistency, including: defining the transition set sat(DI) under data inconsistency error, the data inconsistency state set sat(c_DI), and the transition set sat(T||) storing concurrency relationships. coAt the same time, these sets are initialized separately;
[0089] Furthermore, the initialization process includes storing all concurrent transition pairs (t1, t2) in the system into sat(T|| co ), sequentially select from set sat(T|| co Select transition pairs; if the data operations bound to the transition and the corresponding data item values are all performed on the same data item, it indicates that a data inconsistency error has occurred between the transition pairs; otherwise, there is no data inconsistency error; when it is determined that the transition pairs perform data operations on the same data item, further determine whether it meets the data inconsistency error definition formula;
[0090] Furthermore, the formula for defining a data inconsistency error is expressed as follows:
[0091]
[0092] If the transition pair (t1, t2) satisfies the definition of a data inconsistency error when operating on the same data item value, then a data inconsistency error exists; iterative initialization processing continues until the set sat(T|| co All transition pairs in the table have been queried.
[0093] Furthermore, this embodiment also provides a distributed database system data inconsistency detection system, including:
[0094] The preprocessing storage module is used to store table data and can also initialize transition sets and state sets.
[0095] The modeling module is used for abstract modeling of distributed database systems;
[0096] The judgment and detection module is used to judge data inconsistency, thereby detecting data inconsistency errors.
[0097] This embodiment also provides a computer device applicable to the data inconsistency detection method of a distributed database system, including:
[0098] The system includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes these instructions to implement the distributed database system data inconsistency detection method proposed in the above embodiments.
[0099] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0100] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the data inconsistency detection method for a distributed database system as proposed in the above embodiments.
[0101] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0102] Example 2
[0103] Reference Figure 4 This is a second embodiment of the present invention, which provides a method for detecting data inconsistency in a distributed database system, including:
[0104] The PDT-net model is based on Petri-net to model the control flow in a distributed database system. At the data flow level, transitions are bound to operations on abstract data elements, including read (wt), write (rd), and delete (dt) operations on active data. To describe operations on data item values in the backend database table, transitions are bound to operations on specific data item values, including update (upd), insert (sel), delete (del), and select (sel) operations on data item values, thus realizing operations on data items in the database table.
[0105] Example 3
[0106] Reference Figure 5 This is the third embodiment of the present invention, which provides a method for detecting data inconsistency in a distributed database system, including:
[0107] The developed tools were used to detect data inconsistencies in the model.
[0108] First, this information needs to be stored in a .txt file. After inputting the PDT-net described in the .txt file, the tool can read the information in the text and generate the corresponding state reachability graph, including the number of states generated, the number of arcs, and the time required to generate the state reachability graph. It can be seen that at activity t0, a write (wt) operation is performed on the abstract data element id, and a select (sel) operation is performed on the specific data item value id in the database table. Figure 5 (a) shows a PDT-net model for online shopping; Figure 5 (b) Display the buyer's initial table information; Figure 5 (c) Display the seller's initial table information; Figure 5 (d) Provide the logical formula for the data inconsistency; Figure 5 (e) presents the generated state reachability graph and the data inconsistency detection results; from Figure 5 The experimental results in (e) show that 203 states and 469 arcs were generated, and a total of 32 pairs of data inconsistency error states were generated.
[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting data inconsistency in a distributed database system, characterized in that, include: The distributed database system is abstracted and modeled to form the PDT-net model; Based on the structural and data operation characteristics of distributed database systems, this paper analyzes the system from the perspectives of control flow and data flow, and models it using Petri nets with data and table operations. In this context, a Petri net is defined as N' = (P, T, F, D, R, rd, wt, dt, opt, sel, ins, del, upd); P represents a finite set of places; T = T M ∪T W T represents a finite set of transitions. M T represents the set of main memory transitions. W It is a set of working memory transitions and Represented as a set of arcs; D = {d1, d2, ..., d...} k } is a finite set of data elements; Let R represent a set containing m initial tables, each containing n records, and a record R in the j-th table. j (r i )={d1,d2,…,d k It consists of k attribute values, d i This is represented as the i-th attribute value in the record; j∈{1,2,…,m}, i∈{1,2,…,k}; The corresponding state reachability graph is generated by the transition enabling conditions and occurrence rules in the PDT-net model. Based on the idea of model detection, the definition of data inconsistency is transformed into the corresponding computation tree logic formula; Computational Tree Logic Formula Represented as: like If the result is true, it indicates that there is a data inconsistency error; in this case, the corresponding data inconsistency state set needs to be recorded; otherwise, it indicates that there is no data inconsistency error. Where E represents the existence of certain paths; F represents starting from a certain state in a path from a certain state; X represents starting from the second state in a path from a certain state; this formula means that if there are concurrent paths, and transitions t1 and t2 in future states along these paths have the right to occur in states c1 and c2, then transitions t1 and t2 are operations on data item d, and the result is that the same data item d will have different values in different state tables; wt is the tag function for writing data items in main memory, rd is the tag function for reading data items in main memory, dt is the tag function for deleting data items in main memory, sel is the tag function for selecting records in the table, ins is the tag function for inserting records in the table, del is the tag function for deleting records in the table, and upd is the tag function for updating records in the table; transition t∈T in state It enables, denoted as c[t>. m is the identifier function of N'; θ D :D→{⊥,T} indicates that in the current state, each data element d∈D is assigned a defined value (T) or an undefined value (⊥); in the initial state, each data element is an undefined value (⊥); when a read or write operation is performed on a data element, the data element is assigned a value, indicating that it is a defined value (T); if a delete operation is performed on a data element, the data element will be an undefined value (⊥); This indicates the assignment status of each data item value in the current table, that is, a defined value (T) or an undefined value (⊥). If a data item value in a record in the table has not been assigned a value, then the data item is an undefined value (⊥). When an update or insert operation is performed on the data item value in a record in the table, it means that the data item value has been assigned a defined value (T). Using the generated state reachability graph, traverse all states in the computation tree logic formula to find the transition set and state set with inconsistent data.
2. The data inconsistency detection method for a distributed database system as described in claim 1, characterized in that, Transition enabling conditions include: The transition consists of three parts: the specific activity name, the operation on the abstract data element, and the operation on the specific data item value; Here, the specific activity name refers to the activity name corresponding to the current change t; the operation on the abstract data element refers to performing read, write, and delete operations on the data in the current activity; and the operation on the specific data item value refers to performing select, insert, delete, and update operations on the data items associated with the table in the current activity.
3. The data inconsistency detection method for a distributed database system as described in claim 2, characterized in that, Using the generated state reachability graph, traverse all states in the computation tree logic formula to find inconsistent transition sets and state sets, including: Define the transition set sat(DI) under data inconsistency error, the data inconsistency state set sat(c_DI), and the transition set sat(T||) storing concurrency relationships. co At the same time, these sets are initialized separately.
4. The data inconsistency detection method for a distributed database system as described in claim 3, characterized in that, At the same time, these sets are initialized separately, including: Store all concurrent transition pairs (t1, t2) in the system into sat(T|| co ), sequentially select from set sat(T|| co Select transition pairs; if the data operations bound to the transition and the corresponding data item values are all performed on the same data item, it indicates that a data inconsistency error has occurred between the transition pairs; otherwise, there is no data inconsistency error; when it is determined that the transition pairs perform data operations on the same data item, further determine whether it meets the data inconsistency error definition formula.
5. The data inconsistency detection method for a distributed database system as described in claim 4, characterized in that, The formula for defining the data inconsistency error includes: The formula for defining a data inconsistency error is expressed as follows: R t1 ins(d)∪R t1 upd(d))≠(R t2 del(d)∪R t2 ins(d)∪R t2 upd(d))) If the transition pair (t1, t2) satisfies the definition of a data inconsistency error when operating on the same data item value, then a data inconsistency error exists; iterative initialization processing continues until the set sat(T|| co All transition pairs in the table have been queried.
6. A distributed database system data inconsistency detection system, based on the distributed database system data inconsistency detection method according to any one of claims 1 to 5, characterized in that, include: The preprocessing storage module is used to store table data and can also initialize transition sets and state sets. The modeling module is used for abstract modeling of distributed database systems; The judgment and detection module is used to judge data inconsistency, thereby detecting data inconsistency errors.
7. 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 5.
8. 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 5.
Citation Information
Patent Citations
Concurrent system error detection method, system and apparatus based on PD-Net and medium
CN108647380A
Petri network-based concurrent error detection method and system
CN111444082A