Storage space data reading and writing method, device, storage medium and program product

By setting the idle flag bits in the storage unit, the efficiency reduction caused by CPU intervention management in the read and write of data in the internal storage space of the chip is solved, and efficient data transmission without CPU intervention is achieved.

CN113282240BActive Publication Date: 2024-12-24SHENZHEN YINGHEZHIYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110568696.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2024-12-24
Estimated Expiration
2041-05-24

AI Technical Summary

Technical Problem

During the data reading and writing of the internal storage space of the chip, the CPU is required to intervene in the upper layer management, resulting in a decrease in the data throughput efficiency of the storage space.

Method used

By setting the idle bus flag bit in the storage unit, the write component writes the data and sets it to the write state, and after the read component detects it, it reads and restores the flag bit to the idle state, avoiding the CPU's intervention in management and improving data throughput efficiency.

Benefits of technology

It realizes that processing components access the storage space without CPU intervention management, saves the time and cost of CPU intervention management, and improves the data throughput efficiency of storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282240B_ABST
    Figure CN113282240B_ABST
Patent Text Reader

Abstract

The present application discloses a storage space data reading and writing method, device, storage medium and program product. The storage space includes a plurality of continuous storage units of a preset length, and each storage unit is provided with a corresponding idle busy flag to indicate that the data in the storage unit is in a write state or an idle state. The method includes: performing the following operations on each storage unit in turn until all storage units complete the read and write operations: after writing data to the storage unit by a writing component, setting the idle busy flag corresponding to the storage unit to a write state; detecting the write state by a reading component, and when a preset condition is met, all the data of the storage unit is read out, and the idle busy flag of the storage unit is restored to an idle state. The present application aims to solve the problem that the processing unit needs the CPU to intervene for upper-level management when accessing the storage space, thereby reducing the data throughput efficiency of the storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage space data reading and writing, and in particular to a storage space data reading and writing method, device, storage medium and program product. Background Art

[0002] The internal storage space of a chip is usually accessed by two or more processing components. Data is written into the storage space from one processing component and read out by another processing component. The access of the two processing components to the storage space usually requires the intervention of the CPU for upper-level management. Since the CPU needs to intervene for upper-level management, the data throughput efficiency of the storage space is reduced.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The embodiments of the present application provide a storage space data reading and writing method, device, storage medium and program product, aiming to solve the problem that the processing unit needs CPU intervention for upper-level management when accessing the storage space, thereby reducing the storage space data throughput efficiency.

[0005] The present application provides a method for reading and writing data in a storage space, wherein the storage space includes a plurality of continuous storage units of a preset length, each storage unit correspondingly being provided with an idle or busy flag bit for indicating that data in the storage unit is in a write state or an idle state, and the method includes:

[0006] Perform the following operations on each storage unit in turn until all storage units have completed the read and write operations:

[0007] After writing the data into the storage unit through the writing component, setting the idle and busy flag bit corresponding to the storage unit to a writing state;

[0008] When the write state is detected by the read component and a preset condition is reached, all the data of the storage unit are read out, and the idle / busy flag of the storage unit is restored to an idle state.

[0009] In some embodiments, the preset condition is: the writing component writes the data into the next storage unit, and sets the idle / busy flag corresponding to the next storage unit to a writing state.

[0010] In some embodiments, the readout component is provided with a waiting flag bit corresponding to each of the storage units, and the waiting flag bit is used to indicate that the storage unit is in an unwritten state or a waiting-to-read state; after the step of setting the idle-busy flag bit corresponding to the storage unit to a written state after writing data to the storage unit through the writing component, the step further includes:

[0011] The readout component sets the waiting flag corresponding to the storage unit to a waiting readout state.

[0012] In some embodiments, when the read component detects the write state and reaches a preset condition, after the step of reading out all the data of the storage unit and restoring the busy / idle flag of the storage unit to an idle state, the step further includes:

