Application of object-oriented method in software development of automobile emission test system

Object-oriented programming method is the most important software design method since the 1990s. Automobile emission test system is a computer system based on chassis dynamometer, emission analyzer, data acquisition card and other peripheral hardware devices, and completes various types of automobile emission test data collection and processing in accordance with national emission regulations and production research requirements. Because the system has to interact with peripheral devices, there are many test projects and user requirements are complex, the use of traditional software design methods based on function decomposition makes software development and debugging very difficult, the reliability of the software is poor, and with the changes in hardware equipment, test projects increase And changes in user requirements, it is difficult to expand on the original system. The object-oriented method establishes the problem domain model according to people's normal thinking habits.Software design naturally expresses the problem domain solution method.Abstract data types, data encapsulation, and inheritance make the software architecture stable, reusable, and easy to maintain and expand. Can greatly improve the efficiency of software development.

1 Hardware structure and software requirements of automobile emission test system

The overall structure of the vehicle emission test system is shown in Figure 1. In the input signal, atmospheric pressure, dry temperature, wet temperature, temperature and pressure before and after the catalyst come from the sensor, the vehicle speed and distance pulse come from the drum test bench, and the driver start signal comes from the remote control. The signal conditioning unit converts these signals into standard signals that can be received by the computer interface, and the host computer collects these signals through the A / D and DI / O interface cards. The main computer communicates with the constant volume sampling device and the emission analyzer through the GPIB interface card, reads the data and controls these devices according to the test procedure. The main computer controls the display of the working condition curve of the driver assistance display through a graphic acceleration card. The software requirements are as follows:

(1) The process control of CVS test, modal test and catalytic converter conversion efficiency test can be realized in accordance with the requirements of emission regulations and production research. During the test, the system should complete the tasks of initial parameter setting, data collection, equipment control, display monitoring interface, etc., and write the measurement results to the disk file.

(2) According to user requirements, print out test data tables and curves, including CVS result tables, modal test conditions and cycle statistical results tables, emission pollutant concentration curves, temperature and pressure curves before and after the catalyst, before and after the catalyst Pollutant concentration curve, etc.

(3) Check the hardware equipment such as acquisition card, emission analyzer, etc. before the test, if the equipment is not normal, then prompt the user and stop the test.

(4) A / D input channel can be calibrated.

2 Object-oriented analysis

Abstract data types are one of the central concepts of object-oriented programming. The structural framework and high-level design of an object-oriented software system are ultimately represented by a series of classes, their definitions and objects. A class is an abstract data type. Its definition includes a set of attribute data and a set of operations on the attribute data. It provides services externally through the interface of the class. The object is an instance of the class and corresponds to the entity in the problem domain. The object-oriented analysis process identifies the entities in the problem domain and determines the relationships between these entities. At this stage, a comprehensive document describing system functions and basic characteristics of the problem domain is generated. The objects in the automotive emission test system are shown in Figure 2.

The "emission analyzer" object encapsulates the operation of the analyzer; the "I / O interface card" encapsulates the input and output operations of the A / D interface card and DI / O interface card; the "driver assistance" object implements the driver assistance display operating conditions The display of the curve; the "test equipment" object encapsulates the operation of the hardware equipment in the emission test system. Provide services for the "emission test" object; the "emission test" object encapsulates the test process, save the measurement results to a disk file; the "data file" object reads the file, and prints out the data table and curve.

The hardware equipment of the emission test system may use different types of analyzers, such as MEXA_9000 of HORIBA or CEB_x00 of AVL, or different types of I / O interface cards, such as PC_6313 of Zhongtai or PCL_812 of Advantech, according to The user's request may also add new test items. In the object-oriented approach, inheritance is a technique of using existing classes as the foundation to create new classes. New classes reuse the definition of existing classes, and can add new attributes and operations. The objects communicate with each other through a message. The message is the actual call to the operation, in which the "sender" sends a message to the "receiver" to achieve certain processing functions. The relationship between the objects in the emission test system is shown in Figure 3.

The triangle in the figure represents the whole and part of the structure, the semicircle represents the general and special structure, and the solid arrow represents the message connection. The "test equipment" object consists of three objects: "emission analyzer", "data acquisition card" and "driver assistance", with "emission analyzer", "data acquisition card", "test" and "data file" as the base class Different subclasses can be derived. The "test" object sends a message to the "test equipment" object to achieve functions such as data collection, analyzer control, and driver assistance display.

As can be seen from the object relationship diagram, object-oriented technology builds the software structure on the object corresponding to the entity in the problem domain, and the function of the software is scattered among the objects.Since the object is relatively stable, the modification of the software is mainly concentrated on the package inside the object Attribute and operation without affecting the software architecture. The localization of this modification maintains the stability of the software structure and reduces the workload and difficulty of software modification.

3 High-rise design

The objects identified in the object-oriented analysis process and their relationships constitute the problem domain model, the structure of the development system at the high-level design stage, and the overall model of the application software. The object encapsulates the realization of specific functions in the problem domain and provides external services through the interface. The application program is equivalent to a driver module, which is responsible for creating an instance (object) of the class, receiving user input and sending a message to the object to implement the function call. The application program structure of the vehicle emission test system is shown in Figure 4. The system is divided into three processing functions: system maintenance, emission testing and data processing. The "system maintenance" function includes total accuracy check and channel calibration of the analyzer, the "emission test" completes the test process according to the test category selected by the user, and the "data processing" function completes the printout according to the data file loaded by the user. When the user selects a certain function, the application sends a message to the corresponding object. The arrow in Figure 4 indicates the sending of the message.

4 Characteristic analysis of object-oriented method

(1) The traditional structured programming is based on "process" and "operation" to construct the system, which is a process-oriented architecture. The "process" and "operation" are unstable. If the basic hardware, user needs, and programming environment (compiler and operating system) change, the processing architecture may also need to be changed, and the system transplantation or upgrade will cost a lot. . Object-oriented programming models the problem domain, with "object" and "data structure" as the center, the software architecture is relatively stable, and the reusability of thinking results is better.

(2) Encapsulation and data hiding are the basic elements of object-oriented programming. Bundling data and related processes together is defined as a whole (that is, objects) .The scope and visibility of processes and functions that manipulate data are limited to local areas of the code, and changing data structures or algorithms is limited to implementation. This type of code area does not cause system changes, which provides convenience for program maintenance.

(3) The abstract nature of the class provides a modular architecture, the interface of the class indicates the services it provides, and users of the class do not need to care about the implementation details of these services. Store some tested classes in the class library. When building a new application software, you only need to find the required class in the class library or reuse the existing class through inheritance to meet the change of the problem domain, which makes object-oriented design Reusability is improved.

In accordance with software engineering standards, the author uses object-oriented technology to complete the design of the vehicle emission test system software, and uses Win98 to implement the graphical programming language LabVIEW of National Instruments Corporation under Win98. This system has been put into use in Shanghai Pan-Asia Automotive Technology Center. The system has a short development cycle, good reliability and easy maintenance, which fully reflects the advantages of object-oriented programming.

76-200Kva Diesel Generator

76-200Kva Diesel Generator,Volvo Generator,Generator Set,Portable Diesel Generator

Shanghai Kosta Electric Co., Ltd. , https://www.generatorksd.com