Memory management method and device, storage medium and electronic equipment
By adjusting the standard capacity and redundancy/missing capacity of memory elements, the actual capacity is determined and configured to system modules, thus solving the problem of wasted memory resources and achieving effective utilization of memory resources and improved system performance.
Patent Information
- Application Number
- CN202411081818.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, memory chips have redundant or missing capacity during production, leading to resource waste and high production costs.
By reading the standard capacity and adjusted capacity of memory elements, the actual capacity is obtained and configured into the functional modules of the system, thus achieving effective utilization of memory resources.
It improves the accuracy of system memory configuration, avoids waste of memory components, reduces production costs, and improves system performance and stability.
Smart Images

Figure CN121501469A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a memory management method and device, a storage medium and an electronic device. BACKGROUND
[0002] Memory refers to a hardware device used by an electronic device for temporarily storing data and programs. In the related art, in order to ensure the yield of a memory chip, there is a part of redundant capacity in a memory element during production. If it is found that there is a storage unit damaged in the memory chip during testing, the damaged storage unit can be replaced by a redundant storage unit. However, due to the limitation of the standard capacity of the memory by the system of the electronic device, the part of redundant storage capacity can not be applied by the system, resulting in the problem of waste of resources. Alternatively, the actual capacity of the memory element during production can not reach the standard capacity, which can cause the memory element to be unable to be used by the electronic device, resulting in waste of the memory element. SUMMARY
[0003] Therefore, the present disclosure provides a memory management method and device, a storage medium and an electronic device, which can improve the accuracy of system memory configuration and avoid the problem of waste of memory element resources.
[0004] According to a first aspect of an embodiment of the present disclosure, a memory management method is provided, and the method comprises:
[0005] reading a standard capacity and an adjustment capacity of a memory element, wherein the standard capacity refers to a nominal capacity of the memory element during production, and the adjustment capacity refers to a redundant capacity or a missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to a memory capacity of the memory element exceeding the standard capacity, and the missing capacity refers to a memory capacity of the memory element less than the standard capacity;
[0006] adjusting the standard capacity according to the adjustment capacity to obtain an actual capacity of the memory element;
[0007] configuring the actual capacity to a functional module of a system according to the actual capacity.
[0008] In one embodiment, the adjusting the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element comprises:
[0009] in a case where the adjustment capacity is the redundant capacity, increasing the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element.
[0010] In one embodiment, the adjusting the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element comprises:
[0011] If the adjusted capacity is a missing capacity, the standard capacity is reduced based on the adjusted capacity to obtain the actual capacity.
[0012] In one embodiment, configuring the actual capacity to the system's functional modules based on the actual capacity includes:
[0013] Based on the actual capacity, modify the configuration parameters in the system;
[0014] Based on the configuration parameters, configure the memory mapping relationship between the memory element and the system, wherein the memory mapping relationship describes the mapping relationship between the virtual address of the system and the physical address of the memory element;
[0015] Based on the memory mapping relationship, the actual capacity is configured into the functional modules of the system.
[0016] In one embodiment, configuring the actual capacity into the functional modules of the system according to the memory mapping relationship includes:
[0017] Based on the memory mapping relationship, the actual capacity is allocated to at least one application stage in the system;
[0018] In each application phase, the actual capacity is configured into the system's functional modules based on the configuration parameters in the system.
[0019] In one embodiment, after obtaining the standard capacity and adjusted capacity of the memory element, the method further includes:
[0020] The actual capacity of the memory element is tested to check whether there is a fault in the memory space corresponding to the actual capacity.
[0021] In one embodiment, the standard capacity and adjusted capacity of the read memory element include:
[0022] Read the registers in the memory element to obtain the standard capacity and the adjusted capacity.
[0023] According to a second aspect of the present disclosure, a memory management apparatus is provided, the apparatus comprising:
[0024] The read unit is used to read the standard capacity and the adjusted capacity of the memory element, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity;
[0025] An adjustment unit is used to adjust the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element;
[0026] The configuration unit is used to configure the actual capacity into the functional modules of the system based on the actual capacity.
[0027] In one embodiment, the adjustment unit is specifically used for:
[0028] When the adjusted capacity is redundant, the standard capacity is increased based on the adjusted capacity to obtain the actual capacity of the memory element.
[0029] In one embodiment, the adjustment unit is specifically used for:
[0030] If the adjusted capacity is a missing capacity, the standard capacity is reduced based on the adjusted capacity to obtain the actual capacity.
[0031] In one embodiment, the configuration unit is specifically used for:
[0032] Based on the actual capacity, modify the configuration parameters in the system;
[0033] Based on the configuration parameters, configure the memory mapping relationship between the memory element and the system, wherein the memory mapping relationship describes the mapping relationship between the virtual address of the system and the physical address of the memory element;
[0034] Based on the memory mapping relationship, the actual capacity is configured into the functional modules of the system.
[0035] In one embodiment, the configuration unit is specifically used for:
[0036] Based on the memory mapping relationship, the actual capacity is allocated to at least one application stage in the system;
[0037] In each application phase, the actual capacity is configured into the system's functional modules based on the modified configuration parameters in the system.
[0038] In one embodiment, the apparatus further includes:
[0039] The testing unit is used to test the actual capacity of the memory element and check whether there is a fault in the memory space corresponding to the actual capacity.
[0040] In one embodiment, the reading unit is specifically used for:
[0041] Read the registers in the memory element to obtain the standard capacity and the adjusted capacity.
[0042] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the methods described in the first aspect above.
[0043] According to a fourth aspect of the present disclosure, a memory management apparatus is provided, comprising:
[0044] processor;
[0045] Memory used to store processor-executable instructions;
[0046] The processor is configured as follows:
[0047] The standard capacity and adjusted capacity of a memory element are read, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity;
[0048] The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element;
[0049] Based on the actual capacity, the actual capacity is configured into the functional modules of the system.
[0050] According to a fifth aspect of the present disclosure, a computer program product is provided that, when executed by a processor, implements the steps of any of the methods described in the first aspect above.
[0051] The technical solutions provided in this disclosure may have the following beneficial effects:
[0052] By obtaining the standard capacity and adjusted capacity of memory elements, the actual usable memory space capacity within the memory elements is determined, and the actual capacity is configured for use by the system's functional modules, thereby improving the accuracy of system memory configuration and avoiding the problem of wasting memory element resources.
[0053] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0054] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0055] Figure 1This disclosure is a flowchart illustrating a memory management method according to an exemplary embodiment;
[0056] Figure 2 This disclosure is a flowchart illustrating a method for configuring system memory according to an exemplary embodiment;
[0057] Figure 3 This disclosure is a flowchart illustrating another method for configuring system memory according to an exemplary embodiment;
[0058] Figure 4 This disclosure illustrates another memory management method flowchart according to an exemplary embodiment;
[0059] Figure 5 This disclosure is a block diagram of a memory management device according to an exemplary embodiment;
[0060] Figure 6 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0062] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0063] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0064] Memory refers to the hardware devices in electronic devices used for temporary storage of data and programs. It can be directly accessed by the CPU and is used to store running programs and data. When chip manufacturers produce memory chips, in order to ensure that the memory chips meet standards and improve production yield, they often produce extra memory capacity as backup capacity within the memory chips. If the chip manufacturer finds a damaged memory cell during testing, it can use a memory cell from the backup capacity to replace the damaged memory cell, ensuring that the memory chip meets production standards. However, in practical applications of memory chips, due to system limitations on memory capacity management, this extra backup capacity cannot be provided to users, leading to a waste of memory chip capacity resources.
[0065] Furthermore, if chip manufacturers discover during testing that a memory chip's capacity does not meet production standards, the chip will be considered scrap and unusable in electronic devices due to system limitations on memory capacity. For example, a mobile phone system might limit memory to 8GB, but if 80MB of a memory chip is damaged, resulting in an actual memory capacity below 8GB, the chip will be discarded. However, in practical applications, the impact of the damaged 80MB of memory cells on the chip is minimal. Discarding the chip directly would lead to chip waste and consequently, high production costs.
[0066] Based on this, this disclosure provides a memory management method that can be applied to operating systems, such as Android. By managing memory through the system, memory management of electronic devices such as mobile phones can be achieved. (See reference...) Figure 1 A flowchart illustrating a memory management method according to an exemplary embodiment may include the following steps:
[0067] S101, read the standard capacity and adjusted capacity of the memory element, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity is the memory capacity of the memory element that is less than the standard capacity.
[0068] In some embodiments, when a device such as a mobile phone is powered on, the system first executes the Primary Bootloader (PBL) to initialize the basic hardware in the device, providing hardware guarantees for the normal operation of the device. While loading the PBL, the Secondary Bootloader (SBL) is also loaded to initialize the core components of the system and configure system resources. After the SBL stage ends, control of the system is transferred to the system kernel to enable normal system operation. In other words, by loading the PBL and SBL programs when a device such as a mobile phone is powered on, the hardware and software configurations of the phone can be brought into working condition for user use. In this disclosure, the process of reading the standard capacity and adjusted capacity of memory elements is executed within the SBL; the SBL allows the standard capacity and adjusted capacity of memory elements to be read.
[0069] The standard capacity mentioned above is the nominal capacity marked by the chip manufacturer when producing memory components. This standard capacity is determined by the chip manufacturer based on actual production test results, and the size parameter of the standard capacity is recorded in the register of the memory component. The system can obtain the size of the standard capacity by reading the register. Adjusted capacity refers to the excess or deficiency of capacity in the memory component relative to the standard capacity. This is also determined by the chip manufacturer based on actual production test results, and its size parameter is also recorded in the register of the memory component. The system can also obtain the size of the adjusted capacity by reading the register. Memory components can be DDR, DDR2, DDR3, DDR4, DDR5, or second-generation HBM3 chips, etc. For example, the standard capacity marked by a memory component during production is 8GB, but to ensure that the memory component can reach the 8GB production standard, there is a 200MB spare capacity to replace damaged memory cells in the memory component. This 200MB spare cell is the redundancy capacity. It should be noted that this spare capacity is designed by the chip manufacturer, and the redundancy capacity accounts for approximately 2% to 3% of the standard capacity. Typically, this spare capacity will not be used in the operating system after the chip leaves the factory. For example, a memory element may have a standard capacity of 12GB, but if it contains 200MB of corrupted cells, its actual memory capacity may not reach 12GB. This missing 200MB is called the missing capacity. It should be noted that memory chips with missing capacity are typically unusable in an operating system. However, the memory management method provided in this disclosure allows memory elements with missing capacity to be used in an operating system.
[0070] S102, adjust the standard capacity according to the adjusted capacity to obtain the actual capacity of the memory element.
[0071] In some embodiments, the standard capacity is increased or decreased based on the standard capacity and adjusted capacity read from the memory chip by the system to obtain the actual capacity of the memory element. For example, if the system reads a standard capacity of 16GB and an adjusted capacity of 250MB (redundant capacity) from the memory chip, then the actual capacity of the memory element is 16GB + 250MB. Or, for instance, if the system reads a standard capacity of 12GB and an adjusted capacity of 100MB (missing capacity) from the memory element, then the actual capacity of the memory element is 12GB - 100MB.
[0072] S103, Based on the actual capacity, configure the actual capacity into the functional modules of the system.
[0073] In some embodiments, after the system finishes adjusting the standard capacity and obtains the actual capacity, the SBL program configures the actual capacity into the system applications, enabling the system's functional modules to correctly utilize the actual memory size. For example, if the system requires 8GB of memory, the operating system can only adapt to memory components with a capacity of 8GB. When the actual capacity of the memory component is 8GB + 180MB, the configuration parameters of the SBL program in the operating system can be modified to make the system compatible with memory components with an actual capacity of 8GB + 180MB, and the actual capacity can be configured into the system's functional modules via SBL, thereby improving the operating system's hardware compatibility.
[0074] By obtaining the standard capacity and adjusted capacity of memory elements, the actual usable memory space capacity within the memory elements is determined, and the actual capacity is configured for use by the system's functional modules, thereby improving the accuracy of system memory configuration and avoiding the problem of wasting memory element resources.
[0075] In this embodiment of the disclosure, adjusting the standard capacity based on the adjustment capacity to obtain the actual capacity of the memory element includes: when the adjustment capacity is a redundant capacity, increasing the standard capacity based on the adjustment capacity to obtain the actual capacity of the memory element.
[0076] In some embodiments, if the adjusted capacity is the redundant capacity in the memory cell that exceeds the standard capacity, then the adjusted capacity is increased to the standard capacity to obtain the actual capacity of the memory element. For example, if the system reads the memory element and determines that there is a 300MB redundant capacity in addition to the standard 12GB capacity, then the actual capacity of the system memory can be modified to 12GB + 300MB.
[0077] In this embodiment of the disclosure, adjusting the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element includes: when the adjustment capacity is a missing capacity, reducing the standard capacity according to the adjustment capacity to obtain the actual capacity.
[0078] In some embodiments, if the adjusted capacity is the missing capacity relative to the standard capacity of the memory cells, the missing capacity can be subtracted from the standard capacity to obtain the actual capacity. For example, based on the results of the system reading the memory elements, the standard capacity of the memory elements is determined to be 8GB, but 90MB of the storage cells are damaged, resulting in a missing capacity of 90MB. Then the actual capacity of the system memory can be modified to 8GB - 90MB.
[0079] When memory elements have redundant capacity exceeding the standard capacity, the standard capacity is adjusted based on this redundancy. This allows the system to utilize the redundant capacity, expanding the available memory space and improving resource utilization, thereby enhancing system performance. Conversely, when the adjusted capacity in a memory element is less than the standard capacity (missing capacity), the standard capacity is adjusted based on this missing capacity. This ensures the system is compatible with memory elements containing missing capacity, avoiding their direct disposal and further improving utilization. Furthermore, using these memory elements in low- to mid-range electronic devices reduces production costs.
[0080] In this embodiment of the disclosure, the process of configuring the actual capacity into the functional modules of the system based on the actual capacity is described in reference to... Figure 2 The flowchart shown includes the following steps:
[0081] S201, Based on the actual capacity, modify the configuration parameters in the system.
[0082] S202, Based on the configuration parameters, configure the memory mapping relationship between the memory element and the system, wherein the memory mapping relationship describes the mapping relationship between the virtual address of the system and the physical address of the memory element.
[0083] S203, Based on the memory mapping relationship, configure the actual capacity into the functional modules of the system.
[0084] In some embodiments, after obtaining the actual system capacity, the system's SBL (System Buffer Program) is used to configure the actual capacity into the system, enabling each functional module to run programs based on the actual memory capacity. First, the configuration parameters in the system's SBL are modified according to the actual system capacity, expanding the system-managed memory to the memory space corresponding to the actual capacity. Then, based on the configuration parameters, the memory mapping relationship between the physical addresses of memory elements and the virtual addresses of the system memory space is configured, achieving unification between memory elements and system memory. Finally, based on the configured memory mapping relationship, the memory space corresponding to the actual system capacity is configured into the system's functional modules, enabling the functional modules to correctly access and manage the phone's hardware resources.
[0085] By mapping the actual capacity space of memory elements to the system's virtual memory space, the system can be ensured to operate normally and provide stable performance and user experience, thus improving system stability.
[0086] In this embodiment of the disclosure, the process of configuring the actual capacity into the functional modules of the system based on the memory mapping relationship can be referred to as follows: Figure 3 The flowchart shown includes the following steps:
[0087] S301, based on the memory mapping relationship, allocate the actual capacity to at least one application stage in the system.
[0088] S302, in each application phase, the actual capacity is configured into the system's functional modules according to the configuration parameters in the system.
[0089] In some embodiments, the application phase of an Android system may include the ABOOT (Bootloader) phase and the Android phase. ABOOT is the bootloader for an Android device, the first software to run upon startup, responsible for initializing the hardware and launching the operating system. Specifically, ABOOT is primarily responsible for hardware initialization (e.g., initializing the processor), booting the operating system (e.g., loading and launching the operating system kernel), providing boot options, and recovery functions. The Android phase refers to the entire process from startup to the point where the user interface is available after ABOOT begins, encompassing kernel startup, system service startup, and the startup of application layer frameworks and applications. In other words, the Android phase enables the Android device to launch its user interface, allowing users to begin using the Android device.
[0090] When configuring the system based on actual capacity, the actual capacity can be allocated to the ABOOT and Android stages first. For example, if the system has 12GB of available memory, 2GB of memory can be allocated to the ABOOT stage and 10GB to the Android stage, based on the system's configuration parameters. Then, within these two stages, memory can be allocated to various functional modules according to the configuration parameters provided by the system's SBL (System Boot Record). For instance, based on the configuration parameters, 8GB of space can be allocated to the application startup module in the Android stage, allowing the system to load and release memory according to the application's needs.
[0091] By configuring the memory of functional modules in different stages of the system, the system can be made to run stably, relying on memory space at different stages to ensure the best performance and user experience during device operation.
[0092] In this embodiment of the disclosure, after obtaining the standard capacity and adjusted capacity of the memory element, the method further includes: testing the actual capacity of the memory element and checking whether there is a fault in the memory space corresponding to the actual capacity.
[0093] In some embodiments, after the system obtains the standard capacity and adjusted capacity of the memory elements, a read / write test needs to be performed on the standard capacity and adjusted capacity to check whether the memory space corresponding to the actual capacity is all usable space and to determine whether there are any damaged or faulty memory cells. If the memory space corresponding to the actual capacity passes the read / write test and is usable space, then the system memory can be configured according to the standard capacity and adjusted capacity. If there are damaged or faulty memory cells in the standard capacity or adjusted capacity, then when determining the actual capacity of the memory elements, these damaged or faulty memory cells need to be removed before configuring the system memory.
[0094] By performing read and write tests on memory, we can ensure that memory components meet expectations in terms of performance, stability, and reliability, thereby improving the reliability of system operation.
[0095] In this embodiment of the disclosure, reading the standard capacity and adjusted capacity of the memory element includes: reading the registers in the memory element to obtain the standard capacity and the adjusted capacity.
[0096] In some embodiments, the process of reading the standard capacity and adjusted capacity of a memory element is achieved by reading the registers in the memory element. In one embodiment, the standard capacity and adjusted capacity can be obtained by reading the MR (Main Register) in the memory element. The registers in the memory element are primarily used for storing and controlling data access, managing the execution status of memory operations, and other functions. The system can perform memory read operations by reading and writing to the memory. The standard capacity and adjusted capacity of the memory are recorded in the register during the production of the memory element, based on the actual test results on the production line. This register serves as identification support for memory capacity adjustments in the system and as a reference for adjusting the capacity. Because memory operations are fast and have a significant impact on system performance, managing system memory by reading registers is beneficial to improving the stability and performance of the entire system.
[0097] In one embodiment, it can be referred to Figure 4 The flowchart shown illustrates the memory management method provided in this disclosure. The specific steps are as follows:
[0098] S401 executes the PBL (Phase One Bootloader) when an Android phone boots up, initializing the basic hardware in the device.
[0099] After the PBL (Programmed Bootloader) finishes, the SBL (Second-Stage Bootloader) is loaded. First, it reads the timing parameters recorded in the registers of the memory components. These timing parameters can be used to configure the hardware in the phone. These write parameters include clock frequency, voltage, timing, and other parameters that directly affect the device's performance and stability.
[0100] S403 reads the standard capacity of the memory element. The standard capacity of the memory element is recorded in a register during the manufacturing process and represents the number of memory cells in the memory element that meet the manufacturing requirements.
[0101] S404 checks and reads the extra capacity. When reading the extra capacity, it first determines whether the extra capacity in the memory element can be found through addressing. If the extra capacity can be found, it reads the size of the extra capacity stored in the register and determines whether the standard capacity needs to be increased or decreased based on the extra capacity.
[0102] The S405 performs read and write tests on the entire memory space, including both extra and standard capacity, to ensure the safe availability of the memory space.
[0103] S406 modifies the system SBL configuration parameters based on the additional capacity and standard capacity to make the system compatible with memory elements and changes the system's memory space size to the actual usable memory space size in the memory elements.
[0104] S407 configures the mapping relationship between the physical address of the memory element and the virtual address of the system memory space according to the modified SBL configuration parameters, and configures the system's mapping space so that applications in the system can call the memory units in the memory element.
[0105] S408 allocates the actual available mapping space in the system to the ABOOT and Android stages of the system according to the SBL configuration parameters, and allocates memory to the functional modules in the system according to the configuration parameters provided by SBL in these two stages.
[0106] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should know that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps may be performed in other orders or simultaneously.
[0107] Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by this disclosure.
[0108] Corresponding to the aforementioned application function implementation method embodiments, this disclosure also provides embodiments of application function implementation apparatus and corresponding terminals.
[0109] Reference Figure 5 A memory management device block diagram according to an exemplary embodiment shows that the device may include:
[0110] The reading unit 501 is used to read the standard capacity and the adjusted capacity of the memory element, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity is the memory capacity of the memory element that is less than the standard capacity.
[0111] The adjustment unit 502 is used to adjust the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element;
[0112] The configuration unit 503 is used to configure the actual capacity into the functional modules of the system based on the actual capacity.
[0113] In one embodiment, the adjustment unit 502 is specifically used for:
[0114] When the adjusted capacity is redundant, the standard capacity is increased based on the adjusted capacity to obtain the actual capacity of the memory element.
[0115] In one embodiment, the adjustment unit 502 is specifically used for:
[0116] If the adjusted capacity is a missing capacity, the standard capacity is reduced based on the adjusted capacity to obtain the actual capacity.
[0117] In one embodiment, the configuration unit 503 is specifically used for:
[0118] Based on the actual capacity, modify the configuration parameters in the system;
[0119] Based on the configuration parameters, configure the memory mapping relationship between the memory element and the system, wherein the memory mapping relationship describes the mapping relationship between the virtual address of the system and the physical address of the memory element;
[0120] Based on the memory mapping relationship, the actual capacity is configured into the functional modules of the system.
[0121] In one embodiment, the configuration unit 503 is specifically used for:
[0122] Based on the memory mapping relationship, the actual capacity is allocated to at least one application stage in the system;
[0123] In each application phase, the actual capacity is configured into the system's functional modules based on the modified configuration parameters in the system.
[0124] In one embodiment, the apparatus further includes:
[0125] The testing unit is used to test the actual capacity of the memory element and check whether there is a fault in the memory space corresponding to the actual capacity.
[0126] In one embodiment, the reading unit is specifically used for:
[0127] Read the registers in the memory element to obtain the standard capacity and the adjusted capacity.
[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0129] Accordingly, this disclosure provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to:
[0130] The standard capacity and adjusted capacity of a memory element are read, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity;
[0131] The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element;
[0132] Based on the actual capacity, the actual capacity is configured into the functional modules of the system.
[0133] Figure 6 This is a schematic diagram illustrating the structure of an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a user device, specifically a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, wearable device such as smartwatch, smart glasses, smart bracelet, smart running shoes, etc.
[0134] Reference Figure 6 The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0135] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0136] Memory 604 is configured to store various types of data to support the operation of device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0137] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.
[0138] Multimedia component 608 includes a screen that provides an output interface between the aforementioned electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0139] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0140] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0141] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0142] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the aforementioned communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0143] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0144] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 604 including instructions, which, when executed by a processor 620 of an electronic device 600, enables the electronic device 600 to perform a memory management method, the method including:
[0145] The standard capacity and adjusted capacity of a memory element are read, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity;
[0146] The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element;
[0147] Based on the actual capacity, the actual capacity is configured into the functional modules of the system.
[0148] The non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0149] Based on the same inventive concept, this disclosure also provides a computer program product that, when executed by a processor, implements the steps of the memory management method.
[0150] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0151] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A memory management method, characterized in that, The method includes: The standard capacity and adjusted capacity of a memory element are read, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity; The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element; Based on the actual capacity, the actual capacity is configured into the functional modules of the system.
2. The method according to claim 1, characterized in that, The step of adjusting the standard capacity based on the adjusted capacity to obtain the actual capacity of the memory element includes: When the adjusted capacity is redundant, the standard capacity is increased based on the adjusted capacity to obtain the actual capacity of the memory element.
3. The method according to claim 1, characterized in that, The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element, including: If the adjusted capacity is a missing capacity, the standard capacity is reduced based on the adjusted capacity to obtain the actual capacity.
4. The method according to claim 1, characterized in that, The step of configuring the actual capacity into the system's functional modules based on the actual capacity includes: Based on the actual capacity, modify the configuration parameters in the system; Based on the configuration parameters, configure the memory mapping relationship between the memory element and the system, wherein the memory mapping relationship describes the mapping relationship between the virtual address of the system and the physical address of the memory element; Based on the memory mapping relationship, the actual capacity is configured into the functional modules of the system.
5. The method according to claim 4, characterized in that, The step of configuring the actual capacity into the functional modules of the system based on the memory mapping relationship includes: Based on the memory mapping relationship, the actual capacity is allocated to at least one application stage in the system; In each application phase, the actual capacity is configured into the system's functional modules according to the system's configuration parameters.
6. The method according to claim 1, characterized in that, After obtaining the standard capacity and adjusted capacity of the memory element, the method further includes: The actual capacity of the memory element is tested to check whether there is a fault in the memory space corresponding to the actual capacity.
7. The method according to claim 1, characterized in that, The standard capacity and adjusted capacity of the read memory element include: Read the registers in the memory element to obtain the standard capacity and the adjusted capacity.
8. A memory management device, characterized in that, The device includes: The read unit is used to read the standard capacity and the adjusted capacity of the memory element, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity; An adjustment unit is used to adjust the standard capacity according to the adjustment capacity to obtain the actual capacity of the memory element; The configuration unit is used to configure the actual capacity into the functional modules of the system based on the actual capacity.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The standard capacity and adjusted capacity of a memory element are read, wherein the standard capacity refers to the nominal capacity of the memory element during production, the adjusted capacity is the redundant capacity or missing capacity of the memory element relative to the standard capacity, the redundant capacity refers to the memory capacity of the memory element that exceeds the standard capacity, and the missing capacity refers to the memory capacity of the memory element that is less than the standard capacity; The standard capacity is adjusted according to the adjusted capacity to obtain the actual capacity of the memory element; Based on the actual capacity, the actual capacity is configured into the functional modules of the system.