Data management method and device
By detecting and switching data blocks, the problem of equipment reliability caused by hardware failure was solved, resulting in reduced costs, increased storage space, and improved performance. This approach adapts to hardware iterations and enhances the flexibility and reliability of data management.
Patent Information
- Application Number
- PCT/CN2025/094305
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-23
- Filing Date
- 2025-05-12
- Publication Date
- 2025-11-27
AI Technical Summary
In existing technologies, hardware failures can lead to equipment reliability issues, especially in industrial control and aerospace scenarios. Hardware is prone to failures such as jumps, lockouts, burnouts, and link interruptions. Existing solutions, such as improving hardware performance or using triple-redundant file systems, suffer from high costs, insufficient flexibility, and poor performance.
By detecting whether data blocks are corrupted and switching to uncorrupted data blocks for storage or retrieval when corruption occurs, error detection methods such as information encoding, readback verification, and pre-arranged encoding are used, combined with error correction algorithms, to achieve reliable data storage and retrieval.
It reduces hardware chip costs, increases storage space, improves the flexibility and performance of data writing and reading, adapts to the speed of hardware iteration, can promptly detect and handle damaged data blocks, avoids accidental writing, and improves device reliability.
Smart Images

Figure CN2025094305_27112025_PF_FP_ABST
Abstract
Description
Method and device for data management
[0001] The present application claims priority to the Chinese patent application No. 202410650100.2, filed on May 23, 2024, with the State Intellectual Property Office of China, and entitled "Method and device for data management", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the technical field of storage, in particular to a method and device for data management. BACKGROUND
[0003] Terminal devices or network devices include a hardware layer, and as the devices continue to develop, higher requirements are placed on the reliability of the devices, especially for business scenarios such as industrial control and aerospace. Influenced by harsh factors such as high and low temperatures, humidity, electromagnetic radiation, cosmic rays, etc., the hardware is prone to faults such as jumping, locking, burning, hanging, and link interruption. If the hardware faults are not handled in time, it will have an impact on multiple industries.
[0004] To solve the problem that the hardware is prone to faults, one solution is to improve the performance of the hardware, such as space-grade multi-mode flash hardware, which can improve the reliability of the device. However, this space-grade multi-mode flash hardware has defects such as high chip cost and small storage space.
[0005] Another way is to supplement the deficiencies of the hardware through software, for example, a three-mode redundant file system is added between the operation system (OS) virtual file system and the underlying file system. The three-mode redundant file system can manage three underlying file systems at the same time, so that multiple copies of each data are stored to improve reliability. However, this way lacks flexibility and increases time consumption, resulting in poor performance. SUMMARY
[0006] The present application provides a method and device for data management, which can reduce the cost of dedicated chips of hardware, increase storage space, and improve flexibility and performance while achieving reliable data storage.
[0007] In a first aspect, the present application provides a method for data management, which is applied to a first device, and the method comprises: detecting whether a first data block is damaged before writing a first target data into the first data block; if the first data block is not damaged, writing the first target data into the first data block; or if the first data block is damaged, writing the first target data into a second data block, the second data block being different from the first data block and not being damaged.
[0008] In the embodiments of the present application, after judging whether the first data block is damaged, the first target data can be written into different data blocks according to the judgment result. Specifically, in the case that the first data block is not damaged, the first target data is written into the first data block; in the case that the first data block is damaged, the first target data is written into the second data block which is not damaged; the final result of the two cases is to store the first target data in the undamaged data block, which realizes the reliable storage of the first target data. Compared with the current scheme of improving hardware performance, the embodiments of the present application do not need to make too many changes or improvements to the hardware, thereby reducing the chip cost of the hardware and increasing the storage space. In addition, compared with the current scheme of simultaneously managing three underlying file systems by adding a triple modular redundancy file system, the embodiments of the present application do not limit the storage of multiple copies of each data, have high flexibility and good performance.
[0009] Moreover, if the reliable storage of data is realized by improving hardware, since the technology and process are relatively conservative and the iterative evolution speed is much slower than that of commercial off-the-shelf (COTS) devices, the iterative evolution speed of the hardware in the first device is faster in the embodiments of the present application without making too many changes and improvements to the hardware, and the device requirements can be met more easily. In addition, if the reliable storage of data is realized by simultaneously managing three underlying file systems by adding a triple modular redundancy file system, since this way stores data in the main memory or the read-only memory through the file system when storing, and can only check the data in the main memory or the read-only memory when checking, the metadata in the file system cannot be checked, and in the embodiments of the present application, data is stored in the file system and can be checked, so that errors in the metadata can be detected.
[0010] In combination with the first aspect, in a possible implementation manner, detecting whether the first data block is damaged includes: detecting whether the first data block is damaged through a preset error detection manner; wherein the preset error detection manner includes any one of the following: an information coding error detection manner, a read-back check coding error detection manner, and a pre-arranged coding error detection manner.
[0011] In the embodiments of the present application, whether the first data block is damaged is detected through the preset error detection manner, which includes any one of the following: an information coding error detection manner, a read-back check coding error detection manner, and a pre-arranged coding error detection manner, which can improve the correctness of detecting whether the first data block is damaged, is conducive to writing data into a healthy data block, and is further conducive to improving the reliability of data writing.
[0012] With reference to the first aspect, in a possible implementation manner, if the first data block does not store data, the manner of detecting whether the first data block is damaged includes: a pre-arranged encoding error detection manner; or if the first data block stores data, the manner of detecting whether the first data block is damaged includes: an information encoding error detection manner, a read-back check error detection manner.
[0013] In the embodiments of the present application, by using different error detection manners to detect whether the first data block is damaged according to whether the first data block stores data, the correctness of detecting whether the first data block is damaged can be further improved, thereby facilitating data writing into a healthy data block, and further facilitating improving the reliability of data writing.
[0014] With reference to the first aspect, in a possible implementation manner, the plurality of data blocks include N data blocks arranged in sequence, the first data block is an Ith data block, I < N, I and N are integers greater than or equal to 1; before writing first target data into a second data block in the plurality of data blocks, the method further includes: selecting the second data block from the plurality of data blocks, the second data block is an (I+M)th data block or an (I-M)th data block, 1 ≤ M < I, or the second data block is the Nth data block.
[0015] In the embodiments of the present application, in the case that the first data block is damaged, an undamaged second data block can be selected and the first target data is written into the second data block. In the case that the plurality of data blocks include N data blocks arranged in sequence, if the first data block is an Ith data block and the second data block is the Nth data block, generally, when data is written, data is sequentially written from the 1st data block, and the larger the number of the data block, the smaller the possibility of damage of the data block, therefore, selecting the Nth data block as the second data block can improve the reliability of data writing. If the first data block is an Ith data block and the second data block is an (I+M)th data block or an (I-M)th data block, 1 ≤ M < I, when M = 1, it is equivalent to writing the first target data into a second data block adjacent to the first data block, which can reduce the moving distance of data, thereby improving the writing performance; when M is a number greater than or equal to 1 and smaller than I, it is equivalent to selecting a second data block in a local region formed by the first data block and M data blocks before and after the first data block, which can balance the reliability and performance of data writing, and can improve the data writing performance as much as possible while ensuring the reliability of data writing.
[0016] With reference to the first aspect, in a possible implementation manner, the method further includes: before reading second target data from a third data block, detecting whether the third data block is damaged, the third data block being a data block in the plurality of data blocks that stores data; if the third data block is not damaged, reading the second target data from the third data block; or if the third data block is damaged, obtaining the second target data based on an error correction algorithm.
[0017] In the embodiments of the present application, before reading the second target data from the third data block, the third data block can be detected first, and different processing can be performed according to the detection result. Specifically, if the third data block is not damaged, the second target data is read from the third data block; if the third data block is damaged, the second target data is obtained based on the error correction algorithm; regardless of whether the third data block is damaged or not, the final result can obtain the second target data, so that the reliable reading of the second target data can be realized, thereby improving the reliability of data reading.
[0018] In combination with the first aspect, in a possible implementation, the method further includes: writing the second target data to a fourth data block in the plurality of data blocks, the fourth data block being different from the third data block and the fourth data block being undamaged; and reading the second target data from the fourth data block.
[0019] In the embodiments of the present application, after the third data block is damaged and the second target data is obtained by using the error correction algorithm, the second target data can be written to the undamaged fourth data block, and the second target data can be read from the undamaged fourth data block subsequently, which is beneficial to the reliable reading of the second target data subsequently and improves the reliability of reading the second target data.
[0020] In combination with the first aspect, in a possible implementation, the method further includes: detecting whether the plurality of data blocks are damaged when the first device is in an idle state.
[0021] In the embodiments of the present application, the action of detecting whether the plurality of data blocks are damaged can be executed by a thread, which can be referred to as a patrol thread. When the first device is in an idle state, the system can automatically trigger the patrol thread. That is, all data blocks in the first device are traversed, and a read patrol thread is executed for each data block. If the read patrol fails, it indicates that the data block is damaged, and the data block is marked. This way can timely find the damaged data block, avoid subsequent miswriting of data to the damaged data block, and improve the reliability of data writing.
[0022] In combination with the first aspect, in a possible design, the method further includes: during the detection of whether the plurality of data blocks are damaged, when the first device switches from the idle state to a non-idle state, stopping the detection of the plurality of data blocks.
[0023] In the embodiments of the present application, during the detection of whether the plurality of data blocks are damaged, when the mobile phone switches from the idle state to the non-idle state, such as when the mobile phone switches from the screen-off state to the browsing state of the gallery, since the gallery application has been started, the thread for detecting whether the plurality of data blocks are damaged is preempted, that is, the patrol thread is preempted. At this time, the patrol thread can be suspended, the business thread is executed preferentially, and after the execution of the business thread is completed, the patrol thread is continued to be executed, so as to realize the balance between the data block detection and the business performance overhead.
[0024] With reference to the first aspect, in a possible implementation, the method further includes: determining whether the hardware containing the first data block is damaged; if the hardware is damaged, adding the first data block to the first queue, and the data blocks in the first queue are unavailable; if the hardware is not damaged, adding the first data block to the second queue, and the data blocks in the second queue are available.
[0025] In the embodiments of the present application, the first data block is added to different queues according to the result of whether the hardware containing the first data block is damaged, specifically, if the hardware is damaged, the first data block is added to the first queue; if the hardware is not damaged, the first data block is added to the second queue. The data blocks in the first queue are unavailable, and the data blocks in the second queue are available. By separating the damaged data blocks, the unavailable data blocks can be eliminated in time, so that subsequent data can be prevented from being written to the damaged data blocks, thereby the speed and reliability of data writing can be improved.
[0026] In the embodiments of the present application, before the second target data is read from the third data block, the third data block can be detected first, and different processing can be performed according to the detection result. Specifically, if the third data block is not damaged, the second target data is read from the third data block; or if the third data block is damaged, the second target data is obtained based on the error correction algorithm, the second target data is written to a fourth data block in the plurality of data blocks which is not damaged, and the second target data is read from the fourth data block. Regardless of whether the third data block is damaged or not, the second target data can be obtained, so that the reliable reading of the second target data can be realized, and the reliability of data reading can be improved.
[0027] In the embodiments of the present application, before the second target data is read from the third data block, the third data block can be detected first, and different processing can be performed according to the detection result. Specifically, if the third data block is not damaged, the second target data is read from the third data block; or if the third data block is damaged, the second target data is obtained based on the error correction algorithm, the second target data is written to a fourth data block in the plurality of data blocks which is not damaged, and the second target data is read from the fourth data block. Regardless of whether the third data block is damaged or not, the second target data can be obtained, so that the reliable reading of the second target data can be realized, and the reliability of data reading can be improved.
[0028] With reference to the second aspect, in a possible implementation, the method further includes: writing the second target data to a fourth data block in the plurality of data blocks, the fourth data block is different from the third data block, and the fourth data block is not damaged; and reading the second target data from the fourth data block.
[0029] In the embodiments of the present application, in the case that the third data block is damaged and the second target data is obtained by using the error correction algorithm, the second target data can be written to the fourth data block which is not damaged, and the second target data can be read from the fourth data block which is not damaged in the subsequent process, which is conducive to the reliable reading of the second target data and improves the reliability of reading the second target data.
[0030] With reference to the second aspect, in a possible implementation manner, the detecting whether the third data block is damaged comprises: detecting whether the third data block is damaged by using a preset error detection manner; and the preset error detection manner comprises any one of the following: an information encoding error detection manner, a read-back check code error detection manner.
[0031] In the embodiment of the present application, by detecting whether the third data block is damaged according to the preset error detection manner, the correctness of detecting whether the third data block is damaged can be further improved, thereby facilitating data writing into a healthy data block and reading data from a healthy data block, and further facilitating improving the reliability of data writing and data reading.
[0032] With reference to the second aspect, in a possible implementation manner, the plurality of data blocks comprise N data blocks arranged in sequence, the third data block is a Jth data block, J < N, J and N are integers greater than or equal to 1; and before the second target data is written into a fourth data block in the plurality of data blocks, the method further comprises: selecting the fourth data block from the plurality of data blocks, the fourth data block is a (J+K) th data block or a (J-K) th data block, 1 ≤ K < J, or the fourth data block is the Nth data block.
[0033] In the embodiment of the present application, in the case that the third data block is damaged, an undamaged fourth data block can be selected and the second target data is written into the fourth data block. In the case that the plurality of data blocks comprise N data blocks arranged in sequence, if the third data block is a Jth data block and the fourth data block is the Nth data block, generally, when data is written, data is sequentially written from the 1st data block, and the larger the number of the data block, the smaller the possibility of damage of the data block, therefore, selecting the Nth data block as the fourth data block can improve the reliability of data writing. If the fourth data block is the Jth data block, the fourth data block is the (J+K) th data block or the (J-K) th data block, 1 ≤ K < J, when K = 1, it is equivalent to writing the second target data into the fourth data block adjacent to the third data block, which can reduce the moving distance of data, thereby improving the writing performance; when K is a value greater than or equal to 1 and less than J, it is equivalent to selecting the fourth data block in a local region formed by the third data block and the K data blocks before and after the third data block, which can balance the reliability and performance of data writing, and can improve the data writing performance as much as possible while ensuring the reliability of data writing.
[0034] With reference to the second aspect, in a possible implementation manner, the method further comprises: detecting whether the plurality of data blocks are damaged when the first device is in an idle state.
[0035] In the embodiments of the present application, the operation of detecting whether the plurality of data blocks are damaged can be executed by a thread, which can be referred to as a patrol thread. When the first device is in the idle state, the system can automatically trigger the patrol thread. That is, all data blocks in the first device are traversed, and a read patrol thread is executed for each data block. If the read patrol fails, it indicates that the data block is damaged, and the data block is marked. This way can timely find the damaged data block, avoid subsequent miswriting data to the damaged data block, and improve the reliability of data writing.
[0036] With reference to the second aspect, in a possible implementation, the method further includes: in the process of detecting whether the plurality of data blocks are damaged, when the first device switches from the idle state to the non-idle state, stopping detecting the plurality of data blocks.
[0037] In the embodiments of the present application, in the process of detecting whether the plurality of data blocks are damaged, when the mobile phone switches from the idle state to the non-idle state, such as when the mobile phone switches from the screen-off state to the browsing state of the gallery, because the gallery application has been started, the thread for detecting whether the plurality of data blocks are damaged is preempted, that is, the patrol thread is preempted. At this time, the patrol thread can be suspended, the business thread is executed preferentially, and after the execution of the business thread is completed, the patrol thread is continued to be executed, so as to balance the data block detection and the business performance overhead.
[0038] With reference to the second aspect, in a possible implementation, the method further includes: determining whether the hardware containing the third data block is damaged; if the hardware is damaged, adding the third data block to the first queue, and the data blocks in the first queue are unavailable; and if the hardware is not damaged, adding the third data block to the second queue, and the data blocks in the second queue are available.
[0039] In the embodiments of the present application, the third data block is added to different queues according to the result of whether the hardware containing the third data block is damaged. Specifically, if the hardware is damaged, the third data block is added to the first queue; and if the hardware is not damaged, the third data block is added to the second queue. The data blocks in the first queue are unavailable, and the data blocks in the second queue are available. By separating the damaged data blocks, the unavailable data blocks can be eliminated in time, so that subsequent miswriting data to the damaged data blocks can be avoided, thereby the speed and reliability of data writing can be improved.
[0040] In a third aspect, the present application provides a device for data management, which has the functions of the first aspect, e.g., the device comprises modules or units or means corresponding to the operations of the first aspect, which can be implemented by software, or by hardware, or by a combination of software and hardware. The advantages can be referred to the description of the first aspect, which will not be repeated here. In one possible design, the device for data management includes: a processing unit configured to: before writing first target data into a first data block of a plurality of data blocks, detect whether the first data block is damaged; if the first data block is not damaged, write the first target data into the first data block; or if the first data block is damaged, write the first target data into a second data block of the plurality of data blocks, the second data block being different from the first data block and not damaged. These units can perform the corresponding functions in the method examples of the first aspect, and the details can be referred to the description of the method examples, which will not be repeated here.
[0041] In an implementation, the processing unit in the device can be at least one processor. Optionally, the device can further include a transceiver, which can be a transceiver circuit, or an input / output interface.
[0042] In another implementation, the device can include a chip, a chip system or a circuit or a communication module. The processing unit can be at least one processor, a processing circuit or a logic circuit, etc. Optionally, the device can further include a communication unit, which can be an input / output interface, an interface circuit, an output circuit, an input circuit, a pin or related circuit, etc. on the chip, the chip system or the circuit.
[0043] In a fourth aspect, the present application provides a device for data management, which has the functions of the second aspect, e.g., the device comprises modules or units or means corresponding to the operations of the first aspect, which can be implemented by software, or by hardware, or by a combination of software and hardware. The advantages can be referred to the description of the first aspect, which will not be repeated here. In one possible design, the device for data management includes: a processing unit configured to: before reading second target data from a third data block, detect whether the third data block is damaged, the third data block being a data block of a plurality of data blocks that stores data; if the third data block is not damaged, read the second target data from the third data block; or if the third data block is damaged, obtain the second target data based on an error correction algorithm. These units can perform the corresponding functions in the method examples of the second aspect, and the details can be referred to the description of the method examples, which will not be repeated here.
[0044] In an implementation, the processing unit in the device can be at least one processor. Optionally, the device can further comprise a transceiver, which can be a transceiver circuit, or an input / output interface.
[0045] In another implementation, the device can be a chip, a chip system, or a circuit or a communication module. The processing unit can be at least one processor, a processing circuit, or a logic circuit, etc. Optionally, the device can further comprise a communication unit, which can be an input / output interface, an interface circuit, an output circuit, an input circuit, a pin, or related circuit, etc. on the chip, the chip system, or the circuit.
[0046] In a fifth aspect, the present application provides a device for data management, which comprises at least one processor for executing computer programs or instructions to perform the method in any possible implementation of the first aspect or the second aspect. Optionally, the device further comprises a memory for storing the computer programs or instructions. Optionally, the device further comprises a communication interface coupled with the processor, which can be used to input the computer programs or instructions into the processor, or output information in the processor.
[0047] In an implementation, the device is a terminal device or a network device.
[0048] In another implementation, the device is a chip, a chip system, or a circuit or a communication module for a terminal device or a network device.
[0049] In a sixth aspect, the present application provides a processor for executing the method provided in the first aspect or the second aspect.
[0050] For the sending and obtaining / receiving operations of the processor, if there is no special description, or if it does not contradict the actual role or the inherent logic in the related description, it can be understood as the output and receiving, input operations of the processor, or the sending and receiving operations performed by the radio frequency circuit and the antenna, which are not limited by the present application.
[0051] In a seventh aspect, the present application provides a computer readable storage medium, which stores computer readable instructions, when the computer reads and executes the computer readable instructions, the computer executes the method in any possible implementation of the first aspect or the second aspect.
[0052] In an eighth aspect, the present application provides a computer program product, when the computer reads and executes the computer program product, the computer executes the method in any possible implementation of the first aspect or the second aspect.
[0053] In a ninth aspect, a chip is provided, which includes a processor and a communication interface, the processor reads instructions on a memory through the communication interface, and executes the method provided in any of the implementation manners of the first aspect or the second aspect.
[0054] Optionally, the chip is a Modem chip, also known as a baseband chip, or a system on chip (SoC) chip or a system in package (SIP) chip containing a modem core.
[0055] Optionally, as an implementation manner, the chip further includes a memory, the memory stores a computer program or instructions, and the processor is configured to execute the computer program or instructions on the memory, and when the computer program or instructions are executed, the processor is configured to execute the method provided in any of the implementation manners of the first aspect or the second aspect.
[0056] In a tenth aspect, a computer program product containing instructions is provided, when the computer program product is run on a computer, the computer program product causes the computer to execute the method provided in any of the implementation manners of the first aspect or the second aspect.
[0057] In an eleventh aspect, a communication system is provided, which includes an apparatus having functions of implementing the method in any of the possible implementation manners of the first aspect or the second aspect, or all of the possible implementation manners of the first aspect or the second aspect, and various possible designs. BRIEF DESCRIPTION OF DRAWINGS
[0058] FIG. 1 is a schematic diagram of a system suitable for embodiments of the present application.
[0059] FIG. 2 is a schematic diagram of a data management method provided by embodiments of the present application.
[0060] FIG. 3 is a schematic diagram of data processing provided by embodiments of the present application.
[0061] FIG. 4 is a schematic diagram of data block arrangement provided by embodiments of the present application.
[0062] FIG. 5 is a schematic diagram of data writing and data reading provided by embodiments of the present application.
[0063] FIG. 6 is a schematic diagram of data block damage degree determination provided by embodiments of the present application.
[0064] FIG. 7 is a schematic diagram of another data management method provided by embodiments of the present application.
[0065] FIGS. 8 to 9 are schematic structural diagrams of a data management device provided by embodiments of the present application.
[0066] FIG. 10 is a schematic diagram of a chip system according to an embodiment of the present application. DETAILED DESCRIPTION
[0067] The technical solutions in the present application will be described below with reference to the drawings.
[0068] The technical solutions in the present application can be applied to devices in various communication systems, where the communication systems can include a universal mobile telecommunications system (UMTS), a wireless local area network (WLAN), a wireless fidelity (Wi-Fi) system, a 4th generation (4G) mobile communication system such as a long term evolution (LTE) system, a 5th generation (5G) mobile communication system such as a new radio (NR) system, and a future evolved communication system, etc.
[0069] In the embodiments of the present application, the words "exemplary", "for example", and the like are used solely to indicate examples, instances, or illustrations. Any embodiment or design solution described in the present application as "example" should not be interpreted as being more preferred than other embodiments or design solutions. Rather, the word "example" is used to represent a concept in a particular manner. In the embodiments of the present application, "of", "corresponding" and "corresponding" can be used interchangeably at times. It should be pointed out that when there is no emphasis on the difference, the meanings expressed are consistent.
[0070] The communication systems and service scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions in the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, as the network architecture evolves and new service scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0071] Figure 1 shows a possible, non-limiting, schematic representation of a system. As shown in Figure 1, the communication system 10 includes a radio access network (RAN) 100 and a core network (CN) 200. The RAN 100 includes at least one RAN node (e.g., 110a and 110b in Figure 1, collectively referred to as 110) and at least one terminal (e.g., 120a-120j in Figure 1, collectively referred to as 120). Other RAN nodes, such as wireless relay devices and / or wireless backhaul devices (not shown in the figure), etc., can also be included in the RAN 100. The terminals 120 are wirelessly connected to the RAN nodes 110. The RAN nodes 110 are connected to the core network 200 by wire or wirelessly. The core network devices in the core network 200 and the RAN nodes 110 in the RAN 100 can be different physical devices, respectively, or can be the same physical device integrated with the logical functions of the core network and the logical functions of the radio access network.
[0072] The RAN 100 can be a 3rd generation partnership project (3GPP) related cellular system, e.g., a 4G, 5G mobile communication system, or a future-oriented evolved system. The RAN 100 can also be an open radio access network (O-RAN or ORAN), a cloud radio access network (CRAN), or a wireless fidelity (WiFi) system. The RAN 100 can also be a communication system that combines two or more of the above systems.
[0073] The RAN nodes 110, which can also be referred to as access network devices, RAN entities, access nodes, or network devices, etc., form part of the communication system to help terminals to access wirelessly. The RAN nodes 110 in the communication system 10 can be the same type of nodes or different types of nodes. In some scenarios, the roles of the RAN nodes 110 and the terminals 120 are relative, e.g., the network element 120i in Figure 1 can be a helicopter or a drone, which can be configured as a mobile base station. For those terminals 120j that access the RAN 100 through the network element 120i, the network element 120i is a base station; but for the base station 110a, the network element 120i is a terminal. The RAN nodes 110 and the terminals 120 are sometimes referred to as communication apparatuses, e.g., the network elements 110a and 110b in Figure 1 can be understood as communication apparatuses with base station functions, and the network elements 120a-120j can be understood as communication apparatuses with terminal functions.
[0074] In a possible scenario, the RAN node can be a device or module with corresponding communication functions located at the network side of the above communication system 10. The RAN node is usually provided with a communication module, circuit or chip for performing the corresponding communication functions, and programs for performing the corresponding communication functions and the corresponding program instructions are also configured in the RAN node. The RAN node can be a RAN device or network element deployed in the RAN. For example, the RAN node can be a RAN device or an apparatus, such as a chip system or a combined device or component that can implement the functions of an access network device, which can be installed in a RAN device. The RAN node can be an access point (AP) in a Wi-Fi system, such as a home gateway, a router, a server, a switch, a bridge, etc., a base station, a base station controller (BSC), a base transceiver station (BTS), a home base station, a baseband unit (BBU), a wireless relay node, a wireless backhaul node, and can also be an evolved node B (eNB) in a 4G system, or a next generation eNB (ng-eNB) during the transition from a 4G system to a 5G system, or a next generation base station (gNB) in a 5G system, or a RAN node that implements the functions of a gNB (partially). The RAN node can be a macro base station (such as 110a in FIG. 1), a micro base station or an indoor station (such as 110b in FIG. 1), a relay node or a donor node, or a wireless controller in a CRAN scenario. Optionally, the RAN node can also be a server, a wearable device, a vehicle or a vehicle-mounted device, etc. For example, the access network device in vehicle to everything (V2X) technology can be a road side unit (RSU). All or part of the functions of the RAN node in this application can also be implemented by software functions running on hardware, or by virtualized functions instantiated on a platform (such as a cloud platform). The RAN node in this application can also be a logical node, a logical module or software that can implement all or part of the functions of the RAN node.
[0075] In another possible scenario, multiple RAN nodes cooperate to assist a terminal to implement wireless access, and different RAN nodes respectively implement part of functions of a base station. For example, a RAN node can be a central unit (CU), a distributed unit (DU), a CU-control plane (CP), a CU-user plane (UP), or a radio unit (RU), etc. The CU and the DU can be separately configured, or can be included in the same network element, such as a baseband unit (BBU). The RU can be included in a radio frequency device or a radio frequency unit, such as a remote radio unit (RRU), an active antenna unit (AAU), or a remote radio head (RRH).
[0076] In some examples, the CU is a logical node that carries a radio resource control (RRC) layer, a service data adaptation protocol (SDAP) layer, a packet data convergence protocol (PDCP) layer, and other control functions of an access network device. The CU is connected to network nodes such as a core network through some interfaces, which can be an E2 interface or the like. Optionally, the CU can have part of the functions of the core network. The CU (for example, a PDCP layer and higher layers) is connected to a DU (for example, a radio link control (RLC) and lower layers) through some interfaces, which can be an F1 interface or the like. In some examples, these interfaces (for example, the F1 interface) can provide control plane and user plane functions (for example, interface management, system information management, user equipment (UE) context management, RRC message transmission, etc.). The F1AP is an application protocol of the F1 interface, which defines signaling procedures of the F1 in some examples. The F1 interface supports a control plane F1-C and a user plane F1-U.
[0077] In some examples, a CU can be split into a control unit-control plane (CU-CP) and a control unit-user plane (CU-UP), where the CU-CP is a logical node that carries the control plane part of PDCP (PDCP-C) layer and RRC layer, for implementing the control plane function of the CU. The CU-CP can interact with network elements in the core network for implementing the control plane function. The CU-UP is a logical node that carries the user plane part of PDCP (PDCP-U) layer and SDAP layer, for implementing the user plane function of the CU. The CU-UP can interact with network elements in the core network for implementing the user plane function. The above configuration of CU and DU is only an example, and the CU and DU can have other functions according to needs. For example, the CU or the DU can be configured to have more protocol layer functions, or the CU or the DU can be configured to have partial processing functions of the protocol layer. For example, partial functions of the RLC layer and functions of the protocol layer above the RLC layer are arranged in the CU, and the remaining functions of the RLC layer and functions of the protocol layer below the RLC layer are arranged in the DU. For another example, the functions of the CU or the DU can be divided according to service types or other system requirements. For example, functions that need to meet a relatively short delay requirement in processing time are arranged in the DU, and functions that do not need to meet the delay requirement are arranged in the CU.
[0078] In some examples, the DU is a logical node that carries the RLC layer, the medium access control (MAC) layer, the higher physical (Higher PHY) layer, and other functions. In some examples, the DU can control at least one RU. The DU is connected to the RU through some interfaces, which can be a front-haul interface. In some examples, the Higher PHY layer includes part of the PHY layer processing, such as forward error correction (FEC) encoding and decoding, scrambling, modulation and demodulation, and other processing functions.
[0079] In some examples, a RU is a logical node that hosts lower physical layer (Lower PHY) and radio frequency (RF) processing. In some examples, a RU can be a 3GPP transmission reception point (TRP) or a remote radio head (RRH) or other similar functional entity. In some examples, a Low-PHY includes portions of PHY processing such as fast Fourier transform (FFT), inverse fast Fourier transformation (IFFT), digital beamforming and filtering, and other processing functions. A RU communicates with one or more UEs over a wireless link.
[0080] A DU and a RU can or can not be co-located. A DU and a RU exchange control-plane and user-plane information over a fronthaul link via a lower-layer split-control, user and synchronization (LLS-CUS) interface. The LLS-CUS can include an interface that provides a control-plane (C-plane) and an interface that provides a user-plane (U-plane), respectively. In some examples, the control-plane refers to real-time control between the DU and the RU. The DU and the RU have an interface of the fronthaul link (e.g., a lower-layer split-management (LLS-M) interface) that exchanges management information; the user-plane refers to non-real-time management operations between the DU and the RU.
[0081] A DU and a RU can cooperate to collectively implement the functionality of a PHY layer. A DU can be connected to one or more RUs. The functionality of a DU and a RU can be configured in a number of ways depending on the design. For example, a DU is configured to implement baseband functionality and a RU is configured to implement mid- RF functionality. As another example, a DU is configured to implement high-layer functionality in a PHY layer and a RU is configured to implement low-layer functionality in the PHY layer or to implement the low-layer functionality and RF functionality. The high-layer functionality in the PHY layer can include a portion of the functionality of the PHY layer that is closer to the MAC layer, and the low-layer functionality in the PHY layer can include another portion of the functionality of the PHY layer that is closer to the mid-RF side.
[0082] In different systems, the CU (or CU-CP and CU-UP), DU or RU can also have different names, but those skilled in the art can understand their meanings. For example, the radio access network can also be an open-RAN (O-RAN) architecture, in which the CU can also be referred to as an open CU (O-CU), the DU can also be referred to as an open DU (O-DU), the CU-CP can also be referred to as an open CU-CP (O-CU-CP), the CU-UP can also be referred to as an open CU-UP (O-CU-UP), and the RU can also be referred to as an open RU (O-RU). Any of the CUs (or CU-CP, CU-UP), DUs and RUs in this application can be implemented by a software module, a hardware module, or a combination of a software module and a hardware module.
[0083] As described above, the RAN node can also be referred to as a network device. In the following, the network device is used for description unless otherwise specified.
[0084] The terminal can be a device or module that accesses the above communication system 10 and has a corresponding communication function. The terminal can also be referred to as a terminal device, a user equipment, a user apparatus, an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile terminal, a remote station, a remote terminal, a mobile device, a user terminal, a terminal unit, a terminal station, a terminal apparatus, a wireless communication device, a user agent or a user device. The terminal is usually provided with a communication module, circuit or chip for executing the corresponding communication function. The terminal is also configured with program instructions for executing the corresponding communication function.
[0085] The terminal can be widely applied to various scenarios, for example, device-to-device (D2D), vehicle to everything (V2X) communication, machine-type communication (MTC), internet of things (IOT), virtual reality, augmented reality, industrial control, automatic driving, remote medical treatment, smart grid, smart furniture, smart office, smart wear, smart transportation, smart city, etc. The terminal can be a mobile phone, a personal digital assistant (PDA) computer, a laptop computer, a tablet computer (Pad), a drone, a computer with wireless transceiver function, a machine type communication (MTC) terminal, a virtual reality (VR) terminal, an augmented reality (AR) terminal, an internet of things (IoT) terminal, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical treatment, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home (such as a game console, a smart television, a smart sound box, a smart refrigerator, a fitness equipment, etc.), a transport vehicle with wireless communication function, a communication module, a roadside unit (RSU) with terminal function. The embodiments of the present application do not limit the device form of the terminal.
[0086] It should be understood that, in the embodiments of the present application, the terminal device or the network device includes a hardware layer, an operating system layer running above the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also referred to as a main memory). The operating system can be any one or more computer operating systems that implement business processing through a process, for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer includes applications such as a browser, an address book, word processing software, and instant messaging software. Moreover, the embodiments of the present application do not particularly limit the specific structure of the execution subject of the method provided by the embodiments of the present application, as long as the execution subject can communicate according to the method provided by the embodiments of the present application by running a program in which the code of the method provided by the embodiments of the present application is recorded. For example, the execution subject of the method provided by the embodiments of the present application can be a terminal device, or a functional module in the terminal device that can call and execute a program.
[0087] In addition, various aspects or features of the disclosure can be realized as methods, apparatus, or articles of manufacture using standard programming and / or engineering techniques. The term "article of manufacture" as used in the disclosure encompasses a computer program or other processor-readable storage medium accessible from a computer-readable storage medium embodying a program of instructions executable by an electronic processor. The computer-readable storage medium can include, but is not limited to, memory devices such as hard disks, floppy disks, or optical discs; as well as flash memory devices and cards, digital video disks (DVDs), and Blu-ray discs. The computer-readable storage medium can be distributed among computer systems that act in concert.
[0088] In addition, the various storage media described herein can represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" can include, without being limited to, wireless channels and various other media capable of storing, containing, and / or carrying instruction(s) and / or data.
[0089] As described above, the terminal device or the network device includes a hardware layer, and as the device is continuously developed, higher requirements are put forward for the reliability of the device, especially for business scenarios such as industrial control, aerospace, and the like, which are affected by harsh factors such as high and low temperature, humidity, electromagnetic radiation, cosmic rays, and the like, and the hardware is prone to faults such as jumping, locking, burning, hanging, and link interruption. If the hardware fault cannot be handled in time, it will have an impact on multiple industries.
[0090] To solve the problem that the hardware is prone to faults, one solution is to improve the performance of the hardware, for example, space-grade multi-mode flash hardware, which can improve the reliability of the device, but the space-grade multi-mode flash hardware has defects such as high chip cost and small storage space.
[0091] Another way is to supplement the deficiency of the hardware through software, for example, a three-mode redundant file system is added between the OS virtual file system and the underlying file system, and the three-mode redundant file system can manage three underlying file systems at the same time, so that multiple copies of each data are stored when storing the data, to improve the reliability. However, this way lacks flexibility and increases time consumption, resulting in poor performance.
[0092] Based on this, the present application provides a data management method, which is applied to a first device, wherein the first device can be the terminal device or the network device in the above. The method can include steps 210-230.
[0093] 210, before writing first target data into a first data block in a plurality of data blocks, detecting whether the first data block is damaged.
[0094] In the embodiment of the present application, the memory of the first device can include a plurality of data blocks, and the plurality of data blocks are used to store data such as picture data, text data, and voice data. The first target data in the embodiment of the present application can be at least one of picture data, text data, and voice data.
[0095] The first data block in the embodiment of the present application can be any data block in the plurality of data blocks, and before performing the first target data writing operation into the first data block, the first data block can be an empty data block, that is, no data is stored in the first data block; or the first data block can not be an empty data block, that is, the first data block itself has stored data.
[0096] In the embodiment of the present application, before writing the first target data into the first data block, it can be detected whether the first data block is damaged, and the specific detection method is described in the following, which is not described here.
[0097] 220, if the first data block is not damaged, writing the first target data into the first data block.
[0098] 230, if the first data block is damaged, writing the first target data into a second data block of the plurality of data blocks, the second data block being different from the first data block and not damaged.
[0099] In the embodiments of the present application, after judging whether the first data block is damaged, the first target data can be written into different data blocks according to the judgment result. Specifically, in the case where the first data block is not damaged, the first target data is written into the first data block; in the case where the first data block is damaged, the first target data is written into a second data block which is not damaged; the final result of the two cases is to store the first target data in the data block which is not damaged, thereby realizing reliable storage of the first target data. Compared with the current scheme of improving hardware performance, the embodiments of the present application do not need to make too many changes or improvements to the hardware, thereby reducing the chip cost of the hardware and increasing the storage space. In addition, compared with the current scheme of simultaneously managing three underlying file systems by adding a triple modular redundancy file system, the embodiments of the present application do not limit each data storage to multiple copies, have higher flexibility and better performance.
[0100] It should be further noted that, if the reliable storage of data is realized by improving the hardware, since the technology and process are relatively conservative and the iteration evolution speed is much slower than that of commercial off-the-shelf (COTS) devices, the iteration evolution speed of the hardware in the first device is faster in the embodiments of the present application without making too many changes and improvements to the hardware, and thus the device requirements can be better met. In addition, if the reliable storage of data is realized by simultaneously managing three underlying file systems by adding a triple modular redundancy file system, since this way stores data in the main memory or the read-only memory through the file system when storing, and can only check the data in the main memory or the read-only memory when checking, the metadata in the file system cannot be checked, while in the embodiments of the present application, the data is stored in the file system, and the data in the file system can be checked, so that the error of the metadata can be detected.
[0101] It is pointed out in the above step 210 that, before writing the first target data into the first data block of the plurality of data blocks, whether the first data block is damaged is detected. In the embodiments of the present application, whether the first data block is damaged can be detected in various ways, which will be described below.
[0102] In one embodiment, detecting whether the first data block is damaged comprises: detecting whether the first data block is damaged by a preset error detection mode. The preset error detection mode includes any one of the following: an information coding error detection mode, a read-back check coding error detection mode, and a pre-arranged coding error detection mode.
[0103] In the embodiments of the present application, as shown in FIG. 3, when it is needed to write the first target data into the data block, the first target data can be preprocessed first, such as data cleaning, conversion, integration, normalization, etc., and then any one of the ways shown in FIG. 3 is used to detect whether the first data block is damaged, after the detection is completed, the preprocessed first target data is written into the first data block or the second data block, and after the data writing is completed, the data block is post-processed, such as log recording, so as to facilitate offline data statistics and reliability analysis. At this point, the process of writing the first target data into the data block is completed.
[0104] The above-mentioned error detection ways will be described in detail respectively.
[0105] 1. Information coding error detection way
[0106] The core of the information coding error detection way is to determine whether the first data block is damaged by checking whether the check code generated when the data is written is consistent with the check code generated when the data is read. In the embodiments of the present application, the information coding error detection way can be ECC detection, RS detection, etc.
[0107] Taking the ECC detection as an example, in the case that the original data is stored in the first data block, an ECC check code is generated and saved every 256 bytes when the original data is written into the first data block, which can be called original ECC check code. When the original data is read from the first data block, an ECC check code is generated every 256 bytes, which can be called new ECC check code. Comparing the original ECC check code with the new ECC check code, if they are the same, it means that there is no error, which indicates that the first data block is not damaged, i.e. the first data block is healthy; if they are different, it means that there is an error, which indicates that the first data block is damaged. In the case that the first data block is not damaged, the first target data can be continuously written into the first data block.
[0108] For example, when the original data is written into the first data block, the generated original ECC check code is 11-MOD3478; when the original data is read from the first data block, the generated new ECC check code is also 11-MOD3478, comparing the two check codes, it can be seen that the two check codes are consistent, which indicates that the first data block is not damaged; when the original data is read from the first data block, the generated new ECC check code is 11-MOD3400, comparing the two check codes, it can be seen that the two check codes are inconsistent, which indicates that the first data block is damaged.
[0109] The principle of RS detection is basically the same as that of the above-mentioned ECC detection, which will not be described again.
[0110] 2. Back-reading check code error detection way
[0111] The core of the read-back check coding error detection mode is that the data stored in the data block is read multiple times, and whether the multiple read results are consistent is determined to determine whether the first data block is damaged.
[0112] In the case that the first data block itself stores data, the data can be read from the first data block once, and after the completion of this data reading, the data can be read from the first data block again. If the data read twice is the same, it indicates that the first data block is not damaged. If the data read twice is different, it indicates that the first data block is damaged.
[0113] For example, the data read from the first data block for the first time is 0001110110001, and the data read from the first data block for the second time is 0001110110001. Comparing the two read results, it can be seen that the results of the two readings have no difference, and the first data block is not damaged.
[0114] For example, the data read from the first data block for the first time is 0001110110001, and the data read from the first data block for the second time is 00111110110001. Comparing the two read results, it can be seen that the results of the two readings have a difference, and the first data block is damaged.
[0115] 3. Pre-arranged coding error detection mode
[0116] The core of the pre-arranged coding error detection mode is to read the storage format of the data block that does not store data, and determine whether the first data block is damaged according to whether the read storage format is consistent with the pre-stored storage format.
[0117] In the case that the first data block itself does not store data, the first data block pre-stores a corresponding storage format. Before writing data to the first data block again, the corresponding storage format of the first data block can be read from the first data block. If the read storage format is the same as the pre-stored corresponding storage format, it indicates that the first data block is not damaged. If the read storage format is different from the pre-stored corresponding storage format, it indicates that the first data block is damaged.
[0118] For example, assuming that the pre-stored corresponding storage format in the first data block is 0XXXX5AAAA, if the storage format read from the first data block is also 0XXXX5AAAA, since the storage format read from the first data block is the same as the pre-stored corresponding storage format in the first data block, the first data block is not damaged. If the storage format read from the first data block is 0XXXX5ABBA, since the storage format read from the first data block is different from the pre-stored corresponding storage format in the first data block, the first data block is damaged.
[0119] In the embodiments of the present application, the first data block is detected whether it is damaged by a preset error detection mode, which includes any one of the following: an information coding error detection mode, a read-back check coding error detection mode, and a pre-arranged coding error detection mode. The correct rate of detecting whether the first data block is damaged can be improved, which is beneficial to writing data into a healthy data block, and further beneficial to improving the reliability of data writing.
[0120] In the embodiments of the present application, for the above-mentioned multiple error detection modes, based on the characteristics of each error detection mode, the way of detecting whether the first data block is damaged is determined according to whether the first data block stores data.
[0121] In one embodiment, if the first data block does not store data, the way of detecting whether the first data block is damaged includes: a pre-arranged coding error detection mode; or, if the first data block stores data, the way of detecting whether the first data block is damaged includes: an information coding error detection mode and a read-back check coding error detection mode.
[0122] As described above, the core of the pre-arranged coding error detection mode is to read the storage format of the data block which does not store data, and determine whether the data block is damaged according to whether the read storage format is consistent with the pre-stored storage format. Therefore, for the first data block which does not store data, the pre-arranged coding error detection mode can be used to detect whether the first data block is damaged. The core of the information coding error detection mode is to determine whether the data block is damaged according to whether the check code generated when data is written is consistent with the check code generated when data is read; and the core of the read-back check coding error detection mode is to read the data stored in the data block multiple times, and determine whether the data block is damaged according to whether the multiple reading results are consistent. Therefore, for the first data block which stores data, the information coding error detection mode or the read-back check coding error detection mode can be used to detect whether the first data block is damaged.
[0123] In the embodiments of the present application, by using different error detection modes to detect whether the first data block is damaged according to whether the first data block stores data, the correct rate of detecting whether the first data block is damaged can be further improved, which is beneficial to writing data into a healthy data block, and further beneficial to improving the reliability of data writing.
[0124] As pointed out above, when the first data block is damaged, the first target data can be written into an undamaged second data block. The information of the second data block will be described below.
[0125] In one embodiment, the plurality of data blocks includes N data blocks arranged in sequence, the first data block is the Ith data block, I < N, I and N are integers greater than or equal to 1. Before writing the first target data into the second data block in the plurality of data blocks, the method further includes: selecting the second data block from the plurality of data blocks, the second data block is the (I+M)th data block or the (I-M)th data block, 1≤M<I, or the second data block is the Nth data block.
[0126] In the embodiment of the application, if the first data block is detected to be damaged, a second data block which is not damaged can be selected from the plurality of data blocks. In actual scenarios, when the first data block is detected to be damaged, a data block can be selected from the plurality of data blocks, and after the selection is completed, the selected data block still needs to be detected. When the selected data block is detected to be not damaged, the data block which is not damaged is the second data block in the embodiment of the application, so that the first target data can be written into the selected data block. When the selected data block is also detected to be damaged, another data block can be selected from the plurality of data blocks, and similarly, the selected another data block still needs to be detected. When the selected another data block is detected to be not damaged, the data block which is not damaged is the second data block in the embodiment of the application, so that the first target data can be written into the selected another data block.
[0127] In the embodiment of the application, it is assumed that the first device includes N data blocks, the N data blocks are arranged in sequence, and are sequentially data block 0, data block 1, data block 2, data block 3, …, data block N-1. If the first data block is the Ith data block, the second data block can be the (I+M)th data block or the (I-M)th data block or the Nth data block.
[0128] Taking N as 8 as an example, the eight data blocks are sequentially data block 0, data block 1, data block 2, data block 3, data block 4, data block 5, data block 6, data block 7, and data block 8, as shown in FIG. 4. If the first data block is data block 2, and it is assumed that M is 1, the second data block can be data block 1 or data block 3, and it is assumed that M is 2, the second data block can be any one of data block 0, data block 1, data block 3, and data block 4; or if the first data block is data block 2, the second data block can be data block 7.
[0129] It should be understood that the arrangement of the plurality of data blocks shown in FIG. 4 is only an example, and in some possible implementations, the plurality of data blocks can be arranged in a two-dimensional plane, i.e., the plurality of data blocks can be arranged in a rectangle, for example, when N is 24, the first 12 data blocks are arranged in the first row, and the last 12 data blocks are arranged in the second row. In other possible implementations, the plurality of data blocks can also be arranged in three dimensions, i.e., the plurality of data blocks can be arranged in a plurality of rectangles, and the plurality of rectangles are arranged in different layers, for example, when N is 72, the first 24 data blocks are arranged in the first layer, the middle 24 data blocks are arranged in the second layer, and the last 24 data blocks are arranged in the third layer, so that the 72 data blocks form a cuboid.
[0130] When the data block is specifically selected, the following strategies can be referred to for selection of the second data block.
[0131] 1. Backward adjacent data block strategy
[0132] The strategy indicates that a backward adjacent data block of the currently written data block can be selected as a new data block. For example, taking the first data block currently written as data block 2 as an example, the data block adjacent to data block 2 after data block 2 is data block 3, and based on the backward adjacent data block strategy, data block 3 can be selected as a data block to be written with the first target data. After the selection is completed, data block 3 can be detected, and in the case that data block 3 is not damaged, data block 3 is the second data block in the embodiment of the present application, and thus the first target data can be written to data block 3. Since the strategy aims to find a data block adjacent to the currently written data block as a data block to be written with the first target data, the strategy can reduce the data movement distance, and thus the writing performance can be improved.
[0133] 2. Global latest data block strategy
[0134] The strategy indicates that a globally latest data block is selected as a new data block, wherein the globally latest in the embodiment of the present application refers to the last data block arranged in order in the device. For example, still taking the first data block currently written as data block 2 as an example, referring to FIG. 4, the last data block arranged in order in the device is data block 7, and based on the global latest data block strategy, data block 7 can be selected as a data block to be written with the first target data. After the selection is completed, data block 7 can be detected, and in the case that data block 7 is not damaged, data block 7 is the second data block in the embodiment of the present application, and thus the first target data can be written to data block 7. Generally, the probability of damage of the last data block is the smallest, and thus the second data block selected based on the strategy can improve the reliability of data writing.
[0135] 3. Local area data block strategy
[0136] The strategy indicates that a data block in a local region where the current written data block is located is selected as a new data block. The local region in the embodiment of the present application refers to a local region formed by the current written data block and M data blocks before and after the current written data block. For example, still taking the first data block 2 as the current written data block as an example, referring to FIG. 4, assuming that M is 1, the local region can be understood as a local region formed by the data block 1, the data block 2 and the data block 3, and then the data block 1 or the data block 3 can be selected as the data block to be written with the first target data based on the local region data block strategy. After the selection, the data block 1 or the data block 3 can be detected. If the data block 1 or the data block 3 is not damaged, the data block 1 or the data block 3 is the second data block in the embodiment of the present application, and thus the first target data can be written into the data block 1 or the data block 3. Assuming that M is 2, the local region can be understood as a local region formed by the data block 0, the data block 1, the data block 2, the data block 3 and the data block 4, and then any one of the data block 0, the data block 1, the data block 3 and the data block 4 can be selected as the data block to be written with the first target data based on the local region data block strategy. After the selection, assuming that the data block 4 is selected as the data block to be written with the first target data, the data block 4 can be detected. If the data block 4 is not damaged, the data block 4 is the second data block in the embodiment of the present application, and thus the first target data can be written into the selected data block 4. The second data block selected based on the strategy can balance the reliability and performance of data writing, and can improve the data writing performance as much as possible while ensuring the reliability of data writing.
[0137] In the embodiment of the present application, if the first data block is damaged, the second data block that is not damaged can be selected and the first target data can be written into the second data block. In the case that a plurality of data blocks include N data blocks arranged in order, if the first data block is the Ith data block and the second data block is the Nth data block, generally, when data is written, the data is written from the first data block in order, and the larger the number of the data block, the smaller the possibility of damage. Therefore, selecting the Nth data block as the second data block can improve the reliability of data writing. If the first data block is the Ith data block and the second data block is the I+Mth data block or the I-Mth data block, 1≤M<I, when M is 1, it is equivalent to writing the first target data into the second data block adjacent to the first data block, which can reduce the moving distance of data and thus improve the writing performance. When M is a number greater than or equal to 1 and less than I, it is equivalent to selecting the second data block in a local region formed by the first data block and M data blocks before and after the first data block. This way can balance the reliability and performance of data writing, and can improve the data writing performance as much as possible while ensuring the reliability of data writing.
[0138] In addition, in the process of selecting the second data block in the above manner, the number of times of writing of the data block can also be considered, for example, still taking the currently written first data block as data block 2 as an example, referring to FIG. 4, the maximum number of times of writing of the data block is 20, assuming that data block 3 and data block 4 are not damaged, but the number of times of writing data into data block 3 is 19 times, and the number of times of writing data into data block 4 is 5 times, in this case, data block 4 can be considered as the second data block to avoid the error or damage of the data block caused by too many times of writing of the same data block, thereby improving the service life of the system.
[0139] The above describes the process of writing the target data into the data block, and the following will introduce the content of reading the target data from the data block.
[0140] In an embodiment, the method further comprises: before reading the second target data from the third data block, detecting whether the third data block is damaged, the third data block being a data block in the plurality of data blocks that stores data; if the third data block is not damaged, reading the second target data from the third data block; and if the third data block is damaged, obtaining the second target data based on an error correction algorithm.
[0141] The third data block in the embodiment of the application can be any data block in the plurality of data blocks that stores the second target data, and before reading the second target data from the third data block, the third data block can be detected for damage, and the specific detection manner can refer to the manner of detecting whether the first data block is damaged before writing the first target data into the first data block, which will not be described here.
[0142] In the embodiment of the application, since the third data block stores data, the third data block can be detected for damage by the information encoding error detection manner or the read-back check encoding error detection manner.
[0143] Taking the ECC detection in the information encoding error detection manner as an example, for example, if the third data block stores the second target data, when writing the second target data into the third data block, the original ECC check code generated is 11-MOD3478; when reading the second target data from the third data block, the new ECC check code generated is also 11-MOD3478, and by comparing the two check codes, it can be seen that the two check codes are consistent, indicating that the third data block is not damaged; when reading the original data from the third data block, the new ECC check code generated is 11-MOD3400, and by comparing the two check codes, it can be seen that the two check codes are inconsistent, indicating that the third data block is damaged.
[0144] In the case of detecting that the third data block is damaged, the new check code and the corresponding data can be corrected based on the error correction algorithm to obtain the correct second target data, and the error correction can be performed by the ECC error correction algorithm or the RS error correction algorithm.
[0145] Taking the ECC correction algorithm as an example, the ECC check operates on 256 bytes of data each time, including column check and row check. XOR is performed on each Bit to be checked, and if the result is 0, it indicates that there are even number of 1s; if the result is 1, it indicates that there are odd number of 1s. The column check rule is shown in Table 1, and the row check rule is shown in Table 2. The 256 bytes of data form a matrix of 256 rows and 8 columns, and each element of the matrix represents a Bit.
[0146] Table 1
[0147] Referring to Table 1, CP0-CP5 are 6 Bit, representing column polarity. Among them, CP0 is the polarity of the 0th, 2nd, 4th, and 6th columns, CP1 is the polarity of the 1st, 3rd, 5th, and 7th columns; CP2 is the polarity of the 0th, 1st, 4th, and 5th columns, CP3 is the polarity of the 2nd, 3rd, 6th, and 7th columns; CP4 is the polarity of the 0th, 1st, 2nd, and 3rd columns, and CP5 is the polarity of the 4th, 5th, 6th, and 7th columns.
[0148] Table 2
[0149] Referring to Table 2, RP0-RP15 are 16 Bit, representing row polarity. Among them, RP0 is the polarity of the 0th, 2nd, 4th, 6th, …, 254th byte, RP1 is the polarity of the 1st, 3rd, 5th, 7th, …, 255th byte; RP2 is the polarity of the 0th, 1st, 4th, 5th, 8th, 9th, …, 252nd, 253rd byte (processing 2 Bytes, skipping 2 Bytes), RP3 is the polarity of the 2nd, 3rd, 6th, 7th, 10th, 11th, …, 254th, 255th byte (skipping 2 Bytes, processing 2 Bytes); RP4 processes 4 Bytes and skips 4 Bytes, RP5 skips 4 Bytes and processes 4 Bytes; RP6 processes 8 Bytes and skips 8 Bytes, RP7 skips 8 Bytes and processes 8 Bytes; RP8 processes 16 Bytes and skips 16 Bytes, RP9 skips 16 Bytes and processes 16 Bytes; RP10 processes 32 Bytes and skips 32 Bytes, RP11 skips 32 Bytes and processes 32 Bytes; RP12 processes 64 Bytes and skips 64 Bytes, RP13 skips 64 Bytes and processes 64 Bytes; RP14 processes 128 Bytes and skips 128 Bytes, RP15 skips 128 Bytes and processes 128 Bytes.
[0150] In summary, for 256 bytes of data, 6 bits of column check results, 16 bits of row check results, and a total of 22 bits are generated. In Nand, 3 bytes are used to store the check results, and the remaining two bit positions are set to 1. The storage order is shown in Table 3.
[0151] Table 3
[0152] As described above, when writing data into the page of the NAND Flash, an ECC check code is generated every 256 bytes, referred to as an original ECC check code, and saved to the out-of-band (OOB) data area of the page. When reading data from the NAND Flash, an ECC check code is generated every 256 bytes, referred to as a new ECC check code.
[0153] In the specific detection, the original ECC check code and the new ECC check code read from the OOB area are XORed bit by bit, that is, the check codes at the corresponding positions of the original ECC check code and the new ECC check code are compared. If the check codes at the corresponding positions are the same, the result is 0, indicating that there is no error. If the check codes at the corresponding positions are different, the result is 1, indicating that there is an error. In the case of an error, the original data can be obtained based on the error correction algorithm, such as using the original ECC check code to obtain the original data.
[0154] In the embodiment of the present application, before reading the second target data from the third data block, the third data block can be detected first, and different processing can be performed according to the detection result. Specifically, if the third data block is not damaged, the second target data is read from the third data block; if the third data block is damaged, the second target data is obtained based on the error correction algorithm; regardless of whether the third data block is damaged or not, the second target data can be finally obtained, so that reliable reading of the second target data can be realized, thereby improving the reliability of data reading.
[0155] Optionally, in some embodiments, in the case that the third data block is damaged, the method further includes: writing the second target data to a fourth data block in the plurality of data blocks, the fourth data block being different from the third data block and not being damaged; reading the second target data from the fourth data block.
[0156] As described above, in the case that the third data block is damaged, the second target data can be obtained by the error correction algorithm, and after the second target data is obtained, the second target data can be written to other data blocks, such as the undamaged fourth data block. The second target data can be read from the fourth data block subsequently. The specific writing process is similar to the process of writing the first target data to the data block, and the specific reading process is similar to the process of reading the second target data from the third data block, which will not be described in detail.
[0157] It should be understood that in the embodiments of the present application, after the second target data is obtained, and before it is written into the data block, the data block to be written can still be detected, if the data block to be written is not damaged, the second target data can be written into the data block, and the data block is the fourth data block in the embodiments of the present application; if the data block to be written is damaged, another data block can be detected, and the same is true for the subsequent data blocks, until an undamaged data block is detected, so that the second target data can be written into the undamaged data block, and the undamaged data block is the fourth data block in the embodiments of the present application.
[0158] It should also be understood that in the embodiments of the present application, before the second target data is read from the fourth data block, the fourth data block can still be detected, if the fourth data block is not damaged, the second target data can be directly read from the fourth data block; if the fourth data block is damaged, the second target data can be obtained based on the error correction algorithm, and the second target data can be written into another undamaged data block, so as to facilitate subsequent reading of the second target data from the other data block.
[0159] In the embodiments of the present application, in the case that the third data block is damaged and the second target data is obtained by using the error correction algorithm, the second target data can be written into the undamaged fourth data block, and the second target data can be read from the undamaged fourth data block subsequently, which is beneficial to reliable reading of the second target data and improves the reliability of reading of the second target data.
[0160] The process of writing data into a data block and reading data from a data block will be described below in conjunction with FIG. 5.
[0161] Referring to FIG. 5, taking the APP as a camera as an example, when a picture is stored by the camera, that is, the picture data is written into the data block of the mobile phone, before the picture data is written, the data block to be written is detected first, assuming that the data block to be written is data block 2, the data block 2 can be detected first, if the data block 2 is not damaged, the picture data is written into the data block 2; if the data block 2 is damaged, the picture data can be written in other areas of the data block 2. If it can be written, the picture data can be written into the data block 2; if it cannot be written, a new data block can be selected from a plurality of data blocks, assuming that the selected new data block is data block 3, before the picture data is written into the data block 3, the data block 3 can still be detected first, and the steps similar to the detection of the data block 2 are continued.
[0162] Taking APP as an example, when a picture needs to be read from the gallery, i.e., the picture data is read from the data block of the mobile phone, the data block storing the picture data is detected before the picture data is read. Assuming that the data block storing the picture data is data block 4, the data block 4 can be detected first. If the data block 4 is not damaged, the picture data can be read from the data block 4. If the data block 4 is damaged, data correction can be performed to obtain correct picture data, and a new data block, such as data block 5, is selected again, and the new data block 5 is detected. If the new data block 5 is not damaged, the correct picture data can be written into the data block 5, and the picture data can be read from the data block 5. If the new data block 5 is damaged, another new data block can be selected and detected until an undamaged data block is selected, and the correct picture data is written into the undamaged data block. The picture data can be read from the undamaged data block subsequently.
[0163] To facilitate understanding of the following text, the terms "process" and "thread" involved are first simply explained.
[0164] Process: (process): a running activity of a program on a certain data set in a computer, is the basic unit of system resource allocation and scheduling, and is the basis of operating system structure. In the early process-oriented computer structure, the process is the basic execution entity of the program; in the current thread-oriented computer structure, the process is the container of the thread. Program refers to the description of instructions, data and their organization form, and process is the entity of the program.
[0165] Thread: sometimes referred to as lightweight process (lightweight process, LWP), is the smallest unit of program execution flow. A standard thread consists of thread identity (identity, ID), current instruction pointer, register set and stack. In addition, the thread is an entity in the process, and is the basic unit independently scheduled and dispatched by the system. The thread itself does not own system resources, but only owns a little bit of resources necessary in running, but it can share all the resources owned by the process with other threads belonging to the same process. A thread can create and cancel another thread, and multiple threads in the same process can be executed concurrently.
[0166] Optionally, in an embodiment, the method further comprises: detecting whether the plurality of data blocks are damaged when the first device is in an idle state.
[0167] The idle state in the embodiments of the present application can be understood as that all service threads in the device are not executed, wherein the service thread can correspond to the thread of an application such as a camera, a gallery, and weather. Taking a mobile phone as the first device, the mobile phone in the idle state can be understood as that the mobile phone is in a screen-off state, which is equivalent to that the foreground program of the mobile phone is in a closed state and the background program is in an opened state. The foreground program can also be referred to as a time processing level program, and the background program can be referred to as a task level program.
[0168] When the first device is in the idle state, whether the plurality of data blocks are damaged is detected, which is equivalent to detecting all data blocks in the first device, that is, inspecting the data blocks in the first device, as shown in FIG. 5. Specifically, when the first device is in the idle state, whether all data blocks in the first device are damaged is detected, and when a damaged data block is found, the data block can be marked so as to facilitate subsequent execution of writing data into the data block or reading data from the data block.
[0169] In the process of detecting the data blocks in the first device, the data blocks can be detected according to numbers, such as data block 0, data block 1, data block 2, data block 3, …, in sequence. In the detection process, if data block 3 is detected as damaged, data block 3 can be marked as damaged, or data block 3 can be added to the first queue. For the content of the first queue, please refer to the following.
[0170] The plurality of data blocks can store data or can not store data. The specific detection method can still refer to the plurality of error detection methods described above, which will not be described here.
[0171] In the embodiments of the present application, the action of detecting whether the plurality of data blocks are damaged can be executed by a thread, which can be referred to as an inspection thread. When the first device is in the idle state, the system can automatically trigger the inspection thread. That is, all data blocks in the first device are traversed, and a read inspection thread is executed for each data block. If the read inspection fails, it indicates that the data block is damaged, and the data block is marked. This way can timely find the damaged data block, avoid subsequent miswriting of data into the damaged data block, and can improve the reliability of data writing.
[0172] In one embodiment, the method further includes: in the process of detecting whether the plurality of data blocks are damaged, when the first device switches from the idle state to the non-idle state, stopping detecting the plurality of data blocks.
[0173] The non-idle state in the embodiments of the present application can be understood as that a service thread in the device is executed. Taking a mobile phone as an example, the mobile phone in the non-idle state can be understood as that an application on the mobile phone is running, such as a camera in a photographing state, a gallery in a browsing state, and the like.
[0174] In the embodiments of the present application, in the process of detecting whether the plurality of data blocks are damaged, when the mobile phone switches from the idle state to the non-idle state, such as when the mobile phone switches from the screen-off state to the state of browsing the gallery, since the gallery application has been started, the thread of detecting whether the plurality of data blocks are damaged is preempted, that is, the inspection thread is preempted, at this time, the execution of the inspection thread can be suspended, the business thread is executed preferentially, and after the execution of the business thread is completed, the execution of the inspection thread is continued, so as to realize the balance between the data block detection and the minimum business performance overhead.
[0175] It is indicated above that the plurality of ways of writing data to the data block, reading the data block from the data block, and detecting the plurality of data blocks when the first device is idle can all be used to detect whether the data block in the first device is damaged. In the following, the data block will be further divided according to the damage degree of the data block.
[0176] Optionally, in an embodiment, the method further includes: determining whether the hardware containing the first data block is damaged. If the hardware is damaged, the first data block is added to the first queue, and the data blocks in the first queue are unavailable; if the hardware is not damaged, the first data block is added to the second queue, and the data blocks in the second queue are available.
[0177] In the embodiments of the present application, in the case where it is determined that the first data block is damaged, it can be further judged whether the hardware containing the first data block is damaged, and the first data block is added to different queues according to the judgment result. Specifically, if the hardware containing the first data block is damaged, it means that the first data block cannot be used at all, so the first data block can be added to the first queue, and data will not be written to the data blocks in the first queue in the future; if the hardware containing the first data block is not damaged, it means that the first data block can still be used, so the second data block can be added to the second queue, and data can still be written to the data blocks in the second queue in the future.
[0178] It should be understood that for the damaged data blocks in the second queue, although the data blocks in the second queue are available, the data in some data blocks in the second queue can be recovered, and the data in some data blocks in the second queue cannot be recovered, which is related to the damage degree of the data block.
[0179] Specifically, in some possible implementation manners, if a data block in the second queue has single-bit failure, it can be considered that the data in the data block can be recovered; if another data block in the second queue has multi-bit failure, it can be considered that the data in the data block cannot be recovered. The second queue can be further divided into a recycling queue and a transit queue, wherein the recycling queue includes the data blocks whose data can be recovered, and the transit queue includes the data blocks whose data cannot be recovered, as shown in FIG. 6.
[0180] In some possible implementation manners, if the number of failed bits in a data block in the second queue is less than or equal to the threshold value, it can be considered that the data in the data block can be recovered; if the number of failed bits in another data block in the second queue is greater than the threshold value, it can be considered that the data in the data block cannot be recovered. Alternatively, if the number of failed bits in a data block in the second queue is less than the threshold value, it can be considered that the data in the data block can be recovered; if the number of failed bits in another data block in the second queue is greater than or equal to the threshold value, it can be considered that the data in the data block cannot be recovered.
[0181] The threshold value can be a value specified by a protocol or a value preset by the system, and the threshold value can be a fixed value or a dynamically changing value.
[0182] In the embodiments of the present application, the first data block is added to different queues according to whether the hardware containing the first data block is damaged, specifically, the first data block is added to the first queue if the hardware is damaged, and the first data block is added to the second queue if the hardware is not damaged. The data blocks in the first queue are unusable, and the data blocks in the second queue are usable. By separating the damaged data blocks, the unusable data blocks can be eliminated in time, so that subsequent data can be prevented from being written to the damaged data blocks, thereby the speed and reliability of data writing can be improved.
[0183] As shown in FIG. 7, the present application further provides a data management method, which includes steps 710-730.
[0184] 710, before reading the second target data from the third data block, detecting whether the third data block is damaged, the third data block being a data block in which data is stored in the plurality of data blocks.
[0185] 720, if the third data block is not damaged, reading the second target data from the third data block.
[0186] 730, if the third data block is damaged, obtaining the second target data based on an error correction algorithm.
[0187] In the embodiments of the present application, for the specific process of reading the second target data from the third data block, please refer to the related content in the method of data management shown in FIG. 2, which will not be repeated here.
[0188] In the embodiments of the present application, before reading the second target data from the third data block, the third data block can be detected first, and different processing can be performed according to the detection result. Specifically, if the third data block is not damaged, the second target data is read from the third data block; if the third data block is damaged, the second target data is obtained based on an error correction algorithm; regardless of whether the third data block is damaged or not, the final result can obtain the second target data, so that the reliable reading of the second target data can be realized, and the reliability of data reading can be improved.
[0189] In an embodiment, the method further comprises: writing the second target data to a fourth data block in the plurality of data blocks, the fourth data block being different from the third data block and the fourth data block being undamaged; and reading the second target data from the fourth data block.
[0190] In an embodiment, detecting whether the third data block is damaged comprises: detecting whether the third data block is damaged by a preset error detection mode; wherein the preset error detection mode comprises any one of the following: an information coding error detection mode, a read-back check coding error detection mode.
[0191] In an embodiment, the plurality of data blocks comprises N data blocks arranged in order, the third data block is a Jth data block, J < N, J and N are integers greater than or equal to 1.
[0192] Before writing the second target data to a fourth data block in the plurality of data blocks, the method further comprises: selecting the fourth data block from the plurality of data blocks, the fourth data block being a J+Kth data block or a J-Kth data block, 1 < K < J, or the fourth data block being an Nth data block.
[0193] In an embodiment, the method further comprises: detecting whether the plurality of data blocks are damaged when the first device is in an idle state.
[0194] In an embodiment, the method further comprises: when the first device switches from the idle state to a non-idle state during the process of detecting whether the plurality of data blocks are damaged, stopping detecting the plurality of data blocks.
[0195] In an embodiment, the method further comprises: determining whether a hardware containing the third data block is damaged; if the hardware is damaged, adding the third data block to a first queue, the data blocks in the first queue being unavailable; or if the hardware is not damaged, adding the third data block to a second queue, the data blocks in the second queue being available.
[0196] The contents not described in detail in the embodiments of the present application can refer to the related contents in the method of data management shown in FIG. 2, which will not be described here.
[0197] It should be noted that the numerical values shown in the above embodiments are only for illustration, and can also be other numerical values, which should not particularly limit the present application.
[0198] The above describes the data management method provided by the embodiments of the present application. The above data management method is mainly described from the perspective of the first device. It can be understood that the first device comprises a hardware structure and / or a software module for performing each function in order to implement the above functions.
[0199] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0200] It should be understood that in the above embodiments, if the first device is a terminal device or a network device, the terminal device or the network device can perform part or all of the steps in each embodiment. These steps or operations are only examples, and the embodiments of the present application can also perform other operations or variations of various operations. In addition, each step can be executed in a different order from that presented in each embodiment, and it is possible that not all operations in the embodiments of the present application are to be performed. Moreover, the size of the serial number of each step does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0201] In the following, the data management device provided by the embodiments of the present application is described in combination with FIG. 8 to FIG. 9. It should be understood that the description of the device embodiments corresponds to the description of the method embodiments, therefore, the content not described in detail can be referred to the above method embodiments, and part of the content will not be described again for the sake of brevity.
[0202] FIG. 8 shows a possible exemplary block diagram of the data management device involved in the embodiments of the present application. As shown in FIG. 8, the data management device 1100 can comprise modules or units for implementing the above method embodiments. In one possible implementation, the data management device 1100 comprises a processing unit 1110. Optionally, the data management device 1100 can further comprise a storage unit 1120 for storing device program code and / or data. Optionally, the data management device 1100 can further comprise a communication unit 1130 for receiving or sending signals.
[0203] The device 1100 for data management can be the first device in the above-mentioned embodiments, for example, the first device can be a terminal device or a network device. The device 1100 for data management can be configured to perform the actions performed by the first device in the above-mentioned method embodiments, and the processing unit 1110 is configured to perform the processing-related operations of the first device in the above-mentioned method embodiments.
[0204] For example, in one embodiment, when the device 1100 is configured to perform the operations related to the above-mentioned method for data management shown in FIG. 2, the processing unit 1110 is configured to: before writing the first target data into a first data block in a plurality of data blocks, detect whether the first data block is damaged; if the first data block is not damaged, write the first target data into the first data block; or, if the first data block is damaged, write the first target data into a second data block in the plurality of data blocks, the second data block is different from the first data block, and the second data block is not damaged.
[0205] Specifically, the processing unit 1110 can include a detection unit and a writing unit, wherein the detection unit is configured to: before writing the first target data into a first data block in a plurality of data blocks, detect whether the first data block is damaged; and the writing unit is configured to: if the first data block is not damaged, write the first target data into the first data block; or, if the first data block is damaged, write the first target data into a second data block in the plurality of data blocks, the second data block is different from the first data block, and the second data block is not damaged.
[0206] In another embodiment, when the device 1100 is configured to perform the operations related to the above-mentioned method for data management shown in FIG. 7, the processing unit 1110 is configured to: before reading the second target data from a third data block, detect whether the third data block is damaged, the third data block being a data block in a plurality of data blocks that stores data. If the third data block is not damaged, read the second target data from the third data block; or, if the third data block is damaged, obtain the second target data based on an error correction algorithm.
[0207] Specifically, the processing unit 1110 can include a detection unit, a reading unit and an obtaining unit, wherein the detection unit is configured to: before reading the second target data from a third data block, detect whether the third data block is damaged, the third data block being a data block in a plurality of data blocks that stores data. The reading unit is configured to: if the third data block is not damaged, read the second target data from the third data block. The obtaining unit is configured to: if the third data block is damaged, obtain the second target data based on an error correction algorithm.
[0208] For more detailed description of the processing unit 1110, please refer to the above-mentioned related description in the method embodiments, which will not be repeated here.
[0209] In a possible design, when the device 1100 for data management is a circuit or a chip in a first device, such as a Modem chip or a System on Chip (SoC) chip or a System in Package (SIP) chip including a Modem core, the processing unit 1110 can be implemented by circuitry including one or more processors or processor cores in the chip.
[0210] It can be understood that the division of units in the device is merely a logical division of functions, and each function can correspond to a functional unit, or two or more functions can be integrated into one functional unit. In actual implementation, all or part of the units can be integrated into one physical entity, or can be distributed on different physical entities. In addition, the functional units described above can be implemented in the form of hardware, software, or a combination of hardware and software. Whether a function is implemented in hardware or software depends on a specific application and design constraint condition of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0211] In one example, the functional units in any of the above apparatuses can be one or more integrated circuits configured to implement the above methods, for example, one or more application specific integrated circuits (ASICs), or one or more CPUs, one or more microcontroller units (MCUs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.
[0212] In one example, the storage unit 1120 can include random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, and / or registers, etc.
[0213] Referring to FIG. 9, FIG. 9 is a schematic diagram of another device 1200 for data management according to an embodiment of the present application. The device 1200 includes a processor 1210, and a memory 1220 coupled to the processor 1210, the memory 1220 being configured to store computer programs or instructions and / or data, and the processor 1210 being configured to execute the computer programs or instructions stored in the memory 1220, or read the data stored in the memory 1220, to perform the methods in the above method embodiments.
[0214] Optionally, the processor 1210 is one or more.
[0215] Optionally, the memory 1220 is one or more.
[0216] Optionally, the memory 1220 is integrated with the processor 1210, or is separately arranged.
[0217] Optionally, as shown in FIG. 9, the device 1200 further includes a transceiver 1230 for receiving and / or sending signals. For example, the processor 1210 is configured to control the transceiver 1230 to receive and / or send signals.
[0218] For example, the processor 1210 can have the functions of the processing unit 1110 shown in FIG. 8, the memory 1220 can have the functions of the storage unit 1120 shown in FIG. 8, and the transceiver 1230 can have the functions of the communication unit 1130 shown in FIG. 8.
[0219] As an example, the device 1200 is configured to implement operations performed by a communication apparatus in the various method embodiments.
[0220] For example, the processor 1210 is configured to execute computer programs or instructions stored in the memory 1220 to implement the related operations of the terminal device or the network device in the various method embodiments.
[0221] It should be understood that the processor mentioned in the embodiments of the present application can be a central processing unit, and can also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0222] It should also be understood that the memory referred to in the embodiments of the application can be a volatile memory and / or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an EPROM, an electrically EPROM (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM). For example, the RAM can be used as an external cache. As an example but not limitation, the RAM includes the following various forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
[0223] It should be noted that when the processor is a general processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated in the processor.
[0224] It should also be noted that the memory described herein is intended to include, but not limited to, these and any other suitable types of memory.
[0225] Referring to FIG. 10, FIG. 10 provides a schematic diagram of a chip system 1300 according to an embodiment of the application. The chip system 1300 (or also referred to as a processing system) includes a logic circuit 1310 and an input / output interface 1320.
[0226] Among them, the logic circuit 1310 can be a processing circuit in the chip system 1300. The logic circuit 1310 can be coupled to a storage unit, call instructions in the storage unit, so that the chip system 1300 can realize the method and function of each embodiment of the application. The input / output interface 1320 can be an input / output circuit in the chip system 1300, output the information processed by the chip system 1300, or input the data or signaling information to be processed into the chip system 1300 for processing.
[0227] Optionally, the logic circuit 1310 can be implemented by one or more processors, including the one or more processors or processing portions in the one or more processors.
[0228] Optionally, the input / output interface 1320 can include a transceiver, a transceiver, an input / output circuit or a communication interface.
[0229] As an option, the chip system 1300 is configured to implement operations performed by the first device in the various method embodiments described above.
[0230] For example, the logic circuit 1310 is configured to implement processing-related operations performed by the first device in the method embodiments described above.
[0231] The embodiments of the present application also provide a computer readable storage medium having stored thereon computer instructions for implementing the method performed by the first device in the various method embodiments described above.
[0232] For example, the computer program is executed by a computer, so that the computer can implement the method performed by the first device in the various method embodiments described above.
[0233] The embodiments of the present application also provide a computer program product comprising instructions, which, when executed by a computer, implement the method performed by the first device in the various method embodiments described above.
[0234] The embodiments of the present application also provide a system comprising the device in the various embodiments described above. For example, the system comprises the first device in the above-mentioned FIG. 2 or FIG. 7.
[0235] The explanations and beneficial effects of the related contents in any of the devices provided above can refer to the corresponding method embodiments provided above, and will not be repeated here.
[0236] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other means. For example, the apparatus embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0237] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. For example, the computer can be a personal computer, a server, a network device, or the like. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD), etc. For example, the foregoing available media includes but is not limited to: a variety of media that can store program codes such as a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, etc.
[0238] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data management method characterized by, The method is applied to a first device, and the method comprises: Before writing first target data into a first data block in a plurality of data blocks, detecting whether the first data block is damaged; If the first data block is not damaged, writing the first target data into the first data block; or, If the first data block is damaged, writing the first target data into a second data block in the plurality of data blocks, the second data block being different from the first data block and the second data block being undamaged.
2. The method of claim 1, wherein, The detection of whether the first data block is damaged comprises: Detecting whether the first data block is damaged by a preset error detection mode; The preset error detection mode comprises any one of the following: an information code error detection mode, a read-back check code error detection mode, and a pre-arranged code error detection mode.
3. The method of claim 2, wherein, If no data is stored in the first data block, the mode for detecting whether the first data block is damaged comprises the pre-arranged code error detection mode; or, If data is stored in the first data block, the mode for detecting whether the first data block is damaged comprises the information code error detection mode or the read-back check code error detection mode.
4. The method according to any one of claims 1 to 3, characterized in that, The plurality of data blocks comprise N data blocks arranged in sequence, the first data block being an Ith data block, I < N, I and N being integers greater than or equal to 1; Before the writing of the first target data into the second data block in the plurality of data blocks, the method further comprises: Selecting the second data block from the plurality of data blocks, the second data block being an (I+M)th data block or an (I-M)th data block, 1 ≤ M < I, or the second data block being an Nth data block.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: Before reading second target data from a third data block, detecting whether the third data block is damaged, the third data block being a data block in the plurality of data blocks that stores data; If the third data block is not damaged, reading the second target data from the third data block; or, If the third data block is damaged, obtaining the second target data based on an error correction algorithm.
6. The method of claim 5, wherein, In the case that the third data block is damaged, the method further comprises: Writing the second target data into a fourth data block in the plurality of data blocks, the fourth data block being different from the third data block and the fourth data block being undamaged; Reading the second target data from the fourth data block.
7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: When the first device is in an idle state, detecting whether the plurality of data blocks are damaged.
8. The method of claim 7, wherein, The method further comprises: In the process of detecting whether the plurality of data blocks are damaged, when the first device switches from the idle state to a non-idle state, stopping the detection of the plurality of data blocks.
9. The method according to any one of claims 1 to 8, characterized in that, The method further comprises: Determining whether hardware containing the first data block is damaged; If the hardware is damaged, adding the first data block to a first queue, data blocks in the first queue being unavailable; If the hardware is not damaged, adding the first data block to a second queue, data blocks in the second queue being available.
10. A method of data management, characterized by, The method is applied to a first device, and the method comprises: Before reading the second target data from a third data block, detecting whether the third data block is damaged, the third data block being a data block in the plurality of data blocks that stores data; If the third data block is not damaged, reading the second target data from the third data block; or, If the third data block is damaged, obtaining the second target data based on an error correction algorithm.
11. The method of claim 10, wherein, In the case that the third data block is damaged, the method further comprises: writing the second target data to a fourth data block in the plurality of data blocks, the fourth data block being different from the third data block and the fourth data block being undamaged; reading the second target data from the fourth data block.
12. The method according to claim 10 or 11, characterized in that, The detection of whether the third data block is damaged comprises: detecting whether the third data block is damaged by a preset error detection mode; wherein the preset error detection mode comprises any one of the following: an information coding error detection mode, a read-back check coding error detection mode.
13. The method according to any one of claims 10 to 12, characterized in that, The plurality of data blocks comprises N data blocks arranged in order, the third data block being a Jth data block, J < N, J and N being integers greater than or equal to 1; Before the writing of the second target data to the fourth data block in the plurality of data blocks, the method further comprises: selecting the fourth data block from the plurality of data blocks, the fourth data block being a (J+K)th data block or a (J-K)th data block, 1 ≤ K < J, or the fourth data block being an Nth data block.
14. The method according to any one of claims 10 to 13, characterized in that, The method further comprises: detecting whether the plurality of data blocks are damaged when the first device is in an idle state.
15. The method of claim 14, wherein, The method further comprises: in the process of detecting whether the plurality of data blocks are damaged, stopping the detection of the plurality of data blocks when the first device switches from the idle state to a non-idle state.
16. The method according to any one of claims 10 to 15, characterized in that, The method further comprises: determining whether hardware containing the third data block is damaged; if the hardware is damaged, adding the third data block to a first queue, data blocks in the first queue being unavailable; if the hardware is not damaged, adding the third data block to a second queue, data blocks in the second queue being available.
17. An apparatus for data management, the apparatus comprising: A module or unit for performing the method of any one of claims 1 to 9 or 10 to 16.
18. An apparatus for data management, the apparatus comprising: One or more processors for executing computer programs or instructions, so that the device performs the method of any one of claims 1 to 9 or 10 to 16.
19. A computer-readable storage medium, characterized in that, The storage medium has computer programs or instructions stored therein, when the computer programs or instructions are executed by a computer, the method of any one of claims 1 to 9 or 10 to 16 is implemented.
20. A computer program product, characterised in that, When the computer program product is read and executed by the computer, the computer executes the method of any one of claims 1 to 9 or 10 to 16.
Citation Information
Patent Citations
Disk bad block processing method based on soft RAID (redundant array of independent disks)
CN102508724A
Disk bad block processing method and device
CN111143116A
Data protection method, system and device and storage medium
CN116521433A
Method for processing damaged data of magnetic tape and computing device
CN117149062A
Bad block management method and device of NAND flash memory, storage medium and display equipment
CN118689713A