On the input and discrimination of fuzzy data in database

Source: Internet
Author: User
Tags execution integer variables query range
Data | Database Preface

A fuzzy database is a database that can process fuzzy data. The general database is based on two straight logic and accurate data tools, and cannot express many ambiguous things. With the establishment of fuzzy mathematics theory system, people can use quantity to describe fuzzy events and can perform fuzzy operations. In this way, the incomplete, uncertainty and fuzziness can be introduced into the database system so as to form a fuzzy database. The research of fuzzy database mainly has two aspects, first, how to store the fuzzy data in the database, and then the function of the fuzzy data is defined by various operations. The representation of fuzzy numbers mainly includes the fuzzy interval number, the fuzzy center number, the fuzzy set number and the membership function.
Since the Loftizadeh of the University of California, Berkeley, in 1965, the study of human beings in this field has not ceased; In the field of database, Fuzzy logic theory has been applied to some extent, this paper discusses the input and discrimination of fuzzy data to discuss its own understanding.

Basic principles of Fuzzy logic
You are the set of certain objects, called the domain, which can be continuous or discrete; U represents the element of U, which is recorded as U ={u}.
Define the 1 fuzzy set (sets) domain you to [0,1] interval of any mapping MF, that is mf:u®[0,1], all determine a fuzzy subset of U F; MF is called the subordinate function of F (membership function) or membership degree (Grade of member ship). In other words, MF indicates the degree or rank of the U as a fuzzy subset F. In the domain u, a fuzzy subset can be represented as a sequence couple of the element U and its subordinate function MF (u), which is recorded as:
F ={(U,MF (U) |uîu)}
If u is continuous, then the fuzzy set F can be recorded as:
F =òumf (U)/u
If u is discrete, the fuzzy set F can be written as:
F=MF (U1)/U1+MF (U2)/U2+....+MF (un)/UN=ÅMF (UI)/ui
Definition 2 Fuzzy branch set, intersection point and fuzzy single point if the fuzzy set is the set of all elements u in the domain u that satisfy MF (u) >0, the set is called the set of the fuzzy set F. When u satisfies MF = 10, the fuzzy set is called a fuzzy single point.
Define 3 language variables a language variable can be defined as a multivariate group (x,t (x), u,g,m). where x is the variable name, T (x) is the word set of x, that is, the set of the language value name, and U is the domain; G is the grammatical rule that produces the name of the language value; M is the grammatical rule relating to the meaning of each language value. Each language value of a language variable corresponds to a fuzzy number defined in the domain U. The basic word sets of language variables link the fuzzy concepts with the exact values, and realize the quantification of qualitative concepts and the qualitative fuzziness of quantitative data. For example, a bathroom boiler takes the temperature of the water as a language variable, and the word set T (temperature) can be:
T (temperature) ={ultra-high, very high, high, moderate, low, very low, too poor}

Methods of storing fuzzy data in database

1, the choice of data model
In recent years, most of the database models have relational data model, object-oriented model, object-relational data model.
The fuzzy database requires that the stored data have the characteristics of high abstraction, complex data type, object-oriented operation, especially for the realization of fuzzy recognition function.
Relational data model is difficult to meet the needs of fuzzy database because of its structure unification, record-oriented, limited data type, inability to clearly represent and deal with complex objects effectively.
Object-oriented database management system (OODBMS) is a persistent programming language based on object-oriented programming language, from the object point of view, moving to the database management thinking, which is implemented by the ODMG-93 standard, which is suitable for engineering, graphics, multimedia and other fields with complex data requirements, is a kind of advanced data model idea at present. But it in the query, things management and concurrency is poor, and the client's participation is not good, at the same time because it belongs to new things, is not mature, so the major database manufacturers for its poor support, it is "highbrow." So it's not the best choice.
Object-relational database management system (ORDBMS) is an extended relational model based on relational database and SQL, which is a function of extending complex data types and allowing users to customize functions (SQL or C language) from the viewpoint of relational database. With object-oriented features, supported by SQL3 (SQL99) standard with strong versatility. Ordbms not only satisfies the requirements of the traditional relational database users, but also has the application of complex data needs, powerful query language function, and many large database vendors support. is the best choice for establishing a fuzzy database.

2, the establishment of data model
First establish a non-1NF document relationship:
[Sayyes]01_7_13_3.gif[/sayyes]
An example of a bathroom boiler to the water temperature as a language variable, the word set T (temperature) can be:
T (temperature) ={ultra-high, very high, high, moderate, low, very low, too poor}
----------------------------------------------------------------------------
SQL99 statement:
Create type mynum1 integer varying.
Create type mynum2 numeric varying.
/* Create Complex Type * *
CREATE TABLE temperature
(Fuzzytemp char (4),
x MYNUM1 [10],
MN mynum2 [10],
/* Use an array to determine the position of each number.
Check (fuzzytemp in (' Super high ', ' very high ', ' high ', ' moderate ', ' low ', ' low ', ' lower '))
CREATE TABLE Measure
(Time,
Temp smallint;
Check (temp<=100))

Third, the decision of fuzzy data

The result obtained by fuzzy inference is a fuzzy set or membership function, but in practical use, especially in fuzzy logic control, a certain value must be used to control the servo mechanism. The process of obtaining a single value which is relatively most representative of the fuzzy set in the fuzzy set of inference is called fuzzy judgment or Solution ambiguity (defuzzification). Fuzzy judgments can be used in different ways, and the results obtained by different methods are different. In theory, the center of gravity method is more reasonable, but the calculation is more complicated, so the system is not used in real time higher requirements. The simplest method is the maximum membership method, which takes the maximum membership value of all fuzzy sets or membership functions as output, but this method does not take into account the influence of the lesser value of other membership degree, the representativeness is not good, so it is often used in simpler systems. There are also several averaging methods between the two: the weighted average method, the membership limit (Α-cut) element averaging method, and so on. This paper introduces various methods of fuzzy judgment, and takes "moderate water temperature" as an example to illustrate the calculation process of different methods and the realization of SQL query.
This assumes that the membership function of "moderate water temperature" is:
MN (xi) ={x:0.0/0+0.0/10+0.33/20+0.67/30+1.0/40+1.0/50+0.75/60+0.5/70+0.25/80+0.0/90+0.0/100}
1. Center of gravity Method
The so-called center of gravity method is to take the fuzzy membership function curve and the horizontal axis around the area of the center of gravity as the representative point. Theoretically, the center of gravity of a series of continuous points in the output range is calculated
The U =åxixmn (xi)/åmn (xi) is actually the center of gravity for calculating the entire sampling point (i.e. some discrete values) within the output range. In this way, it is the best compromise to provide the required precision with a small enough sampling interval without too much time. That
U =åxixmn (xi)/åmn (xi)
= (0 0.0+10 0.0+20 0.33+30 0.67+40 1.0+50 1.0
+60 0.75+70 0.5+80 0.25+90 0.0+100 0.0)
/(0.0+0.0+0.33+0.67+1.0+1.0+0.75+0.5+0.25+0.0+0.0)
=48.2
The representation value of the output is 48.2 ℃ in case the membership function is asymmetric. If there is no 48.2 ℃ in the fuzzy set, select the closest temperature value of 50 ℃ output.
2. Maximum degree of membership method
This method is simplest, as long as the maximum membership in the fuzzy set of inference conclusion is the output. However, it is required that the membership function curve of this case must be a normal convex fuzzy set (i.e. its curve can only be a single peak curve). If the curve is trapezoid-topped, then there may be more than one element with the maximum degree of membership, at which point the average of all elements taking the maximum membership is to be obtained. For example, for "moderate water temperature", according to the principle of maximum membership, two elements 40 and 50 have the maximum degree of membership of 1.0, it is necessary for all the maximum membership of the elements 40 and 50 for the average, the amount of execution should be taken:
umax= (40+50)/2=45
3. Coefficient weighted averaging method
The output execution of the coefficient-weighted averaging method is determined by the following:
U =skixxi/ski
In the formula, the choice of coefficient ki should be based on the actual situation, and different system will decide the system has different response characteristics. When the coefficient chooses Ki=mn (xi), when the membership function is taken, this is the centroid method. In fuzzy logic control, the response characteristics of the system can be improved by selecting and adjusting the coefficients. Thus the method is flexible.
4. Membership degree limit element averaging method
The membership function curve is cut with the determined membership value α, and the average of all elements after cutting equal to the membership degree is used as the output execution quantity, which is called the membership degree limiting element averaging method.
For example, when Alpha is the maximum membership value, the "fully subordinate" relationship is α=1.0. In the case of "moderate water temperature", the membership degree of 40 ℃ and 50 ℃ is 1.0, and the average number of outputs is obtained:
U = (40+50)/2=45
In this way, when "completely subordinate", its representative quantity is 45 ℃.
If when α=0.5, the "probably subordinate" relationship, the cutting membership function curve, then from 30 ℃ to 70 ℃ membership value are included in it, so the average number of the output represented:
U = (30+40+50+60+70)/5=50
In this way, when "probably subordinate", its representative amount is 50 ℃
----------------------------------------------------------------------------
Example: Using the center of gravity method to query the SQL language when the boiler water temperature is moderate?
SQL99 statement:
Create function sum ()
Returns integer AS
Select (x[1]* mn[1]+ x[2]* mn[2] + x[3]* mn[3] + x[4]* mn[4] + x[5]* mn[5] + x[6]* mn[6] + x[7]* mn[7] + x[8]* mn[8] + x[9 ]* mn[9] + x[10]* mn[10])/(mn[1]+ mn[2] + mn[3] + mn[4] + mn[5] +mn[6] +mn[7] + mn[8] + mn[9] +mn[10)
From temperature
Where fuzzytemp= ' moderate ')
/* Use the user-defined function in Ordbms to establish the membership function with the center of gravity method * *
Select time
From measure
Where (Temp-sum ()) <5 or (Temp-sum ()) >-5
/* Complete the query by using the return value of the membership function and set the error range of moderate water temperature to 5 ℃ a*/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.