WO2018192184A1 - 双系统内存共享方法及装置 - Google Patents

双系统内存共享方法及装置 Download PDF

Info

Publication number
WO2018192184A1
WO2018192184A1 PCT/CN2017/103796 CN2017103796W WO2018192184A1 WO 2018192184 A1 WO2018192184 A1 WO 2018192184A1 CN 2017103796 W CN2017103796 W CN 2017103796W WO 2018192184 A1 WO2018192184 A1 WO 2018192184A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
file
available capacity
current
partitions
Prior art date
Application number
PCT/CN2017/103796
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 广州视源电子科技股份有限公司
Publication of WO2018192184A1 publication Critical patent/WO2018192184A1/zh

Links

Images

Classifications

    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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

Definitions

  • the present invention relates to the field of electronic device technologies, and in particular, to a dual system memory sharing method and apparatus.
  • Dual-system interactive intelligent devices are becoming more and more mature, and are widely used in education, business meetings, business presentations, etc., which can effectively improve the communication environment and improve group communication efficiency.
  • two Android modules are usually set to load two Android systems.
  • the Android module of the TV solution is often used as the host (Host machine) for input, output and display, and the other Android module is used as the slave (Slave machine), which is the system when the user normally uses.
  • the memory of the two systems cannot be shared.
  • the file When the file is received, it can only be stored in the system running in the foreground, and the memory of the two systems cannot be fully utilized, resulting in the memory of the dual-system interactive smart device.
  • the utilization efficiency is low and the user experience is poor.
  • the invention provides a dual system memory sharing method, comprising:
  • the available capacity of the memory of the first system and the second system is smaller than the occupied space of the current file written, and the total available capacity of the memory of the first system and the second system is greater than the current
  • the current file is divided into two partitions, which are respectively stored in the first system and the second system, wherein the partitions stored in the first system are occupied.
  • the space is less than or equal to the available capacity of the memory of the first system, and the occupied space of the partition stored in the second system is less than or equal to the available capacity of the memory of the second system.
  • the dual system memory sharing method wherein the dividing the current file into two partitions, After the steps of being stored in the first system and the second system respectively, the method further includes:
  • the dual system memory sharing method wherein the step of dividing the current file into two partitions, respectively stored in the first system and the second system, includes:
  • the remaining portion of the segmented current file is stored in the second system.
  • the dual system memory sharing method wherein the step of dividing the current file into two partitions, respectively stored in the first system and the second system, includes:
  • the dual system memory sharing method wherein the first system and the second system are connected through a local area network or through an ADB debug channel.
  • the invention also provides a dual system memory sharing device, comprising:
  • the memory calculation module is configured to calculate the available capacity of the memory of the first system and the second system respectively when the file is written;
  • the current file is divided into two partitions, which are respectively stored in the first system and the second system, where are stored in the first system.
  • the occupied space of the partition is less than or equal to the available capacity of the memory of the first system, and the occupied space of the partition stored in the second system is less than or equal to the available capacity of the memory of the second system.
  • the above dual system memory sharing device further includes:
  • a monitoring module configured to detect whether file deletion or removal occurs in the first system and the second system
  • a mobile module configured to move the partition in the another system to the current system when a occupied space of the partition in another system is less than or equal to an available capacity of a memory of the current system in;
  • a merging module configured to merge two of the segments belonging to the same file in the current system into an original file
  • the memory calculation module is further configured to:
  • the available capacity of the current system memory after the storage file is deleted or removed is calculated.
  • the dual-system memory sharing device wherein the split storage module includes:
  • a first split storage submodule configured to divide the current file according to an available capacity of a memory of the first system, to obtain a partition occupying a space equal to an available capacity of the first system, and storing the current file in the In the first system;
  • the dual-system memory sharing device wherein the split storage module includes:
  • a capacity ratio calculation module configured to calculate a ratio of available capacity of the memory of the first system and the second system
  • a third partition storage submodule configured to divide the current file into two partitions whose ratio of occupied space is equal to the ratio of the available capacity, and are respectively stored in the first system and the second system.
  • the dual system memory sharing device wherein the first system and the second system are connected through a local area network or through an ADB debug channel.
  • the present invention exists in two systems by dividing the written file into two parts.
  • System memory utilization efficiency is improved.
  • FIG. 1 is a flowchart of a dual system memory sharing method in a first embodiment of the present invention
  • FIG. 2 is a flowchart of a dual system memory sharing method in a second embodiment of the present invention.
  • FIG. 3 is a flowchart of a dual system memory sharing method in a third embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a dual system memory sharing device in a fourth embodiment of the present invention.
  • a dual system memory sharing method includes steps S11 to S12.
  • step S11 when the file is written, the available capacity of the memory of the first system and the second system is calculated separately.
  • the first system and the second system are all installed on the same dual-system intelligent interaction device, for example, an interactive smart tablet, which has two Android (Android) modules respectively. Load two Android systems.
  • the pluggable Android module acts as a slave machine and the other Android module acts as a host machine.
  • the first system in this embodiment is an Android system as a Host machine, and the second system is an Android system of a Slave machine.
  • the two Android systems debug the channel connection and exchange information through the LAN or through the ADB (Android Debug Bridge).
  • the first system and the second system each have a set of independent hardware, such as each having a memory.
  • the first A system and a second system can also share specific hardware, such as a keyboard, a mouse, or a touch screen.
  • the first system and the second system can calculate the available, used, and total capacity of the storage space through the system interface, and the second system notifies the calculated value to the first system through the local area network or through the ADB debug channel.
  • the available capacity of the memory of the first system and the second system and the total available capacity of the memory of the first system and the second system are obtained.
  • Step S12 when the available capacity of the memory of the first system and the second system is smaller than the occupied space of the current file written, and the total available capacity of the memory of the first system and the second system is greater than
  • the current file is divided into two blocks, which are respectively stored in the first system and the second system.
  • the occupied space of the partition stored in the first system is less than or equal to the available capacity of the memory of the first system
  • the occupied space of the partition stored in the second system is less than or equal to The available capacity of the memory of the second system.
  • the present embodiment divides the written files into two systems separately.
  • the file is divided according to the preset splitting scheme, and the memory of the other system is used after the memory of the current system is used up. That is, dividing the current file according to the available capacity of the memory of the first system, obtaining a partition occupying a space equal to the available capacity of the memory of the first system, and storing the same in the first system; The remaining portion of the segmented current file is stored in the second system.
  • the first system needs to write an 80MB video file
  • the available memory of the first system is 60MB
  • the available capacity of the second system is 40MB
  • the 80MB file is divided into 60MB and 20MB.
  • the blocks are stored in the first system and the second system, respectively.
  • the current file when the current file is divided, it can also be divided according to the ratio of the available capacity of the memory of the two systems.
  • the first system needs to write an 80MB video file
  • the available capacity of the first system is 60MB
  • the available capacity of the second system is 40MB
  • the available capacity of the memory of the first system and the second system The ratio is equal to 3/2
  • the 80 MB file is divided into two partitions having a footprint equal to 48 MB and 32 MB, respectively, which are stored in the first system and the second system, respectively.
  • other splitting schemes can also be preset.
  • This embodiment is divided into two parts by dividing the written file into two parts.
  • the system mentioned in other embodiments of the present invention may be a Windows Phone system (WP system), a Windows system, or an IOS system (Apple mobile device operating system) in addition to the Android system.
  • WP system Windows Phone system
  • IOS system Apple mobile device operating system
  • the dual system can be two identical systems or two different systems.
  • a dual system memory sharing method includes steps S21 to S25.
  • step S21 when the file is written, the available capacity of the memory of the first system and the second system is calculated separately.
  • Step S22 when the available capacity of the memory of the first system and the second system is smaller than the occupied space of the current file written, and the total available capacity of the memory of the first system and the second system is greater than
  • the current file is divided into two blocks, which are respectively stored in the first system and the second system.
  • the current file is divided into two partitions whose ratio of occupied space is equal to the available capacity according to the ratio of the available capacity of the memory of the first system and the second system, and are separately stored. In the first system and the second system.
  • step S23 when it is detected that the storage file of any system is deleted or removed, the available capacity of the current system memory after the storage file is deleted or removed is calculated.
  • Step S24 determining whether the occupied space of the partition in another system is less than or equal to the available capacity of the current system, and if so, moving the partition in the other system to the current system in.
  • the partitioning moves between systems through a local area network or through an ADB debugging channel.
  • the ADB debugging channel is mainly applicable to devices in which both systems are Android systems.
  • the merged files are sequentially sorted according to the order of the divided times. That is, the two partitions of the first split file are preferentially merged, and after the merge of one file is completed, the next file is merged until the available capacity of the current system memory is not Enough to accommodate any one of the blocks in another system.
  • the merging of the blocks can also be performed according to the priority of the divided files. That is, the higher the priority file, the earlier the merge.
  • Step S25 combining the two segments belonging to the same file in the current system into an original file.
  • the memory change of the first system and the second system is monitored in real time by setting a storage space monitoring service.
  • any system such as the storage file of the first system
  • the memory of the first system is thus increased.
  • the available capacity of the memory of the first system is calculated, and it is determined whether the occupied space of the partition in the second system is less than or equal to the available capacity of the memory of the first system. If so, the block of the second system is moved to the first system, and another block corresponding thereto is merged into the original file.
  • FIG. 3 illustrates a dual system memory sharing method according to a third embodiment of the present invention, including steps S31-S40.
  • step S31 when the file is written, the available capacity of the memory of the first system and the second system is calculated separately.
  • step S32 it is determined whether the available capacity of the memory of the first system is greater than or equal to the occupied space of the current file that is written, and if yes, step S33 is performed, otherwise step S34 is performed.
  • Step S33 storing the current file in the first system.
  • step S34 it is determined whether the available capacity of the memory of the second system is greater than or equal to the occupied space of the current file that is written. If the step S35 is performed, otherwise step S36 is performed.
  • Step S35 storing the current file in the second system.
  • step S36 it is determined whether the total available capacity of the memory of the first system and the second system is greater than the occupied space of the current file, and if yes, step S37 is performed.
  • Step S37 dividing the current file into two partitions, which are respectively stored in the first system and the second system.
  • the occupied space of the partition stored in the first system is less than or equal to The available capacity of the memory of the first system
  • the occupied space of the partition stored in the second system is less than or equal to the available capacity of the memory of the second system.
  • the split information of the current file is saved in the first system, and the split information includes storage path information of each of the partitions, and each The occupied space of the partition, the MD5 value of each of the partitions, and the file information of each of the partitions.
  • step S38 when it is detected that the storage file of any one system is deleted or removed, the available capacity of the memory of the current system in which the storage file is deleted or removed is calculated.
  • Step S39 determining whether the occupied space of the partition in another system is less than or equal to the available capacity of the current system memory, and if so, moving the partition in the another system to the current system in.
  • Step S40 combining the two segments belonging to the same file in the current system into an original file.
  • the written file When writing a file, if the available capacity of the memory of the first system or the second system is sufficient, the written file is stored in a system with sufficient memory. If the memory of both systems is insufficient and the total available capacity of the memory of both systems is sufficient, the written file is divided into two blocks and stored in two systems.
  • the split information includes:
  • the storage path information of each of the partitions that is, the path of each of the partitions stored in the storage space of the corresponding system, facilitates searching and moving the partitions during the file merge process;
  • the occupied space of each of the partitions that is, the size of each of the partitions
  • the file information of each of the blocks that is, which file each of the blocks belongs to.
  • File merge In the process, two partitions originally belonging to the same file are merged into the original file according to the file information of each of the partitions.
  • the split information of the merged file is deleted.
  • a dual system memory sharing device includes:
  • the memory calculation module 10 is configured to calculate, respectively, the available capacity of the memory of the first system and the second system when the file is written;
  • the partitioning storage module 20 is configured to: when the available capacity of the memory of the first system and the second system is smaller than the occupied space of the current file that is written, and the memory of the first system and the second system When the total available capacity is greater than the occupied space of the current file, the current file is divided into two partitions, which are respectively stored in the first system and the second system.
  • the occupied space of the partition stored in the first system is less than or equal to the available capacity of the memory of the first system
  • the occupied space of the partition stored in the second system is less than or equal to the first The available capacity of the memory of the second system.
  • split storage module 20 includes:
  • a first split storage submodule configured to divide the current file according to an available capacity of a memory of the first system, to obtain a partition occupying a space equal to an available capacity of the first system, and storing the current file in the In the first system;
  • a second split storage submodule configured to store the remaining portion of the divided current file in the second system.
  • the split storage module 20 includes:
  • a capacity ratio calculation module configured to calculate a ratio of available capacity of the memory of the first system and the second system
  • a third partition storage submodule configured to divide the current file into two partitions whose ratio of occupied space is equal to the ratio of the available capacity, and are respectively stored in the first system and the second system.
  • two systems of the dual-system intelligent interaction device are connected through a local area network or through an ADB debug channel, and perform information interaction between files and data.
  • the available capacity within each system is detected by the memory computing module 10, when the available capacity of the memory of both systems is less than the occupied space of the written file, and the total available capacity of the two systems
  • the split storage module 20 divides the written file into two partitions, which are respectively stored in two systems.
  • the dual system memory sharing device further includes:
  • the monitoring module 30 is configured to detect whether file deletion or removal occurs in the first system and the second system;
  • a moving module 40 configured to move the partition in the another system to the current when a occupied space of the partition in another system is less than or equal to an available capacity of a memory of the current system In the system;
  • a merging module 50 configured to merge two of the segments belonging to the same file in the current system into an original file
  • the memory calculation module 10 is further configured to:
  • the available capacity of the current system memory after the storage file is deleted or removed is calculated.
  • the memory computing module 10 calculates the available capacity of the memory of the current system in which the deletion or removal occurs. And, the mobile module 40 moves the partition in another system that has a occupied space less than or equal to the available capacity of the current system's memory to the current system. The two of the segments in the current system are merged into the original file by the merge module 50. The two partitions of the split file are merged into the original file to be readable.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种双系统内存共享方法及装置,所述方法包括:进行文件写入时,分别计算第一系统和第二系统的内存的可用容量(S11,S21,S31);当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中(S12,S22)。通过将写入的文件分割为两部分,分别存在两个系统中。基于上述方案,提高了双系统内存的利用效率。

Description

双系统内存共享方法及装置 技术领域
本发明涉及电子设备技术领域,特别是涉及一种双系统内存共享方法及装置。
背景技术
双系统交互智能设备日趋成熟,广泛应用于教育教学、企业会议、商业展示等领域,可有效改善沟通环境、提升群体沟通效率。现有交互智能设备中,通常设置两个Android模块加载两个Android系统。其中,往往选用TV方案的Android模块作为主机(Host机)用于输入输出和显示用,另一个Android模块作为从机(Slave机),为用户正常使用时的系统。
现有的双系统交互智能设备中,两个系统的内存不能共享,在接收文件时只能存储在当前前台运行的系统中,无法充分利用两个系统的内存,导致双系统交互智能设备的内存利用效率低、用户体验较差。
发明内容
鉴于上述状况,有必要针对现有技术中两个系统的内存利用功率低的问题,提供一种双系统内存共享方法和装置。
本发明提供了一种双系统内存共享方法,包括:
进行文件写入时,分别计算第一系统和第二系统的内存的可用容量;
当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中,其中,储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
上述双系统内存共享方法,其中,所述将所述当前文件分割为两个分块, 分别存储在所述第一系统和所述第二系统中的步骤之后还包括:
当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量;
判断另一系统中的所述分块的占用空间是否小于或等于所述当前系统的内存的可用容量,若是,将所述另一系统的所述分块移动至所述当前系统中;
将所述当前系统中属于同一文件的两个所述分块合并为原文件。
上述双系统内存共享方法,其中,所述将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中的步骤包括:
根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;
将分割后的所述当前文件的剩余部分存储在所述第二系统中。
上述双系统内存共享方法,其中,所述将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中的步骤包括:
计算所述第一系统和所述第二系统的内存的可用容量之比,将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,分别存储在所述第一系统和所述第二系统中。
上述双系统内存共享方法,其中,所述第一系统和所述第二系统通过局域网或者通过ADB调试通道连接。
本发明还提供了一种双系统内存共享装置,包括:
内存计算模块,用于进行文件写入时,分别计算第一系统和第二系统的内存的可用容量;
分割存储模块,用于当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中,其中,储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
上述双系统内存共享装置,还包括:
监测模块,用于检测所述第一系统和所述第二系统是否发生文件删除或移除;
移动模块,用于当另一系统中的所述分块的占用空间小于或等于所述当前系统的内存的可用容量时,将所述另一系统中的所述分块移动至所述当前系统中;
合并模块,用于将所述当前系统中属于同一文件的两个所述分块合并为原文件;
所述内存计算模块还用于:
当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量。
上述双系统内存共享装置,其中,所述分割存储模块包括:
第一分割存储子模块,用于根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;
第二分割存储子模块,将分割后的所述当前文件的剩余部分存储在所述第二系统中。
上述双系统内存共享装置,其中,所述分割存储模块包括:
容量比计算模块,用于计算所述第一系统和所述第二系统的内存的可用容量之比;
第三分割存储子模块,用于将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,并分别存储在所述第一系统和所述第二系统中。
上述双系统内存共享装置,其中,所述第一系统和所述第二系统通过局域网或者通过ADB调试通道连接。
本发明通过将写入的文件分割为两部分,分别存在两个系统中。解决了两个系统的内存的可用容量均小于写入的当前文件的占用空间,且两个系统的内存总可用容量大于当前文件的占用空间时,无法存储写入的文件的问题,提高了双系统内存的利用效率。
附图说明
图1为本发明第一实施例中的双系统内存共享方法流程图;
图2为本发明第二实施例中的双系统内存共享方法流程图;
图3为本发明第三实施例中的双系统内存共享方法流程图;
图4为本发明第四实施例中的双系统内存共享装置的结构框图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。
参照下面的描述和附图,将清楚本发明的实施例的这些和其他方面。在这些描述和附图中,具体公开了本发明的实施例中的一些特定实施方式,来表示实施本发明的实施例的原理的一些方式,但是应当理解,本发明的实施例的范围不受此限制。相反,本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。
请参阅图1,为本发明第一实施例中的双系统内存共享方法,包括步骤S11~S12。
步骤S11,进行文件写入时,分别计算第一系统和第二系统的内存的可用容量。
本实施例中,所述第一系统及所述第二系统均安装在同一个双系统智能交互设备上,该双系统智能交互设备例如为交互智能平板,其具有两个Android(安卓)模块分别加载两个Android系统。其中可插拔的Android模块作为Slave机,另一个Android模块作为Host机。本实施例中的第一系统为作为Host机的Android系统,第二系统为Slave机的Android系统。
两个Android系统通过局域网或者通过ADB(Android Debug Bridge,Android调试桥接器)调试通道连接,并进行信息交互。在所述双系统智能交互设备中,第一系统及第二系统均具有一套独立的硬件,如各自具有一个内存。当然,第 一系统及第二系统也可共用特定的硬件,如键盘、鼠标或者触摸屏等。
第一系统和第二系统可通过系统接口计算存储空间可用、已用、总的容量,第二系统将计算好的数值通过局域网或者通过ADB调试通道同步通知给第一系统。即可得到第一系统和第二系统的内存的可用容量以及第一系统和第二系统的内存的总可用容量。
步骤S12,当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中。其中,储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
现有技术中,当两个系统的内存的可用容量均小于写入的当前文件的占用空间,且两个系统的总可用容量大于当前文件的占用空间时,无法充分利用两个系统的内存进行文件的存储。
为了解决这一问题,本实施例将写入的文件进行分割分别存储在两个系统中。在进行文件分割和存储时,按照预设的分割方案进行文件分割,将当前系统的内存使用完后再使用另外一个系统的内存。即,根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;将分割后的所述当前文件的剩余部分存储在所述第二系统中。
例如,第一系统需要写入一个80MB的视频文件,第一系统的内存的可用容量为60MB,第二系统的内存的可用容量为40MB时,将该80MB的文件分割为60MB和20MB的两个分块,分别存储在第一系统和第二系统中。
可以理解的,对当前文件进行分割时,也可以按照两个系统的内存的可用容量的比例进行分割。例如第一系统需要写入一个80MB的视频文件,第一系统的内存的可用容量为60MB,第二系统的内存的可用容量为40MB,第一系统和所述第二系统的内存的可用容量之比等于3/2,将该80MB的文件分割为占用空间分别等于48MB和32MB的两个分块,分别存储在第一系统和第二系统中。 当然,也可以预设其他的分割方案。
本实施例通过将写入的文件分割为两部分,分别存在两个系统中。解决了两个系统的内存的可用容量均小于写入的当前文件的占用空间,且两个系统的内存总可用容量大于当前文件的占用空间时,无法存储写入的文件的问题,提高了双系统内存的利用效率。
可以理解的,在本发明其他实施例中提到的系统除了为Android系统,还可以是Windows Phone系统(WP系统)、Windows系统、或IOS系统(苹果移动设备操作系统)。所述双系统可以是两个相同的系统,也可以是两个不同的系统。
请参阅图2,为本发明第二实施例中的双系统内存共享方法,包括步骤S21~S25。
步骤S21,进行文件写入时,分别计算第一系统和第二系统的内存的可用容量。
步骤S22,当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中。
上述步骤中,按照所述第一系统和所述第二系统的内存的可用容量之比将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,并分别存储在所述第一系统和所述第二系统中。
步骤S23,当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量。
步骤S24,判断另一系统中的所述分块的占用空间是否小于或等于所述当前系统的内存的可用容量,若是,将所述另一系统中的所述分块移动至所述当前系统中。所述分块通过局域网或者通过ADB调试通道进行系统间的移动,其中ADB调试通道主要适用于两个系统均为Android系统的设备中。
如若两个系统中存在多个文件的分块,则根据分割的时间的先后顺序依次进行分割后的文件的合并。即,先分割的文件的两个分块优先进行合并,一个文件合并完成后在进行下一个文件的合并,直至当前系统的内存的可用容量不 足以容纳另一系统中任何一个分块。
可以理解的,也可以根据被分割的文件的优先级进行分块的合并。即优先级越高的文件,越先进行合并。
步骤S25,将所述当前系统中属于同一文件的两个所述分块合并为原文件。
读取文件时,需要将分割后的文件的两个分块进行合并,本实施例中,不仅充分利用两个系统的内存对写入的文件进行分割,而且将分割后的文件进行合并。本实施例通过设置存储空间监控服务,实时监测第一系统和第二系统的内存变化。当任意一系统,例如第一系统的存储文件发生删除或移动到其他存储空间时,第一系统的内存因此增加。此时,计算第一系统的内存的可用容量,并判断第二系统中的分块的占用空间是否小于或等于第一系统的内存的可用容量。如是,则将第二系统的所述分块移动到第一系统中,并与其对应的另一个分块合并成原文件。
可以理解的,当第二系统的存储文件发生删除或移动时,对分割后的文件的合并过程与上述过程基本相同,在此不再赘述。
请参阅图3,为本发明第三实施例中的双系统内存共享方法,包括步骤S31~S40。
步骤S31,进行文件写入时,分别计算第一系统和第二系统的内存的可用容量。
步骤S32,判断所述第一系统的内存的可用容量是否大于或等于写入的当前文件的占用空间,若是,执行步骤S33,否则执行步骤S34。
步骤S33,将所述当前文件存储在所述第一系统中。
步骤S34,判断所述第二系统的内存的可用容量是否大于或等于写入的当前文件的占用空间,若是执行步骤S35,否则执行步骤S36。
步骤S35,将所述当前文件存储在所述第二系统中。
步骤S36,判断第一系统和第二系统的内存的总可用容量是否大于所述当前文件的占用空间,若是,执行步骤S37。
步骤S37,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中。并且,储存在所述第一系统的所述分块的占用空间小于或等于 所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
上述步骤中,当所述当前文件分割为两个分块时,将所述当前文件的分割信息保存在第一系统中,所述分割信息包括每个所述分块的存储路径信息、每个所述分块的占用空间、每个所述分块的MD5值和每个所述分块的所属文件信息。
步骤S38,当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除的当前系统的内存的可用容量。
步骤S39,判断另一系统中的所述分块的占用空间是否小于或等于所述当前系统的内存的可用容量,若是,将所述另一系统中的所述分块移动至所述当前系统中。
上述步骤,根据所述第一系统存储的每个所述分块的存储路径信息和每个所述分块的占用空间查找所述另一系统中的分块及确定其占用空间是否小于或等于所述当前系统的内存的可用容量。
步骤S40,将所述当前系统中属于同一文件的两个所述分块合并为原文件。
上述步骤中,根据所述当前系统存储的每个所述分块的所属文件信息将属于同一文件的两个分块合并为原文件。两个分块合并后根据MD5值确认文件的完整性。
当写入文件时,如果第一系统或第二系统的内存的可用容量足够时,将写入的文件存储在内存足够的系统中。如果两个系统的内存均不够,且两个系统的内存的总的可用容量足够时则将写入的文件分割为两个分块分别存储在两个系统中。
文件进行分割时,将文件的分割信息保存在第一系统中。所述分割信息包括:
每个所述分块的存储路径信息,即每个所述分块存储在对应系统的存储空间的路径,便于文件合并过程中查找和移动所述分块;
每个所述分块的占用空间,即每个所述分块的大小;
每个所述分块的所属文件信息,即每个所述分块属于哪个文件。文件合并 过程中根据每个所述分块的所属文件信息将原本属于同一文件的两个分块合并成原文件。
进一步的,分割的文件合并后,删除合并后的文件的分割信息。
请参阅图4,为本发明第四实施例中的双系统内存共享装置,包括:
内存计算模块10,用于进行文件写入时,分别计算第一系统和第二系统的内存的可用容量;
分割存储模块20,用于当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中。储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
进一步的,所述分割存储模块20包括:
第一分割存储子模块,用于根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;
第二分割存储子模块,用于将分割后的所述当前文件的剩余部分存储在所述第二系统中。
进一步的,本发明的另一实施例中,所述分割存储模块20包括:
容量比计算模块,用于计算所述第一系统和所述第二系统的内存的可用容量之比;
第三分割存储子模块,用于将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,并分别存储在所述第一系统和所述第二系统中。
本实施例中,双系统智能交互设备的两个系统通过局域网或者通过ADB调试通道连接,并进行文件、数据等信息的交互。当写入文件时,通过内存计算模块10检测每个系统的内的可用容量,当两个系统的内存的可用容量均小于写入的文件的占用空间,且所述两个系统的总可用容量大于写入的文件的占用空间时,分割存储模块20将写入的文件分割为两个分块,分别存储在两个系统中。
进一步的,上述双系统内存共享装置还包括:
监测模块30,用于检测所述第一系统和所述第二系统是否发生文件删除或移除;
移动模块40,用于当另一系统中的所述分块的占用空间小于或等于所述当前系统的内存的可用容量时,将所述另一系统中的所述分块移动至所述当前系统中;
合并模块50,用于将所述当前系统中属于同一文件的两个所述分块合并为原文件;
所述内存计算模块10还用于:
当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量。
当监测模块30监测到任意一系统的存储文件发生删除或移除时,内存计算模块10计算发生删除或移除的当前系统的内存的可用容量。并且,移动模块40将另一系统中占用空间小于或等于所述当前系统的内存的可用容量的所述分块移动至所述当前系统中。再通过合并模块50将所述当前系统中的两个所述分块合并为原文件。将分割后的文件的两个分块合并为原文件方可读取。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。

