Java: Past and Future King of Internet Programming

 

What is Java to you? A language you learned in college? A lingua franca of the IT industry? Do you believe that Java is ready for the next Internet explosion? Java enhances embedded computing on the one hand and streamlines real-time applications on the other, and this article will explain why Java is the best language for IoT (Internet of Things) development.

Alt text

Enhanced for embedded computing, streamlined for real-time systems - why Java is the best language for IoT

From 1969 to the present, we can see an explosion of network equipment: from the ARPANET, which was built with computer clusters of four universities, to the 200 million active users on the Internet today. And in the near future this number will grow exponentially, from hundreds of millions of devices to billions of embedded processing devices. Every aspect of our lives will be connected to the Internet through networked devices: homes, workplaces, cars, appliances, tools, toys - it's up to you.

(Translator's Note: Advanced Research Projects Agency Network, the world's first operational packet-switching network developed by the US Defense Advanced Research Projects Agency, is the ancestor of the global Internet. Originally composed of four nodes on the West Coast , UCLA, Stanford Research Institute (SRI), UC Santa Barbara (UCSB) and University of Utah (UTAH))

Java for Embedded Systems

Nineteen years ago, David L. Ripps wrote an introduction to Java and embedded systems for JavaWorld. Ripps' article is still very useful if you want to understand the interplay between embedded systems programming, mobile connected devices, and the Internet of Things.

While today’s chatter about the Internet of Things is partly hyped, it is essentially the changes that will happen in the Internet in the next moment that will eclipse previous generations of information processing technology. The Internet of Things is not just a buzzword, but a new technology that changes the world. Refer to the timeline below, which showcases those tipping points in the internet as we know it:

1982 to 1989: The TCP/IP network was born.
1985 to 1989: Internet commercialization begins.
1990 to 1991: The World Wide Web is officially established.
1990 to 1998: Traditional computers were literally redesigned as Internet devices.
1996-present: Slowly but surely, we have entered an era of "rule" by mobile internet-connected devices (i.e., the Internet of Things).
Complementary technologies for IoT are coming online one after another. HTTP/2, as a new version of the key network protocol, will adapt to machine-to-machine communication to a certain extent. Thingsee is a pioneer in IoT development kits that provide the hardware required for IoT development.

Silicon Valley sage Tim O'Reilly emphasizes that IoT is far more than just connecting insignificant devices like coffee makers and refrigerators to the Internet. With the support of sufficient sensors and automation equipment, the Internet of Things will undoubtedly be a huge progress for mankind. Java will play a major role in the coming changes.

How the Internet of Things Works

In September 2014, Andrew C. Oliver wrote such an essay discussing the importance of networking in team collaboration at the implementation level. In this case, teamwork will condense both humans and computers.

Since devices need to communicate not just with human users, but with other devices, fundamentally new capabilities emerge - not only can the refrigerator know that you've run out of tomatoes, it can also order more on your behalf. The success of ubiquitous computing is that computers will step back "behind the scenes" and work with other connected devices to work out facts and events and solutions. Only executable-level results will be presented to the user. The achievements of the Internet will make us stop thinking too much, because the Internet of Things solves everything for us seamlessly.

The most mundane examples are often the most convincing. In recent news, we've witnessed an impressive array of IoT applications, including agricultural pest management, small zha dan sniffers, and advances in medical diagnostics. Think of an alternative to the humble vending machine—stored in moderation, well-maintained, and waiting in perpetuity for your command.

When you put your bill into a vending machine and press a button to execute your purchase, there are several interactions to confirm your hunger is satisfied. You don't need to understand or agree with the entire realization process, your stomach will be very happy with the result. Now, we have vending machines with IoT capabilities. When you buy from an IoT-enabled vending machine, your purchase triggers operations around the world to keep inventory balanced and parts properly maintained, a new model that reduces total costs by 30% compared to previous IoT models .

Java's Embedded Computing Journey

Only a few people now realize that Java is a language built for embedded computing. An early version of it was intended to refer explicitly to household appliances such as TV set-top boxes. The original vision of James Gosling (the father of Java) was centered on inter-device communication, and he imagined that Java could be used not only for device-to-user communication, but also for device-to-device communication. Twenty years later, these initial design advantages are ready to support the Internet of Things.

Java's ubiquity also makes it a very good fit for the Internet of Things. Huge resources from all over the world are devoted to transporting Java to a new generation of programmers and ensuring that it is maintained - to support all production systems that depend on it. Hundreds of thousands of successful applications and systems have proven Java's prowess.

It is important to distinguish parts of the Java platform for developers exploring embedded programming. There is no need to make changes to writing or reading programs for embedded development: good Java programmers can easily read the source code of an embedded system as they would a typical desktop enterprise application. However, the library and development environment (especially the development and testing environment) are customized for embedded Java programming. Make sure you have the correct embedded development environment.

Is Java too big for embedded systems?

Because embedded devices are always stretched thin for computing performance, Java is often not the first choice for embedded development. Assembly, C, and even Python can all work better on systems with limited memory, low-power CPUs, or other hardware constraints. However, as the average embedded environment has grown, this hindrance has gradually disappeared in recent years. The introduction of new Java compilation technologies for embedded environments has also reduced resource requirements.

Outlook for Java Embedded Development in 2015

Java has been qualified for embedded programming since 1996, but lacks momentum. This trend is moving fast today, and an ecosystem for embedded -- including Java standards and tools -- is ready.

Between 2000 and 2010, it was a common fact that Java-based embedded or "micro" computing was concentrated on J2ME (Jave 2 Platform, Micro Edition). Today, the Java Platform, Micro Edition or Java ME is the standard embedded application runtime. While Java ME and its concepts -- especially profiles and configurations -- remain critical, mobile Java developers tend to focus more on Android and HTML5 user interfaces. Mobile phones are the most common type of embedded computer, and roughly four-fifths of phones sold today are based on Android. (While Android supports Java ME, the two have different product life cycles, and it's unclear who will decide what will be the application environment for the next generation of actual embedded devices).

(Translator's Note: profiles are often translated as profiles, which are a summary of the characteristics in a certain industry or field, each set of profiles is specifically for a certain type of equipment; configurations are often translated as configurations, Java ME introduces the concept of configuration, which shields the physical characteristics of different hardware devices)

Profiles and configurations are key concepts in embedded programming. An embedded profile such as MIDP (Mobile Information Device Profile) is a set of APIs for supporting related devices. A configuration is a set of framework specifications. It may be helpful to understand the concept of profiles in a loose sense of configuration as belonging to a profile, including most notably CLDC (Connected Limited Device Configuration) or so-called Wired Connected Device Configuration. (See "Jim Connors' Weblog" for more profiles and configurations for IoT applications).

Aside from Java ME profiles and configurations, a handful of enterprise-grade Java technologies hold the potential for embedded development. Java Management Extensions for distributed resource management and monitoring, or JMX Java Management Extensions, could one day fully complement the embedded definition. Real-time Java also plays an important role in IoT embedded programming.

Real-time models and tools for Java

Embedded applications connecting sensors and effectors in medical, transportation, manufacturing and other industries are very demanding in real-time. Predictable, accurate results are a matter of life and death for pacemakers, engine controllers, plumbing valves, and more, not just annoying stack backtracking.

Although James Gosling wanted Java to fulfill common real-time requirements, real-time was not Java's strong suit in the early years. In particular, many Java Runtimes are notorious for being unreliable or at least incoherent in their handling of garbage collection. RTSJ (Real-Time Specification for Java) and related standards are used to deal with the time uncertainty of these events - periodic or sporadic task scheduling, task deadlines and CPU time budgets, garbage collection threads, enabling certain A ration of tasks to avoid garbage collection delays. RTSJ was approved in 2002 and has been implemented by many Java virtual machines.

Although RTSJ was listed as a pending project by the Java Community Process until February 2015, it has been actively improved and updated by experts over the past decade. For example, JamaicaVM is an RTSJ implementation supported by aicas GmbH and is now freely available for educational or other non-commercial use.

Timeline of a real-time system

The timeline for the development of embedded, especially real-time standards, is generally much longer than that of typical consumer software. A successful mobile app can peak and disappear in six months, while embedded software in medical devices, cars and factories often needs decades to run reliably. Published standards affecting these applications took correspondingly longer to draft.

The recent introduction of Oracle's Java SE real-time system suggests that Java SE has been sufficiently enhanced to meet "soft" real-time requirements. "Soft" has at least two distinct meanings here. One is to require software with average performance, for example, a typical bank transaction being sent within 300 milliseconds is good enough. "Hard" real-time requirements are quite different, e.g. a motorized solenoid valve closing within a quarter of a second of an application receiving an alert is a worst-case scenario. The most critical requirement for "hard" real-time is in the sense that the worst-case scenario can be predicted.

For many IoT-embedded applications, "soft" real-time is fully qualified. For applications that require hard real-time support, Java developers are largely turning to JSR-302: Safety-Critical Java Technologies. This specification is a subset of the Java real-time specification, and is partially dependent on CLDC. Among other features, safety-critical Java defines its own concurrency model and real-time threads. The Open Group initially started working on safety-critical Java in 2003. When asked about the status of the specification this spring, Doug Locke, director of the JSR 302 specification, estimated that after a long gestation, a specification will be certified in early May 2015, containing a reference to an implementation.

The Future of Embedded Java

Java has a lot of promise in embedded programming, and there is still a long way to go before it can meet the needs and opportunities of the coming IoT explosion. Over the next few years, tens of billions of dollars of Java-powered devices will be put into use as part of the Internet of Things. My next article on a related topic will use the hobbyist and commercial environments as examples to give concrete examples of Java embedded programming, and to explain in more depth why RTSJ 2.0's impact on Java real-time programming goes far beyond the traditional realm.

Reprinted from: Code Agricultural Network

Alt text

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327042796&siteId=291194637