Data erasing method and device, electronic equipment and computer readable storage medium

Through the mapping relationship between identification information, erase instructions and erase length of storage devices, the problem of low data erase efficiency of memory of different manufacturers is solved, efficient data erase and reduced erase waiting time.

CN118939183APending Publication Date: 2024-11-12GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410875254.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The data erasure strategy of existing memory cannot be adapted to memory produced by different manufacturers, resulting in inefficient data erasure when using memory of different manufacturers.

Method used

By pre-storing the mapping relationship between the identification information, erase instructions and erase length of the storage device, the corresponding erase instructions and erase length are quickly obtained to realize data erase.

Benefits of technology

It improves the data erasing efficiency of memory in memory scenarios of different manufacturers, reduces the erasing waiting time, and avoids data failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939183A_ABST
    Figure CN118939183A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data erasing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of automobile software development. According to the method, the erasure instruction and the erasure length corresponding to the identification information of the storage device can be obtained based on the mapping relation among the identification information, the erasure instruction and the erasure length, and the erasure length represents the data length capable of being erased each time; and according to the erasing instruction and the erasing length, erasing the to-be-erased data in the storage device, so that when data erasing needs to be performed, the corresponding erasing instruction and the corresponding erasing length are quickly found in the mapping relation according to the identification information. Namely, the data erasing method can adapt to memories produced by different manufacturers, the data erasing efficiency of the memories can be improved in the scene that the memories produced by different manufacturers are used at the same time, and the erasing waiting time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of automobile software development, and specifically to a data erasure method, device, electronic device, and computer-readable storage medium. Background Art

[0002] Memories are widely used in embedded systems and storage devices. For example, non-volatile memory Norflash has a faster read speed, lower read latency, and better random access performance, making it particularly suitable for scenarios that require fast code reading and running, such as in vehicles.

[0003] In the actual application of memory, taking vehicles as an example, a vehicle may be equipped with multiple memories from different manufacturers. The current erasure strategy is that manufacturers design data erasure strategies for the memories they produce. However, the erasure instructions of different manufacturers are not uniform, and the lengths that can be erased by different erasure instructions are also different. That is, the current memory data erasure strategy cannot adapt to memories produced by different manufacturers, and the memory data erasure efficiency is low when using memories from different manufacturers. Summary of the invention

[0004] The embodiments of the present application provide a data erasure method, device, electronic device, and computer-readable storage medium to solve the above-mentioned problems.

[0005] In a first aspect, an embodiment of the present application provides a data erasure method, the method comprising: based on a mapping relationship between identification information, erasure instructions and erasure lengths, obtaining erasure instructions and erasure lengths corresponding to identification information of a storage device, the erasure length indicating the length of data that can be erased each time; and erasing the data to be erased in the storage device according to the erasure instructions and the erasure length.

[0006] In a second aspect, an embodiment of the present application provides a data erasure device, which includes: a data acquisition module, which is used to acquire an erasure instruction and an erasure length corresponding to identification information of a storage device based on a mapping relationship between identification information, erasure instructions and erasure lengths, wherein the erasure length represents the length of data that can be erased each time; and a data erasure module, which is used to erase the data to be erased in the storage device according to the erasure instruction and the erasure length.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein an application is stored in the memory, and when the processor calls the application, the method provided in the first aspect is executed.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code is used to execute the method provided in the first aspect when called by a processor.

[0009] The data erasing method of the present application stores the mapping relationship between the identification information of the storage device, the erasing instruction, and the erasing length in advance, so that when data erasure is required, the corresponding erasing instruction and the erasing length can be quickly found in the mapping relationship according to the identification information. That is, the data erasing method of the present application can be adapted to memories produced by different manufacturers, and in the scenario where memories produced by different manufacturers are used at the same time, the data erasing efficiency of the memories can be improved, and the erasing waiting time can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of a data erasing method according to an embodiment of the present application is shown;

[0012] Figure 2 A schematic diagram showing a flow chart of a data erasing method provided by another embodiment of the present application is shown;

[0013] Figure 3 It shows that an embodiment of the present application provides Figure 2 Schematic diagram of the process of step S240;

[0014] Figure 4 A schematic diagram showing a flow chart of a data erasing method provided by another embodiment of the present application is shown;

