CN116010658A - Management system of object-oriented database based on BS architecture - Google Patents

Management system of object-oriented database based on BS architecture Download PDF

Info

Publication number
CN116010658A
CN116010658A CN202211536912.1A CN202211536912A CN116010658A CN 116010658 A CN116010658 A CN 116010658A CN 202211536912 A CN202211536912 A CN 202211536912A CN 116010658 A CN116010658 A CN 116010658A
Authority
CN
China
Prior art keywords
attribute
class
user
data
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211536912.1A
Other languages
Chinese (zh)
Inventor
关晨曦
赵享
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202211536912.1A priority Critical patent/CN116010658A/en
Publication of CN116010658A publication Critical patent/CN116010658A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a management system of an object-oriented database based on a BS architecture, which logically comprises three layers: the presentation layer is responsible for man-machine interaction, transmits instructions to the logic layer, receives data of the data layer and feeds back the data to a user; the logic layer is an application program on the remote server and is responsible for processing instructions transmitted by a user and simultaneously carrying out operation and backup management on data; the data layer is the storage of the original database data and is mainly stored on the hardware of the client. Compared with the prior art, the invention has the advantages that: the invention is based on B/S architecture development, is divided into three layers of a data layer, a logic layer and a presentation layer, aims to process data which is closer to the actual situation, can rapidly produce data through inheritance relations among a plurality of classes, can further process stored data by a user-defined method, simplifies user operation steps and learning cost, and can process data types such as images, hypertext, sound and the like.

Description

