使用哪些语言进行实时系统编程?

发布于 2024-07-16 06:22:24 字数 1431 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

与君绝 2024-07-23 06:22:24

我是一名航空电子软件工程师。
我能够参与几个开发项目。
我在这些项目中使用的语言是:C、C++ 和 Real-time Java。

C 很棒。
C++ 还不错,但出于安全考虑,C/C++ 需要严格的编码标准,例如 DO-178B。

我认为实时 Java 是可行的方法,但我还没有看到很多航空电子应用程序。

韩国喷气式教练机 T-50 将配备一台运行 RT Java 应用程序的任务计算机,为 HUD 和 MFD 显示器提供服务,以及所有关键任务功能。

I am an avionics software engineer.
I was able to participate in several development projects.
The languages I used in those projects are: C, C++, and Real-time Java.

C is great.
C++ is not so bad but C/C++ require strict coding standards for the safety considerations such as DO-178B.

I think Real-time Java is the way to go but I don't see many avionics applications, yet.

Korean jet trainer T-50 will have a mission computer running RT Java application serving HUD and MFD displays, and all of the mission critical functions.

爱的故事 2024-07-23 06:22:24

Java 实时规范现在有几个商业级的实现:

这些产品跨越了从编译到本机代码 (Aonix) 到 J2ME (aicas、apogee)、到完整的 J2SE (Sun、IBM)。 大多数(如果不是全部)都已经部署了少量安全或关键任务系统,但势头正在增强。 示例包括埃格林空军基地的太空监视雷达现代化 以及美国海军在 DDG-1000/Zumwalt 驱逐舰中使用 RTSJ 。 Sun 还声称在金融交易处理领域进行了部署。

如果您对 RTSJ 感兴趣,我建议您阅读 Peter Dibble 的实时平台编程,或 Wellings 教授的Java 并发实时编程

与此相关的是,还正在进行为 Java 编程语言提供安全关键配置文件的工作,该配置文件构建为 RTSJ 的子集。 此外,还成立了一个专家组来探索分布式 RTSJ DRTSJ,但该工作已陷入停滞。

The Real-Time Specification for Java now has several commercial-grade implementations:

These products span the continuum from compilation to native code (Aonix) to J2ME (aicas, apogee), to full J2SE (Sun, IBM). Most, if not all, have seen deployments in small numbers of safety- or mission-critical systems, but momentum is building. Examples include Eglin AFB's space surveillance radar modernization and the US Navy's use of RTSJ in the DDG-1000/Zumwalt destroyer. Sun also claims deployment in the financial transaction processing domain.

If you are interested in RTSJ, I suggest Peter Dibble's Real-Time Platform Programming, or Professor Wellings' Concurrent and Real-Time Programming in Java.

On a related note, there is also work underway to provide a Safety-Critical profile for the Java programming language, built as a subset of RTSJ. Also, an expert group has formed to explore a Distributed RTSJ DRTSJ, but the work is stalled.

梦断已成空 2024-07-23 06:22:24

本书涵盖了 Ada 95、Java 实时系统和实时 POSIX 扩展(用 C 编程)的使用。 这些都不是直接的领域特定语言。

Ada 95 是 90 年代末常用的编程语言,(据我所知)至今仍广泛用于国防和航空航天工业的实时编程。 至少有一个建立在 Ada 之上的 DSL - SparkAda - 这是一个系统向程序验证工具描述系统特征的注释。

2006 年 4 月 6 日的采访表明了一些构成 Java 实时系统的类和虚拟机发生了变化。 它没有提到任何特定于领域的语言扩展。 我还没有在实时系统中遇到过 Java 的使用,但我也没有研究过我希望找到它的各种系统(我从事航空航天模拟工作,其中使用 C++、Fortran,偶尔也使用 Ada)对于实时在环系统)。