[0015] Figure 5 A schematic diagram of a data erasing method provided by an exemplary embodiment of the present application is shown;

[0016] Figure 6 A schematic diagram of the structure of a data erasing device provided in an embodiment of the present application is shown;

[0017] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0019] See also Figure 1 , Figure 1 The flowchart of a data erasing method provided by an embodiment of the present application is shown. The data erasing method may include the following steps S110 to S120.

[0020] Step S110: based on the mapping relationship among the identification information, the erase instruction and the erase length, the erase instruction and the erase length corresponding to the identification information of the storage device are obtained.

[0021] In actual applications, Norflash memories from different manufacturers may have pre-set identification information for identifying which manufacturer the Norflash memory belongs to. The identification information may be a number provided by the manufacturer or a number uniformly distributed by staff, as long as different manufacturers can be distinguished.

[0022] Norflash memory is usually composed of multiple blocks. Blocks are larger storage units in Norflash memory. The size of each block can range from a few kilobytes (Kb) to several megabytes (Mb). Each block can be composed of multiple sectors. Sector is the smallest storage unit in Norflash memory. The size of each sector is generally 4Kb, and some may be smaller.

[0023] The erase instruction is an instruction used to clear the written contents in a storage unit (such as a block or sector) in the operation of Nor Flash memory. In the actual application of Nor Flash, before writing new data to a storage unit, the contents of the storage unit must be cleared first, and the erase operation is usually performed in units of sectors, blocks or chips.

[0024] The specific form of the erase instruction may generally depend on the specification of the Nor Flash memory and the interface provided by the manufacturer. Generally speaking, the erase operation is a series of erase instructions sent by a related system (such as the data erase device provided in this application) to the Nor Flash memory, and these erase instructions will be interpreted by the parsing module inside the memory, and then the corresponding erase action will be executed.

[0025] The erase length indicates the length of data that can be erased each time, that is, the length erased at one time when the erase instruction is used to erase data. Different erase instructions correspond to different erase lengths, for example, there may be 4kb erase instructions, 32kb erase instructions, and 128kb erase instructions, and the specific contents of the instructions are also different.

[0026] As mentioned above, the erase instructions corresponding to the Norflash memories of different manufacturers are not uniform, so the identification information of the Norflash memory may correspond to multiple erase instructions and multiple erase lengths.

[0027] In an embodiment of the present application, a mapping relationship between identification information, erase instructions, and erase length may be established in advance, for example, it may be a mapping relationship table in a database, and the embodiment of the present application does not limit this.

[0028] For example, assuming that manufacturer A provides 4kb erase instructions, 32kb erase instructions, and 128kb erase instructions, manufacturer B provides 4kb erase instructions, 32kb erase instructions, and manufacturer C provides 32kb erase instructions and 128kb erase instructions, the mapping relationship table can be shown in Table 1 below:

[0029] Table 1

[0030] 4kb 32kb 128kb Manufacturer A Directive 1.1 Directive 1.2 Directive 1.3 Manufacturer B Directive 2.1 Directive 2.2 none C Manufacturer none Directive 3.1 Directive 3.2

[0031] When data needs to be written into a Norflash memory, data of the same size as the data to be written (ie, the data to be erased) needs to be erased from the Norflash memory to make room for the data to be written.

[0032] Taking the Norflash memory in the vehicle as an example, it is assumed that there is a corresponding relationship between the vehicle module and the Norflash memory, that is, the data of the module is stored in the corresponding Norflash memory by default. When a module in the vehicle has a storage requirement, the module can send the data to be stored and the instruction requesting storage (which may include identification information and the data length of the data to be stored) to the data erasing device.

[0033] In some implementations, when receiving the instruction requesting storage, the data erasing device may obtain information about the data to be stored (eg, data length and identification information) from the instruction requesting storage.

[0034] After obtaining the data length and identification information, the data erasing device can determine the starting address of data erasure according to the identification information of the storage device. For example, the data erasing device can allocate the corresponding erasure starting address and erasure ending address for this erasure operation based on the actual situation of the Norflash memory.

[0035] Among them, the starting address of erasure refers to the address of the first storage unit selected when performing an erase operation. This address is relative to the starting address of the entire Norflash memory. By default, the Norflash memory generally randomly assigns the starting address. The starting address can also be specified in special circumstances. The embodiment of the present application does not limit this.