Management system of object-oriented database based on BS architecture
Technical Field
The invention relates to the field of database construction, in particular to a management system of an object-oriented database based on a BS architecture.
Background
The existing database system mainly comprises a relation database such as mySQL, oracleDatabase, the reading and writing process of the relation database is complicated, the table structure is fixed, and unstructured data such as images and hypertext cannot be processed. When a conventional relational database processes multi-attribute data, a complex relationship needs to be constructed to process multi-value dependencies between data. Object-oriented is a programming paradigm that organizes related data and methods into one whole, systematically models from a higher level, and is closer to the natural running state of things. Inheritance relationships of classes in object-oriented are more consistent with links between facts. The protection of the attributes of the class is achieved through the encapsulation of the class, and the security of the database is improved. Meanwhile, network communication overhead between the client and the server can be reduced through the B/S architecture, a user can manage the database only by one browser without downloading any program, and meanwhile, the updating maintenance of the DBMS by a developer is facilitated.
Disclosure of Invention
In order to solve the technical problems, the technical scheme provided by the invention is as follows: a management system based on a BS architecture object-oriented database logically comprises three layers: the presentation layer is responsible for man-machine interaction, transmits instructions to the logic layer, receives data of the data layer and feeds back the data to a user; the logic layer is an application program on the remote server and is responsible for processing instructions transmitted by a user and simultaneously carrying out operation and backup management on data; the data layer is a data file at the client, comprises a class table, an instance table and a query, and is responsible for storing and organizing data;
a management system based on a BS architecture object-oriented database comprises the following steps:
s1, creating a class, which specifically comprises the following steps:
s1.1, creating a class; s1.2, inheritance; s1.3, packaging; s1.4, polymorphism; s1.5, an interface;
s2, constructing attributes, specifically including:
s2.1, an nullable attribute and a default attribute, wherein the nullable attribute refers to an attribute which can be a null value when defined, namely, an attribute domain has no value, and when a user refers to the nullable attribute in the process of instantiating an object, the value under the attribute domain can be arbitrarily regulated, but the data type defined by the attribute cannot be exceeded; the default attribute is opposite to the nullable attribute, an attribute value is set when the attribute is defined, when a user refers to the attribute, the attribute value is determined, and whether the attribute can be changed is judged according to the encapsulation type of the attribute;
s2.2, sharing attributes and special attributes, wherein when a child refers to a parent attribute, the attributes of the parent contained in the child under the same parent are called as shared attributes, the shared attributes do not distinguish the child, and the shared attributes are avoided from being used as much as possible in inquiry; the unique attribute refers to the attribute of the subclass which is different from the attribute of the parent class and other subclasses relative to the attribute of the parent class;
s2.3, for example members under the class, if a certain attribute is all of all example members, the inherent attribute and the occasional attribute are called as the inherent attribute; if a certain attribute is only owned by a part of instance members, the attribute is called an occasional attribute, and the attribute under a class is represented as not being null in a limited instance;
s3, constructing a method, namely, performing operation on attributes of the class, wherein the basic method is standardized by a database system, namely, an interface is provided with methods of writing in the attributes, restraining word length, acquiring the attributes and the like, and the database allows a user to customize the method body, wherein the method comprises simple operations of addition, subtraction, multiplication, division, modulus and the like, and conditional statements and cyclic statements; the method may also operate on a plurality of attributes, and interface implementations of the system may be invoked during creation of the class including, but not limited to, summing, averaging, maximizing or minimizing, etc.;
s4, constructing data types, wherein the data types comprise long text (255), short text, integer, floating point type, date, picture, audio, video, hyperlink and Boolean type;
s5, constructing a storage structure, which specifically comprises the following steps:
s5.1, storing files; s5.2, inheriting the relation table; s5.3, an instance set; s5.4, an attribute set;
s6, creating and operating the instance, namely, directly accessing and modifying the data file in the user interface; the second is to modify the temporary data indirectly through inquiry, namely similar to a general database, and modify the data file after final storage by updating and deleting in inquiry;
s7, inquiring specifically comprises the following steps:
s7.1, indexing, wherein each class is an index during query, and the query is searched according to each individual class. Inheritance relationships between classes are represented by PIDs and IDs;
s7.2, inquiring the command structure, submitting an inquiry after the front-end user designs the inquiry, transmitting an inquiry command to the background through an Http protocol, returning a result to the front end by the background processing command, and storing the inquiry command by adopting a Json structure;
s7.3, conditions, conditional statements use "=", "< or >", "> =", "<=", "Like", "betweend", "IN", etc. operators, and logical or are represented by "≡ @" and "||" where each operator is strict for data type;
s7.4, single-class query, considering two cases, namely, the case that the attribute of a class has even attribute and the case that the attribute of the class has inherent attribute, selecting a tuple corresponding to the even attribute on the workflow, and selecting a tuple meeting the condition from the tuple; selecting another even attribute corresponding tuple, and repeating the operation until all even attribute tuples meeting the conditions are obtained; thirdly, performing cross operation on all the obtained tuples to obtain a new tuple; finally, selecting a corresponding tuple of the inherent attribute meeting the condition from the new tuple to obtain a query result;
s7.5, multi-class query, and query of two or more classes, wherein the classes are inherited or related to the parent class, so that at least one parent class and a plurality of subclasses are required to be selected in the process of querying by a user. There are three cases of child queries, homologous queries, alternate queries.
Compared with the prior art, the invention has the advantages that: the invention is based on B/S architecture development, is divided into three layers of a data layer, a logic layer and a presentation layer, aims to process data which is closer to the actual situation, can rapidly produce data through inheritance relations among a plurality of classes, can further process stored data by a user-defined method, simplifies user operation steps and learning cost, and can process data types such as images, hypertext, sound and the like.
Further, the specific steps of S1.1 are as follows: 1) User-defined class names; 2) Judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending; 3) Defining an attribute domain by a user, and designing a data type of the attribute domain; 4) A user-defined method, designing constraints on attributes; 5) And recording the defined class into an inheritance relationship table, and returning the defined class.
Further, the specific steps of S1.2 are as follows: 1) The user selects a parent class to be inherited; 2) Judging whether the parent class exists, if so, continuing to execute, otherwise, returning an error and terminating; 3) User-defined subcategory names; 4) Judging whether the subclass name is unique, if so, continuing to execute, otherwise, returning to the step 3) and outputting an error; 5) Defining a subclass attribute field by a user, and designing a data type of the attribute field; 6) User-defined subclass methods; 7) And recording the defined class into an inheritance relationship table, and returning the defined class.
Further, the specific steps of S1.3 are as follows: 1) User-defined class names; 2) Judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending; 3) A user-defined attribute field, wherein the user-defined attribute or method modifier is one of public, protected, private; 4) A user defines a method, wherein the method uses the this keyword to refer to the attribute or the method of the package; 5) And recording the defined class into an inheritance relationship table, and returning the defined class.
Further, the specific steps of S1.4 are as follows: 1) Repeating steps 1 to 5 in the 1.2 inheritance algorithm; 2) A user-defined subclass method, wherein the user invokes a parent class method; 3) Judging whether the called parent class method exists or not, if so, continuing to execute, otherwise, returning to the step 2 and outputting an error; 4) The user rewrites the parent class method; 5) Judging whether the method name of the rewritten method is consistent with the returned data type with the original method name, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error; 6) Judging whether the modifier of the rewritten method is consistent with the original method, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error; 7) And recording the defined class into an inheritance relationship table, and returning the defined class.
Further, in S5.1, data is transmitted between the user and the server through the TCP/IP protocol, the data is saved as json format file, each operation of the user in the database system is temporarily stored on the server, and the user data is finally saved locally.
Further, in S6, the creating steps of the instance are specifically as follows: 1) The user selects the belonging class and defines an instance name; 2) The user defines an instance identification code, if the identification code is not defined, the system automatically endows the identification code, and the identification code is an attribute for determining the uniqueness of the instance; 3) The user realizes the operation of the attribute through the method; 4) The system detects whether the attribute value meets the defined data type; 5) And recording the defined examples into an example table.
Further, the specific steps of 7.4 are as follows: 1) The user selects an instance set of classes that need to execute the query; 2) The user designs the query conditions and the attributes and classes to be queried; 3) Submitting a query by a user; 4) Background processing inquiry commands; 5) And the background returns the query result.
Further, 7.5 includes three types of queries, respectively:
child queries 1) user selection of instance sets of parent classes; 2) The user selects an instance set of subclasses; 3) The user designs the query conditions and the attributes and classes to be queried; 4) Submitting a query request to the background; 5) The system judges whether the classes are inheritance relations or not, if yes, the system continues to execute, otherwise, error information is returned; 6) The background treatment is shown in the attached drawing;
homologous query, 1) user selection of parent class; 2) The user selects an instance set of subclasses; 3) The user designs the query conditions and the attributes and classes to be queried; 4) Submitting a query request to the background; 5) The system judges whether the multiple classes have the same parent class, if yes, the system continues to execute, otherwise, error information is returned; 6) Carrying out background treatment;
alternate queries 1) user selection of an instance set of a parent class; 2) The user selects a subclass; 3) The user selects an instance set of subclasses of its subclasses; 4) The user designs the query conditions and the attributes and classes to be queried; 5) Submitting a query request to the background; 6) The system inquires whether the parent class of the selected class is a subset of the subclass of the class, if yes, the system continues to execute, otherwise, error information is returned; 7) And (5) carrying out background treatment.
Drawings
FIG. 1 is a schematic diagram of a hierarchical architecture of the present invention.
FIG. 2 is a flow chart of an algorithm for creating classes in the present invention.
FIG. 3 is a schematic diagram of attribute construction in the present invention.
FIG. 4 is a flow chart of an algorithm for attribute set construction in the present invention.
Fig. 5 is a flowchart of an algorithm for indexing in the present invention.
FIG. 6 is a flow chart of an algorithm for condition building in the present invention.
FIG. 7 is a flow chart of an algorithm for a single class query in the present invention.
FIG. 8 is a flow chart of an algorithm for parent class determination in the present invention.
FIG. 9 is a flowchart of an algorithm for multi-class queries in the present invention.
FIG. 10 is a schematic diagram of an architecture of the classes in the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
In a specific implementation, as shown in the embodiment of fig. 1, the present solution is based on a B/S framework, which can greatly simplify the data transmission mode of the client. The B/S framework transmits data through the HTTP protocol, and the server side is responsible for the centralized management of application logic, namely transaction management. The invention is logically divided into three layers: presentation layer, logic layer, data layer. The representation layer is responsible for man-machine interaction, transmits instructions to the logic layer, receives data of the data layer and feeds back the data to a user; the logic layer is an application program on the remote server and is responsible for processing instructions transmitted by a user and simultaneously carrying out operation and backup management on data; the data layer is a data file at the client, and comprises a class table, an instance table and a query, and is responsible for storing and organizing data.
In one embodiment of the invention, as shown in FIG. 2, class creation:
(one) Create class
1. User-defined class names;
2. judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending;
3. defining an attribute domain by a user, and designing a data type of the attribute domain;
4. a user-defined method, designing constraints on attributes;
5. recording the defined class into an inheritance relationship table, and returning the defined class;
(II) inheritance
1. The user selects a parent class to be inherited;
2. judging whether the parent class exists, if so, continuing to execute, otherwise, returning an error and terminating;
3. user-defined subcategory names;
4. judging whether the subclass name is unique, if so, continuing to execute, otherwise, returning to the step 3 and outputting an error;
5. defining a subclass attribute field by a user, and designing a data type of the attribute field;
6. user-defined subclass methods;
7. and recording the defined class into an inheritance relationship table, and returning the defined class.
(III) packaging
1. User-defined class names;
2. judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending;
3. a user-defined attribute field, wherein the user-defined attribute or method modifier is one of public, protected, private;
4. a user defines a method, wherein the method uses the this keyword to refer to the attribute or the method of the package;
5. and recording the defined class into an inheritance relationship table, and returning the defined class.
(IV) polymorphism
1. Repeating steps 1 to 5 in the 2.2 inheritance algorithm;
2. a user-defined subclass method, wherein the user invokes a parent class method;
3. judging whether the called parent class method exists or not, if so, continuing to execute, otherwise, returning to the step 2 and outputting an error;
4. the user rewrites the parent class method;
5. judging whether the method name of the rewritten method is consistent with the returned data type with the original method name, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error;
6. judging whether the modifier of the rewritten method is consistent with the original method, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error;
7. and recording the defined class into an inheritance relationship table, and returning the defined class.
(V) interface
An interface is a set of abstract methods, an interface is not a class, implementation of an interface method is implemented among classes, an interface has only method bodies, and an object cannot be instantiated. The database interface is a set of system preset methods including, but not limited to, writing of attributes, reading of attributes, summation of multiple attributes, average, variance, maximum and minimum values, and the like. The database provides a standard method body, and a user can customize which classes are operated in the classes, so that an interface method is realized.
In one embodiment of the invention, as shown in fig. 3 and 4, the construction of the attributes:
an attribute is a high abstraction of an object, a collection of a series of concepts for a class of things. For the present system, attributes are descriptive specifications of classes, each instance must contain at least one attribute under the class to which it belongs.
The concepts related to attributes are as follows:
1. nullable properties and default properties. The attribute of the nullable attribute refers to a null value when defined, namely the attribute domain has no value, and when the nullable attribute is referenced in the process of instantiating an object by a user, the value under the attribute domain can be arbitrarily specified, but the data type defined by the attribute cannot be exceeded; the default attribute is opposite to the nullable attribute, an attribute value is set when the attribute is defined, and when the user refers to the attribute, the attribute value is determined, and whether the attribute can be changed is judged according to the encapsulation type of the attribute. For example: when the user defines the student class, the attribute of 'name' is defined as a null value, the attribute of 'school' is defined as 'XX school' and is packaged, and other people cannot directly change the attribute.
2. The common attributes and the unique attributes. When the child refers to the attribute of the parent, the attribute of the parent contained in the child under the same parent is called a common attribute, and the common attribute does not distinguish the child, so that the use of the common attribute in the query should be avoided as much as possible; the specific attribute is the attribute of the subclass distinguished from the parent class and other subclasses relative to the parent class attribute. For example: for both the "apple" and "pear" classes, the "taste" of the parent class "fruit" is inherited: sweet "is an attribute, while the distinguishing attribute of two classes is the attribute" color ".
3. Intrinsic and extrinsic properties. For instance members under a class, if a certain attribute is all of its instance members, then it is called an inherent attribute; if a property is owned by only a portion of the instance members, it is called an occasional property, and appears that a property under a class is not empty in a limited instance.
In one embodiment of the invention, the method comprises the steps of: the method refers to the behavior of an object in the object-oriented, and refers to the manipulation of the attributes of a class in the present database. The basic method is standardized by a database system, namely an interface, and the interface is provided with methods of writing in attributes, constraining word length, acquiring attributes and the like. The database allows users to customize method bodies, including simple operations such as addition, subtraction, multiplication, division, modulus and the like, and conditional sentences and loop sentences. The method may also operate on a plurality of attributes and may invoke interface implementations of the system including, but not limited to, summing, averaging, maximizing or minimizing, etc. during creation of the class.
In one embodiment of the invention, the database has the following data types: long text (255), short text, integer, floating point, date, external object (picture, audio, video), hyperlink, boolean.
In one embodiment of the invention, the storage structure:
first, store the file
The database system mainly transmits data between a user and a server through a TCP/IP protocol, so json format files in Ajax behaviors are most common. Compared with the XML format, the Json format has the advantages of simpler structure, faster reading and writing speed, better suitability with Javascript and the like, and meanwhile, the Json file has small data volume, and is convenient for the storage and transmission of a server. Each time a user in the database system operates, the user data is temporarily stored on the server, and the user data is finally stored locally.
(II) inheritance relationship table
The class constructed by the user is synchronously written into an inheritance relation table in the server, wherein the inheritance relation table comprises a class name, an identification code (id) of the class, a parent class identification code (Pid) of the class, an attribute method of the class and an encapsulation modifier.
Json structure:
Figure BDA0003975847790000061
Figure BDA0003975847790000071
(III) instance set
The data of the user created instance is stored in instance sets, each instance set comprising the id of the class to which it points, the identifier of the instance itself, the properties of which the instance modifies by means of a method or directly accesses the modified values for the properties.
Json structure:
Figure BDA0003975847790000072
(IV) Attribute set
The attribute set is automatically generated by the server each time the user imports the data file and temporarily stored on the server for improving the query efficiency during the query. The attribute table classifies the attributes of each class into a common attribute (Ca) and a unique attribute (Ua), an inherent attribute (Ia) and an occasional attribute (Oa), wherein the identification codes of the examples of the class record with the occasional attribute, and the inherent attribute corresponding to the identification codes are used for representing all examples by 'x'.
Json structure:
Figure BDA0003975847790000073
in one embodiment of the invention, examples:
creation of instance (one)
1. User selection of the class and definition of instance names
2. User-defined instance identification codes, and if the identification codes are not defined, the system automatically assigns the identification codes, wherein the identification codes are attributes for determining the uniqueness of the instance
3. User realizes the operation of attribute by the method
4. The system detects whether the attribute value satisfies a defined data type
5. Recording the defined examples into an example table
Operation of (two) instance
The operations of updating, deleting and the like of the instance mainly comprise two modes, wherein the first mode is to directly modify the data file on a user interface, namely directly access the data file and modify the data file; the second is to modify the temporary data indirectly through inquiry, namely similar to a general database, and modify the data file after final storage by updating and deleting in inquiry.
In one embodiment of the invention, as shown in FIG. 5, a query
Index (one)
An index is a pointer in a database that provides a data value that points to a column stored in a table. For the present database, each class is an index at the time of the query, which retrieves according to each individual class. Inheritance relationships between classes are represented by PIDs and IDs, which refer to the IDs of the parent classes of the class, so each child class can point to its parent class.
(II) query Command Structure
After the front-end user designs the query, the front-end user submits the query, the query instruction is transmitted to the background through the Http protocol, and the background processing command returns the result to the front end. The database system adopts a Json structure to store the query command.
Data structure:
Figure BDA0003975847790000081
Figure BDA0003975847790000091
(III) conditions
Similar to a general database, a conditional statement may use "=", "< or >", "> =", "<=", "Like", "betweennend", "IN" and Like operators, and the logical AND and OR are represented by "& =" and "|", where each operator returns false for the case of data type strict, such as 1= "1".
(IV) Single class query
1. User selection of instance sets of classes that need to execute a query
2. User designs query conditions and attributes and classes to be queried
3. User submitted queries
4. Background processing of query commands
5. The background returns the query result
The operation thinking is as follows:
for the query of a class, consider two cases, one is the case that there is an occasional attribute among the attributes of the class, and the other is the case that there is an inherent attribute, so that the query steps can be effectively reduced due to the special nature of the occasional attribute. Firstly, selecting a tuple corresponding to the occasional attribute, and selecting a tuple meeting the condition from the tuple; selecting another even attribute corresponding tuple, and repeating the operation until all even attribute tuples meeting the conditions are obtained; thirdly, performing cross operation on all the obtained tuples to obtain a new tuple; finally, selecting the corresponding tuple meeting the inherent attribute of the condition from the new tuple to obtain the query result.
The algorithm formula:
there is an instance set R, there is an attribute field, where for even attributes, a logical expression F (t n ) For the case of A 1m ,A 2m ,...A nm In the attribute of (0 < m.ltoreq.1), t tuple is represented by F (t) n ) The following formula is used for the established tuple:
Figure BDA0003975847790000092
8.5 Multi-class queries
Multi-class queries refer to queries having two or more classes, where the classes must be inherited or related to a parent class, so that at least one parent class and multiple subclasses must be selected during the user query. There are three cases of child queries, homologous queries, alternate queries.
The operation steps are as follows:
1. offspring queries
(a) The user selects an instance set of the parent class;
(b) The user selects an instance set of subclasses;
(c) The user designs the query conditions and the attributes and classes to be queried;
(d) Submitting a query request to the background;
(e) The system judges whether the classes are inheritance relationships or not, if yes, execution is continued, otherwise, error information is returned (see FIG. 8);
(f) Background processing (see fig. 9).
2. Homologous queries
(a) The user selects a parent class;
(b) The user selects an instance set of subclasses;
(c) The user designs the query conditions and the attributes and classes to be queried;
(d) Submitting a query request to the background;
(e) The system judges whether the classes have the same parent class, if yes, execution is continued, otherwise, error information is returned (see FIG. 8);
(f) Background processing (see fig. 9).
3. Alternate queries
(a) The user selects an instance set of the parent class;
(b) The user selects a subclass;
(c) The user selects an instance set of subclasses of its subclasses;
(d) The user designs the query conditions and the attributes and classes to be queried;
(e) Submitting a query request to the background;
(f) The system inquires whether the parent class of the selected class is a subset of the subclass of the class, if yes, execution is continued, otherwise, error information is returned (see fig. 8);
(g) Background processing (see fig. 9).
The operation thinking is as follows:
the attributes of the parent class and the child class have a hidden connection, i.e., a common attribute. The instance set of subclasses is a subset of the instance set of parent classes, so for queries with parent classes and subclasses, the query scope is first reduced from the parent class; firstly, selecting all tuples with common attributes meeting the conditions in a parent class to form a new tuple; secondly, performing projection operation on the new parent class instance set, and projecting tuples with non-common attributes; thirdly, comparing the common attribute in the child instance set with the common attribute set of which the parent meets the condition one by one, and extracting the same from the new tuple; and finally, combining the tuple with the non-common attribute of the parent class and the new tuple with the new sub-class to obtain a Cartesian product, and simultaneously selecting the tuple with the specific attribute meeting the condition to finish the query.
The algorithm formula:
there are multiple instance sets R, R 1 Corresponding attribute field A 1 ,A 2 Logical operation relation F (t 1 ) F (t 2),. For inheritance relationship C R (R 1 ,R 2 ,. Rk), k < n, at A 1m ,A 2m Among the properties of m > 0, the tuple of t tuple at F (tn) becomes the tuple with i common properties A i A-i parent class specific attributesA a-i With b-i subclasses specific attribute A b-i (b+a=n-i) calculated by the following formula:
Figure BDA0003975847790000111
in one embodiment of the present invention, as shown in fig. 1 to 10, the data layer is a storage of original database data, mainly stored on hardware of a client, and the server mainly records operation information and temporary files of a user. The logic layer is a layer for realizing the operations of adding, deleting, updating and extracting data, is mainly written by PHP and JavaScript, and operates the data layer by receiving the instruction transmitted from the front end and comparing with the instruction set. The presentation layer is an interface presented to the user and is also a layer for delivering user operation information and accepting backend information.
In one embodiment of the present invention, as shown in fig. 1 to 10, a user needs to create a class and its subclasses before entering data, where the creation of the class includes class name (unique), member attribute, member method, and constraint and assignment of the member attribute are implemented by the member method. For inheritance of the class, the child inherits the attribute and method of the parent class, the child can have own specific attribute and method, the child can rewrite the parent class method, and the parent cannot rewrite the child method. The inheritance allows multiple sub-classes to inherit a parent class and a chained inheritance, one sub-class cannot simultaneously possess two parent classes, and two classes with the same attribute and method can be realized by an interface. The objects are realized by the examples, and the examples are mutually independent and belong to the same class together; instances of the same class constitute a set of instances. After the user creates the needed class, the class needs to be instantiated, namely an object is created, and the attribute of the object is modified through a specific method in the class, so that the constraint limiting effect is achieved. Where the implementation of the query function depends on classes, the step of querying an instance is to find its corresponding class first, then the instance and its conditional constraints. For queries between multiple instance sets, the database allows queries between instance sets of the same parent class, or between parent class instance sets and their child instances, does not allow cross-relationship queries. The types of queries are single-set queries and multi-set queries, where the multi-set queries include set operations (cross, parallel, difference) and join operations (full join, left join, right join). The multi-set query follows the tracing principle, i.e. the parent class is retrieved first between two classes, then the child class is retrieved, and so on.
In one embodiment of the invention, as shown in FIGS. 1-10, the constraint principle for database classes: the class and the class cannot be renamed, the parent class cannot inherit the subclass, and the subclass cannot inherit more than two parent classes. Constraint principles for the examples: two identical instances must not appear in an instance set, and the attributes of the instances follow the user-defined integrity and the inter-instance set relationship.
While there has been shown and described what is at present considered to be the fundamental principles and the main features of the invention and the advantages of the invention, it will be understood by those skilled in the art that the invention is not limited to the foregoing embodiments, but is described in the foregoing description merely illustrates the principles of the invention, and various changes and modifications may be made therein without departing from the spirit and scope of the invention as hereinafter claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (9)

