Reservoir dynamic analysis is an important task in the process of oilfield exploitation. The traditional dynamic auxiliary software cannot save important oilfield knowledge and has the inherent defect of poor scalability and maintainability due to the analysis rules was embedded into system with the form of "hard-coded". When the dynamic analysis index changes, it need heavy work-load to modify the program code and it is prone to error, thus lead to higher software maintenance costs. At the same time, the reservoir dynamic analysis involves the business scope widely and need write the low level code repeatedly for each analysis content, the reusability is poor. As an important research achievement in the field of artificial intelligence, rule engine is an intelligent reasoning widget which can be embedded in system anywhere and reused in different systems to reduce the cost of software development. At the same time, the analysis logic was stored separately in the form of rule, it is convenient for the maintenance of dynamic analysis system and conducive to summarize and promote valuable knowledge accumulated in the process of oilfield development.In this thesis, the author chooses reservoir dynamic analysis and rule engine as the research object, and elaborates the implementation and application of rule engine that suitable for the reservoir dynamic analysis. Firstly, analyze the knowledge characteristics about reservoir dynamic analysis from the business level and system level and put forward the "fact template- condition elements-inference rule" there-tier knowledge representation model, this study provides a basis for rule-based reasoning and knowledge storage and management. Secondly, this paper introduces the principle of RETE algorithm in detail, for the RETE network structure itself, through building indexes for the left and right storage area of Beta nodes respectively to improve the efficiency of pattern matching; Aiming at the process characteristics of dynamic analysis in practical applications, through the establishment of virtual memory area and loading facts in a reverse way to lower memory usage in the matching process. Then, based on the open-source rule engine CLIPS6.3 version, by adding functionality and improve performance to carry on the transformation, on the function aspect, by adding visual knowledge management module, make up for the knowledge management deficiency of the CLIPS; On the performance aspect, by improving RETE algorithm to solve the problem that rule engine has low reasoning efficiency faced with the large amounts of data in oilfield. Finally, integrates the improved rule engine into an practical project from an oil production plant in daqing oilfield, and compares the new solution with the traditional dynamic analysis system, the experimental results verify the feasibility and effectiveness of implemented rule engine, and the new solution can achieve better scalability and maintainability with a little performance loss. |