在搭载eCos操作系统的嵌入式平台上中文输入法的实现

 2022-09-04 08:09

论文总字数:28038字

摘 要

嵌入式系统属于一种为特定的应用而专门设计的计算机系统,嵌入式系统的软硬件均可接受裁减,从而达到专用,降低成本、体积、功耗,提升可靠性等目的。在我国用户与嵌入式设备交互的过程中,中文输入法作为检索需要用到的工具,往往是这些嵌入式设备中不可缺少的一部分。T9输入法(全名智能输入法)以输入字符高效快捷著称,因为嵌入式设备的便携特性,T9输入法成为了嵌入式设备中最为常用的中文输入法。

本文介绍了嵌入式系统的概况、发展和应用以及eCos(embedded Configurable operating system 嵌入式可配置操作系统)这种适合与硬件资源受限的嵌入式设备的操作系统,并且介绍了在搭建eCos操作系统的嵌入式设备上实现中文输入法,包括构建字库、词库索引表,围绕字库设计算法,从而实现输入法的基本的全拼功能、加快用户输入速度的首拼功能、词汇联想、整词输入、自动添加拼音分隔符等功能,除此之外,还实现了中文笔画输入法和英文、数字的输入,在完成程序的设计和编写后,将程序通过串口移植到搭载eCos操作系统的家庭影音多媒体播放器设备上,完成编译、测试工作。

关键词:嵌入式系统,eCos,T9,中文输入法

Abstract

Embedded system is a computer system specially designed for particular applications. the hardware and software of the embedded system can be reduced to achieve the purposes of application specific, improving reliability, reducing costs, size, power consumption etc. In the process of dealing with these embedded devices, the Chinese input method is an indispensable tool as a way to lookup information on these embedded devices. T9 input method is famous for its highly efficiency, as a result, because of the portable features of the embedded device, the t9 input method becomes the most commonly used Chinese input method in embedded devices.

This article not only introduces the eCos (embedded Configurable operating system embedded embedded operating system) which is suitable for highly hardware resource constrained embedded devices, but also describes realizing Chinese input method on those embedded equipments. Including the construction of the Chinese character table, the Chinese vocabulary index table, besides design algorithm based on the Chinese character table, in order to achieve the basic full spell function, and the first pinyin letter spell function which increase users’ speed to input , vocabulary association, the whole word input, automatically add pinyin separators and other functions just as the input method which depends on the strokes of the Chinese character as well as the English and number input method. After the completion of the program design and coding, the program will be ported to the media player equipment which equipped with eCos operating system,through the serial port, and then complete the compilation and testing work.

KEY WORDS: embedded operating system, eCos, T9, Chinese character input method

目 录

摘要 ……………………………………………………………………………………………Ⅰ

Abstract …………………………………………………………………………………… Ⅱ

第一章 前言和背景知识 1

1.1前言 1

1.2嵌入式系统的诞生和发展 1

1.2.1硬件的发展 1

1.2.2软件的发展 2

1.3嵌入式操作系统 2

1.4 eCos简介 3

第二章 中文输入法概述 6

2.1项目综述 6

2.2汉字编码 7

2.3全拼功能描述 7

2.4首拼和不完全输入功能描述 8

2.5词汇联想功能描述 9

2.6整词输入功能描述 10

2.7自动添加分隔符功能描述 12

2.8对输出的Text的处理功能描述 12

2.9附加功能简述 13

第三章 开发环境搭建和输入法的总体架构设计 15

3.1配置工具搭建 15

3.2程序移植和编译 16

3.3开发平台架构和物理结构设计 16

3.4 T9输入法功能模块介绍 17

3.4.1数字键2-9处理模块 17

3.4.2解析匹配数字串模块 18

3.4.3汉字输入模块 18

3.4.4功能按键处理模块 18

第四章 T9输入法程序设计 19

4.1索引方式设计 19

4.1.1单字输入索引 20

4.1.2词汇联想索引 21

4.1.3整词输入索引 22

4.2系统逻辑流程 23

4.3主要的外部接口设计 25

4.4主要的内部接口设计 26

第五章 总结 30

致 谢 31

参考文献 32

第一章 前言和背景知识

1.1前言

作为我们在计算机系统上使用频率最高的应用程序,中文输入法是指将汉字输入到计算机、手机等电子设备的一种编码方式。中文输入法自诞生起自身也经历过各种大大小小的进化,总的来说,其进化方向总是朝着实用、简洁,更加智能和使用户的输入更准确、方便。嵌入式设备的特点是软硬件均可接受裁减,从而达到专用、降低成本、体积、功耗,提升可靠性等目的。而又受限于嵌入式设备自身的特点,在嵌入式设备上实现全键盘输入并不现实,因此,一种只用九个按键输入的T9输入法就成为了嵌入式系统中最为常用的输入法。

本文针对eCos操作系统的环境,分析比较了其相对于其他嵌入式系统的优势和缺点。在此基础上,探讨了在公司搭载eCos操作系统的嵌入式设备上设计T9中文输入法和实现输入法首拼、全拼以及联想功能的具体的开发步骤及其实现过程。

1.2嵌入式系统的诞生和发展

嵌入式设备源于计算机技术,它的产生和发展都与计算机技术息息相关,但是嵌入式设备又保持着其自身的特点。人们所认知的最早的嵌入式系统之一是Apollo Guidance Computer,在项目的初期,为了减少AGC的体积和重量,使用了当时最新的单片式集成电路而被认为是相当冒险的。因为20世纪60年代人们对嵌入式系统的早期尝试,随着20世纪70年代微型机的出现,以及微型机嵌入式不断的专用化,进入了嵌入式系统独立的微控制器发展时期。

1.2.1硬件的发展

1971年,因特尔公司开发出4004微处理器成功地将算术运算器和控制电路集成在一起,形成了单片微型计算机(SCM,Single Chip Microcomputer),这也标志着嵌入式处理器概念的出现。单片机的出现大力推动了嵌入式系统在工业领域的广泛应用。整个80年代,随着电子工业技术的提高,单片机的体积得以大大缩小,功耗能够进一步降低,片内资源也更加的丰富。而此时得到加强的单片机也被称之为微控制器(MCU,Micro Controller Unit)。

剩余内容已隐藏,请支付后下载全文,论文总字数:28038字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;