• 沒有找到結果。

行動裝置個人化搖動解鎖

N/A
N/A
Protected

Academic year: 2021

Share "行動裝置個人化搖動解鎖"

Copied!
56
0
0

加載中.... (立即查看全文)

全文

(1)

國立台灣科技大學資訊工程系

100 學年度第 1 學期專題研究 總報告

行動裝置個人化搖動解鎖

研 究 組 員

王牧得 B9815013

許國輝 B9815016

吳宗祐 B9815043

陸家鈞 B9815047

指導老師 :

中 華 民 國 一百零二 年 二 月 十八 日

(2)

目錄

摘要………3

一、 緒論 (一)、研究動機………..5

(二)、研究目的………..5

二、 相關研究 (一)、手機感測器………..7

(二)、Android 手機螢幕解鎖相關程式與函式庫……..12

(三)、背景執行服務(Service)……….……….17

三、 系統架構 (一)、主要核心: 手機內部感測器……….21

(二)、操作系統流程………21

四、 程式流程 (一)、錄製及驗證………23

(二)、如何解鎖………27

(三)、Service 流程………...32

五、 專利申請 (一)、全額補助聲明書………34

(二)、台灣專利………35

(三)、美國專利………40

六、 成果展示……….47

七、 結論 (一)、完成度………53

(二)、實用性………53

(三)、未來發展性………54

八、 參考文獻……….55

(3)

3

摘要

近年來,智慧型手機已逐漸深入民眾的生活,不論食、衣、住、行、育、

樂, 皆提供許多方便的應用。而在 Apple 的 App Store 和 Google 的 Google Play內, 已存在許多資訊科技人員開發的應用程式,對於開發人員而 言,如何創造出使人 們生活趨於便利的應用已成了一項重要課題。

在這次專題研究中,我們從現有的技術發想,現今有了語音控制的系 統,智慧型手機從我們講出的話語中做解讀和分析,做出我們要的需求;

以此類推,如果今天我們手持智慧型手機,揮出常做的動作並做出某種指 定功能,是不是也是一種很快又直覺的操作方式呢?例如:揮出直覺性的 假想圓形手勢,便執行解鎖;又或者是,右手拿起手機,就可以直接撥電 話給指定的聯絡人。所以我們的專題研究的方向,就是讓智慧型手機也懂 我們的手勢並執行特定功能。

本系統大致需要的就是,智慧型手機、方向感測器、加速度感測器等,

而本研究的核心-驗證,是我們最關鍵卻也費了最大功夫的成功點,因此

我們也已經提出了台灣與美國專利申請來保護我們的新構想。

(4)

(5)

5

(一)研究動機

現行的智慧型手機,螢幕有越來越大的趨勢,從 3.5、4.3、4.8 到現在 5.5 吋,讓使用者越來越無法只用單手就可以操控它,此時必然使用智慧型 手機的第一個動作,就是『解鎖』 ,雖然他是一個簡單的動作,但是這是每 天頻繁而且必須被執行到的功能;且如果使用者是女性,那必然更難操控 它了。此外,使用者每天對螢幕做解鎖的動作,螢幕就會殘留每次解鎖的 軌跡,這樣將會導致個人的資安受到危害。

(二)研究目的

為了因應智慧型手機螢幕越來越大的趨勢,我們想到另一種可以擺脫用 手觸碰螢幕才『解鎖』的方法,又可以單手對智慧型手機操作的方法。此 法就是利用手機裡的感測器,事先錄製好特定手勢動作軌跡,啟動後,開 始層層關卡比對手勢動作,驗證正確後,手機按鍵鎖便解除鎖固狀態。此 研究不僅只針對手機的解鎖功能,最大的核心在於錄製、比對、進行一種 功能,除了解鎖功能,此研究的方向包含常用的功能-「手機搖動撥號」、

「手機摔落提醒」,此研究將帶來更快速、更直覺的操作方式。

(6)

(7)

7

(一) 手機感測器

在討論 G+M solution (加速度器+地磁感測器解決方案)的應用前,就要 先介紹 G sensor 的製程與架構,也必須先了解何謂 MEMS (micro electronic mechanical system 微機械電子系統),因為 MEMS 技術的演進,包含電容 製程的陀螺儀(Gyro)與加速度儀(G sensor)感測器,才能越做越小,小到足 以放進講究輕薄短小及功能強大的智慧型手機內。

電子羅盤會沿著當地磁場指向決定方向,這個方向通常為當地的磁北。

因為磁北和真北不相同,所以磁北和真北通常不在一起的。這偏差被成作 磁偏角(declination angle),簡單說它是磁北和地理北之間的角度差,表示為 偏東的或偏西的方向。

 傾角對方向角的影響 (圖片提供 Honeywell)

所以 3 軸的電子羅盤必須搭配 3 軸的 G sensor 做傾角補償,如果不想

加入 G sensor 的話,那就得保證裝置在使用時永遠是保持水平的狀態。可

(8)

8 參考下圖 Mcu 接收到 G sensor 與 compass 的輸出後透過公式即可算出方向 角度並做傾角補償。

 G+M 架構 (圖片提供 Honeywell)

G sensor 顧名思義就是偵測 g 力的大小及動作方向,而將 G sensor 擺 水平時,會有 1g 的地心引力會在 Z 軸,隨著改變裝置的同時 g 值會在不 同軸向做變化,就可以知道姿態的變換。也因為這個特性,在 G sensor 靜 止時,可以藉由 arcSin/ arcCos 的公式去運算出傾斜角度,這個傾斜角度可 以延伸出更多的應用。

 G 值分佈在不同軸向示意圖(圖片提供 Kionix)

(9)

9

 G 值轉換成角度基本公式(圖片提供 Kionix)

Compass(電子指南針)

欲使用手機感測器,必須創建 SensorManager(感測器管理者),在電子 指南針中,我們需要使用的是 SENSOR_ORIENTATION(方向感測器),最 上面兩段就是在註冊使用方向感測器的使用權限。

最下面的一段, onSensorChanged ,他的作用就是當感測器有在變化時(也 就是說當手機有在晃動),則啟動該框框內程式碼,當中的 values[0]就是取 方向感測器的第一個數值,其代表的就是該手機相對北方的相差的度數,

即偏北角。

而該 class-rose(於完整程式碼中)在做的就是將偏北角輸入後,將圖形繪

製出來並顯示在螢屏上。

(10)

10 以下為摘要程式碼:

SensorManager sensorManager;

static final int sensor = SensorManager.SENSOR_ORIENTATION;

...

public void onResume() { super.onResume();

sensorManager.registerListener(this, sensor);

}

...

public void onSensorChanged(int sensor, float[] values) { if (sensor != Compass.sensor)

return;

int orientation = (int) values[0];

rose.setDirection(orientation);

}

完整程式碼 參考文獻 2.1.1

(11)

11 簡易的 Android 滾球遊戲

如同電子指南針,都是在感測器在晃動時,該程式就會自動去執行該框 框內之程式碼,在這個遊戲中,他擷取了 X 跟 Y,分別就是 X 跟 Y 軸當下 所施的力,其大小大約是介於在-25 至+25 之間,把玩了一陣子,對於施予 的力量及方向相對其給予的數值能有相呼應。

以下為摘要程式碼:

@Override

public void onAccelerometerChanged(AccelerometerData pAccelerometerData) { this.mGravityX = pAccelerometerData.getY() * 2;

this.mGravityY = pAccelerometerData.getX() * 2;

if(this.mGravityX > con)

this.mGravityX = con;

if(this.mGravityY > con)

this.mGravityY = con;

if(this.mGravityX < con * (-1))

this.mGravityX = con * (-1);

if(this.mGravityY < con * (-1))

this.mGravityY = con * (-1);

this.mTempVector.set(this.mGravityX, this.mGravityY);

this.mPhysicsWorld.setGravity(this.mTempVector);

}

完整程式碼 參考文獻 2.1.2

(12)

12

(二)Android 手機螢幕解鎖相關程式與函式庫

Android 系統關閉行動裝置螢幕鍵盤鎖關閉與重新啟動方法 Public Class KeyguardManager.KeyguardLock

 Extends object

Public Methods

Void

disableKeyguard ()

Disable Keyguard from showing.

Void

reenableKeyguard ()

Re-enable the keyguard.

Inherited Methods

 From class java.lang.Object

當行動裝置螢幕鍵盤被鎖定須依照特定方式解除才能正常使用時,

disableKeyguard ( ) 函式可以在裝置之電源尚未關閉或待命前解除行動裝 置鎖定狀態,讓使用者操作自由而不需要解除鎖定;在使用

reenableKeyguard ( ) 啟動回來前,即使按下鎖定按鍵也不會再度被鎖定

(13)

13 解鎖範例程式:

package com.android;

…….

import android.app.KeyguardManager;

import android.app.KeyguardManager.KeyguardLock;

public class HelloTest extends Activity { @Override

public void onCreate(Bundle savedInstanceState) {

…….

KeyguardManager keyguardManager =

(KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);

KeyguardLock Keylock =

keyguardManager.newKeyguardLock(Activity.KEYGUARD_SERVICE);

Keylock.disableKeyguard(); // 自動解鎖 }

}

此範例為當程式執行後,即解除手機螢幕鎖,最後一行

disableKeyguard( )即為解除之動作,將其改回 reenableKeyguard( )則可以恢

復手機螢幕鎖。

(14)

14 Android 手機可供設定之電源狀態

public class PowerManager

 extends Object

 PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);

 PowerManager.WakeLock wl = pm.newWakeLock( PowerManager.FlagValue, "Tag")

Flag Value 可以選擇使用者想設定的電源狀態,以下為四種可選擇的狀態

Flag Value CPU Screen Keyboard

PARTIAL_WAKE_LOCK On* Off Off

SCREEN_DIM_WAKE_LOCK On Dim Off

SCREEN_BRIGHT_WAKE_LOCK On Bright Off

FULL_WAKE_LOCK On Bright Bright

PARTIAL_WAKE_LOCK:

將行動裝置處理器永遠保持運作,即使按下電源按鍵手機螢幕關閉,處理 器也還是保持運作(此設定須小心使用,以免造成電池快速損耗)

SCREEN_DIM_WAKE_LOCK:

當行動裝置放置一段時間不動作後,螢幕將會關閉背光,但是顯示器仍然

有顯示畫面,而鍵盤則關閉

(15)

15 SCREEN_BRIGHT_WAKE_LOCK:

當行動裝置放置一段時間不動作後,螢幕與背光保持顯示,僅鍵盤關閉。

FULL_WAKE_LOCK:

當行動裝置放置一段時間不動作後,螢幕與背光保持顯示,鍵盤也正常運 作取得手機電源狀態設定的權限,讓程式可以改變手機原先設定好的狀態。

Android 取得電源設定與回覆原先設定

public class PowerManager

 extends Object

Public Methods

Void

acquire()

Makes sure the device is on at the level you asked when you created the wake lock.

Void

release ()

Release your claim to the CPU or screen being on.

Inherited Methods

 From class java.lang.Object

當程式設定好要改變的電源狀態後(例如:PARTIAL_WAKE_LOCK),

則使用函式 acquire ( ),取得控制權改變原先電源設定狀態;而當需要回復

原先狀態時,則使用 release ( )函式,回到手機原先標準電源狀態。

(16)

16 範例程式:

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);

PowerManager.WakeLock wl =

pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");

wl.acquire();

..screen will stay on during this section..

wl.release();

第二行程式設定完欲啟動的電源狀態”SCREEN_DIM_WAKE_LOCK”

後,執行 acquire( )則馬上變更電源狀態,直到 release( )後,才恢復原先預 設電源狀態。

完整程式碼 參考文獻 2.2.1

(17)

17

(三)背景執行服務(Service)

Service 介紹:

今有一使用者欲「聽音樂」與「玩遊戲」,以熟知的 activity 生命週期 來說,使用者必須聽完音樂才能玩遊戲,或者必須玩完遊戲才能聽音樂,

兩件事情不能同時做。有鑑於此,本隊決定致力研究 Android 提供另一程式 生命週期-service 來達成上述事項。以下則是簡單的比較上述所提及的案 例:

Activity 生命週期:

解說:一旦開始了,就是結束或暫停。

Service 生命週期:

解說:開始進入綁縛狀態以後,代表 Android 已另外安排執行緒來執 行 Service 內的程式段,只要未經呼叫 onDestroy()方法,該執行緒就會一直 在背景執行。

onCreate() → onStart() → onStop()

↘ onPause()

onStart() → onBind() → onDestory()

(18)

18 經由 Activity 開啟 Service 之後:

第 5 行:Bind 住該 Service。

第 10~13 行:創立一音樂播放程式,並指定音源檔 amelie 使其持續 播放。

第 15~18 行:一受到意圖呼叫便開啟先前宣告的音樂播放程式 player。

第 20~23 行:停止該 Service。

1: public class MusicService extends Service { 2: private static final String TAG = "MusicService";

3: MediaPlayer player;

4: @Override

5: public IBinder onBind(Intent arg0) { 6: // TODO Auto-generated method stub 7:

return null;

8: }

9: @Override

10: public void onCreate() {

11: player = MediaPlayer.create(this, R.raw.amelie);

12: player.setLooping(false); // Set looping 13: }

14: @Override

15: public void onStart(Intent intent, int startId) { 16:

super.onStart(intent, startId);

17: player.start();

18: }

19: @Override

20: public void onDestroy() { 21:

super.onDestroy();

22: player.stop();

23: }

24: }

(19)

19 使用 Service 應注意之要件

如欲應用 Service,必須在 AndroidManifest.xml 檔及.java 檔應用以及宣告其 對應的關鍵字:

此外,由於 Service 不得單獨存在,必須由一 Activity 發動 intent(意圖)方 法啟動之;因此必須在啟動 Service 之 Activity 底下呼叫 StartService 方法,

以開啟 Service 才能完成 Service 之啟動。

Service 要件:.java 檔

public class MusicService extends Service{}

@Override

public IBinder onBind

@Override

public void onStart(Intent intent, int startId){}

@Override

public void onDestroy() {}

Service 要件:AndroidManifest.xml 檔

<service android:enabled="true" android:name=".Service" />

(20)

(21)

21

(一)主要核心: 手機內部感測器

(二)操作系統流程

1.錄製動作

啟動本程式(Start)

選擇「錄製」進行動作側錄

(Press record to read input)

由手持裝置感應器讀進參數 值進行儲存,作為日後驗證依 據(Store the attributes for verifying )

2.比對驗證

是否符合先前儲存的資料

(Verify if matched)

使用觸發方法(Utilize triggering method)

設定為背景待機偵測

(Set as standby mode)

解鎖

(Unlock)

Yes

No

(22)

(23)

23

(一)錄製及驗證

關卡驗證 V.S.區段驗證

關於動作錄製及驗證方面,我們有考慮到兩種方法,一種是關卡驗證,

另一種則是區段驗證;以下為兩種驗證方式的介紹:

區段驗證:將使用者從起始到結束所做的動作錄製起來,於下次使用者揮 出同樣動作時,取得該段動作資訊去跟錄製動作做比對,如果在一定誤差 值範圍內則認定通過。

關卡驗證:將使用者做出動作期間,以一定時間間隔作為關卡設置,並將 該時間點之當下位置及速度等資訊紀錄下來,等到使用者下次揮出相同動 作時,如果當下該時間點之資訊與錄製之資訊相符合,則進行下一個時間 點驗證。

結論:由上述所示,區段驗證的缺點甚多,第一,起始時間難以取得;第 二,錄製資訊與使用者下次揮動之資訊,資料上難以校正;第三,應用上 面如果採區段驗證,在驗證方面,較關卡驗證耗時。所以我們最後採用關 卡驗證來實作。

[錄製及驗證需要參數]

1. int TimesOfRecord=0,n=3;

2. float error=20,Aerror=(float) 5;

//error(Orientation誤差值設定) //Aerror(Accelerometer誤差值設定)

3. boolean Record=true,Verify=false;

4. float[][] gesture=new float[25][5];

//Record gesture by 2 values of Orientation & 3 values of Accelerometer

5. float Ax=0,Ay=0,Az=0,Oy=0,Oz=0;

//Initial

6. long time = new Date().getTime();

7. SensorManager smgr;

(24)

24 [錄製動作主程式]

//Get 5 values when Sensors change(每當手機位置有作改變就會執行一次)

//When Record is true, it’ll record mobile position(user gesture) every time per 200ms

public void onSensorChanged (int sensor, float[] values) { if (sensor == SensorManager.SENSOR_ORIENTATION) {

Oy = values[SensorManager.DATA_Y];

Oz = values[SensorManager.DATA_Z];

}

if (sensor == SensorManager.SENSOR_ACCELEROMETER) { Ax = values[SensorManager.DATA_X];

Ay = values[SensorManager.DATA_Y];

Az = values[SensorManager.DATA_Z];

}

if(Record==true){

long now = new Date().getTime();

if(now-time>200&&TimesOfRecord<25){

gesture[TimesOfRecord][0]=Oy;

gesture[TimesOfRecord][1]=Oz;

gesture[TimesOfRecord][2]=Ax;

gesture[TimesOfRecord][3]=Ay;

gesture[TimesOfRecord][4]=Az;

time=now;

TimesOfRecord++;

}

tv.setText("Record times : "+TimesOfRecord);

} }

(25)

25 //When App is running, till listen to Orientation & Accelerometer

//When quit App, stop listening

[驗證動作主程式]

//Get 5 values when Sensors change(每當手機位置有作改變就會執行一次)

@Override

protected void onResume() { super.onResume();

smgr.registerListener( this,

SensorManager.SENSOR_ORIENTATION | SensorManager.SENSOR_ACCELEROMETER, SensorManager.SENSOR_DELAY_UI);

}

protected void onStop() { smgr.unregisterListener(this);

super.onStop();

}

public void onSensorChanged (int sensor, float[] values) { if (sensor == SensorManager.SENSOR_ORIENTATION) {

Oy = values[SensorManager.DATA_Y];

Oz = values[SensorManager.DATA_Z];

}

if (sensor == SensorManager.SENSOR_ACCELEROMETER) { Ax = values[SensorManager.DATA_X];

Ay = values[SensorManager.DATA_Y];

Az = values[SensorManager.DATA_Z];

}

(26)

26 //if gesture matches in between positive & negative error

//go next position, just n++, n means position of gesture record

//if n is equal TimesOfRecord, it means gesture matched //it’ll unlock and show text

long Tnow = new Date().getTime();

if(Tnow-time>5&&n<TimesOfRecord){

if(Oy<gesture[n][0]+error&&Oy>gesture[n][0]-error&&Oz<ge sture[n][1]+error&&Oz>gesture[n][1]-error&&Ax<gesture[n][2]+

Aerror&&Ax>gesture[n][2]-Aerror&&Ay<gesture[n][3]+Aerror&&Ay

>gesture[n][3]-Aerror&&Az<gesture[n][4]+Aerror&&Az>gesture[n ][4]-Aerror)

n++;

if(n==TimesOfRecord){

stop_sound.play(stop_id, 1, 1, 0, 0, 1);

n=0;

Toast print = Toast.makeText(Unlock_Service.this,

"unlock", Toast.LENGTH_LONG);

print.show();

}

time=Tnow;

} }

(27)

27

(二)如何解鎖

一般解鎖方式

但是由於手機在待機狀態(螢幕鍵盤鎖定)時,手機將會自動進入待命模式,

只保留少數基本運作,以節省電力,此時非必要的功能都會被關閉,而”感 應器”與”CPU”也將不再受使用者或應用程式支配。

替代方案

(28)

28 因此,我們必須設定手機電源,讓其保持啟動,以便我們使用感應器 偵測資訊,並使用 CPU 運算比對資料,比對成功後,再使用指令將螢幕鍵 盤鎖解除。

而電源狀態設定為”PARTIAL_WAKE_LOCK”即可讓 CPU 保持運作,

但螢幕與鍵盤都關閉,這樣而來就可以讓手機在鍵盤與螢幕鎖定狀況下,

執行動作變析與解鎖。

取得權限

在程式可控制手機螢幕鍵盤鎖與電源狀態前,Android 規定開發者必須先取 得相對應的權限,在 AndroidManifest.xml 中輸入以下兩段指令:

1. <uses-permission

android:name="android.permission.DISABLE_KEYGUARD"/>

2. <uses-permission android:name="android.permission.WAKE_LOCK"/>

第一行” permission.DISABLE_KEYGUARD”

 取得應用程式可解除螢幕鍵盤鎖的權限 第二行” permission.WAKE_LOCK”

 取得變更電源狀態的權限

(29)

29 程式撰寫

導入函式庫與宣告

1. ...

2. import android.app.KeyguardManager;

3. import android.app.KeyguardManager.KeyguardLock;

4. import android.os.PowerManager;

5. import android.os.PowerManager.WakeLock;

6.

7. public class Unlock_Service extends Service implements SensorListener { 8. //private Handler handler = new Handler();

9. KeyguardManager keyguardManager;

10. KeyguardLock Keylock;

11. PowerManager powerManager;

12. WakeLock wakeLock;

13. ...

14. }

前面 2~5 行將會使用到的鍵盤鎖與電源管理函式庫導入,才可以使用其函 式庫內定義的功能與物件;而 9~12 行則是在宣告我們後面將會使用到的解 鎖與電源管理物件

程式執行後初始狀態

1. public void onStart(Intent intent, int startId) { 2. ...

3. keyguardManager =

(KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);

4. Keylock =

keyguardManager.newKeyguardLock(Activity.KEYGUARD_SERVICE);

5. powerManager =

(PowerManager)getSystemService(Context.POWER_SERVICE);

6. wakeLock

=powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,

"Gank");

7. wakeLock.acquire();

8. }

(30)

30 當程式執行後,宣告解鎖事件與電源管理事件後,並設定電源狀態

成”PARTIAL_WAKE_LOCK”`,CPU 永遠啟動後,於第 7 行正式變更電源 設定。

感應器啟動比對

1. public void onSensorChanged (int sensor, float[] values) { 2. ...感應器取得資訊後與原先資料做比對

3. If(動作一致)

4. Unlock();

5. }

當感應器偵測到資訊後即與原先資料做比對,當比對後結果符合,則啟動 解鎖副程式。

解除螢幕鍵盤鎖

1. void Unlock() 2. {

3. Keylock.disableKeyguard();

4. KeyguardManager.OnKeyguardExitResult keyguardExitResultListener = 5. new KeyguardManager.OnKeyguardExitResult()

6. {

7. public void onKeyguardExitResult(boolean success) { 8. // TODO Auto-generated method stub

9. if(success)

10. Log.e(tag,"successfull to do Keyguard exit");

11. else

12. Log.e(tag,"fail to do Keyguard exit");

13. } 14. };

15. Keylock.reenableKeyguard();

16. }

(31)

31 第 4 行為解除螢幕鍵盤鎖指令,第 7 行” onKeyguardExitResult(boolean success)”則為用來判斷是否成功解除螢幕鍵盤鎖函式,而第 4~14 行則為記 錄關閉螢幕鍵盤鎖是否成功,做為 debug 用途;第 15 行則為將螢幕鍵盤鎖 重新啟動回去,以讓下次使用者按下鎖定按鍵仍可以發揮作用,所以當成 功解除後必須啟動回去。

回復電源狀態到預設值

1. public void onDestroy() { 2. ...

3. wakeLock.release();

4. }

最後在程式執行結束後,要將電源狀態回復到原先預設值(CPU 會休眠),否

則電力將會一直耗損下去。

(32)

32

(三) Service 流程

Service 流程:

1. 由上一層 Activity 程式,藉由 intent 方法,指派一執行緒,讓 Service 能 常駐於背景執行「驗證」 。

2. 進入偵測時,正常流程如下:

(1).

但假設欲更換錄製之動作,必須先行中止先前啟動的 Service,否則會出 現兩個驗證執行緒在搶著驗證同一個動作的情形,如下所示:

(2).

以錄製與讀入之 否

動作做驗證

是 解鎖

以「錄製

1

」與讀

入之動作做驗證

是 解鎖

以「錄製

2

」與讀

入之動作做驗證

是 解鎖

(33)

( 台 灣 及 美 國 雙 案 受 本 校 科 權 會 全 額 補 助

(34)

34

(一) 全額補助聲明書

(二) 台灣專利說明書(節錄;目前進度:已提申)

(35)

35

發明專利說明書

( 本 說 明 書 格 式 、 順 序 , 請 勿 任 意 更 動 , ※ 記 號 部 分 請 勿 填 寫 )

※ 申請案號: 101134383

※ 申請日: ※I P C 分類:

一、發明名稱: (中文/英文)

電子裝置及其控制方法/ AN ELECTRONIC DEVICE AND THE CONTROLLING METHOD THEREOF

二、中文發明摘要:

本發明揭露了一種電子裝置及其控制方法,更明確的說,

本發明係揭露了一種得利用其加速度感測器來輸入、比對使用 者設定的加速度資料進而於指定狀況中提供一指定功效的電 子裝置以及其操控方法。藉此,本發明的電子裝置以及其操作 方法讓使用者得應用一由自己定義的三維動作以為指定功能 的啟動指令,讓使用者得以更靈活且簡單的方式來對電子裝置 進行應用。

三、英文發明摘要:

The present invention discloses an electronic device and the controlling method thereof. More specifically, both of the devices and method of the present invention is capable of providing a predetermined function in a predetermined situation by inputting and comparing an accelerating data generated by an accelerator sensor. Thus, the present invention allows the user to define a three dimensional action path as the active requirement of a predetermined function. Accordingly, the user is capable of applying the electronic device with more flexibility and less limitation thereof.

四、申請專利範圍:

(36)

36 1﹑ 一種電子裝置的操作方法,其包含以下步驟:

提供一基準資料,該基準資料係包含有該電子裝置於使用者 進行動作時所檢測到的一第一加速度模式;

記錄該電子裝置於使用者進行動作時所檢測到的一第二加速 度模式並將其設定為一驗證資料;以及

將該基準資料以及該驗證資料進行比對,若該基準資料與該 驗證資料相呼應時,則啟動一對應的指定功能。

2﹑ 如申請專利範圍第1項所述之方法,在該提供一基準資料之 步驟前,其進一步包括一基準資料錄製步驟,其包含:

記錄該電子裝置於使用者進行動作時所檢測到的該第一加速 度模式並將其設定為該基準資料。

3﹑ 如申請專利範圍第1項所述之方法,其中該第一加速度模式 或該第二加速度模式係分別包含有複數個接續的加速度因 子,該等複數個加速度因子係分別地包含有一加速度方向以 及一加速度大小。

4﹑ 如申請專利範圍第1項所述之方法,其中該基準資料以及該 驗證資料之比對方式係利用比例法或階段式驗證法。

5﹑ 如申請專利範圍第1項所述之方法,其中該指定功能係選自 於由一使用者介面解鎖功能、一音源播放功能、一撥號功能 以及一警示音功能所組成的群組。

6﹑ 一種電子裝置,其包含:

一記憶體,其係儲存有一操作軟體以及一基準資料,該操作 軟體係具有一軟體介面,並且該基準資料係包含有該電子裝 置於使用者進行動作時所檢測到的一第一加速度模式;

一顯示屏,其用於顯示該操作軟體之該軟體介面;

一加速度感測器,其係用於感測該電子裝置所接受的加速度

(37)

37 模式;

一處理器,其係耦接至該顯示屏、該記憶體以及該加速度感 應器;

一功能模組,其係耦接至該處理器並且係受該處理器之控 制,以提供一指定功能;以及

一分析模組,其係耦接至該處理器並可根據該處理器之指令 來執行以下步驟:

記錄該電子裝置於使用者進行動作時所檢測到的一第二加速 度模式,並將其設定為一驗證資料;以及

將該基準資料以及該驗證資料進行比對,若該基準資料與該 驗證資料相呼應時,則啟動一對應的指定功能。

7﹑ 如申請專利範圍第6項所述之方法,其中該第一加速度模式 或該第二加速度模式係分別包含有複數個接續的加速度因 子,該等複數個加速度因子係分別地包含有一加速度方向以 及一加速度大小。

8﹑ 如申請專利範圍第6項所述之電子裝置,其中該基準資料以 及該驗證資料之比對方式係利用比例法或階段式驗證法。

9﹑ 如申請專利範圍第6項所述之電子裝置,其中該指定功能係

選自於由一使用者介面解鎖功能、一音源播放功能、一撥號

功能以及一警示音功能所組成的群組。

(38)

38

五、圖式:

▲流程圖

(39)

39

▲程式運作示意圖

(40)

40

(三) 美國專利(節錄;目前進度:與事務所校稿)

What is claimed is:

1. A controlling method of an electronic device, comprising the following steps of:

S3: automatically obtaining a reference data from a memory, the reference data comprising a plurality of acceleration factors, each of the plurality of acceleration factors comprising a plurality of acceleration vector data and a plurality of acceleration dimension data;

S4: automatically obtaining a verifying data from the memory, the verifying data having a plurality of acceleration factors, each of the plurality of acceleration factors comprising a plurality of acceleration vector data and a plurality of acceleration dimension data;

S5: automatically comparing the reference data with the verifying data so as to generate an control signal by a CPU; and S6: automatically activating a pre-determined function in accordance with the control signal.

2. The method of the claim 1, further comprising the following steps:

S1: utilizing an acceleration sensor to generate the reference data in accordance with the acceleration applied to the electronic device and storing the reference data to the memory.

3. The method of the claim 1, further comprising the following steps:

S2: utilizing an acceleration sensor to generate the verifying data

(41)

41 in accordance with the acceleration applied to the electronic device and storing the verifying data to the memory.

4. The method of the claim 1, wherein the reference data and the verifying data respectively comprise a plurality of subsequent orientation factors, each of the plurality of the orientation factors comprises a plurality of orientation vector data and a plurality of orientation dimension data.

5. The method of the claim 1, wherein the pre-determined function comprises a user interface unlocking function.

6. An electronic device, comprising:

a display, utilized to display a user interface;

an acceleration sensor, utilized to sense the acceleration of the electronic device;

a functional module, utilized to provide a pre-determined function;

a memory, utilized to store an interface data and a verifying procedure data, the interface data comprising a user interface, the verifying procedure data comprising the following procedures of:

obtaining a reference data, the reference data comprising a plurality of acceleration factors and being generated by the acceleration sensor;

obtaining a verifying data, the verifying data comprising a

(42)

42 plurality of acceleration factors and being generated by the acceleration sensor;

comparing the reference data with the verifying data so as to generate a control signal; and

activating the pre-determined function in accordance with the control signal; and

a CPU, coupled with the display, the acceleration sensor, the functional module and the memory, the CPU utilized to operate the verifying procedure so as to activate the functional module while the reference data is matched with the verifying data.

7. The electronic device of the claim 6, wherein the reference data and the verifying data are defined by the user.

8. The electronic device of the claim 6, wherein the reference data and the verifying data respectively comprise a plurality of subsequent acceleration factors, each of the plurality of the acceleration factors comprises a plurality of acceleration vector data and a plurality of orientation dimension data.

9. The electronic device of the claim 6, wherein the reference data and

the verifying data respectively comprise a plurality of subsequent

orientation factors, each of the plurality of the orientation factors

comprises a plurality of orientation vector data and a plurality of

orientation dimension data.

(43)

43

10. The electronic device of the claim 6, wherein the pre-determined

function comprises a user interface unlocking function which is

capable of unlocking the user interface.

(44)

44 ABSTRACT

The present invention discloses an electronic device and the

controlling method thereof. More specifically, both of the devices

and method of the present invention are capable of providing a

predetermined function in a predetermined situation by inputting

and comparing an accelerating data generated by an acceleration

sensor. Thus, the present invention allows the user to define a

three dimensional action path as the active requirement of a

predetermined function. Accordingly, the user is capable of

applying the electronic device with more flexibility and less

limitation thereof.

(45)

45

automatically obtaining a verifying data from the memory

automatically comparing the

reference data with the verifying data so as to generate an control signal

automatically activating a pre- determined function in accordance

with the control signal

FIG.2

S4

S5

S6 automatically obtaining a reference

data from a memory

S3

▲Flowchart of the claim

(46)

46

Verifying Mode

ON

FIG. 3A FIG. 3B

IE

F

12:14 pm

38 C Sunny

Call

A

IE

F

12:16 pm

38 C

O

Sunny

Call

FIG. 3D

U2 U1

U1

A A

A

12:15 PM

2012-8-20

KT&T

FIG. 3C

12:16

12:14

12 :13AM 12 :14AM

12 :16AM

Background mode Press To Record

Verifying Test Verifying Stop

Shake to Unlock

O

User interface Unlocked

User interface

locked

U2

▲Execution steps

(47)

47

(48)

48

引言:

我們於三年級下學期參加比賽,並於初審時,因為作品完整度以及 創意運用都深得評審們青睞,順利入圍決賽。此外,我們主要以「行動 裝置個人化搖動解鎖」一題目參加比賽,但是後來考量到作品的未來發 展,我們便以「動作軌跡驗證」為主軸,除了原定題目「個人化搖動解 鎖」以外,我們還發展出「特定動作撥號」以及「手機掉落提醒」兩個 延伸應用,大大提升了本作品的實用性,以及未來可供無限延伸應用的 潛力。

由本作品的「獲獎」以及「專利申請」佐證,本作品既富創意及實 用性,亦不失產業利用性,是本組員努力研究後之結果。

搖動解鎖 搖動撥號 防摔落題醒

▲參賽之作品

(49)

49

決 賽 合 照

展 示 合 照

(50)

50

(51)

51

(52)

52

(53)

53

(一) 完成度

手機搖動解鎖:

使用者可事先錄製好特定手勢動作軌跡,並可以依據動作大 小預先設定感應器的容許值以增加驗證的準確度,在驗證啟動 後,開始層層關卡比對手勢動作,驗證正確後,便解除手機按鍵 鎖之鎖固狀態。

(二)實用性

使用者可以自行錄製平常最慣用的手勢,達到不須按螢幕及 任何按鈕即可快速解鎖的目標,也不會殘留指紋。系統功能替兩 種訴求不同的使用者特別設計:

(1). 快速

使用者須常常開啟手機查看,只要錄製一較容易揮動之手 勢,待解鎖時,順著手勢拿起手機就可以解鎖,實增便利。

(2). 資訊安全

要求使用者多加一道密碼,再加上特定手勢才可解鎖;藉

此,可於手機失竊時,即便對方只知道手勢或密碼,仍無

法解鎖進入存取使用者之資訊。

(54)

54

(三)未來發展性

除了個人化搖動「解鎖」之外,未來還可使用個人化搖動來 做出更多功能:

(1). 設定特定聯絡人之個別搖動撥號,省去進入電話簿尋找聯 絡人的時間,達成快速撥號的便利性

(2). 手機異常摔落提醒,當手機從高處摔落時,系統偵測到不 正常的撞擊,立即發出聲響提醒主人手機掉落;或發出掉 落當下之 GPS 位置,回傳給已預設好的手機,藉由查找,

就可以減少手機遺失的機會。

(3). 藉由上述二例,可知其可做不只三種之應用,有了動作辨 析作為核心,可衍伸出更無數種實用的功能。

(4). 鑒於上述並搭配美國與台灣專利,本作品實富產業利用

性,可望與手機廠商合作,直接裝置於該廠手機內,以帶

來更大的商機。

(55)

(56)

56 範例程式 .

2.1.1

電子指南針:http://marakana.com/forums/android/examples/98.html 2.1.2

Ball Game:

http://www.codeproject.com/Articles/188957/Simple-Android-Ball-Game 2.2.1

Android Developer: http://developer.android.com/index.html 解鎖範例:

http://shung007.blogspot.tw/2010/10/android-tips-keyguardmanager.html 2.3.1

http://goo.gl/g8OuY

http://ccckmit.wikidot.com/ga:serviceexample

碁峯 Google Android 應用程式開發實戰 第三版-適用 Android SDK 2.x/3.x

書號:ACL034100

作者:林城

參考文獻

相關文件

Wang, Solving pseudomonotone variational inequalities and pseudocon- vex optimization problems using the projection neural network, IEEE Transactions on Neural Networks 17

volume suppressed mass: (TeV) 2 /M P ∼ 10 −4 eV → mm range can be experimentally tested for any number of extra dimensions - Light U(1) gauge bosons: no derivative couplings. =&gt;

For pedagogical purposes, let us start consideration from a simple one-dimensional (1D) system, where electrons are confined to a chain parallel to the x axis. As it is well known

The observed small neutrino masses strongly suggest the presence of super heavy Majorana neutrinos N. Out-of-thermal equilibrium processes may be easily realized around the

Define instead the imaginary.. potential, magnetic field, lattice…) Dirac-BdG Hamiltonian:. with small, and matrix

incapable to extract any quantities from QCD, nor to tackle the most interesting physics, namely, the spontaneously chiral symmetry breaking and the color confinement.. 

(1) Determine a hypersurface on which matching condition is given.. (2) Determine a

• Formation of massive primordial stars as origin of objects in the early universe. • Supernova explosions might be visible to the most