[0036] In some implementations, after the identification information of the Norflash memory is determined, the erase instructions that can be called by the Norflash memory corresponding to the identification information and the erase lengths of the erase instructions can be determined by querying the above-mentioned mapping relationship.

[0037] Step S120: erasing the data to be erased in the storage device according to the erase instruction and the erase length.

[0038] Based on the known erase instruction, erase length, and data length of the data to be erased, when the Norflash memory needs to be erased, the erase length can be selected according to actual needs, and the corresponding erase instruction can be used to perform the erase operation, starting from the starting address and gradually erasing backward until the total erase length reaches the data length of the data to be erased.

[0039] After erasing is completed, the content to be stored can be written into the Norflash memory.

[0040] Based on steps S110 to S120, by pre-storing the mapping relationship between the identification information of the storage device, the erasure instruction, and the erasure length, when data erasure is required, the corresponding erasure instruction and the erasure length can be quickly found in the mapping relationship according to the identification information. That is, the data erasure method of the present application can be adapted to memories produced by different manufacturers, and in the scenario where memories produced by different manufacturers are used at the same time, the data erasure efficiency of the memories can be improved, and the erasure waiting time can be reduced.

[0041] See also Figure 2 , Figure 2 A schematic flow chart of a data erasing method provided by another embodiment of the present application is shown. The data erasing method may include the following steps S210 to S250.

[0042] Step S210: based on the mapping relationship between the identification information, the erase instruction and the erase length, the erase instruction and the erase length corresponding to the identification information of the storage device are obtained.

[0043] Step S220: Determine the data length of the data to be erased.

[0044] Among them, the specific description of step S210 and step S220 can refer to the relevant parts of step S110 and step S120, and the embodiments of the present application will not be repeated here.

[0045] Step S230: Determine whether the storage device meets the data erasure condition according to the start address and the data length of the erased data.

[0046] In some embodiments, whether the starting address is valid can be determined based on the starting address and the minimum erase length among the multiple erase lengths; whether the data length of the data to be erased is greater than zero can be detected; when the starting address is valid and the data length of the data to be erased is greater than zero, it is determined that the storage device meets the data erasure condition.

[0047] Specifically, the starting address can be divided by the minimum erase length. If the remainder is 0 (i.e., it is divisible), it means that the starting address is aligned with the minimum erase length, and the present application can at least use the minimum erase length for erasure, that is, the starting address is valid. If the remainder is not 0 (i.e., it cannot be divided evenly), it means that the starting address cannot be aligned with the minimum erase length, and using the minimum erase length for erasure may also cause data failure, that is, the starting address is invalid.

[0048] Taking the erase length corresponding to manufacturer A in Table 1 as an example, the minimum erase length is 4kb. Assuming the starting address is 0x0004, 0x0004 can be divided by 4kb. If 0x0004 is divisible by 4kb, then the starting address 0x0004 is valid.

[0049] Step S240: after determining that the storage device meets the data erasure condition, determine a target erasure instruction from multiple erasure instructions according to the data length of the data to be erased and multiple erasure lengths.

[0050] When it is determined that the storage device meets the data erasure condition, the target erasure instruction can be further determined from the multiple erasure instructions. Specifically, the starting address of the data erasure can be determined according to the identification information of the storage device; the target erasure length can be determined from the multiple erasure lengths according to the starting address, the data length of the data to be erased, and the multiple erasure lengths; and the erasure instruction corresponding to the target erasure length is obtained from the multiple erasure instructions as the target erasure instruction, wherein different erasure lengths correspond to different erasure instructions.

[0051] In some implementations, an erase length that is less than or equal to the data length of the to-be-erased data and can be divided by the start address may be selected from a plurality of erase lengths as the target erase length.

[0052] If an erase instruction with a length greater than the length of the data to be erased is used for erasure, additional erasure will occur, erasing other stored data, which may cause unnecessary losses. Therefore, it is necessary to limit the length of the data to be less than or equal to the length of the data to be erased, and even if multiple erasures may be required, it is not recommended to erase too much data at one time.