1. A BS-based architecture object-oriented database management system, comprising three levels logically: the system comprises a representation layer, a logic layer and a data layer, wherein the representation layer is responsible for man-machine interaction, transmits instructions to the logic layer, receives data of the data layer and feeds back the data to a user; the logic layer is an application program on the remote server and is responsible for processing instructions transmitted by a user and simultaneously carrying out operation and backup management on data; the data layer is a data file at the client, comprises a class table, an instance table and a query, and is responsible for storing and organizing data;
the management system based on the BS architecture object-oriented database comprises the following steps:
s1, creating a class, which specifically comprises the following steps:
s1.1, creating a class; s1.2, inheritance; s1.3, packaging; s1.4, polymorphism; s1.5, an interface;
s2, constructing attributes, specifically including:
s2.1, an nullable attribute and a default attribute, wherein the nullable attribute refers to an attribute which can be a null value when defined, namely, an attribute domain has no value, and when a user refers to the nullable attribute in the process of instantiating an object, the value under the attribute domain can be arbitrarily regulated, but the data type defined by the attribute cannot be exceeded; the default attribute is opposite to the nullable attribute, an attribute value is set when the attribute is defined, when a user refers to the attribute, the attribute value is determined, and whether the attribute can be changed is judged according to the encapsulation type of the attribute;
s2.2, sharing attributes and special attributes, wherein when a child refers to a parent attribute, the attributes of the parent contained in the child under the same parent are called as shared attributes, the shared attributes do not distinguish the child, and the shared attributes are avoided from being used as much as possible in inquiry; the unique attribute refers to the attribute of the subclass which is different from the attribute of the parent class and other subclasses relative to the attribute of the parent class;
s2.3, for example members under the class, if a certain attribute is all of all example members, the inherent attribute and the occasional attribute are called as the inherent attribute; if a certain attribute is only owned by a part of instance members, the attribute is called an occasional attribute, and the attribute under a class is represented as not being null in a limited instance;
s3, constructing a method, namely, performing operation on attributes of the class, wherein the basic method is standardized by a database system, namely, an interface is provided with methods of writing in the attributes, restraining word length, acquiring the attributes and the like, and the database allows a user to customize the method body, wherein the method comprises simple operations of addition, subtraction, multiplication, division, modulus and the like, and conditional statements and cyclic statements; the method may also operate on a plurality of attributes, and interface implementations of the system may be invoked during creation of the class including, but not limited to, summing, averaging, maximizing or minimizing, etc.;
s4, constructing data types, wherein the data types comprise long text (255), short text, integer, floating point type, date, picture, audio, video, hyperlink and Boolean type;
s5, constructing a storage structure, which specifically comprises the following steps:
s5.1, storing files; s5.2, inheriting the relation table; s5.3, an instance set; s5.4, an attribute set;
s6, creating and operating the instance, namely, directly accessing and modifying the data file in the user interface; the second is to modify the temporary data indirectly through inquiry, namely similar to a general database, and modify the data file after final storage by updating and deleting in inquiry;
s7, inquiring specifically comprises the following steps:
s7.1, indexing, wherein each class is an index during query, and the query is searched according to each individual class. Inheritance relationships between classes are represented by PIDs and IDs;
s7.2, inquiring the command structure, submitting an inquiry after the front-end user designs the inquiry, transmitting an inquiry command to the background through an Http protocol, returning a result to the front end by the background processing command, and storing the inquiry command by adopting a Json structure;
s7.3, conditions, conditional statements use "=", "< or >", "> =", "<=", "Like", "betweend", "IN", etc. operators, and logical or are represented by "≡ @" and "||" where each operator is strict for data type;
s7.4, single-class query, considering two cases, namely, the case that the attribute of a class has even attribute and the case that the attribute of the class has inherent attribute, selecting a tuple corresponding to the even attribute on the workflow, and selecting a tuple meeting the condition from the tuple; selecting another even attribute corresponding tuple, and repeating the operation until all even attribute tuples meeting the conditions are obtained; thirdly, performing cross operation on all the obtained tuples to obtain a new tuple; finally, selecting a corresponding tuple of the inherent attribute meeting the condition from the new tuple to obtain a query result;
s7.5, multi-class query, and query of two or more classes, wherein the classes are inherited or related to the parent class, so that at least one parent class and a plurality of subclasses are required to be selected in the process of querying by a user. There are three cases of child queries, homologous queries, alternate queries.
2. The BS-architecture object-oriented database management system of claim 1, wherein: the specific steps of the S1.1 are as follows: 1) User-defined class names; 2) Judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending; 3) Defining an attribute domain by a user, and designing a data type of the attribute domain; 4) A user-defined method, designing constraints on attributes; 5) And recording the defined class into an inheritance relationship table, and returning the defined class.
3. The BS-architecture object-oriented database management system of claim 1, wherein: the specific steps of the S1.2 are as follows: 1) The user selects a parent class to be inherited; 2) Judging whether the parent class exists, if so, continuing to execute, otherwise, returning an error and terminating; 3) User-defined subcategory names; 4) Judging whether the subclass name is unique, if so, continuing to execute, otherwise, returning to the step 3) and outputting an error; 5) Defining a subclass attribute field by a user, and designing a data type of the attribute field; 6) User-defined subclass methods; 7) And recording the defined class into an inheritance relationship table, and returning the defined class.
4. The BS-architecture object-oriented database management system of claim 1, wherein: the specific steps of the S1.3 are as follows: 1) User-defined class names; 2) Judging whether the class name is unique, if so, continuing to execute, otherwise, returning an error and ending; 3) A user-defined attribute field, wherein the user-defined attribute or method modifier is one of public, protected, private; 4) A user defines a method, wherein the method uses the this keyword to refer to the attribute or the method of the package; 5) And recording the defined class into an inheritance relationship table, and returning the defined class.
5. The BS-architecture object-oriented database management system of claim 1, wherein: the specific steps of the S1.4 are as follows: 1) Repeating steps 1 to 5 in the 1.2 inheritance algorithm; 2) A user-defined subclass method, wherein the user invokes a parent class method; 3) Judging whether the called parent class method exists or not, if so, continuing to execute, otherwise, returning to the step 2 and outputting an error; 4) The user rewrites the parent class method; 5) Judging whether the method name of the rewritten method is consistent with the returned data type with the original method name, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error; 6) Judging whether the modifier of the rewritten method is consistent with the original method, if so, continuing to execute, otherwise, returning to the step 4 and outputting an error; 7) And recording the defined class into an inheritance relationship table, and returning the defined class.
6. The BS-architecture object-oriented database management system of claim 1, wherein: in the step S5.1, data are transmitted between the user and the server through a TCP/IP protocol, the data are stored as json format files, each time the user in the database system operates, the data are temporarily stored on the server, and the user data are finally stored locally.
7. The BS-architecture object-oriented database management system of claim 1, wherein: in the step S6, the creating steps of the instance are specifically as follows: 1) The user selects the belonging class and defines an instance name; 2) The user defines an instance identification code, if the identification code is not defined, the system automatically endows the identification code, and the identification code is an attribute for determining the uniqueness of the instance; 3) The user realizes the operation of the attribute through the method; 4) The system detects whether the attribute value meets the defined data type; 5) And recording the defined examples into an example table.
8. The BS-architecture object-oriented database management system of claim 1, wherein: the specific steps of 7.4 are as follows: 1) The user selects an instance set of classes that need to execute the query; 2) The user designs the query conditions and the attributes and classes to be queried; 3) Submitting a query by a user; 4) Background processing inquiry commands; 5) And the background returns the query result.
9. The BS-architecture object-oriented database management system of claim 1, wherein: the 7.5 includes three types of queries, respectively:
child queries 1) user selection of instance sets of parent classes; 2) The user selects an instance set of subclasses; 3) The user designs the query conditions and the attributes and classes to be queried; 4) Submitting a query request to the background; 5) The system judges whether the classes are inheritance relations or not, if yes, the system continues to execute, otherwise, error information is returned; 6) The background treatment is shown in the attached drawing;
homologous query, 1) user selection of parent class; 2) The user selects an instance set of subclasses; 3) The user designs the query conditions and the attributes and classes to be queried; 4) Submitting a query request to the background; 5) The system judges whether the multiple classes have the same parent class, if yes, the system continues to execute, otherwise, error information is returned; 6) Carrying out background treatment;
alternate queries 1) user selection of an instance set of a parent class; 2) The user selects a subclass; 3) The user selects an instance set of subclasses of its subclasses; 4) The user designs the query conditions and the attributes and classes to be queried; 5) Submitting a query request to the background; 6) The system inquires whether the parent class of the selected class is a subset of the subclass of the class, if yes, the system continues to execute, otherwise, error information is returned; 7) And (5) carrying out background treatment.
CN202211536912.1A 2022-12-01 2022-12-01 Management system of object-oriented database based on BS architecture Pending CN116010658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211536912.1A CN116010658A (en) 2022-12-01 2022-12-01 Management system of object-oriented database based on BS architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211536912.1A CN116010658A (en) 2022-12-01 2022-12-01 Management system of object-oriented database based on BS architecture

