WO2013127274A1 - 一种应用程序数据存储的方法及终端设备 - Google Patents

一种应用程序数据存储的方法及终端设备 Download PDF

Info

Publication number
WO2013127274A1
WO2013127274A1 PCT/CN2013/070143 CN2013070143W WO2013127274A1 WO 2013127274 A1 WO2013127274 A1 WO 2013127274A1 CN 2013070143 W CN2013070143 W CN 2013070143W WO 2013127274 A1 WO2013127274 A1 WO 2013127274A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
storage space
path
user
actual path
Prior art date
Application number
PCT/CN2013/070143
Other languages
English (en)
French (fr)
Inventor
陈磊
Original Assignee
华为终端有限公司
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 华为终端有限公司 filed Critical 华为终端有限公司
Priority to JP2014519412A priority Critical patent/JP2014526088A/ja
Priority to KR1020137033822A priority patent/KR101578832B1/ko
Priority to EP13755403.6A priority patent/EP2704041B1/en
Publication of WO2013127274A1 publication Critical patent/WO2013127274A1/zh
Priority to US14/141,775 priority patent/US9152480B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/40Data acquisition and logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and terminal device for storing application data. Background technique
  • the storage space of the mobile phone can be divided into an own storage space and an extended storage space according to the location of the storage space.
  • it is a built-in SD card with its own storage space (that is, a separate storage space is opened on its own memory chip) and an external SD card as an extended storage space.
  • an external SD card as an extended storage space.
  • Embodiments of the present invention provide a method and terminal device for application data storage, which enable installation and data storage of an application of a default specific path to be located in the same storage space.
  • a method of providing application data storage includes:
  • Receiving a user-triggered instruction to run an application Determining the actual path of the storage space installed by the application;
  • the data generated after the application is run is stored in the actual path of the storage space installed by the application.
  • a terminal device comprising:
  • a receiving unit configured to receive a user-triggered instruction to run an application
  • a determining unit configured to determine an actual path of a storage space installed by the application
  • a running unit configured to run the application, and obtain data generated after the application runs
  • a storage unit configured to store data generated after the application is run in an actual storage space of the application installation Under the path.
  • the method for storing application data and the terminal device receive an instruction triggered by a user to run a native application; determine an actual path of a storage space installed by the application; run the application, and obtain an application to generate after running Data; store the data generated after the application is run in the actual path of the storage space where the application is installed.
  • the data after the application is run is stored in the storage space of the application installation, so that the installation and data storage of the application of the default specific path are located in the same storage space.
  • FIG. 1 is a flowchart of a method for storing application data according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for storing application data according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of another terminal device according to an embodiment of the present invention. detailed description
  • the method for storing application data provided by the embodiment of the present invention, as shown in FIG. 1 includes:
  • S104 Store the data generated after the application is run in an actual path of the storage space where the application is installed. In this way, by determining the actual path of the storage space installed by the application, the data after the application is run is stored in the storage space of the application installation, so that the installation and data storage of the application of the default specific path are located in the same storage space. Medium, user-friendly.
  • a method for storing application data according to another embodiment of the present invention is described by taking a mobile phone of the Android platform as a terminal device as an example, and the specific steps are as shown in FIG. 2 .
  • the mobile phone provides two storage spaces for installing an application when it leaves the factory - its own storage space (ie, built-in SD card) and extended storage space (external SD card).
  • built-in SD card built-in SD card
  • extended storage space extended SD card.
  • the actual path of setting the built-in SD card at the factory is "/sdcard/inner”
  • the actual path of setting the external SD card is "/sdcard/outer”.
  • the actual path of the storage space can be arbitrarily set according to the actual situation. This is just an example.
  • the mobile phone receives an instruction of the user to install the application, and prompts the user with the actual path information of each storage space in which the application can be installed.
  • the mobile phone after the user downloads the application of the Android open platform to the local machine, when the user installs the application, that is, after the mobile phone receives the instruction of the user to install the application, the mobile phone prompts the user to install each storage of the application.
  • the actual path information of the space in this embodiment, in order to facilitate the user to view, the mobile phone displays the built-in SD card storage space and the external SD card storage space of the installable application through the display screen, and the user can independently select and install according to actual needs. Storage space.
  • the actual paths of the built-in SD card storage space and the external SD card storage space are "/sdcard/ inner” and "/sdcard/outer ⁇ respectively.
  • the mobile phone receives an actual path of a storage space selected by the user.
  • This embodiment assumes that the user selects the external SD card as the storage space for the installation of the application, and the actual path of the storage space selected by the mobile phone to the user is '7sd C ard/ 0 uter'.
  • the mobile phone installs the application to the actual path of the storage space selected by the user.
  • a default path is set in the application, and the default path is used to instruct the application to save the data generated after running to the default path.
  • This default path is a well-known agreed path.
  • the Android application is running, the path that the physical layer transfers to the middle layer is set to the above default path by default in the Android phone.
  • the default path of the Android application is '7sd car d'.
  • the user selects an external SD card to install the application, and the application is installed in the "/sdcard/outer" path of the external SD card.
  • the middle layer of the mobile phone can record the application identification (Identification) of the application and the actual path of the installed storage space when the application is installed, and associate the above application identity with the actual path of the storage space installed by the application. Stored in the database of the phone. Wherein, each application identity corresponds to an application. The middle layer can obtain information about the application ID and the actual path of the storage space each time the application is loaded.
  • the mobile phone receives a user-triggered instruction to run the application.
  • the terminal device usually divides the data processing process into three layers:
  • the first layer is the application layer, that is, the client (also called the user interface layer), providing user-friendly access to the system;
  • the second layer is the middle layer. (also known as the application service layer), used for the implementation of business logic;
  • the third layer is the driver layer (also known as the data source layer), responsible for the storage, access and optimization of data information, so the data after the application runs Access is done at the driver layer.
  • the application layer transparently transmits the application default path to the driver layer through the intermediate layer, and the driver layer performs data storage after the operation according to the default path. Therefore, the data saved by the Android platform application is stored by default in the default path.
  • existing applications generally use the " /sdcard" path as the default path, that is, the data after the application is run will be saved to the "/sdcard” path by default.
  • the mobile phone determines the actual path of the storage space installed by the application.
  • the mobile phone After receiving the instruction triggered by the user to run the application, the mobile phone obtains an application ID that is included in the application and indicates the identity of the application; and then the mobile phone searches the database for the storage space installed by the application corresponding to the application identity according to the application ID.
  • the actual path wherein the correspondence between the application identity and the actual path of the storage space installed by the application is recorded and stored in the database by the application layer when the application is installed.
  • the database may be a general-purpose database for data storage in a mobile phone, or may be a database independently created for storing a correspondence between an application identity and an actual path of an installation space of an application installation, and is not limited herein.
  • the mobile phone may obtain the actual path of the storage space installed by the application corresponding to the application identity according to the application ID, or obtain the above-mentioned correspondence by using a two-dimensional array query method, and obtain the application installation according to the corresponding relationship.
  • the actual path of the storage space may be obtained by the application corresponding to the application identity according to the application ID, or obtain the above-mentioned correspondence by using a two-dimensional array query method, and obtain the application installation according to the corresponding relationship.
  • the storage space installed by the application is an external SD card
  • the actual path obtained by the query is a " / sdcard / outer " path.
  • the default path reserved by the application according to the industry rule application is "/sdcard", when the middle layer of the mobile phone is After the application is installed on the external SD card, the actual path can be obtained. //sdcard/outer
  • the physical layer sends the default path of the application to the middle layer "/sdcard”, but the embodiment of the present invention
  • the middle layer in the middle layer no longer sends the default path "/sdcard” to the driver layer as in the prior art, but sends the obtained actual path " /sdcard/outer " to the driver layer so that the driver layer runs the application.
  • the generated data is saved under the actual path "/sdcard/outer”.
  • the transmission relationship of the above path may be set when the mobile phone is shipped from the factory.
  • the middle layer determines the application installation location, and may send different actual paths to the driver layer according to the installation location. Therefore, in the application data storage method provided by the embodiment of the present invention, the sequence of the step S207 and the foregoing steps is only an example, and the actual application is not limited thereto, and any technical person skilled in the art may disclose the technical scope disclosed by the present invention. Within the scope of the present invention, variations are readily conceivable.
  • an example is to install an application to an external SD card.
  • the user can also install the application into the built-in SD card.
  • the middle layer sends the acquisition to the driver layer.
  • the actual path "/sdcard/inner" is the same as the embodiment, and will not be described in detail here.
  • the storage space installed by the application is the storage space of the mobile phone
  • the data file of the running of the application is finally stored in the storage space of the mobile phone
  • the storage space installed by the application is the extended storage of the mobile phone.
  • Space the data file after the application's run is eventually stored in the phone's extended storage space.
  • the application installation and post-run data storage are in the same storage space, which is convenient for mobile phone users.
  • the extended storage space is an external SD card
  • the storage space installed by the application is the storage space of the mobile phone
  • the installation and operation of the application are not related to the external SD card, and the external SD card is not involved.
  • the plugging and unplugging has no effect on the installation and operation of the application; when the storage space installed by the application is the extended storage space of the mobile phone, when the external SD card is in place, the application is stored in the external SD card, when the external SD is in the SD When the card is unplugged, the application saved in the external SD card and the data saved after the operation are not lost.
  • the external SD card is inserted again, the above path setting still exists, and Affects the saving of data files after the application is run again and after running.
  • the root directory of the actual path of each storage space of the machine may be the same as the root directory of the default path, for example, the root directory of the actual path of the storage space may be set to "/sd Car d". This will ensure that some of the prior art media applications that automatically scan files in all directories under the "/sdcard" directory, such as MUSIC (Music), PICTURE (Picture), etc., will work.
  • the method for storing application data determines the actual path of the storage space installed by the application, so that the data after the application is run is directly stored in the storage space installed by the application, thereby enabling the application of the default specific path.
  • the installation and data saving of the program are located in the same storage space, which is convenient for users.
  • the mapping path of the built-in SD card and the external SD card is switched.
  • the external SD card is inserted, the external SD card is inserted.
  • the mapping path can be switched to the default path, which is "/sdcard”; the mapping path of the built-in SD card can be switched to the same non-default path as the default path root directory, for example " /sd C ard/inner ".
  • This ensures that some of the prior art media applications that automatically scan files in all directories under the "/sdcard” directory, such as MUSIC (Music), PICTURE (Picture), etc., will work.
  • the terminal device 30 provided by the embodiment of the present invention, as shown in FIG. 3, includes:
  • the receiving unit 301 is configured to receive a user-triggered instruction to run the native application.
  • a default path is set in the application, and the default path is used to instruct the application to save the data generated after running to the default path.
  • the determining unit 302 is configured to determine an actual path of the storage space installed by the application.
  • the determining unit 302 includes: an identity obtaining module, configured to acquire an application identity that is sent by the application and that is used to indicate an application identity; and a path determining module, configured to search, in the database, an application corresponding to the application identity according to the application identity The actual path to the installed storage space.
  • the correspondence between the application identity and the actual path of the storage space installed by the application is recorded and stored in the database by the application layer when the application is installed.
  • the running unit 303 is configured to run an application and obtain data generated after the application runs.
  • the storage unit 304 is configured to store data generated after the application is run in an actual path of the storage space where the application is installed.
  • the operating unit runs the application after the receiving unit receives the user-triggered instruction to run the native application
  • the storage unit runs the data after the application runs according to the actual path of the storage space installed by the application determined by the determining unit.
  • the data after the application is running is stored in the storage space of the application installation, thereby enabling the installation and data storage of the application identifying the default path to be located in the same storage space, which is convenient for the user. use.
  • the terminal device 30 further includes:
  • the prompting unit 305 is configured to prompt the user to the actual path of each storage space of the installation application after receiving the instruction that the user determines to install the application.
  • the selecting unit 306 is configured to receive an actual path of the storage space selected by the user.
  • the installation unit 307 is configured to install an application to an actual path of the storage space selected by the user, and store an application identifier that is included in the application and that indicates the application identity and the storage space installed by the application. The corresponding relationship of the actual path to the database.
  • root directory of the actual path of each storage space of the terminal device is the same as the root directory of the default path.
  • the root of the actual path to this storage space can be the " /sdcard/ " directory.
  • the terminal device includes any one of a mobile phone, a human-machine interaction terminal, an e-book, and a terminal having a display function.
  • the terminal device is a mobile phone
  • the mobile phone further includes: a radio frequency circuit, an audio circuit, and a power circuit.
  • the radio frequency circuit is used for establishing communication between the mobile phone and the wireless network, and realizing data receiving and transmitting of the mobile phone and the wireless network.
  • An audio circuit for collecting sound and converting the collected sound into sound data, so that the mobile phone transmits sound data to the wireless network through the radio frequency circuit, and/or restores the sound data received by the mobile phone from the wireless network through the radio frequency circuit to sound and The user plays the sound.
  • a power circuit that supplies power to the various circuits or devices of the handset.
  • the mobile phone can also include: a display screen, a power source, etc., in order to complete the basic functions of the mobile phone.
  • the above audio circuit includes a microphone and a speaker, wherein the microphone is used to collect sound and convert the collected sound into sound data, so that the mobile phone passes
  • the radio frequency circuit transmits sound data to the wireless network; the speaker restores the sound data received by the mobile phone from the wireless network through the radio frequency circuit to sound and plays the sound to the user.
  • the power supply is mainly used to supply power to various circuits or devices of the mobile phone to ensure the normal operation of the mobile phone.
  • the operating unit runs the application program after the receiving unit receives the instruction triggered by the user to run the native application, and the storage unit selects the actual path of the storage space installed according to the application determined by the determining unit.
  • the data after the application is run is stored in the actual path of the storage space, so that the data after the application is run is stored in the storage space of the application installation, so that the installation and data storage of the application identifying the default path are located in the same storage. In the space, it is convenient for users to use.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

