Connectivity changes everything, especially with embedded computing technology. Since we're entering a world in which things will link and think, it's clear that many new projects will begin to incorporate more advanced and sometimes complex technology.
Options are available for implementing whole new classes of applications with embedded devices. Development engineers must judge these options carefully to accommodate possible resource constraints and emerging standards and specifications.
As smart devices become more capable, it's becoming increasingly important to adhere to industry-oriented standards and specifications while avoiding the task of building and supporting basic components as part of the overall project. The issue is one of focus. If development engineers are mired in trying to complete the low-level facilities of a platform, they could run out of time and resources when it's finally time to focus on project-specific components.
When working with embedded Java technology, developers get a head start toward project conformity and shorter time-to-market thanks to the well-defined and well-known base Java class libraries. When developers target embedded platforms, these libraries can be chosen with different configurations, considerably reducing the size of Java applications. This impacts both the number of classes and methods included in libraries, and the amount of code needed to implement a method. For example, when a small library configuration without security support is selected, the java.security classes are eliminated, as well as the internal references and manipulation of security-related data within other classes throughout the library.
Several Java Community Process Expert Groups are now working on "Micro Edition"-related class library configurations. Vendors are providing different approaches to implementing configurations, including Java compatible libraries that adhere to JCP specifications and other libraries that can be used to meet special customer requirements. Both types of implementations are available in IBM's VisualAge Micro Edition tools and runtime components.
"Personal configuration" components add several additional libraries to those found in the base Java class libraries. For example, components for the following use are included:
- Windows-based user interfaces (AWT and SWT technology)
- Image map-based user interfaces (MicroView model/event/view-based technology)
- Relational databases (with JavaSQL parts that interface with embedded databases like DB2/Everyplace)
- Remote Method Invocation (CORBA RMI technology)
Additional components are available to provide access to cross-industry and industry-specific services, for example:
- Transaction messaging (with products like MQSeries Everyplace)
- Component bundle management (with OSGi-compliant components)
- Automotive bus interfaces (compatible with MOST, CAN, and IEEE-1850 protocols)
- GPS and cellular phone control interfaces
- Home Internet gateways
The OSGi bundle management technology is of particular interest (see www.osgi.org). Using tools that package and identify bundles of components with appropriate descriptive data, bundle management works with a virtual machine and bundle servers to provide bundle delivery and hot-code activation for maintaining applications. This can be used to add and remove the features of an offering as well as update data and replace code. Bundle management can be completely automated, allowing a system to be designed with the minimum usage of space on a device. For example, a product-diagnostic package could deliver in-depth analysis components upon recognition of a given error code.
Sharing the Development Workload
Many developers considering pervasive solutions will turn to partners to create and deploy the portions of the system that reside on embedded devices. Object-oriented Java and the use of virtual machines provide several advantages for fast project development, reduced time-to-market, and ongoing product maintenance and update. Thanks to the relative portability of components written in Java, it's possible to reuse existing logic from earlier projects and do much of the development in a cross-platform environment.
An embedded device is equally adept at running both client and server components. Deeply embedded devices may not even have a user interface, responding instead to requests from other devices in the network that gather information and render the interface to the user. Much of the advantage of pervasive computing solutions comes from completely automating activities, with servers communicating directly with smart connected devices.
In some cases an experienced embedded developer will have access to major program assets designed in direct executing languages such as Assembler, C, and C++. These are usually specific to platform CPU architectures and RTOS environments. Examples include speech recognition software, specialized device drivers, and existing applications that need to be adapted for pervasive system integration. The embedded Java environment makes the Java Native Interface (JNI) available for this work. In implementations, such as IBM's J9 virtual machine, special attention has been paid to making this interface compact and fast.
With the use of middleware and the ability to reuse existing logic through JNI, the elements of an end-to-end pervasive computing solution can be incorporated quickly, improving time-to-market. While embedded platforms are not personal computers (lacking the PC's uniform approach to device attachment and large resource pools), powerful connected-device solutions can be constructed and maintained. Today's embedded platforms and processors are achieving remarkable power while using space efficiently, reducing heat generation, and conserving power - often enabling battery-operated mobile use.
Each embedded device platform is unique. In many cases the connected device will be deployed with custom-engineered hardware. Designers can select from a broad range of processors, including 32-bit PowerPC, X86, Pentium, SuperH, ARM, DragonBall, and MIPS. Clearly, the improved portability of Java makes a difference in reuse on embedded platforms.
Embedded software is usually developed using personal computer-based developer workstations (VisualAge Micro Edition tools run on both Windows and Linux platforms), and functional testing can be done on the same workstation using a Windows or Linux version of the J9 virtual machine. Cross-platform development is consistent because IBM's J9 VM is generated from the same source for all target platforms, including the one supplied for use on developer workstations.
The actual device hardware does change some aspects of the execution environment. For example, on a device that doesn't have floating point math hardware, the VM and RTOS will emulate these facilities. Obviously, applications will run more slowly in emulation. There are other considerations as special devices are supported. Flash memory (for file system simulation and direct execution memory), graphic user interface layers, and communication interfaces may have different characteristics on different platforms.
During early project development, it's often wise to include a reference platform that integrates the actual target-device processor and several related devices. This allows the application to be tested and tuned on the processor and the devices that will be used in the deployment of the actual project.
In many cases the vendors of embedded Java and RTOS technology will perform this integration on a range of standard reference platforms. Offerings that include services and reference boards are available from vendors such as QSSL (www.qssl.com), Motorola (www.motorola.com/mobileGT), MontaVista (www.mvista.com), and IBM's Object Technology International, Inc. (www.embedded.oti.com). These offerings help developers quickly start their projects and focus on application instead of integration issues.
Embedded platforms usually have limited resources available to application programs. Beyond applications that occupy about 500KB, Java byte code technology is actually more compact than raw machine language. By combining compact and well-engineered base Java class libraries, middleware components, and adaptive compilation techniques (Just in Time [JIT] and Ahead of Time [AOT]), it's possible to create more compact and efficient applications in the Java language.
Embedded RTOS components, the virtual machine, Java class libraries, and extended components are often configurable. This allows components on a platform to be tuned for efficient memory utilization and fast execution. IBM's SmartLinker technology even allows the automatic elimination of unreferenced classes from the base Java class libraries. The J9 VM includes "plug-in" technology for features such as dynamic loading, debugging, JIT, and analyzers.
Clearly, it'll be necessary to provide scalable server support for pervasive solutions. Existing networks and servers may not be able to handle the workload of thousands to millions of devices. For this reason, an early phase of project design must consider the architecture and deployment hierarchy of the ongoing processing demand of devices and the periodic maintenance requirements of bundle management technology.
Java technology is ideal for this use thanks to support for servlet and applet program structures. Advanced techniques that automate server workload distribution have already been tested and deployed in products such as IBM's WebSphere servers. For example, workloads of millions of interactions per day were handled efficiently during IBM's support of the Web sites for the Olympic Games in Nagano and Sydney.
After product deployment, bundle management involves the selection of appropriate components from those available on bundle servers, and the delivery and activation of those components on embedded-device platforms.
Often network hierarchy will include high-capacity devices close to the embedded platform that can be used to stage and store bundles. Examples include the Telematics computer that provides the user interface, mobile interconnection, and data storage resources on a vehicle, and the Internet gateway processor that will be part of home automation networks. These designs enable developers to reduce the component size on deeply embedded devices. For example, connection security facilities may only be needed at the point in which a vehicle or house attach to the external Internet, since the network inside a house or within a vehicle is protected by physical access control.
Keeping Up with Changes
The task of maintaining components for embedded devices involves several distinct steps. First, a deeply embedded device must determine where its bundle server is located on a network. This is done using service discovery protocols. There are now about 23 competing implementations of service discovery components. One of the most interesting is the "Salutation" protocol, since it's robust and open.
Bundle management allows developers to work with connected devices after a product is in customer hands. It usually can accomplish this without the inconvenience of returning a product to a service center. The OSGi specification for bundle management defines how metadata is stored and used to identify appropriate bundles for a device. This is based upon device and platform architecture and related component release levels. The selection is based upon a secure exchange of authentication information, which is used to authorize and select the appropriate bundles for a device. More details are available at OSGi's Web site, www.osgi.org
When a bundle has been delivered to a device, it's best to avoid interrupting the user. When a virtual machine-based technology is used, it's possible to suspend a class's execution and then hot-code replace the component, restarting it at the interrupted method. With careful design, the user need not even be aware of the product upgrade or maintenance activity.
Several important extensions of embedded Java have recently become available to pervasive solution developers. Since the environment of connected embedded devices is quite different from the personal computer and server environments that many systems engineers are familiar with, it's wise to consider working with specialists familiar with embedded software design and integration. Java offers a significant advantage to systems designers and developers with its well-known base class libraries, configurable components, bundle management, and advanced middleware options.
Marc R. Erickson is a project manager for Object Technology International, a subsidiary of IBM. He holds a degree in data systems management from Southern Illinois University. He can be contacted at [email protected]