Claims (10)

  1. 一种双系统内存共享方法,其特征在于,包括:
    进行文件写入时,分别计算第一系统和第二系统的内存的可用容量;
    当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中,其中,储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
  2. 如权利要求1所述的双系统内存共享方法,其特征在于,所述将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中的步骤之后还包括:
    当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量;
    判断另一系统中的所述分块的占用空间是否小于或等于所述当前系统的内存的可用容量,若是,将所述另一系统的所述分块移动至所述当前系统中;
    将所述当前系统中属于同一文件的两个所述分块合并为原文件。
  3. 如权利要求1所述的双系统内存共享方法,其特征在于,所述将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中的步骤包括:
    根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;
    将分割后的所述当前文件的剩余部分存储在所述第二系统中。
  4. 如权利要求1所述的双系统内存共享方法,其特征在于,所述将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中的步骤包括:
    计算所述第一系统和所述第二系统的内存的可用容量之比,将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,分别存储在所述第一系统和所述第二系统中。
  5. 如权利要求1所述的双系统内存共享方法,其特征在于,所述第一系统和所述第二系统通过局域网或者通过ADB调试通道连接。
  6. 一种双系统内存共享装置,其特征在于,包括:
    内存计算模块,用于进行文件写入时,分别计算第一系统和第二系统的内存的可用容量;
    分割存储模块,用于当所述第一系统和所述第二系统的内存的可用容量均小于写入的当前文件的占用空间,且所述第一系统和所述第二系统的内存的总可用容量大于所述当前文件的占用空间时,将所述当前文件分割为两个分块,分别存储在所述第一系统和所述第二系统中,其中,储存在所述第一系统的所述分块的占用空间小于或等于所述第一系统的内存的可用容量,存储在所述第二系统的所述分块的占用空间小于或等于所述第二系统的内存的可用容量。
  7. 如权利要求6所述的双系统内存共享装置,其特征在于,还包括:
    监测模块,用于检测所述第一系统和所述第二系统是否发生文件删除或移除;
    移动模块,用于当另一系统中的所述分块的占用空间小于或等于所述当前系统的内存的可用容量时,将所述另一系统中的所述分块移动至所述当前系统中;
    合并模块,用于将所述当前系统中属于同一文件的两个所述分块合并为原文件;
    所述内存计算模块还用于:
    当监测到任意一系统的存储文件发生删除或移除时,计算发生存储文件删除或移除后的当前系统的内存的可用容量。
  8. 如权利要求6所述的双系统内存共享装置,其特征在于,所述分割存储模块包括:
    第一分割存储子模块,用于根据所述第一系统的内存的可用容量分割所述当前文件,得到占用空间等于所述第一系统的内存的可用容量的分块,并将其存储在所述第一系统中;
    第二分割存储子模块,将分割后的所述当前文件的剩余部分存储在所述第 二系统中。
  9. 如权利要求6所述的双系统内存共享装置,其特征在于,所述分割存储模块包括:
    容量比计算模块,用于计算所述第一系统和所述第二系统的内存的可用容量之比;
    第三分割存储子模块,用于将所述当前文件分割成为占用空间之比等于所述可用容量之比的两个分块,并分别存储在所述第一系统和所述第二系统中。
  10. 如权利要求6所述的双系统内存共享装置,其特征在于,所述第一系统和所述第二系统通过局域网或者通过ADB调试通道连接。
PCT/CN2017/103796 2017-04-18 2017-09-27 双系统内存共享方法及装置 WO2018192184A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710253733.XA CN107193651B (zh) 2017-04-18 2017-04-18 双系统内存共享方法及装置
CN201710253733.X 2017-04-18

Publications (1)

Publication Number Publication Date
WO2018192184A1 true WO2018192184A1 (zh) 2018-10-25

Family

ID=59872042

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103796 WO2018192184A1 (zh) 2017-04-18 2017-09-27 双系统内存共享方法及装置

Country Status (2)

Country Link
CN (1) CN107193651B (zh)
WO (1) WO2018192184A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193651B (zh) * 2017-04-18 2019-11-12 广州视源电子科技股份有限公司 双系统内存共享方法及装置
CN112817932A (zh) * 2020-05-19 2021-05-18 中兴通讯股份有限公司 一种数据转移方法、设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080244031A1 (en) * 2007-03-31 2008-10-02 Devesh Kumar Rai On-Demand Memory Sharing
CN102810071A (zh) * 2011-05-30 2012-12-05 联想(北京)有限公司 控制方法、控制装置以及计算机
CN104572485A (zh) * 2015-01-28 2015-04-29 宇龙计算机通信科技(深圳)有限公司 双系统共用内存的分配方法及装置
CN104657218A (zh) * 2015-02-10 2015-05-27 西安酷派软件科技有限公司 一种多操作系统运行方法、装置及终端
CN105843656A (zh) * 2016-04-22 2016-08-10 Tcl集团股份有限公司 磁盘空间不足的系统升级方法、终端设备及服务器
CN107193651A (zh) * 2017-04-18 2017-09-22 广州视源电子科技股份有限公司 双系统内存共享方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080244031A1 (en) * 2007-03-31 2008-10-02 Devesh Kumar Rai On-Demand Memory Sharing
CN102810071A (zh) * 2011-05-30 2012-12-05 联想(北京)有限公司 控制方法、控制装置以及计算机
CN104572485A (zh) * 2015-01-28 2015-04-29 宇龙计算机通信科技(深圳)有限公司 双系统共用内存的分配方法及装置
CN104657218A (zh) * 2015-02-10 2015-05-27 西安酷派软件科技有限公司 一种多操作系统运行方法、装置及终端
CN105843656A (zh) * 2016-04-22 2016-08-10 Tcl集团股份有限公司 磁盘空间不足的系统升级方法、终端设备及服务器
CN107193651A (zh) * 2017-04-18 2017-09-22 广州视源电子科技股份有限公司 双系统内存共享方法及装置

Also Published As

Publication number Publication date
CN107193651A (zh) 2017-09-22
CN107193651B (zh) 2019-11-12

Similar Documents

Publication Publication Date Title
US10754550B2 (en) Optimized data placement for individual file accesses on deduplication-enabled sequential storage systems
US10374792B1 (en) Layout-independent cryptographic stamp of a distributed dataset
CN102156738B (zh) 数据块处理方法、数据块存储设备及系统
EP2821925B1 (en) Distributed data processing method and apparatus
CN110413685B (zh) 数据库服务切换方法、装置、可读存储介质和计算机设备
US8965856B2 (en) Increase in deduplication efficiency for hierarchical storage system
US20190163371A1 (en) Next generation storage controller in hybrid environments
JP2019101703A (ja) 記憶システム及び制御ソフトウェア配置方法
US7681001B2 (en) Storage system
US20060047926A1 (en) Managing multiple snapshot copies of data
CN104077380B (zh) 一种重复数据删除方法、装置及系统
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
US9792185B2 (en) Directed backup for massively parallel processing databases
US20220284377A1 (en) Method and apparatus for task group positioning
CN104424052A (zh) 一种自动冗余的分布式存储系统及方法
CN104205780A (zh) 一种存储数据的方法和装置
WO2018192184A1 (zh) 双系统内存共享方法及装置
CN104517067A (zh) 访问数据的方法、装置及系统
WO2017020757A1 (en) Rebalancing and elastic storage scheme with elastic named distributed circular buffers
CN111414422B (zh) 一种数据分布方法、装置、设备和存储介质
US20120179885A1 (en) Write control system
CN106257447A (zh) 云存储服务器的视频存储及检索方法、视频云存储系统
US9053100B1 (en) Systems and methods for compressing database objects
CN111708489B (zh) 一种提高硬盘服务质量的方法和设备
JP2024506131A (ja) 仮想マシンのメモリ共有方法および装置

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: 17906036

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17906036

Country of ref document: EP

Kind code of ref document: A1