本发明实施例提供的一种应用程序数据存储的方法及终端设备,涉及通信领域,能够使默认特定路径的应用程序的安装和数据保存位于同一存储空间中。包括:接收用户触发的运行本机应用程序的指令;确定应用程序安装的存储空间的实际路径;运行应用程序,并获取应用程序运行后生成的数据;将应用程序运行后生成的数据存储在应用程序安装的存储空间的实际路径下。本发明实施例用于手机的使用。

Description

一种应用程序数据存储的方法及终端设备 本申请要求于 2012年 2月 28日提交中国专利局、 申请号为 CN 201210047761. 3、发明 名称为 "一种应用程序数据存储的方法及终端设备" 的中国专利申请的优先权, 其全部内 容通过引用结合在本申请中。 技术领域
本发明涉及通信领域, 尤其涉及一种应用程序数据存储的方法及终端设备。 背景技术
现有技术中, 按照存储空间所处位置可以将手机的存储空间分为自有存储空间和扩展 存储空间。 例如作为自有存储空间的内置 SD 卡 (即在自有存储芯片上开辟出一个独立的 存储空间) 和作为扩展存储空间的外置 SD 卡。 这样, 对于一部手机而言, 相当于存在两 张 SD卡。
目前, 对于如安卓 (android) 这类开放平台的应用程序的安装以及运行数据保存而 言, 只默认特定的路径, 如只识别 " /sdcard"路径。 而各个生产厂商在手机出厂时, 有 的直接将内置 SD 卡映射为特定路径 /sdcard ; 有的直接将外置 SD 卡映射为特定路径 /sdcard; 还有的在外置 SD卡插入和拔出时, 切换内置 SD卡和外置 SD卡的映射路径。
由于业界目前针对内置 SD卡、 外置 SD卡的路径映射模式不尽相同, 给用户的使用带 来了诸多不便。 例如: 若某手机的内置 SD卡被固定映射为特定路径 /sdcard, 如果用户将 应用程序安装在了外置 SD卡上, 则运行后的数据仍会存储到内置 SD卡上; 反之, 若某手 机的外置 SD卡被固定映射为特定路径 /sdcard, 如果用户将应用程序安装在了内置 SD卡 上, 则运行后的数据仍会存储到外置 SD卡上。 发明内容
本发明的实施例提供一种应用程序数据存储的方法及终端设备, 能够使默认特定路径 的应用程序的安装和数据保存位于同一存储空间中。
为达到上述目的, 本发明的实施例采用如下技术方案:
一方面, 提供一种应用程序数据存储的方法, 包括:
接收用户触发的运行应用程序的指令; 确定所述应用程序安装的存储空间的实际路径;
运行所述应用程序, 并获取所述应用程序运行后生成的数据;
将所述应用程序运行后生成的数据存储在所述应用程序安装的存储空间的实际路径 下。
—方面, 提供一种终端设备, 包括:
接收单元, 用于接收用户触发的运行应用程序的指令;
确定单元, 用于确定所述应用程序安装的存储空间的实际路径;
运行单元, 用于运行所述应用程序, 并获取所述应用程序运行后生成的数据; 存储单元, 用于将所述应用程序运行后生成的数据存储在所述应用程序安装的存储空 间的实际路径下。
本发明实施例提供的应用程序数据存储的方法及终端设备, 接收用户触发的运行本机 应用程序的指令; 确定应用程序安装的存储空间的实际路径; 运行应用程序, 并获取应用 程序运行后生成的数据; 将应用程序运行后生成的数据存储在应用程序安装的存储空间的 实际路径下。 这样一来, 通过确定应用程序安装的存储空间的实际路径, 使得应用程序运 行后的数据存储在应用程序安装的存储空间中, 进而使默认特定路径的应用程序的安装和 数据保存位于同一存储空间中, 方便用户的使用。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施例或现有技 术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明 的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根 据这些附图获得其他的附图。
图 1为本发明实施例提供的一种应用程序数据存储的方法流程图;
图 2为本发明实施例提供的另一种应用程序数据存储的方法流程图;
图 3为本发明实施例提供的一种终端设备结构示意图;
图 4为本发明实施例提供的另一种终端设备结构示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地 描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本 发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实 施例, 都属于本发明保护的范围。
本发明实施例提供的应用程序数据存储的方法, 如图 1所示, 包括:
5101、 接收用户触发的运行应用程序的指令。
5102、 确定应用程序安装的存储空间的实际路径。
S103、 运行应用程序, 并获取应用程序运行后生成的数据。
S104、 将应用程序运行后生成的数据存储在应用程序安装的存储空间的实际路径下。 这样一来, 通过确定应用程序安装的存储空间的实际路径, 使得应用程序运行后的数 据存储在应用程序安装的存储空间中, 进而使默认特定路径的应用程序的安装和数据保存 位于同一存储空间中, 方便用户的使用。
本发明另一实施例提供的应用程序数据存储的方法, 以安卓平台的手机作为终端设备 为例进行说明, 具体步骤如图 2所示。
本实施例中, 手机在出厂时, 提供两个可安装应用程序的存储空间——自有存储空间 (即内置 SD卡) 和扩展存储空间 (外置 SD卡)。 在本实施例中, 假设出厂时设置内置 SD 卡的实际路径为 "/sdcard/inner"; 设置外置 SD 卡的实际路径为 "/sdcard/outer"。 上 述存储空间的实际路径可以根据实际情况任意设置, 这里只是举例说明。
5201、 手机接收用户安装应用程序的指令, 向用户提示可安装应用程序的各个存储空 间的实际路径信息。
本实施例中, 用户将安卓开放平台的应用程序下载到本机后, 当用户在安装应用程序 时, 即手机接收到用户安装应用程序的指令后, 手机向用户提示可安装应用程序的各个存 储空间的实际路径信息, 在本实施例中, 为了便于用户查看, 手机通过显示屏向用户显示 可安装应用程序的内置 SD卡存储空间和外置 SD卡存储空间, 用户可以根据实际需求自主 选择安装的存储空间。 其中, 内置 SD卡存储空间和外置 SD卡存储空间的实际路径分别为 "/sdcard/ inner"和 "/sdcard/outer^
5202、 手机接收用户选定的存储空间的实际路径。
本实施例假设用户选择外置 SD 卡为应用程序的安装的存储空间, 则手机接收用户选 定的存储空间的实际路径为 '7sdCard/0uter"。
5203、 手机安装应用程序至用户选定的存储空间的实际路径下。
需要说明的是, 对于开发平台的应用程序来说, 应用程序中设置有一个默认路径, 默 认路径用于指示应用程序将运行后生成的数据保存至默认路径下。 该默认路径为公知约定 的路径。 安卓应用程序运行时, 在安卓手机中默认设置物理层向中间层传送的路径为上述 默认路径。 本实施例假设安卓应用程序的默认路径为 '7sdcard"。 在本实施例中, 用户选择外置 SD卡来安装应用程序, 则该应用程序安装到外置 SD卡 的 " /sdcard/outer "路径下。 手机的中间层可以在应用程序安装时, 记录该应用程序的 应用身份标识 (Identification) 以及安装的存储空间的实际路径, 并将上述应用身份标 识与应用程序安装的存储空间的实际路径的对应关系存储至手机的数据库中。 其中, 每个 应用身份标识对应一个应用程序。 在每次开机加载应用程序时, 中间层可以对应用 ID及 存储空间的实际路径的信息进行获取。
5204、 手机接收用户触发的运行该应用程序的指令。
在实际应用中, 终端设备通常将数据处理过程分为三层: 第一层是应用层, 即客户端 (也称为用户界面层),提供用户与系统的友好访问;第二层是中间层(也称为应用服务层), 用于业务逻辑的实现; 第三层是驱动层 (也称为数据源层), 负责数据信息的存储、 访问 及其优化, 因此该应用程序运行后的数据存取都在驱动层进行。 现有技术中, 在用户触发 应用程序后, 应用层将应用程序默认路径通过中间层透传给驱动层, 驱动层根据该默认路 径进行运行后的数据存储。 因此, 安卓平台的应用程序运行后的数据保存默认存储到默认 路径中。 一般而言, 现有应用程序普遍以 " /sdcard"路径为默认路径, 即该应用程序运 行后的数据将默认保存至 "/sdcard"路径。
5205、 手机确定应用程序安装的存储空间的实际路径。
手机接收用户触发的运行该应用程序的指令后, 获取应用程序自带的指示应用程序身 份的应用 ID; 然后手机根据应用 ID, 在数据库中查找与应用身份标识相应的应用程序安 装的存储空间的实际路径; 其中, 应用身份标识与应用程序安装的存储空间的实际路径的 对应关系为应用层在应用程序安装时记录并存储至数据库中的。 该数据库可以是手机中用 于数据存储的通用数据库, 也可以是独立建立的专用于储存应用身份标识与应用程序安装 的存储空间的实际路径的对应关系的数据库, 这里不做限制。 示例的, 手机可以根据应用 ID, 在数据库扫描获取应用身份标识相应的应用程序安装的存储空间的实际路径, 也可以 使用二维数组查询的方法获取上述对应关系, 根据该对应关系得到应用程序安装的存储空 间的实际路径。
在本实施例中, 该应用程序安装的存储空间为外置 SD 卡, 查询获取的实际路径为 " / sdcard/ outer "路径。
5206、 运行应用程序, 并获取应用程序运行后生成的数据。
上述运行应用程序, 并获取应用程序运行后生成的数据在手机驱动层执行。
S207、 将应用程序运行后生成的数据存储在应用程序安装的存储空间的实际路径下。 本实施例中, 根据业界规则应用程序预定的默认路径为 "/sdcard", 当手机中间层确 定了应用程序安装在外置 SD 卡后, 能够获取其实际路径 "/sdcard/outer 在该应用程 序运行时, 物理层向中间层发送该应用程序的默认路径 "/sdcard", 但本发明实施例中的 中间层不再如现有技术那样将默认路径 " /sdcard"发送给驱动层, 而是将获取到的实际 路径 " /sdcard/outer "发送给驱动层, 以便驱动层将应用程序运行后生成的数据保存在 实际路径 "/sdcard/outer"下。
特别的, 上述路径的发送关系可以是在手机出厂时已经设置好的。 此外, 当手机接收 用户触发的运行该应用程序的指令, 中间层确定了应用程序安装位置, 可以根据该安装位 置的不同, 相应地向驱动层发送不同的实际路径。 因此, 本发明实施例提供的应用程序数 据存储方法中, 步骤 S207 以及上述步骤的顺序只是举例说明, 实际应用中, 并不仅限于 此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化方法, 均在本发明保护范围内。
本实施例中是以将应用程序安装到外置 SD 卡为例进行的说明, 当然用户也可以将应 用程序安装到内置 SD 卡中, 此时应用程序运行后, 中间层会向驱动层发送获取到的实际 路径 "/sdcard/inner", 其过程与效果与本实施例相同, 这里不再详述。
这样一来, 当应用程序安装的存储空间为手机的自有存储空间, 应用程序的运行后的 数据文件最终也存储在手机的自有存储空间, 当应用程序安装的存储空间为手机的扩展存 储空间, 应用程序的运行后的数据文件最终也存储在手机的扩展存储空间。 两种情况下应 用程序的安装和运行后数据保存均位于同一存储空间中, 方便手机用户的使用。 在实际应 用中, 当扩展存储空间为外置 SD 卡时, 当应用程序安装的存储空间为手机的自有存储空 间, 应用程序的安装和运行都与外置 SD卡不相关, 外置 SD卡的拔插对应用程序的安装和 运行没有影响; 当应用程序安装的存储空间为手机的扩展存储空间时, 外置 SD卡在位时, 应用程序存入外置 SD卡中, 当外置 SD卡拔出, 即外置 SD卡不在位时, 保存在外置 SD卡 中的应用程序及其运行后保存的数据不丢失, 当外置 SD 卡再次插入时, 上述路径的设置 依然存在, 不会影响应用程序再次运行及运行后数据文件的保存。
进一步的, 本机的各个存储空间的实际路径的根目录与默认路径的根目录可以相同, 如该存储空间的实际路径的根目录可以设置为 "/sdCard"。 这样可以保证现有技术中的一 些默认自动扫描 "/sdcard" 目录下所有目录中的文件的媒体应用程序, 如 MUSIC (音乐)、 PICTURE (图片) 等能够正常运行。
本发明实施例提供的应用程序数据存储的方法, 通过确定应用程序安装的存储空间的 实际路径, 使得应用程序运行后的数据直接存储在应用程序安装的存储空间中, 进而使默 认特定路径的应用程序的安装和数据保存位于同一存储空间中, 方便用户的使用。 特别的, 针对现有技术中, 一些手机在外置 SD卡插入和拔出时, 切换内置 SD卡和外 置 SD卡的映射路径的情况, 当外置 SD卡插入的时候, 外置 SD卡的映射路径可以切换到 默认路径, 即 "/sdcard"; 内置 SD 卡的映射路径可以切换到与该默认路径根目录相同的 非默认路径, 例如 " /sdCard/inner "。 这样可以保证现有技术中的一些默认自动扫描 "/sdcard"目录下所有目录中的文件的媒体应用程序, 如 MUSIC (音乐)、 PICTURE (图片) 等能够正常运行。 本发明实施例提供的终端设备 30, 如图 3所示, 包括:
接收单元 301, 用于接收用户触发的运行本机应用程序的指令。
应用程序中设置有一个默认路径, 默认路径用于指示应用程序将运行后生成的数据保 存至默认路径下。
确定单元 302, 用于确定应用程序安装的存储空间的实际路径。
该确定单元 302包括: 身份获取模块, 用于获取应用程序自带的指示应用程序身份的 应用身份标识; 路径确定模块, 用于根据应用身份标识, 在数据库中查找与应用身份标识 相应的应用程序安装的存储空间的实际路径。
其中, 应用身份标识与应用程序安装的存储空间的实际路径的对应关系为应用层在应 用程序安装时记录并存储至数据库中的。
运行单元 303, 用于运行应用程序, 并获取应用程序运行后生成的数据。
存储单元 304, 用于将应用程序运行后生成的数据存储在应用程序安装的存储空间的 实际路径下。
这样一来, 运行单元在接收单元接收用户触发的运行本机应用程序的指令后运行应用 程序, 存储单元并根据确定单元所确定的应用程序安装的存储空间的实际路径将应用程序 运行后的数据存储在该存储空间的实际路径下, 使应用程序运行后的数据存储在应用程序 安装的存储空间中, 进而能够使识别默认路径的应用程序的安装和数据保存位于同一存储 空间中, 方便用户的使用。
进一步的, 如图 4所示, 该终端设备 30还包括:
提示单元 305, 用于在接收用户确定安装应用程序的指令后, 向用户提示安装应用程 序的各个存储空间的实际路径。
选定单元 306, 用于接收用户选定的存储空间的实际路径。
安装单元 307, 用于安装应用程序至用户选定的存储空间的实际路径下, 并存储所述 应用程序自带的指示所述应用程序身份的应用身份标识与所述应用程序安装的存储空间 的实际路径的对应关系至数据库中。
需要说明的是, 终端设备的各个存储空间的实际路径的根目录与默认路径的根目录相 同。 该存储空间的实际路径的根目录可以为 " /sdcard/ " 目录。
该终端设备包括手机、 人机交互终端、 电子书、 具有显示功能的终端中的任意一种。 当该终端设备为手机时, 手机还包括: 射频电路、 音频电路和电源电路。
射频电路,用于建立手机与无线网络的通信,实现手机与无线网络的数据接收和发送。 音频电路, 用于采集声音并将采集的声音转化为声音数据, 以便手机通过射频电路向 无线网络发送声音数据, 和 /或将手机通过射频电路从无线网络接收的声音数据, 还原为 声音并向用户播放该声音。
电源电路, 用于为手机的各个电路或器件供电。
该手机还可以包括: 显示屏、 电源等, 以便完成手机的基本功能, 特别的, 上述音频 电路包括了麦克风、 扬声器, 其中麦克风用于采集声音并将采集的声音转化为声音数据, 以便手机通过射频电路向无线网络发送声音数据; 扬声器于将手机通过射频电路从无线网 络接收的声音数据, 还原为声音并向用户播放该声音。
电源, 主要用于为手机的各个电路或器件供电, 保证手机的正常工作。
本发明实施例提供的终端设备中, 运行单元在接收单元接收用户触发的运行本机应用 程序的指令后运行应用程序, 存储单元并根据确定单元所确定的应用程序安装的存储空间 的实际路径将应用程序运行后的数据存储在该存储空间的实际路径下, 使应用程序运行后 的数据存储在应用程序安装的存储空间中, 进而能够使识别默认路径的应用程序的安装和 数据保存位于同一存储空间中, 方便用户的使用。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于此, 任何熟 悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到变化或替换, 都应涵盖 在本发明的保护范围之内。 因此, 本发明的保护范围应以所述权利要求的保护范围为准。