实时 POSIX 是 POSIX 操作系统工具的一组扩展。 作为操作系统扩展,它们不需要语言中的任何特定内容。 也就是说,我可以想到一种基于 C 的 DSL 来描述嵌入式系统 - SystemC - 但我不知道它是否也用于生成嵌入式系统。

书中没有提到的是Matlab,它在过去几年里已经从一个仿真工具变成了一个模型实时系统的驱动开发系统。
Matlab/Simulink 实际上是用于线性编程、状态机和算法的 DSL。 Matlab 可以生成 CHDL 用于实时和嵌入式系统。 很少会看到航空电子设备、电子战或其他国防工业实时职位广告不需要一些 Matlab 经验。 (我不为 Matlab 工作,但很难过分强调它在行业中的普遍存在)

The book covers use of Ada 95, the Java Real-Time System and realtime POSIX extensions (programmed in C). None of these is directly a domain specific language.

Ada 95 is a programming language commonly used in the late 90s and (AFAIK) still widely used for realtime programming in defence and aerospace industries. There is at least one DSL built on top of Ada - SparkAda - which is a system of annotations which describe system characteristics to a program verification tool.

This interview of April 6, 2006 indicates some of the classes and virtual machine changes which make up the Java Real-Time System. It doesn't mention any domain specific language extensions. I haven't come across use of Java in real-time systems, but I haven't been looking at the sorts of systems where I'd expect to find it (I work in aerospace simulation, where it's C++, Fortran and occasionally Ada for real-time in-the-loop systems).

Realtime POSIX is a set of extensions to the POSIX operating system facilities. As OS extensions, they don't require anything specific in the language. That said, I can think of one C based DSL for describing embedded systems - SystemC - but I've no idea if it's also used to generate the embedded systems.

Not mentioned in the book is Matlab, which in the last few years has gone from a simulation tool to a model driven development system for realtime systems.
Matlab/Simulink is, in effect, a DSL for linear programming, state machines and algorithms. Matlab can generate C or HDL for realtime and embedded systems. It's very rare to see an avionics, EW or other defence industry real-time job advertised which doesn't require some Matlab experience. (I don't work for Matlab, but it's hard to over emphasis how ubiquitous it really is in the industry)

唯憾梦倾城 2024-07-23 06:22:24

实时应用程序几乎可以用任何语言进行。 然而,环境(操作系统、运行时和运行时库)必须符合实时约束。 在大多数情况下,实时意味着事情发生的时间总是确定的。 确定性时间通常是微秒/毫秒范围内的非常低的时间值。

实时系统完全依赖于这个标准,因为规范通常会说“每个x(时间段)(做某事|检查某事)”。 如果系统与外部传感器连接并控制救生或危及生命的系统,通常会发生这种情况。

我当时正在开发一个主要用 C/C++ 开发的车载导航和信息娱乐系统,其操作系统专门配置为满足实时约束,以提供实时导航和媒体播放。

但这并不是实时系统的全部:通常,整个系统中算法的选择是根据 Big-O 表示法具有确定性的运行时间,大多使用线性或恒定时间。 其他一切都被认为是不确定的,因此不适用于实时系统。

Real time applications can be made in almost any language. The environment (operating system, runtime and runtime libraries) must however be compliant to real time constraints. In most cases real-time means that there's always a deterministic time in which something happens. Deterministic time being ussually a very low time value in the microseconds/milliseconds range.

Real time systems depend solely on this criteria, as the specificiations usually say something like 'Every x (period of time) (do something | check something)'. Usually this happens if the system interfaces with external sensors and controls life-saving or life-threatening systems.

I was working on an in-car navigation and infotainment system developed mostly in C/C++ with an operating system configured specifically to meet the real-time constraints to provide real-time navigation and media playback.

But this is not all to real-time systems: Usually the selection of algorithms in the entire system is made to have deterministic runtimes according to the Big-O notation, mostly using linear or constant time. Everything else is considered non-deterministic and thus not useable for real-time systems.

别理我 2024-07-23 06:22:24

我使用过的所有实时系统主要是用 C 语言编写的,并带有一些汇编程序,或者主要是用汇编程序编写的,带有少量 C 语言。(取决于我们是在谈论 90 年代及以后,还是 80 年代, )但是,我使用过的一些实时系统使用了(不完全是 DSL)特殊的自制代码生成器。

All of the real-time systems I have worked with were predominantly written in C with some bits of assembler, or written mostly in assembler with little bits of C. (Depending on whether we're talking the 90s and beyond, or the 80s, respectively.) However, some of the real-time systems I've worked with have used -- not exactly DSLs -- special homegrown code generators.

苦笑流年记忆 2024-07-23 06:22:24

面向实时的语言?

什么是实时

首先我们必须定义实时的含义。

当然,取决于您的工具如何在物理环境中工作,纯实时无法有效地完成,主要是因为会有很多第三方依赖项。

如果您使用 arduino 等微控制器构建嵌入内容,则使用的语言将受到硬件的限制,但更多像 Raspberry Pi 这样复杂的东西,语言选择非常广泛。

粒度

这取决于您测量的内容,如果您正在处理:

  • 天气温度,每 10 分钟读取一次可能就足够了
  • 人的身高或体重,一次或可能每天读取四次
  • 服务器状态,从精细调试的 1 秒到安静的不重要辅助服务器的大约 1 小时。
  • 原子碰撞计数:更精细的东西...

基于事件的读取

收集数据的正确(更好)方法是基于值更改事件...只要设备允许。

您的工具不得从设备轮询值,但设备必须在值发生变化时将值发送到您的工具。

例如,这可以通过使用硬件中断触发器或使用RS-232等端口协议在某些串行端口上保持侦听来完成。

监控环境

最后要警告的是合法用户将如何与之交互。

如果您正在构建嵌入式独立设备,例如机器人,您可以使用图形库与触摸屏交互。

如果您正在构建基于网络的监视器,您可能必须记住,客户端可能是旧的 800x600 单色屏幕,使用较差的互联网连接和小型处理器......但取决于最终目标,如果您可以与客户互动,您可以确保强大的硬件和强大的互联网连接。 无论如何,您必须注意连接丢失以及服务器和客户端之间的通信延迟事件。 主要有第三方依赖项。

哪种编程语言?

从那里开始,语言的选择范围很广,并且显然取决于

  • 您的知识。
  • 要求的粒度(当然,也通过使用基于事件的)
  • 您必须构建工具的时间(金钱;)
  • 延迟,同事......
  • 某种设备
  • ,用于监视
  • 其他一些政治原因

您可以构建真实的-使用 ,我见过在 仅...我个人构建了一个基于网络的, 使用 进行太阳能监控,

Real-time oriented language?

What is real-time

First we have to define what real-time mean.

Of course depending on how your tool will work against the physical environment pure real-time couldn't be effectively done, mostly because there will be a lot of third party dependencies.

If you are building embed stuff by using microcontrollers like arduino, the language to use will be limited by the hardware, but with more complex stuff like Raspberry Pi, the language choice is very wide.

Granularity

This is depending on what you are measuring, if you're working with:

  • weather temperatures, one read each 10 minute could be enough
  • people height or weight, one or maybe four read by day
  • server status, between 1 second for fine debugging to approx 1 hour for quiet unimportant secondary server.
  • atomic collision count: something finer...

Event based reading

The right (better) way for collecting data is based on value change event... whenever the device do permit it.

Your tool have to not poll values from device, but the device have to send values to your tool, when they change.

This could be done by using an hardware interrupt trigger or by using port protocole like RS-232 staying listening on some serial port, for sample.

Monitoring environment

The last thing to be warned is how legitimate user will interact with.

If you're building embed standalone device, like robot, you may use graphic libraries to interact with touch screen.

If you're building web based monitor, you may have to keep in mind that the client could be an old 800x600 monochrome screen, using poor internet connection and small processor... But depending on final goal if you may interact with clients, you could ensure strong hardware and strong internet connections. Anyway you have to watch for connexion loosing and event for communication delay between server and client. There is mostly third party dependencies.

Which programming language?

From there, the language choice is wide and clearly depend on

  • your knowledge.
  • granularity requested (by using event-based too, of course)
  • the amount of time you have to build the tool (money;)
  • delay, co-workers...
  • kind of device
  • kind of monitoring
  • some other political reasons

You could build real-time monitoring engine by using and only, I've seen sophisticated engines that was built under only... I've personally built a web based, solar energy monitor by using , and .

花心好男孩 2024-07-23 06:22:24

我不敢相信没有人提到过 LabVIEW 编程语言,它广泛用于实时安全关键系统。 它拥有广泛的库和众所周知的设计模式,用于构建和实现 RT 系统。

National Instruments 还生产各种专为实时应用而设计的硬件(cRIO、PXI 等)。

我们使用 LabVIEW 进行水力压裂(水力压裂),该技术用于安全关键环境。

I cannot believe no one has mentioned LabVIEW programming language which is widely used for Real-time safety-critical systems. It has extensive libraries and well-known design patterns for architecturing and implementing for RT systems.

Also National Instruments makes various hardware (cRIO, PXI and etc) which are designed for real-time applications.

We use LabVIEW for Fracking (Hydraulic Fracturing) which is used in safety-critical environments.

萌无敌 2024-07-23 06:22:24

PLC 运行梯形图和 fbd 代码,这实际上是一种实时 dsl,因为您的选择非常有限,以至于很难以导致不可预测的运行时性能的方式进行编程

PLCs run ladder and fbd code which is really a real-time dsl in the sense that your options are so limited that it is difficult to program in a way that would result in unpredictable runtime performance

瞎闹 2024-07-23 06:22:24

我的 Kickstarter 提供了 C 语言在实时编程中真正有目的的应用 - 以及所有相关问题(例如并行编程)
http://www.kickstarter.com/projects/767046121/crawl -带连接的空间计算
这就是所谓的“广泛编程”,我一生中的大部分时间都在做这件事。 奖励包括一个软件库和一本书——旨在有用。

A really purposeful application of the C language to real-time programming - and all related issues (such as parallel programming) - is offered by my Kickstarter
http://www.kickstarter.com/projects/767046121/crawl-space-computing-with-connel
It is called "Wide Programming" and I've been doing it most of my life. The rewards include a software library and a book - designed to be useful.

橘寄 2024-07-23 06:22:24

我自 2003 年以来一直工作的公司一直在开发和部署 Scada/Mes 平台。 最初的实现始于 1993 年,在 OS/2 上使用 Modula2。 后来(1998年)它被移植到Ada95和Windows。 目前(2019)我们使用 AdaCore 的 Ada 编译器。 我们的系统已移植并部署到 32/64 Windows、HPUX、OpenVMS(最近甚至部署到 Raspberry)。 我们在中欧拥有多个设施(天然气工业、炼油厂、工厂、发电厂)。
我们认为 Ada 的功能为我们的系统提供了高度的可靠性,并防止了许多如果我们使用 C 等语言很容易发生的错误。
另请参阅我的博客
https://www.ipesoft.com/en/博客/d2000 是用什么语言编写的

the company I've been working for since 2003 has been developing and deploying a Scada/Mes platform. Original implementation started in 1993, used Modula2 on OS/2. Later (1998) it was ported to Ada95 and Windows. Currently (2019) we use Ada compiler by AdaCore. Our system was ported and has been deployed to 32/64 Windows, HPUX, OpenVMS (and lately even to Raspberry). We have multiple installation in central Europe (gas industry, refineries, factories, power plants).
We feel Ada's features give our system a high degree of reliability and prevents a lot of errors that would easily occour if we used languages like C.
See also my blog
https://www.ipesoft.com/en/blog/what-language-is-the-d2000-written

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文