[0053] In addition, the erasure of Norflash memory is generally performed in units of storage cells, which is determined by the physical properties of Norflash memory. Specifically, in Norflash memory, data is stored in storage cells in the form of electric charge. If the erase and write operation is not aligned with the starting address, it may happen that, for example, "only part of the charge in a certain storage cell is erased, while another part remains", which is very likely to cause data damage, failure, etc. Moreover, if only part is erased and the other part remains, when data is written, it may cause confusion of the written data, thereby causing data failure.

[0054] In an embodiment of the present application, if the erase length is divisible by the starting address, it means that the starting address is exactly located at the boundary of the storage unit. After erasing data with this erase length, the boundary can be completely aligned, that is, the length erased by this erase operation is exactly an integer multiple of the storage unit, thereby avoiding the above-mentioned data failure problem.

[0055] For example, assuming that the size of a sector is 4kb, the erase length is 4kb, and there are eight addresses: 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, and 0x0007. 0x0000, 0x0001, 0x0002, and 0x0003 are 4kb in total, which is one sector; 0x0004, 0x0005, 0x0006, and 0x0007 are 4kb in total, which is one sector. If you use an erase length of 4kb for erasing, you need to ensure that the starting address is located at the left boundary of the sector, that is, at 0x0000 or 0x0004.

[0056] In some embodiments, to further improve the erasure efficiency, refer to Figure 3 , according to the data length of the data to be erased and multiple erase lengths, determining the target erase instruction from multiple erase instructions may include steps S241 to S243.

[0057] Step S241: In descending order of the multiple erasure lengths, check in turn whether the multiple erasure lengths are less than or equal to the data length of the data to be erased and whether they can be divided by the start address.

[0058] For example, taking the three erase lengths of manufacturer A in Table 1 as an example, you can first check whether the erase length of 128kb meets the above requirements. If the erase length of 128kb does not meet the above requirements, then check whether the erase length of 32kb meets the above requirements. If the erase length of 32kb does not meet the above requirements, then check whether the erase length of 4kb meets the above requirements.

[0059] Step S242: when an erase length whose length is less than or equal to the data length of the data to be erased and can be divided by the start address is detected, the erase length is determined to be the target erase length.

[0060] In some implementations, for this erasing operation, the detection in step S242 may be performed on all erasing lengths first. If there are multiple erasing lengths that meet the requirement, the largest erasing length is selected as the target erasing length.

[0061] In other implementations, for this erasing operation, when an erasing length that meets the above requirements is detected for the first time, subsequent detection may be terminated, and the erasing length may be determined as the target erasing length.

[0062] For example, take the three erase lengths of manufacturer A in Table 1 as an example, assuming that the total length of the data to be erased is 164kb. First, detect the erase length of 128kb. If 128kb<164kb and the starting address cannot be divided by 128kb, then continue to detect the erase length of 32kb. If 32kb<164kb and the starting address can be divided by 32kb, there is no need to continue to detect the erase length of 4kb, and 32kb can be directly determined as the target erase length.

[0063] Step S243: Determine the target erase instruction according to the target erase length.

[0064] Step S250: Erasing the data to be erased according to the target erasing instruction.

[0065] Based on step S210 to step S250: ① By first judging the validity of the starting address before executing data erasure, data alignment can be guaranteed during data erasure, ensuring that data is erased in units of storage units, avoiding multiple erasures or missed erasures, and avoiding the problem of data invalidation after erasing; ② By designing a screening among multiple erase lengths, the largest erase length that can be aligned with the starting address and will not be erased multiple times is selected, so that when erasing data, while ensuring that the data is not invalid, erasure can be performed more efficiently, which can effectively shorten the erase waiting time of Norflash and greatly improve the erase rate.

[0066] To facilitate Figure 2 as well as Figure 3 To understand the data erasure methods provided, please refer to Figure 4 , Figure 4 A schematic flow chart of a data erasing method provided by an exemplary embodiment of the present application is shown, including the following steps S310 to S350.

[0067] Step S310: based on the mapping relationship between the identification information, the erase instruction and the erase length, the erase instruction and the erase length corresponding to the identification information of the storage device are obtained.

[0068] Step S320: Determine whether the data length of the data to be erased is 0.

[0069] If the length of the data to be erased is 0, the erasing is terminated.

[0070] If the data length of the data to be erased is not 0, jump to step S330.

[0071] Step S330: determining a target erase instruction from multiple erase instructions according to the data length of the data to be erased and multiple erase lengths.

[0072] Step S340: starting from the start address, erase the target erase length backwards through the target erase instruction.

[0073] Step S350: taking the sum of the starting address and the target erasure length as the new starting address, taking the difference between the data length of the data to be erased and the target erasure length as the new data length of the data to be erased, and jumping to step S320.

[0074] After the erasure is completed using the target erase instruction, the starting address also changes accordingly, and the new starting address is the end point of the previous erasure, so that the validity of the erase operation is guaranteed by aligning the starting address. After the erasure is completed, there may still be remaining data to be erased, so further judgment is required through step S320.

[0075] Based on step S310 to step S350, the starting address and the data to be erased are continuously updated in a loop by design, so that the current optimal erase instruction (i.e., the target erase instruction) is re-determined for erasing in each loop, and erasing is started with a larger amount of data first, and then gradually ends with a smaller erase length, so as to ensure that the data to be erased is completely erased. In addition, when the erase length changes dynamically during the loop process, the start address is adaptively offset and aligned to ensure the effectiveness of the erase and write operation in each loop.

[0076] See also Figure 5 , an exemplary embodiment is provided herein to further illustrate the data erasing method provided in the aforementioned embodiment.

[0077] Step S410: Obtain identification information of the storage device.

[0078] Step S420: based on the mapping relationship among the identification information, the erase instruction and the erase length, obtain the erase instruction and the erase length corresponding to the identification information of the storage device.

[0079] Assume that the acquired erase lengths include 4 kb, 32 kb, and 128 kb.

[0080] Step S430, obtaining the starting address.

[0081] Step S440, determining whether the start address is divisible by 4kb.

[0082] If the start address is divisible by 4kb, jump to step S450.

[0083] If the starting address cannot be divided by 4kb, the erasing process ends.

[0084] Step S450, determining whether the data length of the data to be erased is greater than 0.

[0085] If the data length of the data to be erased is greater than 0, jump to step S460.

[0086] If the length of the data to be erased is not greater than 0, the erasing process ends.

[0087] Step S460, determining whether the data length of the data to be erased is greater than or equal to 128 kb.

[0088] If the data length of the data to be erased is greater than or equal to 128 kb, jump to step S470.

[0089] If the data length of the data to be erased is less than 128 kb, jump to step S490.

[0090] Step S470, determine whether the start address is divisible by 128kb.

[0091] If the start address is divisible by 128kb, jump to step S480.

[0092] If the starting address is not divisible by 128kb, jump to step S

[0093] Step S480, erase with the erase instruction corresponding to 128kb, add 128kb to the starting address, subtract 128kb from the data length to be erased, and jump to step S450.

[0094] Step S490, determining whether the data length of the data to be erased is greater than or equal to 32 kb.

[0095] If the data length of the data to be erased is greater than or equal to 32kb, jump to step S4100.

[0096] If the data length of the data to be erased is less than 32kb, jump to step S4120.

[0097] Step S4100, determine whether the starting address is divisible by 32kb.

[0098] If the starting address is divisible by 32kb, jump to step S4110.

[0099] If the starting address is not divisible by 32kb, jump to step S4120.

[0100] Step S4110, erase with the erase instruction corresponding to 32kb, add 32kb to the starting address, subtract 32kb from the data length to be erased, and jump to step S450.

[0101] Step S4120, erase with the erase instruction corresponding to 4kb, add 4kb to the starting address, subtract 4kb from the data length to be erased, and jump to step S450.

[0102] Through step S410 to step S4120, ① by pre-storing the mapping relationship between identification information, erase instruction and erase length, when data erasure is required, the corresponding erase instruction and erase length can be quickly found in the mapping relationship according to the identification information, thereby improving the data erasure efficiency; since the erase instruction and erase length corresponding to any identification information can be quickly obtained, data erasure is more flexible. Compared with the Norflash memory of different manufacturers in the prior art, which needs to design erase strategies separately when erasing data, the present application can design data erasure with a unified strategy, thereby further improving the data erasure efficiency and reducing the erase waiting time; ② by first judging the validity of the starting address before executing data erasure, It can ensure data alignment during data erasure, ensure that data is erased in units of storage units, avoid over-erasing or missed erasing, and avoid the problem of data failure after erasing; ③ Through the design of screening among multiple erase lengths, select the largest erase length that can be aligned with the starting address and will not be over-erased, so that when erasing data, it can ensure that the data is not invalid and perform erasure more efficiently, which can effectively shorten the Norflash erasure waiting time and greatly improve the erase rate; ④ Through the design of continuous cyclic update of the starting address and the data to be erased, the current optimal erase instruction is used for erasing in each cycle, and the erasing is started with a larger amount of data first, and then gradually ends with a smaller erase length to ensure that the data to be erased is completely erased. In addition, when the erase length changes dynamically during the cycle, the start address adaptability offset alignment can ensure the effectiveness of the erase operation.

[0103] See also Figure 6 , Figure 6 The parking device 100 includes a data acquisition module 110, which is used to acquire an erase instruction and an erase length corresponding to the identification information of the storage device based on the mapping relationship between the identification information, the erase instruction and the erase length, wherein the erase length indicates the length of data that can be erased each time; and a data erasing module 120, which is used to erase the data to be erased in the storage device according to the erase instruction and the erase length.

[0104] In some embodiments, the identification information of the storage device corresponds to multiple erase instructions and multiple erase lengths. The data erase module 120 is further used to determine the data length of the data to be erased; determine a target erase instruction from the multiple erase instructions according to the data length of the data to be erased and the multiple erase lengths; and erase the data to be erased according to the target erase instruction.

[0105] In some embodiments, the data erasure module 120 is further used to determine the starting address of data erasure based on the identification information of the storage device; determine the target erasure length from the multiple erasure lengths based on the starting address, the data length of the data to be erased, and the multiple erasure lengths; and obtain the erasure instruction corresponding to the target erasure length from the multiple erasure instructions as the target erasure instruction, wherein different erasure lengths correspond to different erasure instructions.

[0106] In some implementations, the data erasing module 120 is further configured to select, from the multiple erasing lengths, an erasing length that is less than or equal to the data length of the to-be-erased data and is divisible by the start address as a target erasing length.

[0107] In some embodiments, the data erasure module 120 is further used to detect, in descending order of the data lengths of the multiple erasure lengths, whether the multiple erasure lengths are less than or equal to the data length of the data to be erased and whether they can be divided by the starting address; when an erasure length that is less than or equal to the data length of the data to be erased and can be divided by the starting address is detected, the erasure length is determined to be the target erasure length.

[0108] In some embodiments, the data erasing device 100 further includes a condition judgment module. The condition judgment module is used to determine the starting address of data erasure according to the identification information of the storage device; determine whether the storage device meets the data erasure condition according to the starting address and the data length of the erased data; when the storage device meets the data erasure condition, erase the data to be erased in the storage device according to the erase instruction and the erase length.

[0109] In some embodiments, the conditional judgment module is used to determine whether the starting address is valid based on the starting address and the minimum erase length among the multiple erase lengths; detect whether the data length of the data to be erased is greater than zero; when the starting address is valid and the data length of the data to be erased is greater than zero, determine that the storage device meets the data erasure condition.

[0110] Those skilled in the art can clearly understand that the data erasure device 100 provided in the embodiment of the present application can implement the data erasure method provided in the embodiment of the present application. The specific working process of the above nodes can refer to the corresponding process of the data erasure method in the embodiment of the present application, which will not be repeated here.

[0111] In the embodiments provided in the present application, the coupling, direct coupling or communication connection between the modules shown or discussed may be indirect coupling or communication coupling through some interfaces, devices or modules, and may be electrical, mechanical or other forms, and the embodiments of the present application are not limited to this.

[0112] In addition, each functional module in the embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules, which is not limited in the embodiment of the present application.

[0113] See also Figure 7 , Figure 7 The schematic diagram of the structure of the electronic device provided by the embodiment of the present application is shown. The electronic device 200 includes a memory 210 and a processor 220. The memory 210 stores an application program, and the processor 220 executes the data erasing method when calling the application program.

[0114] Among them, the processor 220 may include one or more processing cores. The processor 220 uses various interfaces and lines to connect various parts within the entire electronic device 200, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 210, and calling data stored in the memory 210. The processor 220 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 220 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 220, and may be implemented separately through a communication chip.

[0115] The memory 210 may include a random access memory (RAM) or a read-only memory (ROM). The memory 210 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 210 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may store data created by the electronic device 200 during use, etc.

[0116] The embodiment of the present application also provides a computer-readable storage medium, in which a program code is stored. The program code is used to execute a parking parameter adjustment method or a vehicle control method on the vehicle side when called by a processor.

[0117] The computer readable storage medium can be an electronic storage such as a flash memory, an electrically erasable programmable read only memory (Electrically Erasable Programmable Read Only Memory, EEPROM), an electrically programmable read only memory (Electrical Programmable Read Only Memory, EPROM), a hard disk or a read only memory (ReadOnly Memory, ROM). In some embodiments, the computer readable storage medium may include a non-volatile computer readable medium (Non-Transitory Computer-Readable Storage Medium, NTRSM). The computer readable storage medium has a storage space for the program code of any method step in the above method. These program codes can be read from one or more computer program products or written into one or more computer program products. The program code can be compressed in an appropriate form.

[0118] The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present application. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. A data erasure method, characterized in that: include: Based on the mapping relationship between the identification information, the erasure instruction and the erasure length, acquiring the erasure instruction and the erasure length corresponding to the identification information of the storage device, wherein the erasure length indicates the length of data that can be erased each time; The data to be erased in the storage device is erased according to the erase instruction and the erase length.

2. The method according to claim 1, characterized in that The identification information of the storage device corresponds to a plurality of erasure instructions and a plurality of erasure lengths; Erasing the data to be erased in the storage device according to the erase instruction and the erase length includes: Determine the data length of the data to be erased; Determining a target erase instruction from the multiple erase instructions according to the data length of the to-be-erased data and the multiple erase lengths; The data to be erased is erased according to the target erasing instruction.

3. The method according to claim 2, characterized in that The step of determining a target erase instruction from the multiple erase instructions according to the data length of the data to be erased and the multiple erase lengths comprises: Determining a starting address for data erasure according to identification information of the storage device; Determining a target erasure length from the multiple erasure lengths according to the starting address, the data length of the data to be erased, and the multiple erasure lengths; From the multiple erase instructions, an erase instruction corresponding to the target erase length is obtained as a target erase instruction, wherein different erase lengths correspond to different erase instructions.

4. The method according to claim 3, characterized in that The step of determining a target erasure length from the multiple erasure lengths according to the start address, the data length of the data to be erased, and the multiple erasure lengths comprises: From the multiple erasure lengths, an erasure length that is less than or equal to the data length of the to-be-erased data and aligned with the start address is used as a target erasure length.

5. The method according to claim 4, wherein determining, from the multiple erasure lengths, an erasure length having a data length less than or equal to the data length of the data to be erased and aligned with the start address as the target erasure length comprises: In descending order of the data lengths of the multiple erasure lengths, sequentially detecting whether the multiple erasure lengths are less than or equal to the data length of the data to be erased and whether they are aligned with the start address; When an erase length that is less than or equal to the data length of the to-be-erased data and aligned with the start address is detected, the erase length is determined to be a target erase length.

6. The method according to claim 1, characterized in that Before erasing the data to be erased in the storage device according to the erase instruction and the erase length, the method further includes: Determining a starting address for data erasure according to identification information of the storage device; Determining whether the storage device meets the data erasure condition according to the starting address and the data length of the erased data; When the storage device meets the data erasure condition, the data to be erased in the storage device is erased according to the erasure instruction and the erasure length.

7. The method according to claim 6, characterized in that The determining, according to the starting address and the data length of the erased data, whether the storage device meets the data erasure condition comprises: Determining whether the starting address is valid according to the starting address and the minimum erase length among the multiple erase lengths; Detecting whether the data length of the data to be erased is greater than zero; When the start address is valid and the data length of the data to be erased is greater than zero, it is determined that the storage device meets the data erasure condition.

8. A data erasing device, characterized in that: include: A data acquisition module, used to acquire an erase instruction and an erase length corresponding to the identification information of the storage device based on a mapping relationship between the identification information, the erase instruction and the erase length, wherein the erase length indicates the length of data that can be erased each time; A data erasing module is used to erase the data to be erased in the storage device according to the erasing instruction and the erasing length.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores an application program, and the processor executes the method according to any one of claims 1 to 7 when calling the application program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, and the program codes are used to enable the processor to execute the method according to any one of claims 1 to 7 when called by the processor.