Claims

权利要求
1、 一种应用程序数据存储的方法, 其特征在于, 包括:
接收用户触发的运行应用程序的指令;
确定所述应用程序安装的存储空间的实际路径;
运行所述应用程序, 并获取所述应用程序运行后生成的数据;
将所述应用程序运行后生成的数据存储在所述应用程序安装的存储空间的实际路径 下。
2、 根据权利要求 1 所述的方法, 其特征在于, 确定所述应用程序安装的存储空间的 实际路径包括:
获取所述应用身份标识;
根据所述应用身份标识, 在所述数据库中查找与所述应用身份标识对应的所述应用程 序安装的存储空间的实际路径。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 在所述接收用户触发的运行应用 程序的指令前, 还包括:
接收用户安装应用程序的指令后, 向所述用户提示可安装所述应用程序的各个存储空 间的实际路径;
接收所述用户选定的存储空间的实际路径;
安装所述应用程序至所述用户选定的存储空间的实际路径下, 并存储所述应用程序自 带的指示所述应用程序身份的应用身份标识与所述应用程序安装的存储空间的实际路径 的对应关系至数据库中。
4、 根据权利要求 1至 3任意一项权利要求所述的方法, 其特征在于,
所述应用程序中设置有一个默认路径, 所述默认路径用于指示应用程序将运行后生成 的数据保存至所述默认路径下。
5、 根据权利要求 4所述的方法, 其特征在于:
所述应用程序安装的存储空间的实际路径的根目录与所述默认路径的根目录相同。
6、 根据权利要求 5所述的方法, 其特征在于,
所述根目录为 " /sdcard"。
7、 一种终端设备, 其特征在于, 包括:
接收单元, 用于接收用户触发的运行应用程序的指令;
确定单元, 用于确定所述应用程序安装的存储空间的实际路径; 运行单元, 用于运行所述应用程序, 并获取所述应用程序运行后生成的数据; 存储单元, 用于将所述应用程序运行后生成的数据存储在所述应用程序安装的存储空 间的实际路径下。
8、 根据权利要求 7所述的终端设备, 其特征在于, 所述终端设备还包括: 提示单元, 用于在接收用户确定安装应用程序的指令后, 向所述用户提示安装所述应 用程序的各个存储空间的实际路径;
选定单元, 用于接收所述用户选定的存储空间的实际路径;
安装单元, 用于安装所述应用程序至所述用户选定的存储空间的实际路径下, 并存储 所述应用程序自带的指示所述应用程序身份的应用身份标识与所述应用程序安装的存储 空间的实际路径的对应关系至数据库中。
9、 根据权利要求 7或 8所述的终端设备, 其特征在于, 所述确定单元包括: 身份获取模块, 用于获取所述应用身份标识;
路径确定模块, 用于根据所述应用身份标识, 在所述数据库中查找与所述应用身份标 识对应的所述应用程序安装的存储空间的实际路径。
10、 根据权利要求 7至 9任意一项权利要求所述的终端设备, 其特征在于, 所述应用程序中设置有一个默认路径, 所述默认路径用于指示应用程序将运行后生成 的数据保存至所述默认路径下。
11、 根据权利要求 10所述的终端设备, 其特征在于,
所述应用程序安装的存储空间的实际路径的根目录与所述默认路径根目录相同。
12、 根据权利要求 11所述的终端设备, 其特征在于,
所述根目录为 "/sdcard"。
13、 根据权利要求 7至 12任意一项权利要求所述的终端设备, 其特征在于, 所述终 端设备为手机, 所述手机还包括: 射频电路、 音频电路、 电源电路;
所述射频电路, 用于建立手机与无线网络的通信, 实现手机与无线网络的数据接收和 发送;
所述音频电路, 用于采集声音并将采集的声音转化为声音数据, 以便所述手机通过所 述射频电路向无线网络发送所述声音数据, 和 /或将所述手机通过所述射频电路从无线网 络接收的声音数据, 还原为声音并向用户播放该声音;
所述电源电路, 用于为所述手机的各个电路或器件供电。
PCT/CN2013/070143 2012-02-28 2013-01-07 一种应用程序数据存储的方法及终端设备 WO2013127274A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2014519412A JP2014526088A (ja) 2012-02-28 2013-01-07 アプリケーションデータの記憶方法及び端末装置
KR1020137033822A KR101578832B1 (ko) 2012-02-28 2013-01-07 애플리케이션 데이터를 저장하는 방법 및 단말 기기
EP13755403.6A EP2704041B1 (en) 2012-02-28 2013-01-07 Method for storing application data and terminal device
US14/141,775 US9152480B2 (en) 2012-02-28 2013-12-27 Method for storing application data and terminal device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210047761.3 2012-02-28
CN201210047761.3A CN102646042B (zh) 2012-02-28 2012-02-28 一种应用程序数据存储的方法及终端设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/141,775 Continuation US9152480B2 (en) 2012-02-28 2013-12-27 Method for storing application data and terminal device

Publications (1)

Publication Number Publication Date
WO2013127274A1 true WO2013127274A1 (zh) 2013-09-06

Family

ID=46658872

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/070143 WO2013127274A1 (zh) 2012-02-28 2013-01-07 一种应用程序数据存储的方法及终端设备

Country Status (6)

Country Link
US (1) US9152480B2 (zh)
EP (1) EP2704041B1 (zh)
JP (1) JP2014526088A (zh)
KR (1) KR101578832B1 (zh)
CN (1) CN102646042B (zh)
WO (1) WO2013127274A1 (zh)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646042B (zh) 2012-02-28 2014-12-03 华为终端有限公司 一种应用程序数据存储的方法及终端设备
CN103440178B (zh) * 2013-07-30 2017-11-07 广东欧珀移动通信有限公司 备份应用程序运行参数的方法及其移动终端
CN104424111A (zh) * 2013-09-10 2015-03-18 联想(北京)有限公司 一种数据存储方法及电子设备
CN103530180B (zh) * 2013-10-18 2017-02-01 北京奇虎科技有限公司 应用程序的存储空间切换方法及装置
CN104679544A (zh) * 2013-11-29 2015-06-03 中兴通讯股份有限公司 应用程序管理方法及装置
CN104239494B (zh) * 2014-09-09 2018-02-23 广州华多网络科技有限公司 一种安装路径搜索方法及系统、辅助客户端
CN104572265B (zh) * 2014-12-31 2018-09-04 广东欧珀移动通信有限公司 控制应用运行的方法和移动终端设备
TWI552009B (zh) * 2015-01-12 2016-10-01 宏達國際電子股份有限公司 電子裝置與分類方法
US10572449B2 (en) 2015-03-02 2020-02-25 Walmart Apollo, Llc Systems, devices, and methods for software discovery using application ID tags
CN104657181A (zh) * 2015-03-02 2015-05-27 深圳市中兴移动通信有限公司 应用程序安装方法及装置
CN106598974B (zh) * 2015-10-15 2020-07-03 青岛海信移动通信技术股份有限公司 一种安卓系统应用程序的数据文件生成及调用方法和装置
CN105677445A (zh) * 2016-01-25 2016-06-15 上海斐讯数据通信技术有限公司 应用的安装管理方法、装置及智能终端
WO2018000300A1 (zh) 2016-06-30 2018-01-04 华为技术有限公司 一种电子设备的数据操作方法及电子设备
CN106202551A (zh) * 2016-07-27 2016-12-07 广东欧珀移动通信有限公司 一种文件管理方法、装置及移动终端
CN106406952B (zh) * 2016-09-21 2018-07-06 广州爱九游信息技术有限公司 电子终端及应用程序管理装置与方法
WO2019019194A1 (zh) * 2017-07-28 2019-01-31 华为技术有限公司 应用管理方法及终端
CN110309105B (zh) * 2018-03-23 2023-08-11 阿里巴巴(北京)软件服务有限公司 数据处理方法、系统和设备
CN109472157B (zh) * 2018-10-29 2022-04-19 努比亚技术有限公司 应用程序数据的存储方法、移动终端以及计算机存储介质
CN111711723A (zh) * 2020-06-08 2020-09-25 广东快车科技股份有限公司 一种移动终端的扩展配件装置及应用方法
CN112115134A (zh) * 2020-08-04 2020-12-22 北京金山云网络技术有限公司 数据存储方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340663A (zh) * 2008-05-30 2009-01-07 普天信息技术研究院有限公司 智能存储卡系统以及该系统实现交互的方法
CN101853296A (zh) * 2010-05-28 2010-10-06 华为终端有限公司 管理应用程序的方法和装置
CN102646042A (zh) * 2012-02-28 2012-08-22 华为终端有限公司 一种应用程序数据存储的方法及终端设备

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6360364B1 (en) * 1999-03-17 2002-03-19 Microsoft Corporation System and method for installing an application on a portable computer
US6898727B1 (en) * 2000-03-22 2005-05-24 Emc Corporation Method and apparatus for providing host resources for an electronic commerce site
US6574716B2 (en) * 2001-05-30 2003-06-03 Hewlett-Packard Development Company, L.P. Unifying data storage in a distributed network
US20040172526A1 (en) * 2003-02-27 2004-09-02 Tann Johnathan P. Universal loader for portable electronic devices
US7606973B2 (en) * 2004-09-08 2009-10-20 International Business Machines Corporation System and method for pervasive computing with a portable non-volatile memory device
US20080005472A1 (en) 2006-06-30 2008-01-03 Microsoft Corporation Running applications from removable media
US8024712B1 (en) * 2006-09-29 2011-09-20 Emc Corporation Collecting application logs
CN101425016B (zh) * 2007-11-01 2012-07-25 珠海金山快快科技有限公司 运行安装软件的方法和系统
CN101404023A (zh) * 2008-11-18 2009-04-08 深圳市迅雷网络技术有限公司 一种对下载的文件进行操作的方法和装置
EP2488946B1 (en) * 2009-10-12 2018-11-28 Veeam Software Ag Item-level restoration and verification of image level backups
CN102053903A (zh) 2009-10-30 2011-05-11 国际商业机器公司 用于为在线运行程序保存和查询场景数据的方法和系统
KR101594000B1 (ko) * 2009-12-02 2016-02-26 삼성전자주식회사 포커스 렌즈의 이동 방향을 결정하는 오토포커싱 방법, 상기 방법을 기록한 기록 매체, 오토포커싱 장치
JP5335737B2 (ja) * 2010-07-23 2013-11-06 レノボ・シンガポール・プライベート・リミテッド 動作環境の変更が可能なコンピュータ
US8952978B2 (en) * 2010-09-28 2015-02-10 Sony Corporation Display device, viewing angle control method, computer program storage device with viewing angle control program, and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340663A (zh) * 2008-05-30 2009-01-07 普天信息技术研究院有限公司 智能存储卡系统以及该系统实现交互的方法
CN101853296A (zh) * 2010-05-28 2010-10-06 华为终端有限公司 管理应用程序的方法和装置
CN102646042A (zh) * 2012-02-28 2012-08-22 华为终端有限公司 一种应用程序数据存储的方法及终端设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2704041A4 *

