Data storage method and device for application software, equipment and medium
By dividing the storage medium into partitions based on the writing frequency of storage blocks on a multi-core domain controller, the problem of data interference caused by frequent writing is solved, and data security and the service life of the storage medium are improved.
Patent Information
- Application Number
- CN202410781882.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-10-08
AI Technical Summary
On multi-core domain controllers, frequently written data can easily interfere with other stored data in the same page, increasing the risk of data loss or damage. Existing technologies cannot effectively solve this problem.
Divide the storage medium into multiple storage partitions, and divide the storage blocks into different partitions according to the writing frequency to achieve data isolation and reduce mutual influence during writing.
It improves the security of stored data, significantly reduces the number of data losses or damage, and extends the service life of storage media.
Smart Images

Figure CN118747159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data storage method, device, equipment and medium for application software. Background Art
[0002] A multi-core domain controller is a controller that integrates two or more complete computing engines (cores). A wide variety of application software is deployed on a multi-core domain controller, and different application software is deployed on different cores. The storage medium on a multi-core domain controller is a Flash storage medium. The Flash storage medium includes several blocks, each block is divided into several pages, each page contains several bytes, and each byte is 8 bits.
[0003] Currently, when storing data, the data to be stored is divided into important data and unimportant data. Page address space with low bit error rate is allocated to important data, and page address space with high bit error rate is allocated to unimportant data, so as to balance the management of write operations and extend the service life of the storage medium.
[0004] However, whether important data or non-important data, when it is written frequently, it will interfere with other stored data in the same page, increasing the risk of loss or damage of other stored data. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a data storage method, device, equipment and medium for application software that solves the above problems. The storage medium can be divided into multiple storage partitions, and the storage blocks can be divided into different storage partitions according to the write frequency of the storage blocks, thereby achieving isolation of storage data in different storage blocks, reducing the mutual influence of storage blocks with different write frequencies when writing storage data, improving the security of storage data, and greatly reducing the number of times storage data is lost or damaged.
[0006] In a first aspect, the present invention provides a method for storing data of application software, the method comprising:
[0007] Obtaining a write frequency of a storage block storing data to be stored in the application software;
[0008] The storage block is divided into corresponding storage partitions in a storage medium according to the write frequency, and the storage medium includes a plurality of the storage partitions.
[0009] Optionally, the storage partitions of the storage medium include a fixed storage partition, a low-frequency storage partition, and a high-frequency storage partition, and the dividing the storage blocks into corresponding storage partitions in the storage medium according to the write frequency includes:
[0010] If the write frequency is less than or equal to a preset first threshold, dividing the storage block into the fixed storage partition;
[0011] If the write frequency is greater than the first threshold and less than or equal to a preset second threshold, dividing the storage block into the low-frequency storage partition;
[0012] If the write frequency is greater than the second threshold, the storage block is divided into the high-frequency storage partition.
[0013] Optionally, the physical addresses between the multiple storage partitions are discontinuous.
[0014] Optionally, the method further includes:
[0015] Obtain the total number of bytes occupied by all storage blocks in the storage partition when written once, the estimated number of writes per day for all storage blocks, the estimated number of days of use of the storage blocks, and the erasure life of the storage medium;
[0016] The storage capacity of the storage partition is calculated based on the total number of bytes, the estimated number of write times, the number of days of use, and the erase life.
[0017] Optionally, the method further includes:
[0018] Storing the data to be stored of the application software into the preset upper-layer application software;
[0019] The data to be stored in the upper-layer application software is stored in a storage block of a corresponding storage partition in the storage medium.
[0020] Optionally, the method further includes:
[0021] Record the number of write requests and operation status of each storage block;
[0022] Whether the storage state of each storage block is abnormal is determined according to the number of write requests and the operation state.
[0023] Optionally, the method further includes:
[0024] Obtaining a security level of the storage block;
[0025] Writing each data to be stored in the storage block with a high security level into two copies, and using one copy as backup storage data;
[0026] Only one copy of each data to be stored in the storage block with the general security level is written.
[0027] In a second aspect, the present invention provides a data storage device for application software, the device comprising:
[0028] An acquisition module, used for acquiring a write frequency of a storage block storing data to be stored in application software;
[0029] A partitioning module is used to partition the storage block into corresponding storage partitions in a storage medium according to the write frequency, and the storage medium includes a plurality of the storage partitions.
[0030] Optionally, the partitioning module is also used to:
[0031] If the write frequency is less than or equal to a preset first threshold, dividing the storage block into the fixed storage partition;
[0032] If the write frequency is greater than the first threshold and less than or equal to a preset second threshold, dividing the storage block into the low-frequency storage partition;
[0033] If the write frequency is greater than the second threshold, the storage block is divided into the high-frequency storage partition.
[0034] Optionally, the physical addresses between the multiple storage partitions are discontinuous.
[0035] Optionally, the device further comprises a computing module, configured to:
[0036] Obtain the total number of bytes occupied by all storage blocks in the storage partition when written once, the estimated number of writes per day for all storage blocks, the estimated number of days of use of the storage blocks, and the erasure life of the storage medium;
[0037] The storage capacity of the storage partition is calculated based on the total number of bytes, the estimated number of write times, the number of days of use, and the erase life.
[0038] Optionally, the device further includes a storage module, configured to:
[0039] Storing the data to be stored of the application software into the preset upper-layer application software;
[0040] The data to be stored in the upper-layer application software is stored in a storage block of a corresponding storage partition in the storage medium.
[0041] Optionally, the device further includes a judgment module, configured to:
[0042] Record the number of write requests and operation status of each storage block;
[0043] Whether the storage state of each storage block is abnormal is determined according to the number of write requests and the operation state.
[0044] Optionally, the device further includes a backup module, configured to:
[0045] Obtaining a security level of the storage block;
[0046] Writing each data to be stored in the storage block with a high security level into two copies, and using one copy as backup storage data;
[0047] Only one copy of each data to be stored in the storage block with the general security level is written.
[0048] In a third aspect, the present invention provides an electronic device comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method described in the first aspect by executing the computer instructions.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0050] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:
[0051] The data storage method, device, equipment and medium of an application software provided by an embodiment of the present invention can first obtain the write frequency of the storage block of the data to be stored in the application software; divide the storage block into corresponding storage partitions in the storage medium according to the write frequency, and the storage medium includes multiple storage partitions. The method can divide the storage medium into multiple storage partitions, and divide the storage blocks into different storage partitions according to the write frequency of the storage blocks, thereby realizing the isolation of the storage data in different storage blocks, reducing the mutual influence of storage blocks with different write frequencies when writing storage data, improving the security of the storage data, and greatly reducing the number of times the storage data is lost or damaged.
[0052] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0054] Figure 1is a flow chart of a data storage method for application software provided by an embodiment of the present invention;
[0055] Figure 2 It is a structural block diagram of a data storage device for application software provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0057] Figure 1 is a flow chart of a data storage method for application software provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes steps S110 to S120.
[0058] Step S110: Obtain the write frequency of the storage block storing the data to be stored of the application software.
[0059] In this embodiment, some current data storage methods do not support data storage of multiple domains and multiple data on complex controllers such as domain controllers, while the data storage method in this application can be applied to multi-core domain controllers, on which a wide variety of application software are deployed, and different application software are deployed to different cores. Before data storage, the storage requirements of the application software will be investigated, and the investigation content may include: the name, size, default value, write frequency, functional description and storage security level of the storage block to be applied for, and whether it is necessary for the underlying system to uniformly read the power-on and write the power-off during sleep, and store these investigation contents in the demand investigation table. Therefore, the write frequency of the storage block can be obtained from the demand survey table.
[0060] In this embodiment, a unique ID number can also be set for each storage block, and the ID number is used as an identification code for each storage block, so as to identify the corresponding storage block, and all relevant operations can be performed on the storage block using the ID number. For example, digital numbers are assigned to all storage blocks in ascending order, and the digital numbers of each storage block are different, and the digital numbers can be used as the ID numbers of the storage blocks.
[0061] In this embodiment, a storage block name, a storage block ID number and a storage block size are also allocated to each data to be stored in the application software, and the allocated storage block is used to store the data to be stored.
[0062] Step S120: Divide the storage blocks into corresponding storage partitions in the storage medium according to the write frequency.
[0063] The storage medium includes multiple storage partitions.
[0064] In this embodiment, storage blocks with different write frequencies are divided into different storage partitions in the storage medium, that is, the storage medium of the underlying system is divided into multiple storage partitions in advance, and the write frequencies of the storage blocks in each storage partition are different. Wherein, the storage medium is a Flash storage medium.
[0065] It should be noted that the underlying system refers to the Flash emulated EEPROM (Electrically Erasable Programmable Read Only Memory) module in the basic software BSW (Basic Software), namely the FEE (Flash EEPROM Emulation) module. The FEE module is an important module in AUTOSAR (Automotive Open System Architecture) and is used to implement the simulation of non-volatile memory (NVM) on the vehicle electronic control unit (Electronic Control Unit, ECU). Multiple storage partitions are configured in the FEE module, and each storage partition is configured with a starting physical address and the size of the storage partition. The physical address is the actual access address of the storage partition in the storage medium.
[0066] Optionally, the physical addresses of the multiple storage partitions are not continuous.
[0067] In this embodiment, in order to ensure that each storage partition does not interfere with the data in other storage partitions when storing data, the physical addresses between the storage partitions are configured to be discontinuous. It can be understood that each storage partition has a starting physical address and an ending physical address, and the ending physical address of the front storage partition and the starting physical address of the back storage partition in two adjacent storage partitions are discontinuous, and there will be a difference of a set number of physical addresses, so as to isolate the two adjacent storage partitions so that they do not interfere with each other when storing data.
[0068] Optionally, the storage partitions of the storage medium include a fixed storage partition, a low-frequency storage partition, and a high-frequency storage partition, and step S120 includes:
[0069] If the write frequency is less than or equal to a preset first threshold, the storage block is divided into a fixed storage partition;
[0070] If the write frequency is greater than the first threshold and less than or equal to the preset second threshold, the storage block is divided into a low-frequency storage partition;
[0071] If the write frequency is greater than the second threshold, the storage block is divided into high-frequency storage partitions.
[0072] In this embodiment, the first threshold value may be 1, and the write frequency may be divided into write-once, write-with lower frequency, and write-with higher frequency. Then, all the write-once storage blocks are allocated to the fixed storage partition, the write-with lower frequency storage blocks are allocated to the low-frequency storage partition, and the write-with higher frequency storage blocks are allocated to the high-frequency storage block partition.
[0073] In this embodiment, the storage partitions of the storage medium may also include special storage partitions. Storage blocks with higher write frequencies may also be allocated to special storage partitions. Special storage partitions are also used to store the most important data information of the storage system (such as OS scheduling information, Task stack information, etc.) when the controller system crashes, for subsequent analysis of the cause of the system crash.
[0074] Optionally, the method further includes:
[0075] Get the total number of bytes occupied by all storage blocks in the storage partition when written once, the expected number of writes per day for all storage blocks, the expected number of days of use of storage blocks, and the erase life of the storage media; calculate the storage capacity of the storage partition based on the total number of bytes, expected number of writes, days of use, and erase life.
[0076] In this embodiment, after the storage partitions are divided, the storage capacity of the storage partitions must be determined. Among them, the total number of bytes occupied by a storage block when written once and the estimated number of writes to the storage block per day are also the survey contents during the application software storage demand survey, and the estimated number of days of use of the storage block is determined according to the use scenario of the application software. For example, if the application software is software on a vehicle, the estimated number of days of use of the storage block is the life of the vehicle. Each storage medium has a set erase life, and the corresponding erase life can be directly matched according to the model of the storage medium.
[0077] Specifically, the storage capacity of the storage partition is calculated according to the following formula:
[0078] C = (a*b*t) / d;
[0079] Among them, C represents the storage capacity of the storage partition, a represents the total number of bytes, b represents the number of writes, t represents the number of days of use, and d represents the erase life.
[0080] In this embodiment, in order to make the storage capacity determination more accurate, a correction coefficient may be set to correct the storage capacity.
[0081] For example, C=(a*b*t) / d+e, where e represents a correction coefficient, and the size of e can be determined according to actual storage requirements.
[0082] Optionally, the method further includes:
[0083] The data to be stored of the application software is stored in the preset upper-layer application software; the data to be stored stored in the upper-layer application software is stored in the storage block of the corresponding storage partition in the storage medium.
[0084] In this embodiment, an upper-layer application software is also pre-set as a storage proxy module, which is used to interact with the application domain of the application software to store data. Specifically, all the data to be stored that needs to be stored in the application domain is collected, and the storage proxy module reads the data to be stored from each application domain, and then calls the write interface of the underlying system to write the data to be stored into the storage medium. At the same time, when calling the storage data in the storage medium, the storage proxy module first calls the read interface of the underlying system, reads the storage data in the storage medium, and then sends it to the corresponding application domain. The application storage proxy module interacts directly with the underlying storage system, isolates the application domain from directly accessing the bottom layer of the storage system, and improves access security. The storage proxy module needs to be deployed on the same core as the underlying storage system.
[0085] In addition, since the data to be stored comes from application modules with storage requirements in the application domain, the storage proxy module and the application module can be deployed on the same core or on different cores. If both are deployed on different cores, data interaction must be performed through a cross-core method.
[0086] Optionally, the method further includes:
[0087] The number of write requests and the operation status of each storage block are recorded; and whether the storage status of each storage block is abnormal is determined according to the number of write requests and the operation status.
[0088] In this embodiment, there are many application domains on the multi-core domain controller, and a lot of data to be stored. If the application domains frequently store data under certain working conditions, it will seriously affect the service life of the storage hardware and threaten the data storage security. In order to timely discover abnormal storage behavior, this embodiment also provides a monitoring function for storage data storage behavior.
[0089] Specifically, the number of write requests for each storage block in the underlying system, that is, the number of successful write requests, and the operating status of each storage block are monitored, and the number of write requests and the operating status are periodically sent to the cloud, so as to facilitate the statistics of the storage frequency and storage abnormality of each storage block. When the number of write requests is greater than the set first threshold, it is judged that the storage of the corresponding storage block is too frequent, an early warning is issued, and corresponding adjustment measures are taken; if the number of failures in the operation status is greater than the set second threshold, the storage of the corresponding storage block is judged to be abnormal, and an early warning is issued. Among them, the operating status includes success, failure, restore default value and processing. Success: indicates that the storage block is read or written and no error occurs; failure: indicates that the storage block fails to read or write; restore default value: indicates that an error occurs when reading the storage block, and the storage data of the storage block is restored to the default value; processing: indicates that the management module of the underlying system has successfully received the request for reading or writing the storage block, but the processing has not yet been completed.
[0090] In this embodiment, the historical erasure times of each storage partition is also recorded, and the theoretical remaining erasure life of the storage medium is obtained according to the difference between the historical erasure times and the erasure life.
[0091] Optionally, the method further includes:
[0092] Obtain the storage security level of the storage block; write two copies of each data to be stored in the storage block with a high storage security level, and use one copy as backup storage data; write only one copy of each data to be stored in the storage block with a general storage security level.
[0093] In this embodiment, the storage security level of the storage block can be obtained from the demand survey table, and then the management type of the storage block with a high storage security level is determined to be the Redundant mode. For the storage block configured as the Redundant mode, two identical copies of the data to be stored will be written into the storage medium each time the data is written. When reading, if one copy of the storage data fails the verification or is damaged, the backup storage data is used, and the damaged storage data is rewritten and replaced with the backup storage data, so that the undamaged storage data is always guaranteed, which improves the security of the storage block. If both copies of the data are damaged, the storage data is replaced with a preset default value. The management type of the storage block with a general storage security level is determined to be the Native mode, and for the storage block configured as the Native mode, only one copy of the data to be stored will be written into the storage medium, and when damaged, it will be directly replaced with the default value.
[0094] It should be noted that each storage block is configured with a corresponding default value for replacing erroneous storage data.
[0095] In this embodiment, the method further includes:
[0096] Set the configuration items of the storage blocks that need to be uniformly read on power-on and written on hibernation by the underlying system to TRUE. In the power-on initialization phase of the multi-core domain controller, the underlying system reads all storage blocks with the power-on read configuration item set to TRUE from the storage medium. In the hibernation power-off phase, the underlying system uniformly stores the storage data of the storage blocks that need to be written on hibernation. Set the configuration items of the storage blocks that do not need to be uniformly read on power-on and written on hibernation by the underlying system to False, and there is no need to read and store the corresponding storage data in the power-on initialization phase and hibernation power-off phase of the multi-core domain controller.
[0097] In this embodiment, the storage block can also be checked for storage reading. When reading the stored data, if the CRC check (Cyclic Redundancy Check) fails, it means that the stored data is damaged or tampered with, and the underlying system provides the configured default value to the application domain for use. When the ID number of the storage block requested for the storage data operation is inconsistent with the ID number read from the storage medium, the static ID check fails, and the operation request for the storage data is considered to be an illegal operation, and the operation is rejected and the request operation error code is returned.
[0098] The data storage method of the multi-core domain controller in this embodiment includes a storage demand investigation, storage plan formulation and implementation, storage behavior monitoring, etc. for the storage data of multiple application software in the multi-core domain controller, thereby realizing the multi-data storage demand and storage security of the multi-core domain controller. The storage characteristics of each storage data are fully considered to divide the storage partitions, thereby realizing the storage isolation of data with different storage attributes, reducing mutual influence, improving data security, and greatly reducing the number of times erroneous data is recovered. For data with a high security level, a dual backup feature is configured to improve the storage security performance of important data. For storage behavior monitoring, the storage behavior of the current storage data and the historical operating status of the storage medium are effectively monitored, and abnormal storage behavior is discovered in a timely manner, which greatly reduces the possibility of the storage medium exceeding the erase life, and improves the security of data storage.
[0099] Based on the same inventive concept, an embodiment of the present invention further provides a data storage device for application software. Figure 2 is a structural block diagram of a data storage device for application software provided by an embodiment of the present invention, such as Figure 2 As shown, the device 200 includes an acquisition module 201 and a division module 202 .
[0100] An acquisition module 201 is used to acquire a write frequency of a storage block storing data to be stored in application software;
[0101] The partitioning module 202 is used to partition the storage blocks into corresponding storage partitions in the storage medium according to the writing frequency, and the storage medium includes a plurality of storage partitions.
[0102] Optionally, the dividing module 202 is further used for:
[0103] If the write frequency is less than or equal to a preset first threshold, the storage block is divided into a fixed storage partition;
[0104] If the write frequency is greater than the first threshold and less than or equal to the preset second threshold, the storage block is divided into a low-frequency storage partition;
[0105] If the write frequency is greater than the second threshold, the storage block is divided into high-frequency storage partitions.
[0106] Optionally, the physical addresses of the multiple storage partitions are not continuous.
[0107] Optionally, the apparatus 200 further includes a computing module, configured to:
[0108] Obtain the total number of bytes occupied by each write of all storage blocks in the storage partition, the estimated number of writes per day for all storage blocks, the estimated number of days of use of storage blocks, and the erase life of storage media;
[0109] Calculates the storage capacity of a storage partition based on total bytes, estimated write counts, days of use, and erase lifespan.
[0110] Optionally, the device 200 further includes a storage module, configured to:
[0111] Storing the data to be stored of the application software into the preset upper-layer application software;
[0112] The data to be stored in the upper-layer application software is stored in the storage block of the corresponding storage partition in the storage medium.
[0113] Optionally, the device 200 further includes a judgment module, configured to:
[0114] Record the number of write requests and operation status of each storage block;
[0115] According to the number of write requests and the operation status, it is determined whether the storage status of each storage block is abnormal.
[0116] Optionally, the device 200 further includes a backup module, configured to:
[0117] Get the security level of the storage block;
[0118] Each data to be stored in a storage block with a high security level is written into two copies, and one of the copies is used as backup storage data;
[0119] Only one copy of each data to be stored in a storage block with a general security level is written.
[0120] It can be understood that the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0121] An embodiment of the present invention further provides an electronic device, which may include a processor and a memory, wherein the processor and the memory may be communicatively connected to each other via a bus or other means.
[0122] The processor may be a central processing unit (CPU) or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0123] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside the electronic device. In a particular embodiment, the memory may be a non-volatile solid-state memory.
[0124] In one example, the memory may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0125] The processor implements any one of the data storage methods for application software in the above embodiments by reading and executing computer program instructions stored in the memory.
[0126] In one example, the electronic device may further include a communication interface and a bus. Among them, the processor, memory, and communication interface are connected through a bus and communicate with each other. The communication interface is mainly used to realize the communication between the modules, devices, units and / or devices in the embodiment of the present application. Where appropriate, the bus may include one or more buses.
[0127] In addition, in combination with the data storage method of the application software in the above embodiments, the embodiment of the present invention can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data storage methods of the application software in the above embodiments is implemented.
[0128] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0129] The data storage method, device, equipment and medium of an application software provided by an embodiment of the present invention can first obtain the write frequency of the storage block of the data to be stored in the application software; divide the storage block into corresponding storage partitions in the storage medium according to the write frequency, and the storage medium includes multiple storage partitions. The method can divide the storage medium into multiple storage partitions, and divide the storage blocks into different storage partitions according to the write frequency of the storage blocks, thereby realizing the isolation of the storage data in different storage blocks, reducing the mutual influence of storage blocks with different write frequencies when writing storage data, improving the security of the storage data, and greatly reducing the number of times the storage data is lost or damaged.
[0130] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0131] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0132] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "one" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention may be implemented by means of hardware comprising a number of different components and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A data storage method for application software, characterized in that: The method comprises: Obtaining a write frequency of a storage block storing data to be stored in the application software; The storage block is divided into corresponding storage partitions in a storage medium according to the write frequency, and the storage medium includes a plurality of the storage partitions.
2. The data storage method of application software according to claim 1, characterized in that: The storage partitions of the storage medium include a fixed storage partition, a low-frequency storage partition, and a high-frequency storage partition, and the storage blocks are divided into corresponding storage partitions in the storage medium according to the write frequency, including: If the write frequency is less than or equal to a preset first threshold, dividing the storage block into the fixed storage partition; If the write frequency is greater than the first threshold and less than or equal to a preset second threshold, dividing the storage block into the low-frequency storage partition; If the write frequency is greater than the second threshold, the storage block is divided into the high-frequency storage partition.
3. The data storage method of application software according to claim 1, characterized in that: The physical addresses of the multiple storage partitions are not continuous.
4. The data storage method of application software according to claim 1, characterized in that: The method further comprises: Obtain the total number of bytes occupied by all storage blocks in the storage partition when written once, the estimated number of writes per day for all storage blocks, the estimated number of days of use of the storage blocks, and the erasure life of the storage medium; The storage capacity of the storage partition is calculated based on the total number of bytes, the estimated number of write times, the number of days of use, and the erase life.
5. The data storage method of application software according to claim 1, characterized in that: The method further comprises: Storing the data to be stored of the application software into the preset upper-layer application software; The data to be stored in the upper-layer application software is stored in a storage block of a corresponding storage partition in the storage medium.
6. The data storage method of application software according to claim 1, characterized in that: The method further comprises: Record the number of write requests and operation status of each storage block; Whether the storage state of each storage block is abnormal is determined according to the number of write requests and the operation state.
7. The data storage method of application software according to claim 1, characterized in that: The method further comprises: Obtaining a storage security level of the storage block; Writing each data to be stored in the storage block with a high storage security level into two copies, and using one copy as backup storage data; Only one copy of each data to be stored in the storage block with the general storage security level is written.
8. A data storage device for application software, characterized in that: The device comprises: An acquisition module, used for acquiring a write frequency of a storage block storing data to be stored in application software; A partitioning module is used to partition the storage block into corresponding storage partitions in a storage medium according to the write frequency, and the storage medium includes a plurality of the storage partitions.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Method and device for simulating memory
CN121148452A
