CN104166598A - 电子设备及其中断保护方法 - Google Patents

电子设备及其中断保护方法 Download PDF

Info

Publication number
CN104166598A
CN104166598A CN201310180891.9A CN201310180891A CN104166598A CN 104166598 A CN104166598 A CN 104166598A CN 201310180891 A CN201310180891 A CN 201310180891A CN 104166598 A CN104166598 A CN 104166598A
Authority
CN
China
Prior art keywords
data
instruction
interrupt
electronic equipment
storer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310180891.9A
Other languages
English (en)
Inventor
王雅国
陈俊卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN201310180891.9A priority Critical patent/CN104166598A/zh
Priority to TW102117787A priority patent/TW201508768A/zh
Priority to US14/244,092 priority patent/US20140344506A1/en
Publication of CN104166598A publication Critical patent/CN104166598A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1416Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0637Permissions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

一种电子设备,其包括存储器及处理器。该存储器用于存储相关数据,处理器用于将数据写入存储器并当侦测到有数据需要写入存储器时,启动中断保护以屏蔽且不响应外界中断事件产生的中断指令。本发明还提供一种用于防止向存储器写数据时被中断的中断保护方法。

Description

电子设备及其中断保护方法
技术领域
本发明涉及一种电子设备,特别涉及一种防止向存储器写数据时被中断的电子设备。
背景技术
在目前市场上的电子设备中,例如,光碟播放机或电脑等,通常会设置有用以存储***重要参数的存储器,例如,电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory, EEPROM)。当有数据需要向存储器中写入时,存储器在收到写入指令后便会执行写数据动作。但,若此时外部恰好有中断事件(例如,Timer中断、UART中断等)发生,则电子设备将不会考虑写入存储器中的数据是否已完成,便会直接转入处理外部的中断事件。如此,将会导致写入存储器的数据会发生错误,从而导致***异常的发生。
发明内容
有鉴于此,有必要提供一种防止向存储器写数据时被中断的电子设备。
一种电子设备,其包括存储器及处理器。该存储器用于存储相关数据,处理器用于将数据写入存储器并当侦测到有数据需要写入存储器时,启动中断保护以屏蔽且不响应外界中断事件产生的中断指令。
另外,本发明还提供一种用于防止向存储器写数据时被中断的中断保护方法,所述中断保护方法包括如下步骤:
检测是否有数据需要写入存储器中;
当有数据需要写入存储器时,启动中断保护以屏蔽且不响应外界中断事件产生的中断指令;
开始向存储器中写入数据。
上述电子设备及中断保护方法,能够在检测到有数据需要写入存储器时,先启动中断保护将外部中断事件产生的中断指令屏蔽,从而使处理器在向存储器中写入数据过程中不会响应中断指令直到数据写入完成。如此,处理器在向存储器写入数据时不会受到外部中断事件的干扰,从而保证写入存储器中的数据的正确与完整性。
附图说明
图1为本发明一较佳实施方式的电子设备的功能模块图。
图2为本发明一较佳实施方式的中断保护方法的流程图。
主要元件符号说明
电子设备 99
缓存单元 10
存储器 12
输入单元 14
处理器 16
侦测单元 161
保护单元 163
处理单元 165
中断保护方法 S210-S250
如下具体实施方式将结合上述附图进一步说明本发明。
具体实施方式
请参阅图1,其为一较佳实施方式中电子设备99的功能模块图。电子设备99可以为光碟播放器、电脑等装置。在本实施例中,电子设备99为光碟播放器。电子设备99包括缓存单元10、存储器12、输入单元14以及处理器16。处理器16用于当有数据需要写入存储器12时启动中断保护屏蔽且不响应外部中断事件产生的中断指令直至数据写入完成。处理器16包括侦测单元161、保护单元163以及处理单元165。
输入单元14,用于响应用户操作以产生相应的数据与指令。输入单元110可以为键盘、触模板以及与电子设备99匹配使用的摇控器等。
缓存单元10用于暂时存放电子设备99中当前正在使用(即执行中)的相应数据。在本实施例中,缓存单元10为RAM(random access memory)随机存储器。
侦测单元161用于检测缓存单元10是否存放有需要写入存储器12中的数据,并当侦测到有数据需要写入时输出启动指令。
保护单元163用于响应启动指令启动中断保护屏蔽外部中断事件所产生的中断指令,以使处理单元165不响应外部中断事件所产生的中断指令。其中,外部中断事件可包括用于处理***时间的Timer中断,用于处理***之间相互通讯的UART中断以及用于处理外部事件的外部中断等。
保护单元163用于在启动中断保护后输出写入指令。
处理单元165用于响应写入指令开始向存储器12内写入数据,并当数据写入完成时输出完成指令。具体地,存储器12存储电子设备99中的相关数据及程序,例如,各种软件、备份文件、图片、视频、***参数等数据。在本实施例中存储器12为电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory, EEPROM)。
保护单元163还用于响应完成指令解除中断保护。在数据写入过程中,由于启动了中断保护,当电子设备99产生的中断事件时,中断事件所产生的中断指令将被屏蔽,使处理单元165在数据写入过程中不受中断事件的干扰。当数据写入完成后,保护单元163响应完成指令解除中断保护,电子设备99恢复正常。
为便于说明本发明的技术方案,以用户设置电子设备99的音量值为例,来说明处理器16实现中断保护的工作原理。
当电子设备99响应用户的输入操作将当前音量值设定为15dB时,数据值15便暂时存放于缓存单元10内。侦测单元161检测到暂时存放于缓存单元10内的数据值15后输出启动指令。保护单元163响应启动指令启动中断保护并产生写入指令。处理单元165响应写入指令开始向存储器12内写入数据15。此时,若电子设备99中有中断事件发生,例如,关机操作,由于中断保护使得用户的关机操作所产生的中断指令(即关机指令)被屏蔽。如此,处理单元165不响应关机指令进行关机操作而是继续进行数据的写入直至数据值15完全写入存储器12后才恢复正常。存储器12存储上述用户设置的音量值15。如此,将有效的保证了写入存储器12内数据的正确与完整性。当用户下次启动电子设备99时,电子设备99的当前音量将会保存为上次用户调整的音量值15dB,而不会由于处理器16被中断以至写入存储器12中的数据发生错误而导致下次启动电子设备99的音量时发生异常。
请参阅图2,一种中断保护方法用于上述处理器16,该中断保护方法包括如下步骤。
步骤S210,电子设备99中当前正在使用的相应数据被暂时存放于缓存单元10中。
步骤S220,侦测单元161检测缓存单元10中是否存放有需要写入存储器12的数据。若存放有需要写入存储器12的数据,流程转至步骤S230。若否,继续执行步骤S220。
步骤S230,保护单元163输出写入指令并响应启动指令启动中断保护屏蔽外界中断事件产生的中断指令,以使处理单元165不响应外界中断事件产生的中断指令。其中,外部中断事件可包括用于处理***时间的Timer中断,用于处理***之间相互通讯的UART中断以及用于处理外部事件的外部中断等。
步骤S240,处理单元165响应写入指令开始向存储器12内写入数据并当数据写入完成时输出完成指令。
步骤S250,保护单元163响应完成指令解除中断保护。
综上所述,尽管为说明目的已经公开了本发明的优选实施例,然而,本发明不只局限于如上所述的实施例,在不超出本发明基本技术思想的范畴内,相关行业的技术人员可对其进行多种变形及应用。

Claims (10)

1.一种电子设备,其包括存储器及处理器,该存储器用于存储相关数据,处理器用于将数据写入存储器,其特征在于:该处理器用于当侦测到有数据需要写入存储器时,启动中断保护以屏蔽且不响应外界中断事件产生的中断指令。
2.如权利要求1所述的电子设备,其特征在于:该存储器在数据写入完成时输出完成指令,该处理器还用于响应完成指令解除中断保护。
3.如权利要求1所述的电子设备,其特征在于:该处理器包括保护单元、侦测单元以及处理单元,该侦测单元用于检测电子设备中是否有需要写入存储器的数据;当有数据需要写入存储器时,该保护单元启动中断保护屏蔽外部中断事件产生的中断指令并产生写入指令,该处理单元响应写入指令向存储器中写入数据并当数据写入完成时输出完成指令,该保护单元还用于响应完成指令解除中断保护。
4.如权利要求3所述的电子设备,其特征在于:该电子设备包括缓存单元,该侦测单元用于检测缓存单元中是否存放有需要写入存储器的数据;当缓存单元中有数据需要写入存储器时,该侦测单元输出启动指令,该保护单元响应该启动指令启动中断保护。
5.如权利要求3所述的电子设备,其特征在于:该缓存单元为随机存储器。
6.如权利要求1所述的电子设备,其特征在于:该存储器为电可擦可编程只读存储器。
7.一种中断保护方法,其用于防止处理器向存储器写入数据时被中断,该中断保护方法包括如下步骤:
检测是否有数据需要写入存储器中;
当有数据需要写入存储器时,启动中断保护以屏蔽且不响应外界中断事件产生的中断指令;
开始向存储器中写入数据。
8.如权利要求7所述的中断保护方法,其特征在于:当数据写入完成时,解除中断保护。
9.如权利要求7所述的中断保护方法,其特征在于:检测是否有数据需要写入存储器中的步骤为检测缓存单元中是否有数据需要写入存储器中。
10.如权利要求7所述的中断保护方法,其特征在于:该存储器为电可擦可编程只读存储器。
CN201310180891.9A 2013-05-16 2013-05-16 电子设备及其中断保护方法 Pending CN104166598A (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201310180891.9A CN104166598A (zh) 2013-05-16 2013-05-16 电子设备及其中断保护方法
TW102117787A TW201508768A (zh) 2013-05-16 2013-05-20 電子設備
US14/244,092 US20140344506A1 (en) 2013-05-16 2014-04-03 Electronic device with writing protection and related method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310180891.9A CN104166598A (zh) 2013-05-16 2013-05-16 电子设备及其中断保护方法

Publications (1)

Publication Number Publication Date
CN104166598A true CN104166598A (zh) 2014-11-26

Family

ID=51896748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310180891.9A Pending CN104166598A (zh) 2013-05-16 2013-05-16 电子设备及其中断保护方法

Country Status (3)

Country Link
US (1) US20140344506A1 (zh)
CN (1) CN104166598A (zh)
TW (1) TW201508768A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528461A (zh) * 2015-09-14 2017-03-22 三星电子株式会社 储存设备及其中断生成方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11750706B1 (en) * 2020-03-26 2023-09-05 Amazon Technologies, Inc. Data transmission time management

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6128528A (en) * 1999-03-18 2000-10-03 Medtronics, Inc. Error code calculations for data stored in an implantable medical device
WO2006056988A2 (en) * 2004-11-24 2006-06-01 Discretix Technologies Ltd. System, method and apparatus of securing an operating system
US7472244B2 (en) * 2005-12-08 2008-12-30 Intel Corporation Scheme for securing a memory subsystem or stack

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528461A (zh) * 2015-09-14 2017-03-22 三星电子株式会社 储存设备及其中断生成方法

Also Published As

Publication number Publication date
US20140344506A1 (en) 2014-11-20
TW201508768A (zh) 2015-03-01

Similar Documents

Publication Publication Date Title
US8250543B2 (en) Software tracing
TWI505282B (zh) 用於非揮發性儲存器件之電源關閉預測
EP1974272B1 (en) Method and apparatus for detecting a fault condition and restoration thereafter using user context information
CN105335099A (zh) 一种内存清理方法及终端
CN109800181B (zh) 一种基于磁盘的数据写入方法、数据写入装置及终端设备
US20130285942A1 (en) Touch detection method and touch control device using the same
US20140340321A1 (en) Mistouch identification method and device using the same
CN104182068A (zh) 误触识别方法与装置
CN102467440A (zh) 内存错误检测***及方法
CN111143104A (zh) 一种内存异常的处理方法、***、电子设备及存储介质
US8489938B2 (en) Diagnostic data capture in a computing environment
CN103473191A (zh) 中断处理方法、装置和***
CN104166598A (zh) 电子设备及其中断保护方法
CN108520063B (zh) 事件日志的处理方法、装置及终端设备
CN104298618B (zh) 一种智能终端的命令处理方法及装置
WO2023206926A1 (zh) 一种恢复用户配置数据的方法、装置及介质
CN109388511B (zh) 一种信息处理方法、电子设备及计算机存储介质
CN103810051A (zh) 一种看门狗异常恢复装置及方法
CN101630278A (zh) 记录电子装置当机异常信息的方法及其电子装置
CN106126360B (zh) 地址空洞屏蔽方法及装置
CN102750234B (zh) 存储器的控制方法及控制器
CN112912855A (zh) 开机检测方法、开机检测装置及移动终端
CN115756309A (zh) 电池管理设备参数存储方法、电池管理设备、储能***
CN111327746B (zh) 一种用于移动终端的压力异常的确定方法及设备
US20160275011A1 (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20141126