Publications (1)

Publication Number Publication Date
CN116010658A true CN116010658A (en) 2023-04-25

Family

ID=86018227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211536912.1A Pending CN116010658A (en) 2022-12-01 2022-12-01 Management system of object-oriented database based on BS architecture

Country Status (1)

Country Link
CN (1) CN116010658A (en)

Similar Documents

Publication Publication Date Title
US11526338B2 (en) System and method for inferencing of data transformations through pattern decomposition
US6327587B1 (en) Caching optimization with disk and/or memory cache management
US7831534B2 (en) Method of building persistent polyhierarchical classifications based on polyhierarchies of classification criteria
US20020083049A1 (en) Data exploration system and method
US7693857B2 (en) Clinical genomics merged repository and partial episode support with support abstract and semantic meaning preserving data sniffers
US20060155719A1 (en) Complex event discovery in event databases
US6658407B1 (en) Clause-based relational queries
US20040019586A1 (en) Property and object validation in a database system
US7702647B2 (en) Method and structure for unstructured domain-independent object-oriented information middleware
CN116010658A (en) Management system of object-oriented database based on BS architecture
EP1224570A1 (en) A system for composing applications based on explicit semantic models, event driven autonomous agents, and resource proxies
US11372863B2 (en) Ranking filter operation for calculation scenarios
Kopecky et al. Relaxed objects-Object model for context-aware applications
Dzikiewicz Cyrano: a meta model for federated database systems
Gardarin et al. S. HAL B
Andlinger et al. Making C++ Object Persistent by Using a Standard Relational Database System
Yengül A Run-time environment for an object-oriented database management system
Albano Databases Essentials

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination