Application of an Improved UML in Embedded Systems

Publisher:传邮万里Latest update time:2012-05-22 Source: 单片机与嵌入式系统应用 Keywords:UML Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

With the rapid development of computer technology, network technology and communication technology, the current information society has entered the post-PC era from the traditional personal computer era; and the main feature of the post-PC era is the widespread application and development of embedded systems.

Although there are many definitions of embedded systems, the one that is generally accepted in China is [1]: a special-purpose computer system that is application-centric, based on computer technology, with customizable hardware and software to suit the application system's requirements for functionality, reliability, cost, size, and power consumption.

Embedded systems mainly use micro-chips and their solidified software, which are embedded in other systems to achieve the purpose of intelligent or information-based real-time control of other systems.

At present, embedded systems have been widely used in industrial control, aerospace, national defense, information appliances and other fields, and have played an important role. In addition, more and more fields are in urgent need of the support of embedded systems. However, due to the great differences in hardware, software, and application environment of embedded systems, the time and energy of currently limited embedded technicians are mainly spent on familiarizing themselves with different hardware, software and code development. This not only makes the efficiency and quality of embedded system development unguaranteed, but also seriously restricts embedded technicians from conducting higher-level research and development. These have become bottlenecks for the rapid development of increasingly complex embedded systems.

1 Feasibility of Introducing UML into Embedded Systems

In the 1960s and 1970s, the software industry encountered a crisis. The reason was that software became larger and more complex, while the quality and productivity of software became lower and lower. This promoted the birth of software engineering, which greatly improved the standardization and efficiency of software development. In the 1990s, with the development of object-oriented technology, software engineering developed in the direction of automation and intelligence, and its prominent sign was the emergence and development of the UML standard. Subsequently, many software and hardware manufacturers have successively developed many CASE tools based on the UML standard. From then on, software development can use UML's CASE tools to complete a series of software engineering processes from software analysis, design, implementation to testing, which greatly improves the reusability and efficiency of software development and reduces the rework rate in the software development process.

The outstanding feature of UML is that it analyzes and designs the developed system from an object-oriented point of view. It regards each function of the system as a module (represented by a "class"). In UML, the use case view, logical view, component view, concurrency view and expansion view are used to implement the software requirements analysis, design, implementation, integration and testing processes respectively; and each view includes a series of diagrams for specific implementation. The above 5 types of views include use case diagrams, class diagrams, object diagrams, state diagrams, sequence diagrams, collaboration diagrams, activity diagrams, component diagrams and expansion diagrams. Among them, the use case diagram, class diagram, object diagram, component diagram and expansion diagram are static diagrams, which analyze and model the system from a static aspect; while the state diagram, sequence diagram, collaboration diagram and activity diagram analyze the system from a dynamic aspect and simulate the dynamic interaction of the system.

In 2001, the release of UML2.0 marked the further maturity of UML technology, and it also gained the support of more and more hardware and software manufacturers, which also made the development prospects of UML broader. In the face of the great achievements of UML based on software engineering in the software field, can UML be introduced into embedded system development to change the current situation of low efficiency of embedded system development? Through research and analysis, it is found that there are mainly the following difficulties in applying UML to embedded systems:

① Embedded systems consist of hardware and software. Hardware from different manufacturers varies greatly. Software that can run correctly on a certain embedded chip may not run properly on another embedded hardware platform.
② Embedded system software platforms also vary greatly, and their development requirements vary greatly.
③ Most embedded systems have strict real-time requirements.
④ Software for embedded platforms is generally not developed in object-oriented languages, but mainly written in C language or even assembly language.

All these characteristics make it difficult to build UML models in actual embedded systems. Even if the model is built, its correctness and real-time performance are difficult to verify and guarantee.

Nevertheless, researchers and developers from various countries have made unremitting efforts to introduce UML into embedded systems and have achieved some results, mainly including:

① In order to verify the correctness of the established model, some people proposed to use formal methods. For example, William and HC Cheng used VHDL as the formal description language of the model, and obtained the VHDL description of the embedded system by analyzing the class diagram and state diagram in the UML model, determined the structure and behavior of the system, and performed model verification [2]. Other scholars used finite state automata in combination with UML to complete the analysis, design and verification of the system [3].
② For real-time requirements, the solutions provided mainly include: using standard UML and its structural concepts to design real-time systems [4], and expanding UML or modifying UML to meet the requirements of real-time systems [5].
③ For language issues, there are mainly two solutions: one is to use object-oriented C++ language development, such as SystemC [6]; the other is to use a UML development environment that can be combined with C language, such as Rhapsody launched by ILogix in the United States.

From the above three solutions, we can see that the problems of verifiability, real-time performance and language generated by the application of UML in embedded systems can be solved. Therefore, it is possible to widely use UML to analyze, design and guide embedded system development to solve the problem of low efficiency in embedded system development. [page]

2 An Improved UML Solution for General Embedded Systems

Since the current research on the application of UML in embedded systems often focuses on solving a certain aspect of embedded systems, it is not universal and it is difficult to become a standard for embedded system modeling. In order to solve the modeling problem of UML in embedded systems, this paper proposes a universal UML embedded system design solution.

To model an embedded system the following aspects must be considered:

◆ Time. Describe time and its constraints in sequence diagrams.
◆ Concurrency. Use activity classes to describe concurrency. The attributes of activity classes (such as priority) can be defined as class tag values, which can be mapped to the implementation environment through component classes ﹤﹤Process﹥﹥ and ﹤﹤Thread﹥﹥.
◆ Asynchronous communication. UML supports sending asynchronous messages between threads.
◆ Synchronous communication. Define classes/classes of semaphores, monitors, or critical areas to describe synchronization.

From this, we can conclude that the general process of embedded system modeling is as follows:

① First, determine the system requirements. At this stage, we do not consider which part is software or hardware. We only obtain the functions that the system should have based on research and communication with users, and express them through the relationship between roles and use cases, so as to obtain the use case diagram and the final system requirements.
② Enter the system design stage, that is, design the class diagram according to the requirements obtained from the use case diagram. At this stage, we need to determine which functions are completed by hardware and which functions are completed by software. The design of the software class diagram is basically the same as the pure software modeling method, so I will not repeat it here. The processing of hardware is generally implemented by hardware wrapper classes, which provide interfaces for accessing hardware. These hardware wrapper classes handle the communication with the device and the interrupts generated by the device. Through such hardware classes, the details of the low-level protocol can be hidden, and the low-level interrupts can be easily and quickly converted into high-level events in the rest of the system. Whether the wrapper class is an active or static class depends mainly on the properties of the hardware.
③ If the software class or hardware class described in the class diagram is complex and difficult to describe clearly, then an object diagram can be used to refine it to make it more specific and clear.
④ For real-time requirements, it is necessary to define and describe them in the sequence diagram; if you want to know the links between different objects and how to send messages between linked objects, you can create a collaboration diagram; by creating a state diagram, you can understand all the states that an object can reach and the impact of the events received by the object on the state of the object, etc.
⑤ Finally, use component diagrams and expansion diagrams to achieve system integration and verification.

The above process can be implemented in the Rhapsody software environment, because the software can generate C language commonly used in embedded systems, which is closer to the usual embedded development environment.

3 Example Analysis and Discussion

Here we take an alarm system as an example to illustrate how to use UML to design embedded systems. An alarm system is generally composed of sensors (including sound sensors, image sensors and thermal sensors), alarms (including sound alarms, telephone alarms and light alarms), keyboards, LCD displays, system processors, and memory for storing system configuration information and log information.

When the sensor receives a signal, it sends the information to the system processor through analog/digital conversion. The system processor determines whether an alarm is needed based on the set configuration information conditions. If necessary, an alarm command will be sent to the alarm. The keyboard and LCD display are used for human-computer dialogue, and the alarm conditions and methods can be set according to actual needs.

The sequence diagram of the system is shown in Figure 1. As can be seen from Figure 1, the system requires that the time interval from the sensor returning information to the alarm being issued is less than 3 seconds. This is an example of the time requirement for an embedded real-time system in a sequence diagram.

In the class diagram, the system processor is designed as an active class, responsible for handling the interaction with the user through the control panel with LCD display. Through the control panel, the system can be configured, activated and shut down. All configuration changes are saved in the system configuration information class. The system processor receives the information from the sensor and compares it with the system configuration information to decide whether to alarm. In order to query and understand the historical information of the alarm system, the system processor saves all events in the log. The simple relationship of the class diagram of the system processor, sensor and alarm is shown in Figure 2.


Figure 1 Alarm system sequence diagram



Figure 2 Class diagram of alarm system components

Conclusion

Introducing a universal and complete UML technology for embedded systems will definitely have a positive impact on the research and development of the current rapidly developing embedded systems. The ideas and methods proposed in this article have played a useful role in exploring and suggesting ways to get rid of the dilemma of UML technology in the embedded field

.

[1] Wang Tianmiao. Embedded System Design and Example Development - Based on ARM Microprocessor and μC/OSII Real-time Operating System [M]. 2nd Edition. Beijing: Tsinghua University Press, 2003:530.
[2] William E McUmber, Betty HC Cheng. UML-Based Analysis of Embedded Systems Using a Mapping to VHDL [J]. IEEE High Assurance Software Engineering, 1999 (11):5663.
[3] Shi Keyang, Fu Min, Hu Guanrong. Research on the Model Verification Mechanism of Embedded Systems Based on UML [J]. Computer Engineering and Applications, 2001, 37(23):13111.
[4] He Hai, Zhong Yifang, Cai Chilan. Complex embedded system modeling method based on UMLRT and its application [J]. Computer Applications, 2005, 25(6):14271429.
[5] Bikander M. Graphical Programming Using UML and SDL [J]. IEEE Computer, 2000(12):3035.
[6] Shi Ke. Research on embedded system integrated development based on UML and SystemC [J]. High Technology Communications, 2003(11):4447.

Keywords:UML Reference address:Application of an Improved UML in Embedded Systems

Previous article:Application of Power Logic Devices in Embedded Systems
Next article:Graphical interface support system for real-time embedded systems

Recommended ReadingLatest update time:2024-11-16 15:49

Summary of mini2440LCD module
1. Platform: mini2440 + sony ACX502BMU-7 (TFT screen uses 16bpp 240*320) 2. Module Description: First of all, we can see from the hardware schematic diagram above that the pins we need to configure are in addition to VDDLCD nRESET All pins, TSXM TSYM TSXP TSYP and those connected to ground, must be configured.
[Microcontroller]
Summary of mini2440LCD module
AVR driving 3.2 inch tft LCD (ssd1289)
Pin Connection D0 PA0 D5 PA5 D10 PD2 D15 PD7 D1 PA1 D6 PA6 D11 PD3 CS PB0 D2 PA2 D7 PA7 D12 PD4 RS PB1 D3 PA3 D8 PD0 D13 PD5 WR PB2 D4 PA4 D9 PD1 D14 PD6 RD PB3                         RES
[Microcontroller]
PIC16F877A LCD driver HT1621 source code
P IC 16F877A  LCD driver HT1621 source code STATUS  EQU     3H  FSR     EQU     4H  RB      EQU     6H RC EQU 7H  OPTIONA EQU 81H  TRISB EQU 86H  TRISC EQU 87H  GENR0 EQU 053H  GENR1 EQU 054H  WD_RG EQU 055H  DA_AG0 EQU 056H ;SEG0 SEG1  DA_AG8 EQU 05EH ;SEG16 SEG17  ;.............................  C EQU 0  Z EQU 2  R
[Microcontroller]
Samsung completely abandons LCD TVs: 300 related employees transferred to the semiconductor department
According to media reports, Samsung plans to transfer about 300 employees from their original liquid crystal display (LCD) division to the company's semiconductor division. It is reported that the move was made after Samsung completely stopped producing LCD panels for TVs this month. Samsung's decision to exit the
[Home Electronics]
ARM History 4 - LCD
    It has been 10 days since I last wrote about my journey. It was the National Day holiday, so I gave myself a few days off - I played some games, chess, etc.     In fact, it took a lot of time and brainpower to write the touch screen driver and understand the interrupt process in ARM. I will simply share the cond
[Microcontroller]
PIC LCD1602 Display
#include       //Call the header file, you can go to the PICC18 software to find PIC18FXX2.H __CONFIG(1,XT);         //Crystal oscillator is external 4M __CONFIG(2,WDTDIS);     //Watchdog off __CONFIG(4,LVPDIS);     //Disable low voltage programming #define uint unsigned int #define uchar unsigned char #
[Microcontroller]
C51 DS1302 chip + lcd12864 display time
1. Schematic 1302 chip part LCD12864 part 2. Code part config.h #ifndef __CONFIG_H #define __CONFIG_H #include reg51.h #include "lcd12864.h" #include "intrins.h"  #define uchar unsigned char #define uint unsigned int #endif  lcd12864.c #include "lcd12864.h" void lcdinit(void) //Initialize LCD  {     write(0,0
[Microcontroller]
C51 DS1302 chip + lcd12864 display time
Embedded Development (S5PV210) - LCD Display
1. LCD Introduction 1. LCD (Liquid Crystal Display) is commonly known as liquid crystal. A major feature of this material is that the liquid crystal molecules rotate under the drive of electrical signals. The rotation affects the light transmittance. Different light transmittances will pass through different colors of
[Microcontroller]
Embedded Development (S5PV210) - LCD Display
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号