Execution method and device for database processing operation, equipment and storage medium
The method and device manage object dependencies and validity statuses in relational databases to ensure valid operations are executed, preventing invalid operations and ensuring accurate database processing.
Patent Information
- Application Number
- CN202411257772.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-03
Smart Images

Figure CN119248830A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of databases, and in particular to a method, device, equipment and storage medium for executing database processing operations. Background Art
[0002] A relational database is a database that uses a relational model to organize data. Relational databases often use SQL (Structured Query Language, database language) to query data. PL / SQL (Procedural Language / SQL) is a procedural SQL language and an extension of the SQL language. It introduces objects such as stored procedures, custom functions, packages, cursors, variables, and control structures such as conditions and loops, giving the database structured program processing capabilities. PL / SQL objects can be interdependent, but if the dependent object is invalid, then when performing operations on invalid objects, there will be unexpected results such as the inability to perform the operation and inaccurate operation results.
[0003] Therefore, how to enable the database system to effectively perform database processing operations is a technical problem that needs to be solved by those skilled in the art. Summary of the invention
[0004] The present application provides a method, apparatus, device and storage medium for executing database processing operations, so that a database system can effectively execute database processing operations.
[0005] In a first aspect, the present application provides a method for executing a database processing operation, comprising:
[0006] Detect pending database processing operations;
[0007] Determining an operation object corresponding to the database processing operation;
[0008] Querying the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object;
[0009] If the validity status is a valid state, the database processing operation is executed; if the validity status is an invalid state, the database processing operation is refused to be executed.
[0010] Optionally, the execution method further includes:
[0011] Get object processing operation;
[0012] According to the operation type of the object processing operation, the dependency relationship in the object dependency relationship and / or the validity status of each object is updated.
[0013] Optionally, the operation types of the object processing operation include: object creation operation, object update operation and object deletion operation.
[0014] Optionally, if the object processing operation is an object creation operation, updating the dependency relationship and / or the validity status of each object in the object dependency relationship includes:
[0015] Creating a first target object in the object dependency relationship;
[0016] Determining whether the first target object has a dependent object;
[0017] If not, then in the object dependency relationship, the validity state of the first target object is set to a valid state; if so, then in the object dependency relationship, a dependency relationship between the first target object and each dependent object is created, and it is determined whether the validity state of each dependent object is a valid state;
[0018] If so, then in the object dependency, the validity state of the first target object is set to a valid state; if not, then in the object dependency, the validity state of the first target object is set to an invalid state.
[0019] Optionally, if the object processing operation is an object deletion operation, updating the dependency relationship and / or the validity status of each object in the object dependency relationship includes:
[0020] Determining a second target object corresponding to the object deletion operation;
[0021] Deleting the second target object in the object dependency relationship;
[0022] Based on the object dependency relationship, determining whether the second target object has a dependent object;
[0023] If so, then in the object dependency relationship, the validity status of all dependent objects is set to an invalid state.
[0024] Optionally, if the object processing operation is an object update operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes:
[0025] Determining a third target object corresponding to the object update operation;
[0026] According to the object dependency relationship, searching for all dependent objects corresponding to the third target object;
[0027] Determine whether the validity status of all dependent objects is valid;
[0028] If so, then in the object dependency relationship, the validity state of the third target object is set to a valid state; if not, then in the object dependency relationship, the validity state of the third target object is set to an invalid state.
[0029] Optionally, the execution method further includes:
[0030] Receive inspection instructions;
[0031] Determining the object to be inspected from the object dependency according to the inspection instruction;
[0032] Determining whether the object to be checked has a dependent object according to the object dependency relationship;
[0033] If not, determine the next object to be checked; if so, determine the inspection result according to the storage status and validity status of the dependent object corresponding to the object to be checked;
[0034] Determine whether the validity status of the object to be checked in the object dependency is consistent with the check result;
[0035] If they are consistent, the next object to be inspected is determined;
[0036] If they are inconsistent, the validity status of the object to be checked in the object dependency relationship is modified to the check result.
[0037] In a second aspect, the present application provides a device for executing a database processing operation, comprising:
[0038] A detection module, used for detecting database processing operations to be performed;
[0039] A first determining module, used to determine an operation object corresponding to the database processing operation;
[0040] A search module, used to query the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object;
[0041] The execution module is used to execute the database processing operation when the validity status is a valid state; and refuse to execute the database processing operation when the validity status is an invalid state.
[0042] In a third aspect, the present application provides an electronic device, including:
[0043] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the execution method of any database processing operation described above in the present application through the computer program.
[0044] In a fourth aspect, the present application provides a computer storage medium, which stores computer executable instructions, and the computer executable instructions are used to execute the steps of the execution method of the above-mentioned database processing operation of the present application.
[0045] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: before executing the database processing operation, the present application first determines the operation object corresponding to the database processing operation to be executed, and queries the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object; if the validity status is a valid state, the database processing operation is executed; if the validity status is an invalid state, the database processing operation is refused to be executed. Through this method, when executing the database processing operation, the present application can prevent the invalid operation object from being executed, thereby improving the validity of the database processing operation and preventing unexpected results. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0049] Figure 1 A schematic diagram of a method for executing a database processing operation provided in an embodiment of the present application;
[0050] Figure 2 A schematic diagram of an object dependency relationship provided in an embodiment of the present application;
[0051] Figure 3 Another object dependency diagram provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of the structure of a device for executing a database processing operation provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0055] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0056] The present application provides a method, apparatus, device and storage medium for executing database processing operations, so that a database system can effectively execute database processing operations.
[0057] See also Figure 1 , Figure 1 A flowchart of a method for executing a database processing operation provided in an embodiment of the present application, the method specifically comprises the following steps:
[0058] S101, detecting a database processing operation to be executed;
[0059] In this embodiment, the database processing operation refers to a processing operation performed on a certain object, and the database processing operation may specifically be: a target function queries data in a target table, a target stored procedure calls the target function to store data, etc., which are not specifically limited here. When executing this solution, it is necessary to detect the database processing operation to be executed in real time to determine whether the database processing operation is allowed to be executed.
[0060] S102, determining an operation object corresponding to a database processing operation;
[0061] It is understandable that each database processing operation has a corresponding operation object, which may specifically be a stored procedure, a user-defined function, a package, a cursor, a variable, etc., which is not specifically limited here.
[0062] For example: if the database processing operation is that the target function queries the data of the target table, then the operation object is the target table; if the database processing operation is that the target stored procedure calls the target function to store data, then the operation object is the target function.
[0063] S103, querying the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object;
[0064] It should be noted that this application requires the pre-creation of object dependencies, which record the dependencies between objects and the validity status of each object. After the object is created, the default validity status is valid. If the object is deleted, the validity status of all objects that depend on it will be invalid. In this embodiment, if an object references another object, the two objects form a dependency relationship, regardless of whether it exists in a certain judgment branch process.
[0065] For example: a target table in a database can be queried by a custom target function, and the target function can also be called by a target stored procedure. Among them, the target table, target function, and target stored procedure are all objects. The target function depends on the target table, so there is a dependency relationship between the target table and the target function. The target stored procedure depends on the target function, so there is a dependency relationship between the target function and the target stored procedure. When the dependency relationship is satisfied, the validity status of each object is valid; if the dependency relationship is broken, such as when the target table is deleted from the database by the administrator, the validity status of the target function that directly depends on the target table is invalid, and the validity status of the target stored procedure that indirectly depends on the target table is invalid.
[0066] S104. If the validity status is valid, the database processing operation is executed; if the validity status is invalid, the database processing operation is refused.
[0067] In this embodiment, after querying the validity status of the operation object according to the object dependency relationship, if the validity status is valid, the database system allows the execution of the database processing operation; if the validity status is invalid, the database system will prevent the execution of related objects, that is, refuse to execute the database processing operation to avoid unexpected results.
[0068] In summary, before executing a database processing operation, the present application first determines the operation object corresponding to the database processing operation to be executed, and queries the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object, as well as the validity status of each object; if the validity status is a valid state, the database processing operation is executed; if the validity status is an invalid state, the database processing operation is refused to be executed. Through this method, when executing a database processing operation, the present application can prevent the processing operation from being executed on an invalid object, thereby improving the validity of the database processing operation and preventing unexpected results.
[0069] Based on the above embodiment, in this embodiment, the method further includes:
[0070] Obtaining an object processing operation; and updating the dependency relationship in the object dependency relationship and / or the validity status of each object according to the operation type of the object processing operation.
[0071] It should be noted that the present application needs to detect each object processing operation in real time so as to update the object dependency according to each object processing operation. The types of the object processing operation include: object creation operation, object update operation and object deletion operation. Here, the updating process of the object dependency is described based on each operation.
[0072] 1. If the object processing operation is an object creation operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes:
[0073] Create a first target object in an object dependency relationship; determine whether the first target object has a dependent object; if not, set the validity status of the first target object to a valid state in the object dependency relationship; if so, create a dependency relationship between the first target object and each dependent object in the object dependency relationship, and determine whether the validity status of each dependent object is a valid state; if so, set the validity status of the first target object to a valid state in the object dependency relationship; if not, set the validity status of the first target object to an invalid state in the object dependency relationship.
[0074] Here, the following five DDL (Data Definition Language) statements entered by the user are used as an example for specific description. These five DDL statements are all statements for object creation operations:
[0075] Statement 1: create table A(ida number primary key);
[0076] This statement requires that object A be created in the object dependency relationship, and object A has no dependencies, and the validity status is set to valid by default.
[0077] Statement 2: create table B (idb number primary key);
[0078] This statement requires the creation of object B in the object dependency relationship, and object B has no dependency relationship. The validity status is set to valid by default.
[0079] Statement 3:
[0080] create function C(foo in number)
[0081] return number
[0082] is ret number;
[0083] begin
[0084] select ida into ret from A,B where ida=foo and ida=idb;
[0085] return(ret);
[0086] end;
[0087] This statement needs to create object C in the object dependency relationship, and the dependent objects of object C are object A and object B respectively; object A and object B both exist, and their validity status are both valid, then in the object dependency relationship, the validity status of object C is valid.
[0088] Statement 4:
[0089] create procedure D
[0090] is
[0091] va number;
[0092] begin
[0093] va:=C(12);
[0094] delete from B where idb=va;
[0095] end;
[0096] Create object D, which depends on objects B and C. If objects B and C exist and are valid, D is valid.
[0097] create procedure E
[0098] is
[0099] va number;
[0100] begin
[0101] delete from B where idb=12;
[0102] end;
[0103] This statement needs to create object E in the object dependency relationship, and the dependent object of object E is object B; object B exists and the validity status is valid, then in the object dependency relationship, the validity status of object E is valid.
[0104] See also Figure 2 , Figure 2 A schematic diagram of an object dependency relationship provided by an embodiment of the present invention. By executing the above five operation statements, the database can record the following in the object dependency relationship: Figure 2 The dependency relationships between the objects shown include forward dependencies (depends on) and reverse dependencies (depends on). For example, in the dependency relationship between object A and object C, the dependent object of object C is object A, and the dependent object of object A is object C.
[0105] 2. If the object processing operation is an object deletion operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes:
[0106] Determine a second target object corresponding to the object deletion operation; delete the second target object in the object dependency relationship; based on the object dependency relationship, determine whether the second target object has a dependent object; if so, set the validity status of all dependent objects in the object dependency relationship to an invalid state.
[0107] Here, the following DDL statement entered by the user is used as an example for explanation. The DDL statement is a statement for executing an object deletion operation:
[0108] Statement: drop table A;
[0109] In this statement, the object corresponding to the object deletion operation is object A. In the object dependency relationship, object A is deleted and it is checked whether object A has dependent objects. Figure 2 It can be seen that the dependent objects of object A are object C and object D. Therefore, the validity status of object C and object D needs to be set to invalid. Figure 3 , Figure 3 Another object dependency diagram provided by an embodiment of the present invention is Figure 3 It can be seen that object A has been deleted, and the validity state of object C that depends on object A has become invalid. Because object C has become invalid, object D that depends on object C has also become invalid. It should be noted that in this embodiment, when the drop command is executed, that is, when object A is deleted, objects C and D immediately become invalid and cannot be called. This state conversion is real-time.
[0110] 3. If the object processing operation is an object update operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes:
[0111] Determine a third target object corresponding to the object update operation; and search for all dependent objects corresponding to the third target object according to the object dependency relationship;
[0112] Determine whether the validity status of all dependent objects is valid;
[0113] If so, then in the object dependency relationship, the validity state of the third target object is set to a valid state; if not, then in the object dependency relationship, the validity state of the third target object is set to an invalid state.
[0114] In this embodiment, the object update operation is an operation to update the validity status of the object. Here, the following DDL statement input by the user is used as an example for explanation. The DDL statement is a statement for executing the object update operation:
[0115] Statement: alter procedure D compile;
[0116] In this statement, the object corresponding to the object update operation is object D. Figure 3 It can be seen that the dependent objects corresponding to object D are object C and object B, among which object B is in a valid state. Object C is checked again. Since object A, on which object C depends, does not exist, object C is in an invalid state. Therefore, object D is confirmed to be in an invalid state.
[0117] From the above, it can be seen that when executing object creation or object update operations, the present application can create objects in the object dependency relationship and record the validity status of each object and the dependency relationship between each object; when the user executes an object deletion operation, the invalidity status of the object to which the deleted object depends will be set to an invalid state. In this way, the interpreted PL / SQL executor can also have an overall dependency check function like the compiled PL / SQL executor, and can determine the validity status of the object in real time, so that the database system can more effectively execute database processing operations and avoid uncontrollable problems.
[0118] Based on any of the above method embodiments, in this embodiment, the execution method further includes:
[0119] Receive inspection instructions;
[0120] Determining the object to be inspected from the object dependency according to the inspection instruction;
[0121] Determining whether the object to be checked has a dependent object according to the object dependency relationship;
[0122] If not, determine the next object to be checked; if so, determine the inspection result according to the storage status and validity status of the dependent object corresponding to the object to be checked;
[0123] Determine whether the validity status of the object to be checked in the object dependency is consistent with the check result;
[0124] If they are consistent, the next object to be inspected is determined;
[0125] If they are inconsistent, the validity status of the object to be checked in the object dependency relationship is modified to the check result.
[0126] In this embodiment, the user can check whether the validity status of each object dependency is correct by issuing a check instruction. The storage status is used to indicate whether the object has been deleted. If the object has been deleted, the storage status is not stored. If the object has not been deleted, the storage status is stored. Figure 3 As shown, in Figure 3 When checking the validity status of each object in the query, firstly take object C as the object to be checked. The dependent object of object C is object A. Since object A is deleted, the storage status of object A is not stored. Therefore, object C that depends on object A is invalid. Therefore, the check result of object C is invalid. Figure 3It can be seen that the validity status of object C recorded in the object dependency is also invalid, which is consistent with the inspection result, and there is no need to modify the validity status of object C; after the inspection of object C is completed, the next inspection object is determined to continue the inspection until every object in the object dependency is inspected.
[0127] From the above content, it can be seen that in this application, in order to ensure the accuracy of object dependencies, users can check the validity of each object by actively triggering a check instruction, such as traversing all dependent objects of each object, and when the object it depends on is invalid or does not exist, its own state is marked as invalid, otherwise it is valid. In this way, the accuracy of object dependencies can be ensured.
[0128] See also Figure 4 , Figure 4 A schematic diagram of a structure of an execution device for a database processing operation provided in an embodiment of the present application, the device specifically comprises:
[0129] A detection module 11, used to detect a database processing operation to be executed;
[0130] A first determining module 12, used to determine an operation object corresponding to the database processing operation;
[0131] A search module 13 is used to query the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object;
[0132] The execution module 14 is used to execute the database processing operation when the validity status is a valid state; and refuse to execute the database processing operation when the validity status is an invalid state.
[0133] As an optional embodiment, the device further includes:
[0134] The acquisition module is used to obtain object processing operations;
[0135] An updating module is used to update the dependency relationship in the object dependency relationship and / or the validity status of each object according to the operation type of the object processing operation.
[0136] The operation types of the object processing operation include: object creation operation, object update operation and object deletion operation.
[0137] As an optional embodiment, the update module includes:
[0138] A first creation unit, configured to create a first target object in the object dependency relationship;
[0139] A first determining unit, configured to determine whether the first target object has a dependent object; if not, triggering a first setting unit; if yes, triggering a second creating unit;
[0140] A first setting unit, configured to set the validity state of the first target object to a valid state in the object dependency relationship;
[0141] A second creation unit, configured to create a dependency relationship between the first target object and each dependent object in the object dependency relationship;
[0142] The second judging unit is used to judge whether the validity state of each dependent object is a valid state; if so, the second setting unit is triggered; if not, the third setting unit is triggered;
[0143] A second setting unit, configured to set the validity state of the first target object to a valid state in the object dependency relationship;
[0144] A third setting unit is configured to set the validity state of the first target object to an invalid state in the object dependency relationship.
[0145] As an optional embodiment, the update module includes:
[0146] A first determining unit, configured to determine a second target object corresponding to the object deletion operation;
[0147] A deleting unit, configured to delete the second target object in the object dependency relationship;
[0148] A third judging unit, configured to judge whether the second target object has a dependent object based on the object dependency relationship; if so, triggering a fourth setting unit;
[0149] The fourth setting unit is used to set the validity status of all dependent objects in the object dependency relationship to an invalid state.
[0150] As an optional embodiment, the update module includes:
[0151] A second determining unit, configured to determine a third target object corresponding to the object update operation;
[0152] A second searching unit, configured to search for all dependent objects corresponding to the third target object according to the object dependency relationship;
[0153] The fourth judgment unit is used to judge whether the validity status of all dependent objects are valid; if so, the fifth setting unit is triggered; if not, the sixth setting unit is triggered;
[0154] A fifth setting unit, configured to set the validity state of the third target object to a valid state in the object dependency relationship;
[0155] A sixth setting unit is used to set the validity state of the third target object to an invalid state in the object dependency relationship.
[0156] As an optional embodiment, the device further includes:
[0157] A receiving module, used for receiving an inspection instruction;
[0158] A second determination module, configured to determine the object to be inspected from the object dependency according to the inspection instruction;
[0159] A first determination module, configured to determine whether the object to be inspected has a dependent object according to the object dependency relationship; if not, determine the next object to be inspected; if yes, trigger a third determination module;
[0160] A third determination module, configured to determine the inspection result according to the storage status and validity status of the dependent object corresponding to the object to be inspected;
[0161] A second judgment module is used to judge whether the validity status of the object to be checked in the object dependency is consistent with the inspection result; if consistent, determine the next object to be checked; if inconsistent, trigger the modification module;
[0162] A modification module is used to modify the validity status of the object to be checked in the object dependency relationship to the check result.
[0163] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0164] See also Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device specifically includes:
[0165] A processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. The processor 21 executes the steps of the method for executing the database processing operation described in any of the above method embodiments through the computer program.
[0166] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0167] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used to store the following computer program 221, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps in the execution method of the database processing operation disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 22 may also include an operating system 222 and data 223, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 222 may include Windows, Unix, Linux, etc.
[0168] In some embodiments, the electronic device may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power source 27 , and a communication bus 28 .
[0169] certainly, Figure 5 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include Figure 5 More or fewer components than shown, or combinations of certain components.
[0170] In another exemplary embodiment, a computer storage medium is also provided, and when the program instructions are executed by a processor, the steps of the execution method of the database processing operation described in any of the above method embodiments are implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0171] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0172] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0173] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for executing a database processing operation, characterized in that: include: Detect pending database processing operations; Determining an operation object corresponding to the database processing operation; Query the validity status of the operation object according to the object dependency relationship; The object dependency records the dependency of each object and the validity status of each object; If the validity status is a valid state, the database processing operation is executed; if the validity status is an invalid state, the database processing operation is refused to be executed.
2. The execution method according to claim 1, characterized in that: The execution method further includes: Get object processing operation; According to the operation type of the object processing operation, the dependency relationship in the object dependency relationship and / or the validity status of each object is updated.
3. The execution method according to claim 2, characterized in that: The operation types of the object processing operation include: object creation operation, object update operation and object deletion operation.
4. The execution method according to claim 3, characterized in that: If the object processing operation is an object creation operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes: Creating a first target object in the object dependency relationship; Determining whether the first target object has a dependent object; If not, then in the object dependency relationship, the validity state of the first target object is set to a valid state; if so, then in the object dependency relationship, a dependency relationship between the first target object and each dependent object is created, and it is determined whether the validity state of each dependent object is a valid state; If so, then in the object dependency, the validity state of the first target object is set to a valid state; if not, then in the object dependency, the validity state of the first target object is set to an invalid state.
5. The execution method according to claim 3, characterized in that: If the object processing operation is an object deletion operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes: Determining a second target object corresponding to the object deletion operation; Deleting the second target object in the object dependency relationship; Based on the object dependency relationship, determining whether the second target object has a dependent object; If so, then in the object dependency relationship, the validity status of all dependent objects is set to an invalid state.
6. The execution method according to claim 3, characterized in that: If the object processing operation is an object update operation, updating the dependency relationship in the object dependency relationship and / or the validity status of each object includes: Determining a third target object corresponding to the object update operation; According to the object dependency relationship, searching for all dependent objects corresponding to the third target object; Determine whether the validity status of all dependent objects is valid; If so, then in the object dependency relationship, the validity state of the third target object is set to a valid state; if not, then in the object dependency relationship, the validity state of the third target object is set to an invalid state.
7. The execution method according to any one of claims 1 to 6, characterized in that: The execution method further includes: Receive inspection instructions; Determining the object to be inspected from the object dependency according to the inspection instruction; Determining whether the object to be checked has a dependent object according to the object dependency relationship; If not, determine the next object to be checked; if so, determine the inspection result according to the storage status and validity status of the dependent object corresponding to the object to be checked; Determine whether the validity status of the object to be checked in the object dependency is consistent with the check result; If they are consistent, the next object to be inspected is determined; If they are inconsistent, the validity status of the object to be checked in the object dependency relationship is modified to the check result.
8. A device for executing database processing operations, characterized in that: include: A detection module, used for detecting database processing operations to be performed; A first determining module, used to determine an operation object corresponding to the database processing operation; A search module, used to query the validity status of the operation object according to the object dependency relationship; the object dependency relationship records the dependency relationship of each object and the validity status of each object; The execution module is used to execute the database processing operation when the validity status is a valid state; and refuse to execute the database processing operation when the validity status is an invalid state.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the method for executing the database processing operation described in any one of claims 1 to 7 of the present application through the computer program.
10. A computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the steps of the method for executing the database processing operation described in any one of claims 1 to 7 of the present application.
