Electronic device, non-transitory computer-readable storage medium, and method for allocating storage area of memory for storing file
The electronic device addresses file fragmentation and inefficient storage allocation by using a file system to allocate data blocks in separate storage areas based on file size and type, enhancing storage efficiency and output speed.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-10-24
- Publication Date
- 2026-06-18
AI Technical Summary
Existing file systems and methods for allocating storage area of memory for storing and devices fail to efficiently allocate storage capacity and existing technologies have not addressed the issue of efficiently managing fragmented data storage and fragmentation, which existing technologies have not addressed the problem of file fragmentation and inefficient storage allocation.
The solution involves an electronic device that uses a file system to allocate data blocks in a first storage area for smaller files and a second storage area for larger or specific type files, optimizing storage by minimizing fragmentation and maximizing storage capacity.
This approach reduces file fragmentation and enhances storage efficiency by allocating files based on size and type, thereby improving memory output speed and optimizing storage capacity.
Smart Images

Figure KR2025017125_18062026_PF_FP_ABST
Abstract
Description
Electronic device for allocating a storage area of memory for storing a file, a non-transient computer-readable storage medium, and a method
[0001] The following descriptions relate to an electronic device for allocating a storage area of memory for storing a file, a non-transient computer-readable storage medium, and a method.
[0002] An electronic device may use a file system to allocate a data block for storing a file from among the data blocks included in the memory in order to store a file in memory. For example, the electronic device may store data included in the file in the allocated data block.
[0003] The information described above may be provided as related art for the purpose of aiding understanding of the present disclosure. No claim or determination is made as to whether any of the foregoing may be applied as prior art related to the present disclosure.
[0004] An electronic device is provided. The electronic device may include at least one processor comprising a processing circuit and a memory comprising one or more storage media for storing instructions. The instructions may cause the electronic device to identify a file to be stored in the memory when executed individually or collectively by the at least one processor. The instructions may cause the electronic device to store the file in a first storage area of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition when executed individually or collectively by the at least one processor. The instructions may cause the electronic device to store the file in a second storage area of the memory configured to allow the file to be allocated in a second capacity unit larger than the first capacity unit based on the fact that the file is identified as a second file satisfying a second condition when executed individually or collectively by the at least one processor.
[0005] A non-transient computer-readable storage medium is provided. The non-transient computer-readable storage medium may store one or more programs. The one or more programs may include instructions that cause the electronic device to identify a file to be stored in the memory when executed by the electronic device having memory. The one or more programs may include instructions that cause the electronic device to store the file in a first storage area of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition when executed by the electronic device. The one or more programs may include instructions that cause the electronic device to store the file in a second storage area of the memory configured to allow the file to be allocated in a second capacity unit larger than the first capacity unit based on the fact that the file is identified as a second file satisfying a second condition when executed by the electronic device.
[0006] A method is provided. The method may be performed by an electronic device having memory. The method may include an operation of identifying a file to be stored in the memory. The method may include an operation of storing the file in a first storage area of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition. The method may include an operation of storing the file in a second storage area of the memory configured to allow the file to be allocated in a second capacity unit larger than the first capacity unit based on the fact that the file is identified as a second file satisfying a second condition.
[0007] Figure 1 is a schematic view of an exemplary electronic device.
[0008] Figure 2 illustrates an example of a hierarchical structure regarding a computer system of an electronic device.
[0009] Figure 3 illustrates examples of storage regions regarding the memory of an electronic device.
[0010] FIGS. 4a, FIGS. 4b, and FIGS. 4c illustrate examples of operations for allocating a data block for storing a file among data blocks included in a first storage area of memory through a file system.
[0011] FIGS. 5A, FIGS. 5B, and FIGS. 5C illustrate examples of operations for allocating a data block for storing a file among data blocks included in a second storage area of memory through a file system.
[0012] Figure 6 is a flowchart illustrating a method for identifying a storage area to store a file among the storage areas of memory.
[0013] Figure 7 is a flowchart illustrating a method of managing files stored in a storage area of memory through a file system.
[0014] FIGS. 8A, FIGS. 8B, and FIGS. 8C illustrate examples of operations for managing files stored in a second storage area of memory through a file system.
[0015] FIG. 9 is a block diagram of an electronic device in a network environment according to various embodiments.
[0016] Figure 1 is a schematic view of an exemplary electronic device.
[0017] Referring to FIG. 1, the electronic device (101) may include at least one processor (110) and a memory (120). The electronic device (101) may include at least a part of the electronic device (901) of FIG. 9 or correspond to at least a part of the electronic device (901) of FIG. 9.
[0018] At least one processor (110) may include a processing circuit. At least one processor (110) may include a single processor or multiple processors. At least one processor (110) may control the memory (120) and / or one or more components (not shown) of the electronic device (101). For example, at least one processor (110) may perform data input / output operations of the electronic device (101) by performing operations to store data in the memory (120) and operations to read data stored in the memory (120). At least one processor (110) may transmit commands regarding the data input / output operations to the memory (120). For example, at least one processor (110) may be configured to function as a host device (or host) in relation to the memory (120). For example, at least one processor (110) may include at least a part of the processor (920) of FIG. 9 or correspond to at least a part of the processor (920) of FIG. 9.
[0019] Memory (120) may store one or more programs configured to be executed individually and / or collectively by at least one processor (110). The one or more programs may include instructions. The instructions may cause an electronic device (101) to perform operations described with reference to FIGS. 2 through 8c. Memory (120) may include one or more storage media. At least some of the one or more programs may be available to manage, control, and / or execute application software and file systems described below. For example, the one or more storage media may include non-volatile memory. By example, without limitation, the non-volatile memory may include NAND flash. For example, the non-volatile memory may be described as a solid state drive (SSD), universal flash storage (UFS), or embedded multimedia card (eMMC). For example, the memory (120) may include at least a portion of the memory (930) of FIG. 9 or correspond to at least a portion of the memory (930) of FIG. 9.
[0020] Figure 2 illustrates an example of a hierarchical structure regarding a computer system of an electronic device.
[0021] Referring to FIG. 2, the computer system (200) may include memory (120), application software (210), application software (211), and a file system (220).
[0022] The memory (120) may include a storage area for storing data included in a file and a metadata storage area for storing information regarding the configuration of the file system (220). For example, the storage area and the metadata storage area may be defined by the file system (220). The storage area may include a first storage area and a second storage area. For example, the first storage area and the second storage area may be described as storage areas distinguished on the file system (220).
[0023] Each of the application software (210) and application software (211) may be described as a software program that is executed by an operating system (OS) and performs tasks based on user input obtained through a user interface (UI). Each of the application software (210) and application software (211) may identify a file to be stored in memory (120) according to the user input, a file to be modified in memory (120) according to the user input, and a file to be deleted in memory (120) according to the user input. For example, each of the application software (210) and application software (211) may transmit to the file system (220) a request to store a file in memory (120), a request to modify a file stored in memory (120), and a request to delete a file stored in memory (120). For example, each of the application software (210) and application software (211) may be described as a program executed by at least one processor (110). For example, each of the application software (210) and the application software (211) can be stored in memory (120).
[0024] A file system (220) can be described as a software program for managing data input and output from memory (120) in file units. The file system (220) may receive requests from application software (210) and application software (211) to store a file in memory (120), requests to modify a file stored in memory (120), and requests to delete a file stored in memory (120). Based on the above request to store a file in memory (120), the file system (220) may store data contained in the file in the storage area of memory (120) by allocating a data block for storing the file among the data blocks contained in memory (120). For example, the file system (220) may modify data contained in the data block storing the file based on the request to modify a file stored in memory (120). For example, the file system (220) may delete data contained in the data block storing the file based on the request to delete a file stored in memory (120). For example, the file system (220) can be described as a program executed by at least one processor (110). For example, the file system (220) can be stored in memory (120).
[0025] The file system (220) can mitigate file fragmentation in which files are stored in a distributed manner within memory (120) by selectively storing the file in the first storage area or the second storage area depending on whether the file to be stored in memory (120) satisfies defined conditions (e.g., conditions regarding the data size of the file and conditions regarding the type of the file). The structure of the storage area regarding memory (120) is described with reference to FIG. 3.
[0026] Figure 3 illustrates examples of storage regions regarding the memory of an electronic device.
[0027] Referring to FIG. 3, the structure of a memory (120) including a metadata storage area (301), a first storage area (310), and a second storage area (320) is illustrated.
[0028] The metadata storage area (301) can store information regarding the configuration of the file system (220). For example, the information regarding the configuration of the file system (220) may include area information of the memory (120) and address information indicating the address of a data block in which an index node is stored. The data block in which the index node is stored may be included within the first storage area (310) and / or the second storage area (320). For example, the data block in which the index node is stored may store metadata associated with the attributes of the file. For example, the metadata associated with the attributes of the file may include information regarding the file name, file data size, file creation time, file modification time, file access time, file owner, file access rights, file address, file type, and / or file status.
[0029] Each of the first storage area (310) and the second storage area (320) may include data blocks for storing data contained in a file. For example, the electronic device (101) may identify the data blocks using address information regarding the data blocks on a file system (220). By example, the first storage area (310) may be described as a regular region that allocates (or stores) data contained in a file in first capacity units (e.g., pages). For example, the first capacity unit may be a fixed size (e.g., 4KB). By example, the second storage area (320) may be described as a reserved region configured to allow allocating (or storing) data contained in a file in second capacity units (e.g., segments) that are larger than the first capacity unit. For example, the second capacity unit may be larger than the size of the first capacity unit (e.g., 2MB). For example, the second capacity unit may be a size that varies depending on the structure of the file. The second storage area (320) may be described as an area containing consecutive data blocks identified on the file system (220). For example, the capacity and location of the second storage area (320) may be set when formatting the file system (220). For example, the second storage area (320) may have a capacity that varies by the file system (220). For example, the second storage area (320) may be set to consecutive data blocks placed at a location according to the embodiment (e.g., initial location, intermediate location, or final location) among the data blocks identified on the file system (220). For example, the capacity and location of the second storage area (320) may be initialized when loading (or mounting) the file system (220).The electronic device (101) may identify the file as a first file or a second file depending on whether the file to be stored in memory (120) satisfies the defined conditions for being stored in the second storage area (320). The first file may be described as a file that does not satisfy the defined conditions for being stored in the second storage area (320) (or a file that satisfies the first condition). For example, the first condition may be that the defined conditions are not satisfied. The second file may be described as a file that satisfies the defined conditions for being stored in the second storage area (320) (or a file that satisfies the second condition). For example, the second condition may be that the defined conditions are satisfied.
[0030] The above-defined condition may be a condition regarding the data size of the file to be stored in memory (120) and / or the type of the file to be stored in memory (120) (e.g., extension). For example, a file satisfying the above-defined condition may require an output speed of memory (120) higher than a defined speed (or a certain speed).
[0031] For example, the above-defined condition may include the data size of the file to be stored in memory (120) exceeding a threshold size. The value of the threshold size may be set differently depending on the embodiment. For example, the file identified as the first file may be described as a file having a data size smaller than the threshold size. For example, the file identified as the second file may be described as a file having a data size larger than the threshold size. For example, whether the first condition is satisfied may be determined based on the criterion that the data size of the file to be stored in memory (120) is less than the threshold size. For example, whether the second condition is satisfied may be determined based on the criterion that the data size of the file to be stored in memory (120) exceeds the threshold size.
[0032] For example, the above-defined condition may include the file type (e.g., extension) corresponding to a reference type. The reference type may be set in various ways according to the embodiment. By example, the reference type may include an app installation file type (.apk), an AI model file type (.tfile), and a DB file type (.db). By example, the file identified as the first file may correspond to a video file. By example, the file identified as the second file may correspond to a file related to a generative AI model, a file related to game application software, and a DB file. By example, the electronic device (101) may identify the type of the file by using metadata contained within the file (e.g., AI model file, app installation file, and DB file) obtained from data (e.g., content) contained within the file. For example, whether the first condition is satisfied may be determined according to a standard in which the type of the file to be stored in memory (120) corresponds to the first type. For example, whether the above second condition is satisfied can be determined according to the criteria that the type of file to be stored in memory (120) corresponds to the second type.
[0033] In another embodiment, the defined condition may include setting a flag on the file to be stored in memory (120). For example, the flag may be set using a system call (e.g., ioctl) based on user input in the application software (210) and application software (211).
[0034] The electronic device (101) can store the file in memory (120) by performing an operation of allocating a data block for storing the file identified as the first file or the second file among the data blocks of memory (120). For example, the operation of allocating the data block may be performed through contiguous allocation or through non-contiguous allocation. For example, the contiguous allocation may be described as allocating consecutive data blocks for storing the file among the data blocks of memory (120). For example, the consecutive data blocks may be identified as consecutive data blocks according to address information regarding the data blocks on the file system (220). For example, the non-contiguous allocation may be described as allocating non-contiguous data blocks for storing the file among the data blocks of memory (120). For example, the above discontinuous data blocks may be identified as data blocks spaced apart from each other according to address information regarding the data blocks on the file system (220).
[0035] The electronic device (101) can store the file identified as the first file in the first storage area (310) by allocating a data block for storing the file identified as the first file among the data blocks included in the first storage area (310), based on the fact that the file to be stored in memory (120) is identified as the first file. For example, the first storage area (310) may be configured to allow contiguous allocation for storing the file and non-contiguous allocation for storing the file. The operation of allocating a data block for storing a file in the first storage area (310) through the file system (220) is described later with reference to FIGS. 4a, 4b, and 4c.
[0036] The electronic device (101) can store the file identified as the second file in the second storage area (320) by allocating a data block for storing the file identified as the second file among the data blocks included in the second storage area (320), based on the fact that the file to be stored in the memory (120) is identified as the second file. For example, the second storage area (320) may be configured to allow contiguous allocation for storing the file. For example, the second storage area (320) may be configured to allow non-contiguous allocation for storing the file based on the fact that the remaining storage capacity of the memory (120) is smaller than the threshold storage capacity (e.g., the first threshold storage capacity to be described later). For example, the second storage area (320) may be described as a storage area in which the ratio of the number of times a contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is higher than that of the first storage area (310). For example, the second storage area (320) may be described as a storage area in which the ratio of the number of times a non-contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is lower than that of the first storage area (310). The operation of allocating a data block for storing a file in the second storage area (320) through the file system (220) is described later with reference to FIGS. 5a, 5b, and 5c.
[0037] FIGS. 4a, FIGS. 4b, and FIGS. 4c illustrate examples of operations for allocating a data block for storing a file among data blocks included in a first storage area of memory through a file system.
[0038] Referring to FIGS. 4a, 4b, and 4c, a first storage area (310) including a plurality of data blocks is illustrated. For example, the data blocks may include data block (310-1), data block (310-2), data block (310-3), data block (310-4), data block (310-5), data block (310-6), data block (310-7), data block (310-8), data block (310-9), data block (310-10), data block (310-11), data block (310-12), data block (310-13), data block (310-14), data block (310-15), data block (310-16), data block (310-17), and data block (310-18). For example, the first storage area (310) may be configured to allow contiguous allocation for storing the file and non-contiguous allocation for storing the file.
[0039] Referring to FIG. 4a, an example of storing files A, B, and C in a first storage area (310) is illustrated. Each of the files A, B, and C may be described as a file identified as a first file. For example, each of the files A, B, and C may be a file that does not satisfy the defined conditions. For example, each of the files A, B, and C may be a file having a data size smaller than a threshold size and / or a file of a type that does not correspond to a reference type.
[0040] The electronic device (101) can store the file A in the data block (310-1), data block (310-2), and data block (310-3) by allocating the data block (310-1), data block (310-2), and data block (310-3) for storing the file A identified as the first file among a plurality of data blocks (310-1, …, 310-18) included in the first storage area (310), based on the file A being identified as the first file. The electronic device (101) can perform contiguous allocation by storing the file A in the data block (310-1), data block (310-2), and data block (310-3), which are consecutive data blocks. For example, the electronic device (101) may store in memory (120) address information indicating the address of a data block (310-1), which is the first data block among the consecutive data blocks (e.g., the data block with the lowest value corresponding to the address among the data blocks), and size information indicating the data size of the file A, based on the file A being identified as the first file. For example, when the electronic device (101) transfers the file A from memory (120) to at least one processor (110), it may read the file A stored in data block (310-1), data block (310-2), and data block (310-3) using the address information indicating the address of the data block (310-1) and the size information indicating the data size of the file A.
[0041] The electronic device (101) can store the file B in the data block (310-4) by allocating the data block (310-4) for storing the file B identified as the first file among a plurality of data blocks (310-4, …, 310-18) included in the first storage area (310), based on the file B being identified as the first file. For example, the electronic device (101) can store address information indicating the address of the first data block, the data block (310-4), and size information indicating the data size of the file B in the memory (120). For example, when the electronic device (101) transfers the file B from the memory (120) to at least one processor (110), it can read the file B stored in the data block (310-4) using the address information indicating the address of the data block (310-4) and the size information indicating the data size of the file B.
[0042] The electronic device (101) can store the file C in the data block (310-5) and the data block (310-6) by allocating the data block (310-5) and the data block (310-6) for storing the file C identified as the first file among a plurality of data blocks (310-5, …, 310-18) included in the first storage area (310), based on the file C being identified as the first file. The electronic device (101) can perform contiguous allocation by storing the file C in the data block (310-5) and the data block (310-6), which are consecutive data blocks. For example, the electronic device (101) may store in memory (120) address information indicating the address of a data block (310-5), which is the first data block among the consecutive data blocks, and size information indicating the data size of the file C, based on the fact that the file C is identified as the first file. For example, when the electronic device (101) transfers the file C from memory (120) to at least one processor (110), it may read the file C stored in data block (310-5) and data block (310-6) using the address information indicating the address of the data block (310-5) and the size information indicating the data size of the file C.
[0043] Referring to FIG. 4b, an example is shown in which file B is deleted from a first storage area (310) that stores file A, file B, and file C.
[0044] The electronic device (101) can delete the file B stored in the data block (310-4) based on the fact that the file B is identified as a file to be deleted in the first storage area (310).
[0045] Referring to FIG. 4c, an example of storing file D in a first storage area (310) from which file B has been deleted is illustrated. The file D can be described as a file identified as the first file.
[0046] The electronic device (101) can store the file D in the data block (310-4), data block (310-7), and data block (310-8) for storing the file D identified as the first file among a plurality of data blocks (310-4, 310-7, …, 310-18) included in the first storage area (310), based on the file D being identified as the first file. The electronic device (101) can perform non-contiguous allocation by storing the file D in the data block (310-4), data block (310-7), and data block (310-8), which are discontinuous data blocks. For example, the electronic device (101) may store in memory (120) address information indicating the address of the first data block, data block (310-4), address information indicating the address of the first data block among data block (310-7) and data block (310-8), and size information indicating the data size of the file D, based on the fact that the file D is identified as the first file. However, it is not limited thereto. For example, the address information indicating the address of the data block (310-7) may be described as a link pointer stored in the data block (310-4) indicating the address of the data block (310-7).For example, when the electronic device (101) transfers the file D from memory (120) to at least one processor (110), it can read the file D stored in the data block (310-4), data block (310-7), and data block (310-8) using the address information indicating the address of the data block (310-4), the address information indicating the address of the data block (310-7), and the size information indicating the data size of the file D.
[0047] As described above, when the electronic device (101) stores a file identified as a first file in a first storage area (310), it can perform contiguous allocation to mitigate file fragmentation in which the file is stored in a distributed manner and non-contiguous allocation to optimize the remaining storage capacity of the storage area.
[0048] For example, since the output speed of the memory (120) is lower than that of the data stored in fragmented data blocks based on the above discontinuous allocation, the electronic device (101) may store a file identified as a second file in a second storage area (320) that requires the output speed of the memory (120) to be higher than a defined speed (or a constant speed). For example, the second storage area (320) may be described as a storage area in which the ratio of the number of times a contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is higher than that of the first storage area (310).
[0049] FIGS. 5A, FIGS. 5B, and FIGS. 5C illustrate examples of operations for allocating a data block for storing a file among data blocks included in a second storage area of memory through a file system.
[0050] Referring to FIGS. 5A, 5B, and 5C, a second storage area (320) including a plurality of data blocks is illustrated. For example, the data blocks may include data block (320-1), data block (320-2), data block (320-3), data block (320-4), data block (320-5), data block (320-6), data block (320-7), data block (320-8), data block (320-9), data block (320-10), data block (320-11), data block (320-12), data block (320-13), data block (320-14), data block (320-15), data block (320-16), data block (320-17), and data block (320-18). For example, the second storage area (320) can be described as a storage area in which the ratio of the number of times a contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is higher than that of the first storage area (310).
[0051] Referring to FIG. 5a, an example of storing files A and B in a second storage area (320) is illustrated. Each of the files A and B may be described as a file identified as a second file. For example, each of the files A and B may be a file satisfying the defined conditions. For example, each of the files A and B may be a file having a data size larger than a threshold size and / or a file of a type corresponding to a reference type.
[0052] The electronic device (101) can store the file A identified as the second file in the data blocks (320-1), data blocks (320-2), data blocks (320-3), data blocks (320-4), data blocks (320-5), data blocks (320-6), data blocks (320-7), data blocks (320-8), and data blocks (320-9) for storing the file A identified as the second file among a plurality of data blocks (320-1, …, 320-18) included in the second storage area (320), based on the file A being identified as the second file. There is. The electronic device (101) can perform contiguous allocation by storing the file A in consecutive data blocks, namely data block (320-1), data block (320-2), data block (320-3), data block (320-4), data block (320-5), data block (320-6), data block (320-7), data block (320-8), and data block (320-9). For example, the electronic device (101) can store address information indicating the address of the first data block among the consecutive data blocks, data block (320-1), and size information indicating the data size of the file A in memory (120), based on the fact that the file A is identified as the second file.For example, when the electronic device (101) transfers the file A from memory (120) to at least one processor (110), it can read the file A stored in data blocks (320-1), data blocks (320-2), data blocks (320-3), data blocks (320-4), data blocks (320-5), data blocks (320-6), data blocks (320-7), data blocks (320-8), and data blocks (320-9) by using the address information indicating the address of the data block (320-1) and the size information indicating the data size of the file A.
[0053] The electronic device (101) can store the file B identified as the second file in the data blocks (320-10), data blocks (320-11), data blocks (320-12), data blocks (320-13), data blocks (320-14), data blocks (320-15), and data blocks (320-16) for storing the file B identified as the second file among a plurality of data blocks (320-10, …, 320-18) included in the second storage area (320), based on the file B being identified as the second file. The electronic device (101) can perform contiguous allocation by storing the file B in consecutive data blocks, namely data block (320-10), data block (320-11), data block (320-12), data block (320-13), data block (320-14), data block (320-15), and data block (320-16). For example, the electronic device (101) can store address information indicating the address of the first data block among the consecutive data blocks, data block (320-10), and size information indicating the data size of the file B in memory (120), based on the fact that the file B is identified as the second file.For example, when the electronic device (101) transfers the file B from memory (120) to at least one processor (110), it can read the file B stored in data blocks (320-10), data blocks (320-11), data blocks (320-12), data blocks (320-13), data blocks (320-14), data blocks (320-15), and data blocks (320-16) by using the address information indicating the address of the data block (320-10) and the size information indicating the data size of the file B.
[0054] Referring to FIG. 5b, an example is shown in which file A is deleted from a second storage area (320) that stores file A and file B.
[0055] The electronic device (101) can delete the file A stored in data blocks (320-1), data blocks (320-2), data blocks (320-3), data blocks (320-4), data blocks (320-5), data blocks (320-6), data blocks (320-7), data blocks (320-8), and data blocks (320-9) based on the fact that the file A is identified as a file to be deleted in the second storage area (320).
[0056] Referring to FIG. 5c, an example of storing file C in a second storage area (320) from which file A has been deleted is illustrated. The file C can be described as a file identified as the second file.
[0057] The electronic device (101) can store the file C identified as the second file in the data blocks (320-1), data blocks (320-2), data blocks (320-3), data blocks (320-4), data blocks (320-5), data blocks (320-6), data blocks (320-7), and data blocks (320-8) for storing the file C identified as the second file among a plurality of data blocks (320-1, …, 320-9, 320-17, 310-18) included in the second storage area (320), based on the file C being identified as the second file. The electronic device (101) can perform contiguous allocation by storing the file C in consecutive data blocks, namely data block (320-1), data block (320-2), data block (320-3), data block (320-4), data block (320-5), data block (320-6), data block (320-7), and data block (320-8). For example, the electronic device (101) can store address information indicating the address of the first data block among the consecutive data blocks, data block (320-1), and size information indicating the data size of the file C in memory (120), based on the fact that the file C is identified as the second file.For example, when the electronic device (101) transfers the file C from memory (120) to at least one processor (110), it can read the file C stored in data blocks (320-1), data blocks (320-2), data blocks (320-3), data blocks (320-4), data blocks (320-5), data blocks (320-6), data blocks (320-7), and data blocks (320-8) by using the address information indicating the address of the data block (320-1) and the size information indicating the data size of the file C.
[0058] As described above, the electronic device (101) can increase the output speed of the memory (120) by performing contiguous allocation to mitigate file fragmentation, in which files are stored in a distributed manner, when storing a file identified as a second file in the second storage area (310). For example, the second storage area (320) can mitigate file fragmentation, in which files are stored in a distributed manner, even if the file identified as a second file is deleted, by storing the file identified as a second file in contiguous data blocks, which has a data size larger than the data size of the first file when compared with the first storage area (310).
[0059] Figure 6 is a flowchart illustrating a method for identifying a storage area to store a file among the storage areas of memory.
[0060] Referring to FIG. 6, in operation 601, at least one processor (110) can identify a file to be stored in memory (120). For example, at least one processor (110) can identify the file to be stored in memory (120) using a file system (220) by obtaining a request from application software (210) and application software (211) to store the file in memory (120).
[0061] In operation 602, at least one processor (110) can identify whether the file to be stored in memory (120) satisfies a defined condition. The defined condition may be a condition regarding the data size of the file to be stored in memory (120) and / or the type of the file to be stored in memory (120) (e.g., extension). For example, a file satisfying the defined condition may require the output speed of memory (120) to be higher than a defined speed (or a constant speed). For example, the defined condition may include the data size of the file to be stored in memory (120) exceeding a threshold size. The value of the threshold size may be set differently depending on the embodiment. For example, the file identified as the first file may be described as a file having a data size smaller than the threshold size. For example, the file identified as the second file may be described as a file having a data size larger than the threshold size. For example, the defined condition may include the type of the file (e.g., extension) corresponding to a reference type. The above reference type may be configured in various ways according to the embodiment. By example, the above reference type may include an app installation file type (.apk), an AI model file type (.tfile), and a DB file type (.db). By example, the file identified as the first file may correspond to a video file. By example, the file identified as the second file may correspond to a file regarding a generative AI model, a file regarding game application software, and a DB file. By example, at least one processor (110) may identify the type of the file by using metadata contained within the file (e.g., AI model file, app installation file, and DB file) obtained from data (e.g., content) contained within the file.In another embodiment, the defined condition may include setting a flag on the file to be stored in memory (120). For example, the flag may be set using a system call (e.g., ioctl) based on user input in the application software (210) and application software (211).
[0062] In operation 603, at least one processor (110) may identify a file to be stored in memory (120) as a first file based on the fact that the file to be stored in memory (120) does not satisfy the conditions defined above. For example, the file identified as the first file may be a file having a data size smaller than the threshold size and / or a file of a type that does not correspond to the reference type.
[0063] In operation 604, at least one processor (110) can determine whether the remaining storage capacity (e.g., free space) of memory (120) is smaller than a first threshold storage capacity based on the fact that the file to be stored in memory (120) is identified as the first file. The first threshold storage capacity may be set in relation to the storage capacity of the second storage area (320). As an example without limitation, the first threshold storage capacity may be set to a capacity corresponding to twice the storage capacity of the second storage area (320).
[0064] In operation 605, at least one processor (110) may store the file identified as the first file in the first storage area (310) based on the remaining storage capacity of the memory (120) which is larger than the first threshold storage capacity. By example, the first storage area (310) may be described as a regular region that allocates (or stores) the data contained in the file in first capacity units (e.g., pages). For example, the first capacity unit may be a fixed size (e.g., 4KB). For example, the first storage area (310) may be configured to allow contiguous allocation and non-contiguous allocation for the storage of the file. For example, at least one processor (110) may perform the discontinuous allocation by storing a first portion of the file in at least one first data block of the first storage area (310) and storing a second portion of the file in at least one second data block of the first storage area (310), based on the file being identified as the first file. At least one second data block may be spaced apart from the at least one first data block on a file system (220) for memory (120). At least one processor (110) may store in memory (120) first address information indicating the address of the first data block among the at least one first data block, second address information indicating the address of the first data block among the at least one second data block, and size information indicating the data size of the file, based on the file being identified as the first file.
[0065] In operation 606, at least one processor (110) may store the file identified as the first file in a second storage area (320) based on the remaining storage capacity of the memory (120) which is smaller than the first threshold storage capacity. By example, the second storage area (320) may be described as a reserved region configured to allow the data contained in the file to be allocated (or stored) in a second capacity unit (e.g., a segment) larger than the first capacity unit. For example, the second capacity unit may be larger than the size of the first capacity unit (e.g., 2 MB). For example, the second capacity unit may be a size that varies depending on the structure of the file. For example, at least one processor (110) can optimize the remaining storage capacity of the memory (120) by storing the file identified as the first file in the second storage area (320) when the remaining storage capacity of the memory (120) is smaller than the first threshold storage capacity. In another embodiment, at least one processor (110) may optimize the remaining storage capacity of the memory (120) by adjusting the storage capacity of the second storage area (320) based on the remaining storage capacity of the memory (120) being smaller than the first threshold storage capacity.
[0066] In operation 607, at least one processor (110) may identify a file to be stored in memory (120) as a second file based on whether the file to be stored in memory (120) satisfies the conditions defined above. For example, the file identified as the second file may be a file having a data size larger than the threshold size and / or a file of a type corresponding to the reference type.
[0067] In operation 608, at least one processor (110) may store the file in a second storage area (320) of memory (120) based on the fact that the file is identified as a second file. For example, the second storage area (320) may be described as a storage area in which the ratio of the number of times a contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is higher than that of the first storage area (310). For example, at least one processor (110) may perform the contiguous allocation by storing the file in contiguous data blocks of the second storage area (320) based on the fact that the file is identified as the second file. At least one processor (110) may store address information indicating the address of the first data block among the contiguous data blocks and size information indicating the data size of the file in memory (120). In one embodiment, the operation of storing the file identified as the second file in the second storage area (320) may be performed based on the remaining storage capacity of the second storage area (320) being greater than a defined threshold storage capacity. For example, at least one processor (110) may store the file identified as the second file in the first storage area (310) based on the remaining storage capacity of the second storage area (320) being less than the defined threshold storage capacity.
[0068] In operation 604 of FIG. 6, it has been described that operation 605 or operation 606 is selectively performed depending on the remaining storage capacity of the memory (120), but this is exemplary. Operations 604 and 606 may be omitted or skipped. For example, at least one processor (110) may store the file identified as the first file in operation 605 in the first storage area (310) based on the fact that the file stored in the memory (120) in operation 603 is identified as the first file.
[0069] Figure 7 is a flowchart illustrating a method of managing files stored in a storage area of memory through a file system.
[0070] Referring to FIG. 7, in operation 701, at least one processor (110) can identify whether a mode for managing the second storage area (320) is performed. For example, the mode may be performed while the electronic device (101) is in an idle mode. For example, the idle mode may be described as a mode in which the electronic components (e.g., display) of the electronic device (101) are in a power-saving state when no user input is applied to the electronic device (101) within a defined time interval.
[0071] In operation 702, at least one processor (110) can identify whether the storage area of the memory (120) satisfies a condition regarding the remaining storage capacity. The condition regarding the remaining storage capacity may be set in various ways depending on the embodiment. For example, the condition regarding the remaining storage capacity may include that the remaining storage capacity of the first storage area (310) is greater than the second threshold storage capacity and / or that the remaining storage capacity of the second storage area (320) is less than the third threshold storage capacity. Depending on the embodiment, the second threshold storage capacity and the third threshold storage capacity may each be set in various ways.
[0072] In operation 703, at least one processor (110) can identify whether a file identified as a first file is stored in the second storage area (320) based on the remaining storage capacity of the first storage area (310) which is larger than the second threshold storage capacity or the remaining storage capacity of the second storage area (320) which is smaller than the third threshold storage capacity. For example, the file identified as the first file may be described as a file stored in the second storage area (320) through the aforementioned operation 606.
[0073] In operation 704, at least one processor (110) may migrate the file identified as the first file to the first storage area (310) of memory (120) based on identifying that the file identified as the first file is stored in the second storage area (320). For example, the operation of migrating the file to the first storage area (310) of memory (120) may be intended to mitigate file fragmentation occurring in the second storage area (320).
[0074] In operation 705, at least one processor (110) can identify whether the data blocks in which the file identified as the second file is stored satisfy a condition regarding fragmentation. For example, the condition regarding fragmentation may be that the number of fragmented data blocks among the data blocks in the second storage area (320) in which the file identified as the second file is stored exceeds a threshold value. Depending on the embodiment, the threshold value may be set in various ways. At least one processor (110) can identify the number of fragmented data blocks among the data blocks in the second storage area (320) in which the file identified as the second file is stored.
[0075] In operation 706, at least one processor (110) may perform an operation to reallocate the fragmented data blocks into contiguous data blocks based on identifying the number exceeding the threshold value. For example, the operation to reallocate the fragmented data blocks may be described as file defragmentation.
[0076] FIGS. 8A, FIGS. 8B, and FIGS. 8C illustrate examples of operations for managing files stored in a second storage area of memory through a file system.
[0077] Referring to FIGS. 8A, 8B, and 8C, a second storage area (320) including a plurality of data blocks is illustrated. For example, the data blocks may include data block (320-1), data block (320-2), data block (320-3), data block (320-4), data block (320-5), data block (320-6), data block (320-7), data block (320-8), data block (320-9), data block (320-10), data block (320-11), data block (320-12), data block (320-13), data block (320-14), data block (320-15), data block (320-16), data block (320-17), and data block (320-18). For example, the second storage area (320) can be described as a storage area in which the ratio of the number of times a contiguous allocation for the storage of the file is performed to the number of times an allocation for the storage of the file is performed is higher than that of the first storage area (310).
[0078] Referring to FIG. 8a, an example of storing files A, B, and C in a second storage area (320) is illustrated. Each of the files A and B may be described as a file identified as a first file. For example, each of the files A and B may be a file that does not satisfy the defined conditions. For example, each of the files A and B may be a file having a data size smaller than a threshold size and / or a file of a type that does not correspond to a reference type. For example, the file C may be a file that satisfies the defined conditions. For example, the file C may be a file having a data size larger than the threshold size and / or a file of a type corresponding to the reference type.
[0079] The electronic device (101) may store the file A in a data block (320-3) based on the remaining storage capacity of the memory (120) which is smaller than the first threshold storage capacity when the file A is identified as the first file. As described above, the first threshold storage capacity may be set in relation to the storage capacity of the second storage area (320). As an example without limitation, the first threshold storage capacity may be set to a capacity corresponding to twice the storage capacity of the second storage area (320).
[0080] The electronic device (101) can store the file B in a data block (320-7) based on the remaining storage capacity of the memory (120) which is smaller than the first threshold storage capacity when the file B is identified as the first file.
[0081] The electronic device (101), based on the fact that the file C is identified as the second file, allocates a data block (320-1), a data block (320-2), a data block (320-4), a data block (320-5), a data block (320-6), a data block (320-8), a data block (320-9), a data block (320-10), a data block (320-11), a data block (320-12), and a data block (320-13) for storing the file C identified as the second file among a plurality of data blocks (320-1, 320-2, 320-4, 320-6, 320-8, data block (320-9), a data block (320-10), a data block (320-11), a data block (320-12), and a data block (320-13) for storing the file C identified as the second file among a plurality of data blocks (320-1, 320-2, 320-4), data It can be stored in block (320-5), data block (320-6), data block (320-8), data block (320-9), data block (320-10), data block (320-11), data block (320-12), and data block (320-13).
[0082] Referring to FIG. 8b, an example is shown in which files A and B are transferred from a second storage area (320) that stores files A, B, and C to a first storage area (310).
[0083] The electronic device (101) may transfer the file A stored in data block (320-3) and the file B stored in data block (320-7) to the first storage area (310) based on identifying that the file A and the file C identified as the first file are stored within the second storage area (320) while a mode for managing the second storage area (320) is being performed. As described above, the mode may be performed while the electronic device (101) is in an idle mode. For example, the idle mode may be described as a mode in which the electronic components (e.g., display) of the electronic device (101) are in a power-saving state when no user input is applied to the electronic device (101) within a defined time interval.
[0084] Referring to FIG. 8c, an example of a relocation operation performed in a second storage area (320) that stores file C is illustrated.
[0085] The electronic device (101) can identify whether the data blocks in which file C identified as the second file is stored (data blocks of FIG. 8b (320-1, 320-2, 320-4, 320-5, 320-6, 320-8, …, 320-13)) satisfy a condition regarding fragmentation while the mode for managing the second storage area (320) is performed. As described above, the condition regarding fragmentation may be that the number of fragmented data blocks among the data blocks of the second storage area (320) in which the file identified as the second file is stored exceeds a threshold value. According to the embodiment, the threshold value may be set in various ways. For example, the fragmented data blocks for the above file C may be data blocks (data blocks of FIG. 8b (320-1, 320-2)), data blocks (data blocks of FIG. 8b (320-4, 320-5, 320-6)), and data blocks (data blocks of FIG. 8b (320-8, …, 320-13)). For example, the number of fragmented data blocks for the above file C may correspond to '3'.
[0086] The electronic device (101) may perform an operation to reallocate the fragmented data blocks (data blocks of FIG. 8b (320-1, 320-2, 320-4, 320-5, 320-6, 320-8, …, 320-13)) into consecutive data blocks (data blocks of FIG. 8c (320-1, …, 320-11)) based on identifying the number (e.g., ‘3’) of the fragmented data blocks that exceed the threshold value (e.g., ‘2’). As described above, the operation to reallocate the fragmented data blocks can be described as file defragmentation.
[0087] The electronic device (101) may correspond to the electronic device (901) described with reference to FIG. 9 below.
[0088] FIG. 9 is a block diagram of an electronic device in a network environment according to various embodiments.
[0089] Referring to FIG. 9, in a network environment (900), an electronic device (901) may communicate with an electronic device (902) through a first network (998) (e.g., a short-range wireless communication network) or with at least one of an electronic device (904) or a server (908) through a second network (999) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (901) may communicate with the electronic device (904) through a server (908). According to one embodiment, the electronic device (901) may include a processor (920), memory (930), input module (950), sound output module (955), display module (960), audio module (970), sensor module (976), interface (977), connection terminal (978), haptic module (979), camera module (980), power management module (988), battery (989), communication module (990), subscriber identification module (996), or antenna module (997). In some embodiments, at least one of these components (e.g., connection terminal (978)) may be omitted from the electronic device (901), or one or more other components may be added. In some embodiments, some of these components (e.g., sensor module (976), camera module (980), or antenna module (997)) may be integrated into a single component (e.g., display module (960)).
[0090] The processor (920) can control at least one other component (e.g., a hardware or software component) of the electronic device (901) connected to the processor (920) by executing software (e.g., a program (940)), and can perform various data processing or operations. According to one embodiment, as at least part of the data processing or operations, the processor (920) can store commands or data received from other components (e.g., a sensor module (976) or a communication module (990)) in volatile memory (932), process the commands or data stored in volatile memory (932), and store the resulting data in non-volatile memory (934). According to one embodiment, the processor (920) may include a main processor (921) (e.g., a central processing unit or an application processor) or an auxiliary processor (923) that can operate independently or together with it (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, if the electronic device (901) includes a main processor (921) and an auxiliary processor (923), the auxiliary processor (923) may be configured to use lower power than the main processor (921) or to be specialized for a designated function. The auxiliary processor (923) may be implemented separately from the main processor (921) or as part thereof.
[0091] The auxiliary processor (923) may control at least some of the functions or states associated with at least one component of the electronic device (901) (e.g., display module (960), sensor module (976), or communication module (990)) on behalf of the main processor (921) while the main processor (921) is in an inactive (e.g., sleep) state, or together with the main processor (921) while the main processor (921) is in an active (e.g., application execution) state. According to one embodiment, the auxiliary processor (923) (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module (980) or communication module (990)). According to one embodiment, the auxiliary processor (923) (e.g., neural network processing unit) may include a hardware structure specialized for processing an artificial intelligence model. The artificial intelligence model may be generated through machine learning. Such learning may be performed, for example, on the electronic device (901) itself where the artificial intelligence model is executed, or through a separate server (e.g., server (908)). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model may include a plurality of artificial neural network layers.An artificial neural network may be a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to the hardware structure, the artificial intelligence model may include a software structure, either additionally or substantially.
[0092] The memory (930) can store various data used by at least one component of the electronic device (901) (e.g., processor (920) or sensor module (976)). The data may include, for example, software (e.g., program (940)) and input or output data for related commands. The memory (930) may include volatile memory (932) or non-volatile memory (934).
[0093] The program (940) may be stored as software in memory (930) and may include, for example, an operating system (942), middleware (944), or an application (946).
[0094] The input module (950) can receive commands or data to be used for a component of the electronic device (901) (e.g., processor (920)) from outside the electronic device (901) (e.g., user). The input module (950) may include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0095] The sound output module (955) can output an audio signal to the outside of the electronic device (901). The sound output module (955) may include, for example, a speaker or a receiver. The speaker may be used for general purposes, such as multimedia playback or recording playback. The receiver may be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from the speaker or as part thereof.
[0096] The display module (960) can visually provide information to an external (e.g., user) of the electronic device (901). The display module (960) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling said device. According to one embodiment, the display module (960) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of the force generated by said touch.
[0097] The audio module (970) can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module (970) can acquire sound through the input module (950) or output sound through the sound output module (955) or an external electronic device (e.g., electronic device (902)) (e.g., speaker or headphones) connected directly or wirelessly to the electronic device (901).
[0098] The sensor module (976) can detect the operating state of the electronic device (901) (e.g., power or temperature) or the external environmental state (e.g., user state) and generate an electrical signal or data value corresponding to the detected state. According to one embodiment, the sensor module (976) may include, for example, a gesture sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biosensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0099] The interface (977) may support one or more specified protocols that can be used for the electronic device (901) to be connected directly or wirelessly to an external electronic device (e.g., electronic device (902)). According to one embodiment, the interface (977) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0100] The connection terminal (978) may include a connector through which the electronic device (901) can be physically connected to an external electronic device (e.g., electronic device (902)). According to one embodiment, the connection terminal (978) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0101] The haptic module (979) can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic senses. According to one embodiment, the haptic module (979) may include, for example, a motor, a piezoelectric element, or an electric stimulation device.
[0102] The camera module (980) can capture still images and video. According to one embodiment, the camera module (980) may include one or more lenses, image sensors, image signal processors, or flashes.
[0103] The power management module (988) can manage power supplied to the electronic device (901). According to one embodiment, the power management module (988) can be implemented, for example, as at least part of a power management integrated circuit (PMIC).
[0104] The battery (989) can supply power to at least one component of the electronic device (901). According to one embodiment, the battery (989) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0105] The communication module (990) can support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between an electronic device (901) and an external electronic device (e.g., electronic device (902), electronic device (904), or server (908)), and the performance of communication through the established communication channel. The communication module (990) may include one or more communication processors that operate independently of the processor (920) (e.g., application processor) and support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (990) may include a wireless communication module (992) (e.g., cellular communication module, short-range wireless communication module, or GNSS (global navigation satellite system) communication module) or a wired communication module (994) (e.g., LAN (local area network) communication module, or power line communication module). The corresponding communication module among these communication modules can communicate with an external electronic device (904) through a first network (998) (e.g., a short-range communication network such as Bluetooth, WiFi (wireless fidelity) direct, or IrDA (infrared data association)) or a second network (999) (e.g., a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (992) can identify or authenticate the electronic device (901) within a communication network such as the first network (998) or the second network (999) using subscriber information (e.g., International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module (996).
[0106] The wireless communication module (992) can support 5G networks and next-generation communication technologies following 4G networks, for example, new radio access technology. NR access technology can support high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and connection of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low-latency communications (URLLC)). The wireless communication module (992) can support a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate, for example. The wireless communication module (992) can support various technologies for securing performance in the high-frequency band, such as beamforming, massive MIMO (multiple-input and multiple-output), full-dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large-scale antenna. The wireless communication module (992) can support various requirements specified in the electronic device (901), external electronic device (e.g., electronic device (904)), or network system (e.g., second network (999)). According to one embodiment, the wireless communication module (992) may support a Peak data rate (e.g., 20 Gbps or more) for eMBB realization, loss coverage (e.g., 164 dB or less) for mMTC realization, or U-plane latency (e.g., downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) for URLLC realization.
[0107] An antenna module (997) can transmit a signal or power to or from an external source (e.g., an external electronic device). According to one embodiment, the antenna module (997) may include an antenna comprising a radiator made of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). According to one embodiment, the antenna module (997) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as a first network (998) or a second network (999), may be selected from the plurality of antennas, for example, by a communication module (990). A signal or power may be transmitted or received between the communication module (990) and an external electronic device through the selected at least one antenna. According to some embodiments, in addition to the radiator, other components (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module (997).
[0108] According to various embodiments, the antenna module (997) may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent to a first surface (e.g., bottom surface) of the printed circuit board and capable of supporting a specified high frequency band (e.g., mmWave band), and a plurality of antennas (e.g., array antennas) disposed on or adjacent to a second surface (e.g., top surface or side surface) of the printed circuit board and capable of transmitting or receiving a signal of the specified high frequency band.
[0109] At least some of the above components can be connected to each other via a communication method between peripheral devices (e.g., bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)) and exchange signals (e.g., commands or data) with each other.
[0110] According to one embodiment, commands or data may be transmitted or received between an electronic device (901) and an external electronic device (904) through a server (908) connected to a second network (999). Each of the external electronic devices (902, or 904) may be the same or a different type of device as the electronic device (901). According to one embodiment, all or part of the operations performed on the electronic device (901) may be performed on one or more of the external electronic devices (902, 904, or 908). For example, if the electronic device (901) needs to perform a function or service automatically or in response to a request from a user or another device, the electronic device (901) may request one or more external electronic devices to perform at least part of the function or service instead of performing the function or service itself or additionally. One or more external electronic devices that receive the above request may execute at least part of the requested function or service, or additional function or service related to the request, and transmit the result of the execution to the electronic device (901). The electronic device (901) may provide the result as is or additionally processed as at least part of the response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device (901) may provide ultra-low latency services using, for example, distributed computing or mobile edge computing. In one embodiment, the external electronic device (904) may include an Internet of Things (IoT) device. The server (908) may be an intelligent server using machine learning and / or neural networks. According to one embodiment, the external electronic device (904) or the server (908) may be included within a second network (999).The electronic device (901) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0111] The technical problems to be solved in this disclosure are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which this disclosure pertains.
[0112] As described above, an electronic device (e.g., electronic device (101)) may include at least one processor (e.g., at least one processor (110)) comprising a processing circuit; and a memory (e.g., memory (120)) comprising one or more storage media for storing instructions. The instructions may cause the electronic device to be configured such that, when executed individually or collectively by the at least one processor: to identify a file to be stored in the memory; to store the file in a first storage area (e.g., first storage area (310)) of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition; and to store the file in a second storage area (e.g., second storage area (320)) of the memory configured to allow the file to be allocated in a second capacity unit larger than the first capacity unit based on the fact that the file is identified as a second file satisfying a second condition.
[0113] For example, the operation of storing the file identified as the first file within the first storage area of the memory may be performed based on the remaining storage capacity of the memory which is greater than the threshold storage capacity. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to store the file identified as the first file within the second storage area of the memory based on the remaining storage capacity of the memory which is less than the threshold storage capacity.
[0114] For example, the above threshold storage capacity may be a first threshold storage capacity. When the instructions are executed individually or collectively by the at least one processor, the electronic device may cause the file identified as the first file, stored in the second storage area of the memory, to migrate to the first storage area of the memory based on the remaining storage capacity of the first storage area which is greater than the second threshold storage capacity or the remaining storage capacity of the second storage area which is less than the third threshold storage capacity.
[0115] For example, the operation of transferring the above file to the first storage area can be performed while the electronic device is in idle mode.
[0116] For example, the above threshold storage capacity can be set in relation to the storage capacity of the second storage area.
[0117] For example, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to perform an operation to reallocate the fragmented data blocks into contiguous data blocks based on identifying the number of fragmented data blocks among the data blocks of the second storage area in which the file identified as the second file is stored; and identifying the number exceeding a threshold value.
[0118] For example, the first capacity unit may be a fixed size. The second capacity unit may be a variable size depending on the structure of the file.
[0119] For example, whether the first condition is satisfied may be determined based on the criterion that the data size of the file is less than a threshold size. Whether the second condition is satisfied may be determined based on the criterion that the data size of the file exceeds the threshold size.
[0120] For example, whether the first condition is satisfied may be determined according to a criterion where the type of the file corresponds to the first type. Whether the second condition is satisfied may be determined according to a criterion where the type of the file corresponds to the second type.
[0121] For example, the first storage area (310) may be configured to allow non-contiguous allocation for the storage of the file. The second storage area (320) may have a higher ratio of the number of times contiguous allocation for the storage of the file to the number of times allocation for the storage of the file is performed compared to the first storage area (310).
[0122] For example, the above instructions, when executed individually or collectively by the at least one processor, may cause the electronic device to perform the discontinuous allocation by storing a first portion of the file in at least one first data block of the first storage area and storing a second portion of the file in at least one second data block of the first storage area, based on the file being identified as the first file; and to store in the memory first address information indicating the address of the first data block among the at least one first data block, second address information indicating the address of the first data block among the at least one second data block, and size information indicating the data size of the file, based on the file being identified as the first file. The at least one second data block may be spaced apart from the at least one first data block on a file system for the memory (e.g., file system (220)).
[0123] For example, the above instructions may cause the electronic device to perform the contiguous allocation by storing the file in contiguous data blocks of the second storage area, based on the fact that the file is identified as the second file when executed individually or collectively by the at least one processor; and to store address information indicating the address of the first data block among the contiguous data blocks and size information indicating the data size of the file in the memory.
[0124] A non-transient computer-readable storage medium as described above may store one or more programs. The one or more programs may include instructions that cause the electronic device (e.g., electronic device (101)) having memory (e.g., memory (120)) to identify a file to be stored in said memory when executed by said electronic device (e.g., electronic device (101)) having said memory; to store said file in a first storage area of said memory (e.g., first storage area (310)) for allocating said file in a first capacity unit based on said file being identified as a first file satisfying a first condition; and to store said file in a second storage area of said memory (e.g., second storage area (320)) configured to allow said file to be allocated in a second capacity unit larger than said first capacity unit based on said file being identified as a second file satisfying a second condition.
[0125] For example, the operation of storing the file identified as the first file within the first storage area of the memory may be performed based on the remaining storage capacity of the memory which is greater than the threshold storage capacity. The one or more programs may include instructions that cause the electronic device to store the file identified as the first file within the second storage area of the memory, based on the remaining storage capacity of the memory which is smaller than the threshold storage capacity, when executed by the electronic device.
[0126] For example, the above threshold storage capacity may be a first threshold storage capacity. The one or more programs may include instructions that cause the electronic device to migrate the file identified as the first file, stored in the second storage area of the memory, to the first storage area of the memory, based on the remaining storage capacity of the first storage area being greater than the second threshold storage capacity or the remaining storage capacity of the second storage area being less than the third threshold storage capacity when executed by the electronic device.
[0127] For example, the above threshold storage capacity can be set in relation to the storage capacity of the second storage area.
[0128] For example, the first capacity unit may be a fixed size. The second capacity unit may be a variable size depending on the structure of the file.
[0129] For example, whether the first condition is satisfied may be determined based on the criterion that the data size of the file is less than a threshold size. Whether the second condition is satisfied may be determined based on the criterion that the data size of the file exceeds the threshold size.
[0130] For example, whether the first condition is satisfied may be determined according to a criterion where the type of the file corresponds to the first type. Whether the second condition is satisfied may be determined according to a criterion where the type of the file corresponds to the second type.
[0131] A method as described above may be executed by an electronic device (e.g., electronic device (101)) having a memory (e.g., memory (120)). The method may include: an operation of identifying a file to be stored in the memory; an operation of storing the file in a first storage area (e.g., first storage area (310)) of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition; and an operation of storing the file in a second storage area (e.g., second storage area (320)) of the memory configured to allow the file to be allocated in a second capacity unit larger than the first capacity unit based on the fact that the file is identified as a second file satisfying a second condition.
[0132] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs.
[0133] The electronic device according to the various embodiments disclosed in this document may be of various forms. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a consumer electronics device. The electronic device according to the embodiments of this document is not limited to the devices described above.
[0134] The various embodiments of this document and the terms used therein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various modifications, equivalents, or substitutions of said embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of said items unless the relevant context clearly indicates otherwise. In this document, phrases such as "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" may each include any one of the items listed together in the corresponding phrase, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used simply to distinguish said components from other said components and do not limit said components in any other aspect (e.g., importance or order). Where any (e.g., 1st) component is referred to as "coupled" or "connected" to another (e.g., 2nd) component, with or without the terms "functionally" or "communicationly," it means that said any component may be connected to said other component directly (e.g., via a wire), wirelessly, or through a third component.
[0135] The term “module” as used in the various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A module may be a component formed integrally, or a minimum unit of said component or a part thereof that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0136] Various embodiments of the present document may be implemented as software (e.g., program (940)) comprising one or more instructions stored in a storage medium (e.g., internal memory (936) or external memory (938)) readable by a machine (e.g., electronic device (901)). For example, a processor (e.g., processor (920)) of the machine (e.g., electronic device (901)) may call at least one of the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. The storage medium readable by the machine may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' simply means that the storage medium is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily.
[0137] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or distributed online (e.g., download or upload) through an application store (e.g., Play Store™) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0138] According to various embodiments, each component (e.g., module or program) of the components described above may include a singular or multiple entities, and some of the multiple entities may be separated and placed in other components. According to various embodiments, one or more of the components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Generally or additionally, multiple components (e.g., module or program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the multiple components in the same or similar manner as those performed by the corresponding component among the multiple components prior to integration. According to various embodiments, operations performed by the module, program, or other components may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
Claims
1. In an electronic device, At least one processor including a processing circuit; and Memory that stores instructions and includes one or more storage media, When the above instructions are executed individually or collectively by the at least one processor: Identifying a file to be stored in the above memory; Based on the fact that the above file is identified as a first file satisfying a first condition, the file is stored in a first storage area of the memory for allocating the file in a first capacity unit; and Based on the fact that the above file is identified as a second file satisfying a second condition, the file is stored in a second storage area of memory configured to allow the allocation of the file to a second capacity unit larger than the first capacity unit. The above electronic device, causing, Electronic device.
2. In Claim 1, The operation of storing the file identified as the first file within the first storage area of the memory is performed based on the remaining storage capacity of the memory which is greater than the critical storage capacity, and When the above instructions are executed individually or collectively by the at least one processor: Based on the remaining storage capacity of the memory that is smaller than the threshold storage capacity, the file identified as the first file is stored in the second storage area of the memory. The above electronic device, causing, Electronic device.
3. In Claim 2, The above critical storage capacity is a first critical storage capacity, and When the above instructions are executed individually or collectively by the at least one processor: Based on the remaining storage capacity of the first storage area which is greater than the second threshold storage capacity or the remaining storage capacity of the second storage area which is less than the third threshold storage capacity, the file identified as the first file stored in the second storage area of the memory is migrated to the first storage area of the memory. The above electronic device, causing, Electronic device.
4. In Claim 3, The operation of transferring the above file to the first storage area is performed while the electronic device is in idle mode. Electronic device.
5. In Claim 2, The above threshold storage capacity is set in relation to the storage capacity of the second storage area, Electronic device.
6. In Claim 1, When the above instructions are executed individually or collectively by the at least one processor: Identifying the number of fragmented data blocks among the data blocks of the second storage area where the file identified as the second file is stored; and Based on identifying the number exceeding a threshold value, to perform an operation to reallocate the fragmented data blocks into continuous data blocks, The above electronic device, causing, Electronic device.
7. In Claim 1, The above first capacity unit is of a fixed size, and The above second capacity unit is a size that varies according to the structure of the file, Electronic device.
8. In Claim 1, Whether the above first condition is satisfied is determined according to the criterion that the data size of the above file is less than a threshold size, and Whether the above second condition is satisfied is determined according to the criterion that the data size of the above file exceeds the threshold size, Electronic device.
9. In Claim 1, Whether the above first condition is satisfied is determined according to the criteria corresponding to the first type of the file type, and Whether the above second condition is satisfied is determined according to the criteria where the type of the above file corresponds to the second type, Electronic device.
10. In Claim 1, The first storage area is configured to allow non-contiguous allocation for storing the file, and The second storage area has a ratio of the number of times contiguous allocation for the storage of the file to the number of times allocation for the storage of the file is performed that is higher than that of the first storage area. Electronic device.
11. In Claim 10, When the above instructions are executed individually or collectively by the at least one processor: Based on the fact that the above file is identified as the first file, the discontinuous allocation is performed by storing a first portion of the above file in at least one first data block of the first storage area and storing a second portion of the above file in at least one second data block of the first storage area, wherein the at least one second data block is spaced apart from the at least one first data block on the file system for the memory; and Based on the fact that the above file is identified as the above first file, the first address information representing the address of the first data block among the at least one first data block, the second address information representing the address of the first data block among the at least one second data block, and the size information representing the data size of the above file are stored in the memory. The above electronic device, causing, Electronic device.
12. In Claim 10, When the above instructions are executed individually or collectively by the at least one processor: Based on the fact that the above file is identified as the above second file: By storing the above file in the contiguous data blocks of the second storage area, the contiguous allocation is performed; and To store address information indicating the address of the first data block among the above consecutive data blocks and size information indicating the data size of the above file in the memory, The above electronic device, causing, Electronic device.
13. In a non-transient computer-readable storage medium storing one or more programs, said one or more programs, when executed by an electronic device having memory: Identifying a file to be stored in the above memory; Based on the fact that the above file is identified as a first file satisfying a first condition, the file is stored in a first storage area of the memory; and Based on the fact that the above file is identified as a second file satisfying a second condition, the file is stored in a second storage area of memory configured to allow the allocation of the file to a second capacity unit larger than the first capacity unit. Instructions including those that cause the above electronic device Non-transient computer-readable storage media.
14. In Claim 13, The operation of storing the file identified as the first file within the first storage area of the memory is performed based on the remaining storage capacity of the memory which is greater than the critical storage capacity, and When one or more of the above programs are executed by the electronic device: Based on the remaining storage capacity of the memory that is smaller than the threshold storage capacity, the file identified as the first file is stored in the second storage area of the memory. Instructions including those that cause the above electronic device Non-transient computer-readable storage media.
15. A method performed by an electronic device having memory, An operation to identify a file to be stored in the above memory; An operation of storing the file in a first storage area of the memory for allocating the file in a first capacity unit based on the fact that the file is identified as a first file satisfying a first condition; and The operation of storing the file in a second storage area of memory configured to allow allocating the file to a second capacity unit larger than the first capacity unit, based on the fact that the file is identified as a second file satisfying a second condition. method.