[0013] The readout component sets the waiting flag corresponding to the storage unit to the unwritten state.

[0014] In some embodiments, after the writing component writes the data into the storage unit, setting the idle / busy flag corresponding to the storage unit to a write state includes:

[0015] Writing data into the storage unit through the writing component, and checking the validity of the data;

[0016] If the data is valid, the busy / idle flag bit corresponding to the storage unit is set to a write state.

[0017] In some embodiments, verifying the validity of the data includes:

[0018] Parsing the data to obtain identity verification information, comparing the identity verification information with preset identity information, and verifying the validity of the data; or

[0019] Performing an XOR check on the data to check the validity of the data; or

[0020] A cyclic redundancy check is performed on the data to check the validity of the data.

[0021] The present application also proposes a storage space data reading and writing device, which includes a processor, a memory electrically connected to the processor, and a storage space data reading and writing program stored in the memory and runnable on the processor; when the storage space data reading and writing program is executed by the processor, the steps of the storage space data reading and writing method as described are implemented.

[0022] The present application also proposes a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the storage space data reading and writing method as described.

[0023] The present application also proposes a computer program product, including a computer program, which implements the steps of the storage space data reading and writing method when executed by a processor.

[0024] The present application sets a busy or idle flag in the storage unit to indicate that the data in the storage unit is in a write state or an idle state, so that the write component sets the busy or idle flag to the write state after writing the data into the storage unit, and the read component reads the data of the storage unit in time after detecting the write state, and then the read component restores the busy or idle flag to the idle state. This embodiment sets the busy or idle flag as a flag for judging whether the storage unit is busy or idle, so that the processing component accesses the storage space without the CPU intervening for upper-level management, thereby saving the time cost of CPU intervention management and improving the data throughput efficiency of the storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A hardware framework diagram of an embodiment of a storage space data reading and writing device of the present application;

[0026] Figure 2 A flowchart of an embodiment of a storage space data reading and writing method of the present application;

[0027] Figure 3 A flowchart of another embodiment of the storage space data reading and writing method of the present application;

[0028] Figure 4 A flowchart of another embodiment of the storage space data reading and writing method of the present application;

[0029] Figure 5 A flowchart of another embodiment of the storage space data reading and writing method of the present application;

[0030] Figure 6 This is a flowchart of another embodiment of the storage space data reading and writing method of the present application. DETAILED DESCRIPTION

[0031] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0032] The internal storage space of a chip is usually accessed by two or more processing components. Data is written into the storage space from one processing component and read out by another processing component. The access of the two processing components to the storage space usually requires the intervention of the CPU for upper-level management. Since the CPU needs to intervene for upper-level management, the data throughput efficiency of the storage space is reduced.

[0033] Therefore, it is currently necessary to solve the problem that the CPU needs to intervene to perform upper-level management when the processing unit accesses the storage space, which reduces the data throughput efficiency of the storage space. In view of this, the present application proposes a storage space data reading and writing method, device, storage medium and program product.

[0034] Please refer to Figure 1 , the following introduces a storage space data reading and writing device, which may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0035] Those skilled in the art will understand that Figure 1 The storage space data reading and writing device structure shown in the figure does not constitute a limitation on the storage space data reading and writing device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0036] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a storage space data reading and writing program. The operating system is a program that manages and controls the hardware and software resources of the storage space data reading and writing device, and supports the operation of the storage space data reading and writing program and other software or programs.

[0037] exist Figure 1 In the storage space data reading and writing device shown, the network interface 1004 is mainly used for the background server to communicate data with the background server; the processor 1001 can be used to call the storage space data reading and writing program stored in the memory 1005, and execute the steps of the storage space data reading and writing method as described above.

[0038] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including:

[0039] Perform the following operations on each storage unit in turn until all storage units have completed the read and write operations:

[0040] After writing the data into the storage unit through the writing component, setting the idle and busy flag bit corresponding to the storage unit to a writing state;

[0041] When the write state is detected by the read component and a preset condition is reached, all the data of the storage unit are read out, and the idle / busy flag of the storage unit is restored to an idle state.

[0042] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including:

[0043] The preset condition is that the writing component writes data into the next storage unit and sets the idle / busy flag corresponding to the next storage unit to a writing state.

[0044] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including:

[0045] The readout component is provided with a waiting flag bit corresponding to each of the storage units, and the waiting flag bit is used to indicate that the storage unit is in an unwritten state or a waiting read state; after the step of setting the idle busy flag bit corresponding to the storage unit to a written state after the data is written to the storage unit by the writing component, the step further includes:

[0046] The readout component sets the waiting flag corresponding to the storage unit to a waiting readout state.

[0047] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including:

[0048] After the step of detecting the write state through the reading component and reaching a preset condition, reading all the data of the storage unit and restoring the idle and busy flag of the storage unit to an idle state, the method further includes:

[0049] The readout component sets the waiting flag corresponding to the storage unit to an unwritten state.

[0050] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including:

[0051] After the data is written into the storage unit by the writing component, the idle / busy flag bit corresponding to the storage unit is set to a writing state, including:

[0052] Writing data into the storage unit through the writing component, and checking the validity of the data;

[0053] If the data is valid, the busy / idle flag bit corresponding to the storage unit is set to a write state.

[0054] In one embodiment, the processor 1001 may be used to call a storage space data reading and writing program stored in the memory 1005, and execute the method including: the checking the validity of the data includes:

[0055] Parsing the data to obtain identity verification information, comparing the identity verification information with preset identity information, and verifying the validity of the data; or

[0056] Performing an XOR check on the data to check the validity of the data; or

[0057] A cyclic redundancy check is performed on the data to check the validity of the data.

[0058] The storage space data reading and writing device of the present application sets a busy and idle flag in the storage unit to indicate that the data in the storage unit is in a write state or an idle state, so that the writing component sets the busy and idle flag to the write state after writing the data into the storage unit, and the reading component reads the data of the storage unit in time after detecting the write state, and then the reading component restores the busy and idle flag to the idle state. The storage space data reading and writing device improves the storage space data throughput efficiency by setting the busy and idle flag as a flag for judging whether the storage unit is busy or idle.

[0059] Please refer to Figure 2 Based on the hardware architecture of the storage space data reading and writing device, the following is an embodiment of the storage space data reading and writing method of the present application. The storage space includes multiple continuous storage units of a preset length, and each storage unit is provided with a corresponding busy or idle flag to indicate that the data in the storage unit is in a writing state or an idle state.

[0060] It should be noted that the storage space is used to store data. The storage space is in units of a certain fixed length. For example, it can be 512MB, 1T, etc. In this embodiment, the storage space is divided into a plurality of continuous storage units of preset lengths. It is understandable that the preset length here can be set according to actual conditions, for example, it can be flexibly set to 512Byte, 1024Byte, etc. It should be understood that the specific values ​​of the storage units listed above are only for those skilled in the art to better understand the technical solution of the present application, and should not be understood as a specific limitation on the length of the storage units of the present application.

[0061] Busy / idle flag: In this embodiment, each storage unit is provided with a corresponding busy / idle flag. The busy / idle flag is used to indicate that the data in the storage unit is in a write state or an idle state. The busy / idle flag can be set at the beginning, end or other position of the storage unit. The specific position of the busy / idle flag in the storage unit is not limited here.

[0062] In some embodiments, the busy / idle flag bit can be set to 1, which indicates that the data in this storage unit has been written by the write processing component and can be read by the read processing component. Conversely, the busy / idle flag bit can be set to 0.

[0063] It is understandable that in other embodiments, a multi-bit binary number can be set to indicate the write state or idle state. For example, a two-bit binary number can be used to indicate that the storage unit is in the write state or idle state. 01 indicates that the data in this storage unit has been written by the write processing component and can be read by the read processing component. On the contrary, the idle and busy flag bit can be set to 10, which indicates that this storage unit is idle and data can be written to this storage unit. Of course, the write state or idle state of the idle and busy flag bit can also be set by using a binary number with more bits.

[0064] The storage space data reading and writing method comprises the following steps:

[0065] Perform the following operations on each storage unit in turn until all storage units have completed the read and write operations:

[0066] S100, after writing data into the storage unit through the writing component, setting the idle busy flag bit corresponding to the storage unit to a writing state;

[0067] It should be noted that the writing component (also called the writing processing component) of the present application is responsible for writing data to the storage space. The reading component (also called the reading processing component) of the present application is responsible for reading data from the storage space. The writing component and the reading component can be various components that can realize writing data to the storage space and reading data from the storage space.

[0068] After the writing component writes the data into the storage unit, by setting the idle and busy flag corresponding to the storage unit to the writing state (for example, setting the idle and busy flag to 1), the idle and busy state of the storage unit can be promptly indicated, so that the reading component can promptly know the idle and busy state of the storage unit, and the reading component can promptly read the data of the storage unit, so as to improve the data throughput efficiency of the storage space.

[0069] S200, when the write state is detected by the read component and a preset condition is reached, all the data of the storage unit are read out, and the idle / busy flag of the storage unit is restored to an idle state.

[0070] The readout component detects the write state, indicating that the storage unit corresponding to the write state is in a data write state. After the preset condition is met, the readout component can read out all the data of the storage unit corresponding to the write state, thereby completing the writing and reading of a storage unit.

[0071] It should be noted that after the readout component reads the data of the storage unit, the busy / idle flag of the storage unit is restored to the idle state, so as to display the idle state in the storage unit in time and prevent the readout component from mistakenly reading a storage unit with no written data.

[0072] It is worth mentioning that in order to further improve the data throughput efficiency of storage space. Please refer to Figure 3 , the preset condition can be set as the writing component writing data into the next storage unit, and setting the busy / idle flag corresponding to the next storage unit to the writing state. That is, after the next storage unit completes writing data, the reading component reads the data of the previous storage unit. After the writing component completes writing data to the next storage unit, the reading component reads the data of the previous unit. Such alternating operation can realize the access of the storage space by the processing component without the intervention of the CPU (i.e., central processing unit), and the upper-level management without the intervention of the CPU, which saves the time cost of CPU intervention management and improves the data throughput efficiency of the storage space.

[0073] The following is an explanation using a typical embodiment. For example, there are storage unit 0, storage unit 1, storage unit 2, storage unit 3, ...

[0074] During the time from T0 to T1: the writing component writes data to storage unit 0, and after the data of storage unit 0 is fully written, the idle and busy flag is set to 1.

[0075] During the time period from T1 to T2: the write component writes data to storage unit 1, and after storage unit 1 is fully written, the busy / idle flag is set to 1. The read component reads data from storage unit 0, and after all the data in storage unit 0 is read, the busy / idle flag is cleared to 0.

[0076] During the time period from T2 to T3: the write component writes data to storage unit 2, and after storage unit 2 is fully written, the busy and idle flag is set to 1. The read processing component reads data from storage unit 1, and after all the data in storage unit 1 is read, the busy and idle flag is cleared to 0.

[0077] And so on, the read and write operations of the remaining storage units in the storage space are completed.

[0078] It should be noted that there are two situations that affect the data reading and writing speed: one is that the writing component is slower than the reading component; the other is that the writing component is faster than the reading component. The specific data reading and writing speed depends on the processing component with the slower processing speed.

[0079] This embodiment sets a busy or idle flag in the storage unit to indicate that the data in the storage unit is in a write state or an idle state, so that the write component sets the busy or idle flag to the write state after writing the data into the storage unit, and the read component reads the data of the storage unit in time after detecting the write state, and then the read component restores the busy or idle flag to the idle state. This embodiment sets the busy or idle flag as a flag for judging whether the storage unit is busy or idle, so that the processing component accesses the storage space without the CPU intervening for upper-level management, thereby saving the time cost of CPU intervention management and improving the data throughput efficiency of the storage space.

[0080] Based on the same invention concept, please refer to Figure 4 , the present application also proposes a second embodiment, which is based on the first embodiment.

[0081] Embodiment 2

[0082] The readout component is provided with a waiting flag bit corresponding to each of the storage units, and the waiting flag bit is used to indicate that the storage unit is in an unwritten state or a waiting readout state;

[0083] The storage space data reading and writing method of this embodiment includes:

[0084] S100, after writing data into the storage unit through the writing component, setting the idle busy flag bit corresponding to the storage unit to a writing state;

[0085] S300, setting the waiting flag corresponding to the storage unit to a waiting read state by the reading component;

[0086] S200, when the write state is detected by the read component and a preset condition is reached, all the data of the storage unit are read out, and the idle / busy flag of the storage unit is restored to an idle state.

[0087] The following is an explanation using a typical embodiment. For example, there are storage unit 0, storage unit 1, storage unit 2, storage unit 3, ...

[0088] During the time period from T0 to T1: the write component writes data to storage unit 0, and after the storage unit 0 is fully written, the busy flag is set to 1. The waiting flag of the read component is 1 (i.e., waiting for readout), i.e., waiting for valid data.

[0089] During the time period from T1 to T2: the write component writes data to storage unit 1, and after the data in storage unit 1 is fully written, the busy and idle flag is set to 1. The read component reads data from storage unit 0, and after all the data in storage unit 0 is read, the busy and idle flag is cleared to 0, and the wait flag of storage unit 1 is set to 1, that is, waiting for valid data from storage unit 1.

[0090] During the time period from T2 to T3: the write component writes data to storage unit 2, and after the data in storage unit 2 is fully written, the busy and idle flag is set to 1. The read processing component reads data from storage unit 1, and after all the data in storage unit 1 is read, the busy and idle flag is cleared to 0, and the waiting flag of storage unit 2 is set to 1, that is, waiting for valid data from storage unit 2.

[0091] And so on, the read and write operations of the remaining storage units in the storage space are completed.

[0092] By providing the readout component with a waiting flag corresponding to each of the storage units, the readout component can read the data of the storage units one by one, thereby improving the orderliness of the readout component in reading the stored data, thereby improving the data throughput efficiency of the storage space.

[0093] Please refer to Figure 5 In some embodiments, after step S200, the following steps are further included:

[0094] S400, setting the waiting flag corresponding to the storage unit to an unwritten state through the reading component.

[0095] After the readout component reads out the storage unit, the readout component sets the waiting flag corresponding to the storage unit to an unwritten state. For example, after the readout component reads out data from storage unit 0, the waiting flag corresponding to storage unit 0 is set from 1 to 0 (i.e., an unwritten state). This prevents the readout component from mistakenly reading data from the storage unit that has just read data. This improves the orderliness of the readout component in reading stored data and improves the data throughput efficiency of the storage space.

[0096] Based on the same invention concept, please refer to Figure 6 , the present application also proposes a third embodiment, which is based on the first embodiment.

[0097] Embodiment 3

[0098] Step S100 specifically includes:

[0099] S110, writing data into the storage unit through the writing component, and checking the validity of the data;

[0100] S120: If the data is valid, the idle / busy flag corresponding to the storage unit is set to a write state.

[0101] It can be understood that after the writing component writes the data into the storage unit, the validity of the data is first checked. If the data is valid, the idle and busy flag corresponding to the storage unit is set to the write state to avoid non-target data, garbled data or erroneous data from being input into the storage unit, thereby improving the accuracy of the data stored in the storage space.

[0102] Specifically, checking the validity of the data can be achieved in any of the following ways.

[0103] In some embodiments, the data is parsed to obtain identity verification information, and the identity verification information is compared with preset identity information to verify the validity of the data.

[0104] The data usually carries identity verification information indicating the type of data. The identity verification information can be various numbers, English letters, characters, or a combination of at least two of them. And the identity verification information is often a specific position in the data, and the identity verification information can be obtained by parsing the specific position in the data. By comparing the parsed identity verification information with the preset identity information, if the two match, it means that the data written by the writing component is valid.

[0105] In some other embodiments, the data is XOR-checked to check the validity of the data. Specifically, a byte at a specific position in the data is XOR-ed in sequence to finally obtain a check code, and the check code is compared with a preset check code. If they are the same, it means that there is no communication error in the data in the storage unit during communication and the data is valid; if they are different, it means that there is a communication error in the data in the storage unit during communication and the data is invalid.

[0106] In some other embodiments, a cyclic redundancy check may be performed on the data to check the validity of the data. It is worth mentioning that the validity of the data in the storage unit may also be checked by LRC check method, Gray code check method, and sum check method.

[0107] The present application also proposes a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the storage space data reading and writing method.

[0108] The present invention also proposes a computer program product, including a computer program, which, when executed by a processor, implements the steps of the storage space data reading and writing method as described above. The various embodiments of the storage space data reading and writing device, computer-readable storage medium and computer program product of the present invention can all refer to the various embodiments of the storage space data reading and writing method of the present invention, and will not be described again here.

[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0113] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present application may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.

[0114] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0115] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for reading and writing storage space data, characterized in that: The storage space includes a plurality of continuous storage units of a preset length, each storage unit is correspondingly provided with an idle / busy flag bit for indicating that the data in the storage unit is in a write state or an idle state, and the method includes: Perform the following operations on each storage unit in turn until all storage units have completed the read and write operations: Writing data into the storage unit through a writing component, and setting the idle and busy flag corresponding to the storage unit to a writing state; When the write state is detected by the read component and a preset condition is reached, the data of the storage unit is read out, and the busy / idle flag of the storage unit is restored to an idle state, wherein the preset condition is within the read time; The readout component is provided with a waiting flag bit corresponding to each of the storage units, and the waiting flag bit is used to indicate that the storage unit is in an unwritten state or a waiting readout state. After the step of setting the idle busy flag bit corresponding to the storage unit to a written state after the data is written into the storage unit by the writing component, the step further includes: Setting the waiting flag corresponding to the storage unit to the waiting reading state by the reading component; After the step of detecting the write state through the reading component and reaching a preset condition, reading all the data of the storage unit and restoring the idle and busy flag of the storage unit to an idle state, the method further includes: Setting the waiting flag corresponding to the storage unit to the unwritten state by the reading component; After the data is written into the storage unit by the writing component, the idle / busy flag bit corresponding to the storage unit is set to a writing state, including: Writing data into the storage unit through the writing component, and checking the validity of the data; If the data is valid, the busy / idle flag bit corresponding to the storage unit is set to a write state.

2. The method according to claim 1, characterized in that The method further comprises: when a preset condition is met, writing the data into a next storage unit through the writing component, and setting the idle / busy flag corresponding to the next storage unit to a writing state.

3. The method according to claim 1, characterized in that The checking the validity of the data comprises: Parsing the data to obtain identity verification information, comparing the identity verification information with preset identity information, and verifying the validity of the data; or Performing an XOR check on the data to check the validity of the data; or A cyclic redundancy check is performed on the data to check the validity of the data.

4. A storage space data reading and writing device, characterized in that: The device includes a processor, a memory electrically connected to the processor, and a storage space data reading and writing program stored in the memory and executable on the processor; when the storage space data reading and writing program is executed by the processor, the steps of the storage space data reading and writing method as described in any one of claims 1 to 3 are implemented.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the storage space data reading and writing method as described in any one of claims 1 to 3.

6. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the steps of the storage space data reading and writing method described in any one of claims 1-3.