Also Published As

Publication number Publication date
EP2704041B1 (en) 2016-11-16
CN102646042B (zh) 2014-12-03
KR20140025523A (ko) 2014-03-04
JP2014526088A (ja) 2014-10-02
US20140115609A1 (en) 2014-04-24
US9152480B2 (en) 2015-10-06
EP2704041A1 (en) 2014-03-05
CN102646042A (zh) 2012-08-22
EP2704041A4 (en) 2014-07-23
KR101578832B1 (ko) 2015-12-18

Similar Documents

Publication Publication Date Title
WO2013127274A1 (zh) 一种应用程序数据存储的方法及终端设备
WO2019119544A1 (zh) 嵌入式sim卡的数据访问的方法和设备
KR101828903B1 (ko) 로밍 네트워크 액세스 방법 및 장치
EP3944584B1 (en) Method supporting wireless access to storage device, and mobile routing hotspot device
KR102107132B1 (ko) 전자 장치의 억세스 포인트 접속 방법 및 그 전자 장치
CN103096306A (zh) 音频播放方法及系统
CN102917116A (zh) 一种手机软件的分享方法及手机
JP2011103047A (ja) 電子機器及びアクセス制御方法
WO2020037560A1 (zh) 一种应用的安装方法及终端
US20230054451A1 (en) Communication Connection Method and Electronic Device
US20210235245A1 (en) Terminal Application Activation Method, Apparatus, and System
KR101621637B1 (ko) 이동 단말기 리소스 처리 방법과 장치, 클라이언트측 컴퓨터, 서버, 이동 단말기, 프로그램 및 기록매체
AU2014200056A1 (en) Apparatus and method for providing a near field communication function in a portable terminal
CN113552808A (zh) 一种电子家居设备配网方法、电子家居设备以及移动终端
KR20120080823A (ko) 클라이언트 장치를 이용한 호스트 장치의 파일 정보 시스템 편집 방법 및 시스템
EP3553650B1 (en) Multimedia data playback method and terminal device
CN106303616B (zh) 一种播放控制方法、装置及终端
TWI471051B (zh) 外接式電子裝置及儲存裝置的無線存取方法
EP2835737A1 (en) Data terminal running mode switching method, device, and data terminal
CN110944318A (zh) 一种锁卡设置方法、装置、存储介质及终端
CN113709720B (zh) 一种sim双模卡异常的优化方法及电子设备
CN104092742A (zh) 一种利用智能手机对其他智能设备进行远程设置及维护的方法
CN115278642A (zh) 获取sim卡的信息的方法、电子设备及终端设备
CN107147712B (zh) 更新网络应用程序的方法及装置
WO2013166775A1 (zh) 一种连网方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13755403

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2013755403

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013755403

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20137033822

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2014519412

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE