A storage space operation method, device and electronic equipment

By generating and saving recording formulas for storage space, the problem of long storage space initialization time is solved, a fast response and efficient initialization process is achieved, and the user experience is optimized.

CN118626022BActive Publication Date: 2024-11-26SMARTER SILICON (SHANGHAI) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411074531.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-26
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

In the electronic product design stage, the initialization process of storage space takes a long time, affecting the user experience, especially when the storage space is large, traditional methods require real writing of data in the entire address space, resulting in too long waiting time.

Method used

By generating and saving record formulas for the target storage space without actually writing data in the storage space, these formulas are used to calculate initialization data when needed, simplifying the initialization process and reducing waiting time.

Benefits of technology

The waiting time for initialization of storage space is significantly shortened, for example, the initialization time of 1TB of storage space is shortened from several days to several minutes, improving the user experience without affecting subsequent read and write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626022B_ABST
    Figure CN118626022B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and electronic device for operating a storage space, and relates to an initialization technology. The method comprises: obtaining an initialization instruction for a target storage space, wherein the initialization instruction comprises an initialization style and an address range; based on the initialization style, generating a corresponding recording formula and saving it in a specified storage queue, and determining the initialization data corresponding to the address range based on the recording formula; and returning an initialization completion instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to initialization technology, and more specifically, to a storage space operation method, device and electronic device. Background Art

[0002] During the design and application phase of electronic products, the storage space is often initialized. If the storage space is large, the initialization process will take up a lot of time, affecting the user experience. Summary of the invention

[0003] In view of this, this application provides the following technical solutions:

[0004] In a first aspect, the present application provides a method for operating a storage space, the method comprising:

[0005] Obtaining an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range;

[0006] Based on the initialization pattern, a corresponding recording formula is generated and saved in a designated storage queue, and initialization data corresponding to the address range can be determined based on the recording formula;

[0007] Returns the initialization completion instruction.

[0008] In a possible implementation, the initialization instruction also includes setting data, and the generating of the corresponding recording formula based on the initialization pattern includes:

[0009] A recording formula corresponding to the address range is generated based on the initialization pattern and the setting data.

[0010] In a possible implementation, the generating of the record formula corresponding to the address range based on the initialization pattern and the setting data includes any one of the following:

[0011] The initialization style is a first style, and a corresponding first recording formula is generated based on the first style, wherein the first recording formula indicates that all the initialization data to be written within the address range are the setting data;

[0012] The initialization style is a second style, and a corresponding second recording formula is generated based on the second style and the setting data, wherein the second recording formula indicates that the initialization data to be written corresponding to each address within the address range is random data;

[0013] The initialization style is a third style. A corresponding third recording formula is generated based on the third style and the setting data. The third recording formula represents that the initialization data to be written within the address range changes along the address according to a preset rule.

[0014] In a possible implementation, the recorded formula corresponding to the initialization style is a system function or a set formula, and the set formula is a formula set by the user based on initialization requirements.

[0015] In a possible implementation, after returning the initialization completion instruction, the method further includes:

[0016] receiving a data writing instruction, wherein the data writing instruction includes data to be written and a writing address range;

[0017] The data to be written is written into the write address range, and a write flag corresponding to the address range is set to a first state, wherein the first state indicates that data has been written into the corresponding address range.

[0018] In a possible implementation, after returning the initialization completion instruction, the method further includes:

[0019] Obtaining a data read instruction, wherein the data read instruction includes a read address range;

[0020] If the write flag bit corresponding to the read address range is in the first state, the data stored in the read address range is read and returned, and the first state indicates that the corresponding address range has been written with data;

[0021] If the write flag corresponding to the read address range is in the second state, the initialization data of the read address range is determined based on the record formula corresponding to the read address range and the initialization data is returned, and the second state indicates that no data is written to the corresponding address range.

[0022] In a possible implementation, after determining the initialization data of the read address range based on the record formula corresponding to the read address range and returning the initialization data, the method further includes:

[0023] If the initialization data is determined based on a recording formula of the second style, the initialization data is written into the read address range, and the write flag corresponding to the read address range is set to a first state, wherein the first state indicates that data has been written into the corresponding address range.

[0024] In a possible implementation, if there are multiple recording formulas for the same address range in the designated storage queue, the priority of each recording formula is configured according to the order of their saving time. The later the saving time, the higher the priority of the recording formula. The priority is used to determine the recording formula for initializing data.

[0025] A second aspect of the present application provides a storage space operation device, including:

[0026] An instruction acquisition module, used to obtain an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range;

[0027] A formula determination module, used to generate a corresponding record formula based on the initialization pattern and save it in a specified storage queue, and to determine the initialization data corresponding to the address range based on the record formula;

[0028] The instruction return module is used to return the initialization completion instruction.

[0029] In a possible implementation, the instruction obtaining module is further used to: obtain a data reading instruction, wherein the data reading instruction includes a reading address range;

[0030] The device also includes:

[0031] A read operation processing module, used for reading and returning the data stored in the read address range when the write flag bit corresponding to the read address range is in a first state, the first state representing that the corresponding address range has written data; and for determining the initialization data of the read address range based on a record formula corresponding to the read address range and returning the initialization data when the write flag bit corresponding to the read address range is in a second state, the second state representing that the corresponding address range has no written data.

[0032] A third aspect of the present application provides an electronic device, including a processor and a memory, wherein:

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute the computer program so that the electronic device can implement any of the above-mentioned storage space operation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0036] Figure 1 A flowchart of a storage space operation method disclosed in an embodiment of the present application;

[0037] Figure 2 A pseudo code example diagram for initializing the target storage space disclosed in an embodiment of the present application;

[0038] Figure 3 A flowchart of a data writing operation disclosed in an embodiment of the present application;

[0039] Figure 4 A flowchart of a data reading operation disclosed in an embodiment of the present application;

[0040] Figure 5 A schematic diagram of the architecture for interconnecting the DUT and VIP to realize digital verification disclosed in the embodiment of the present application;

[0041] Figure 6 A schematic diagram of a flow chart of a method for operating a storage space disclosed in an embodiment of the present application;

[0042] Figure 7 A schematic diagram of the structure of a storage space operating device disclosed in an embodiment of the present application;

[0043] Figure 8 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0044] For the purpose of reference and clarity, the descriptions, abbreviations or acronyms of the technical terms used below are summarized as follows:

[0045] DUT: design under test. In the field of electronic design, DUT usually refers to the chip, circuit board or system to be tested. It is the object that needs to be verified or tested during the entire verification or testing process, and the stability of its performance and functions directly affects the quality and reliability of the final product.

[0046] VIP: verification IP, that is, verification IP. VIP is a virtual entity that can achieve the same functions as the corresponding DUT.

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The embodiments of the present application can be applied to the verification of chips, circuit boards or systems in the design stage of electronic products, and can also be applied to electronic devices put into use. The present application does not limit the product form of the electronic equipment, which can include but is not limited to smart phones, tablet computers, wearable devices, personal computers (PCs), netbooks, etc., and can be selected according to application requirements.

[0049] Figure 1 This is a flowchart of a storage space operation method disclosed in an embodiment of the present application. Figure 1 As shown, the storage space operation method may include:

[0050] Step 101: Obtain an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range.

[0051] Among them, the target storage space can be an independent memory used for digital verification related to data reading and writing functions during the electronic product design stage, or it can be an internal memory or main memory in a finished electronic device, or it can be other memories that need to meet initialization requirements. The present application does not have fixed restrictions on this. All storage structures that support Ram (Random Access Memory) reading and writing can be the main body of the target storage space described in the embodiments of the present application.

[0052] The initialization instruction may be an instruction issued during the electronic product design verification phase to meet relevant functional verification, or it may be an initialization instruction issued when starting a system or application in other scenarios. The initialization instruction carries an initialization style and an address range, wherein the initialization style can determine what kind of initialization method is required to initialize the address range, that is, what kind of initialization data needs to be written within the address range. There are many types of initialization styles, such as fixed values, segmented fixed values, random values, and initialization data that changes along the address according to a preset rule.

[0053] Step 102: Based on the initialization pattern, a corresponding recording formula is generated and saved in a designated storage queue. Based on the recording formula, initialization data corresponding to the address range can be determined.

[0054] After obtaining the initialization instruction, the initialization style for at least part of the address range of the target storage space is determined, and then the recording formula for the corresponding address range can be determined based on the initialization style, and the recording formula is a formula for calculating the initialization data of the address range. After the recording formula is generated, it will be saved in the specified storage queue, so that when the initialization data of a certain address range needs to be determined later, the corresponding recording formula can be called from the specified storage queue, the initialization data can be calculated and returned.

[0055] Step 103: Return the initialization completion instruction.

[0056] In the present application, after all address ranges of the target storage space have generated corresponding record formulas and saved them, the initialization of the target storage space is considered to have been completed, and an initialization completion instruction is returned. It should be noted that in the initialization scheme of the embodiment of the present application, no initialization data is actually written into the address range of the target storage space, but only one or more record formulas of the address range of the target storage space are saved. When there is an access instruction for a certain address range of the target storage space in the future, the record formula corresponding to the address range will be called out from the specified storage queue to calculate the corresponding initialization data and return it.

[0057] In actual situations, according to the traditional initialization method (actually writing initialization data in the storage space), the waiting time for initializing a 1G continuous address space is 10 minutes. If the address space is larger, such as a 1TB storage space, the waiting time for the traditional initialization operation is about 1 day, which is obviously unacceptable for work tasks with high efficiency requirements. The storage space operation method described in the present application only generates and saves some record formulas for the target storage space when the target storage space needs to be initialized. There is no need to actually write initialization data in the target storage space. For a 1G storage space, it may only take a few seconds to return the initialization completion instruction, and for a 1TB storage space, it may only take a few minutes to return the initialization completion instruction. Therefore, it can greatly shorten the time users wait for initialization to complete.

[0058] That is, the present application scheme uses the method of recording formulas to virtually write addresses in the target storage space. When the data in the target storage space needs to be read later, the recorded formula is used to calculate and return the initialization data of the corresponding address. Although the initialization scheme described in the present application scheme does not actually write data in the storage space, the initialization data is calculated and returned by the recorded formula when reading the data, but these processes are imperceptible to the user, and the user will think that the target storage space has actually performed data initialization operations; at the same time, because the initialization process only generates and saves some recorded formulas, it can quickly respond to initialization instructions.

[0059] In the operation method of the storage space in this embodiment, when initializing the target storage space, the initialization data is not actually written into the target storage space. Only after generating and saving the record formula of the target storage space, the initialization instruction requester is "informed" that the initialization of the target storage space is completed, thereby eliminating the instruction operation time of traversing and writing data in the address space, greatly reducing the initialization waiting time, and at the same time not affecting the subsequent read and write operations on the target storage space, optimizing the user experience.

[0060] In the above embodiment, the initialization instruction further includes set data. Generating the corresponding record formula based on the initialization style may specifically include: generating the record formula corresponding to the address range based on the initialization style and the set data. Wherein, the set data may be a fixed value in the record formula.

[0061] In one implementation, the initialization style is the first style, and the corresponding first record formula is generated based on the first style. The first record formula represents that all the initialization data to be written in the address range is the set data.

[0062] The first style may be a fixed value style, that is, the initialization data in the corresponding address range is set to the same value. For example, the record formula is Y = 10, and the corresponding address range is 0 - 1000, then the initialization data in the address range of address 1 - 1000 is 10. In some implementations, segmented fixed value design can also be performed on the target storage space. For example, the record formula for the address range of 0 - 1000 is Y = 10, the record formula for the address range of 1000 - 2000 is Y = 5, and the record formula for the address range of 2000 - 3000 is Y = 23. The record formula of the fixed value style can be expressed in computer language as Y = FIXED_value; (init startaddr0 < X < init end addr0); where Y = FIXED_value represents a formula with a fixed value, and the content in the parentheses represents the address range corresponding to this record formula, that is, X represents the input space address, and Y represents the initialization data of this space address.

[0063] In another implementation, the initialization style is the second style, and the corresponding second record formula is generated based on the second style and the set data. The second record formula represents that the initialization data to be written corresponding to each address in the address range is random data.

[0064] In this implementation, the set data can be the seed data in the second recording formula. The random value obtained by combining the seed value with the set formula is the initialization data within the corresponding address range. In one example, an exemplary formula of the second recording formula in a computer language is expressed as Y = Seed * (1 + X) + X + 32’h12345678 * X[1:0]. This formula represents an arithmetic expression for circular shift and median value taking, (RAND: init start addr1 < X < init end addr1); where seed is the seed data, X represents the input spatial address, and RAND represents the random number.

[0065] In another implementation, the initialization style is the third style. Based on the third style and the set data, a corresponding third recording formula is generated. The third recording formula characterizes that the initialization data to be written within the address range changes along the address according to a preset rule.

[0066] The third recording formula corresponding to the third style can be a formula that makes the initialization data increase or decrease with the address. In one example, an exemplary representation of the second recording formula in a computer language is Y = INCRinit - 1 + X – init_start_addr2 (init start addr2 < X < init end addr2); this formula is a formula characterizing that the initialization data decreases with the address.

[0067] Of course, the above content only introduces several implementations of the initialization style and does not constitute a fixed limitation on the initialization style. In actual applications, other initialization styles can also be configured to meet different requirements in different application scenarios.

[0068] Combined with the above content, Figure 2 is a pseudo-code example diagram for initializing the target storage space disclosed in the embodiments of this application, which can be combined with Figure 2 the content of the shown pseudo-code to understand the implementation of each of the above initialization styles.

[0069] In the content of the foregoing embodiments, the recording formula corresponding to the initialization style can be a system function or a set formula, and the set formula is a formula set by the user based on the initialization requirements. That is to say, the formula corresponding to the initialization style can be set manually based on requirements, or can be automatically generated by calling a system function. In different application scenarios, which formula determination method can be selected based on the actual situation to determine the final recording formula.

[0070] For the recording formula corresponding to the random style, it should preferably meet the following requirements:

[0071] a. Ensure that the same seed data can calculate the same initialization data result;

[0072] b. The random results are as dispersed and average as possible;

[0073] c. Run as few operating instructions as possible.

[0074] Based on the above requirements, user-set formulas or system functions can be used to determine the random formula of the random style. The user-set formula has the advantage of being able to meet the above requirements a and c, but the disadvantage is that it may not be able to meet requirement b very well; in addition, for repeated access to the corresponding address, the corresponding set formula also needs to be re-read and calculated. The system function has the advantage of being able to meet requirements a and b very well, but the disadvantage is that for requirement c, the system function will take up too many operation instructions; in addition, since data will actually be written to the corresponding address, the memory will increase accordingly; but the benefit is that the next access to the same address does not require running the formula again.

[0075] The above content introduces in detail the specific implementation content of the recording formulas of different initialization styles, which is convenient for technical personnel in the field to better understand and implement the technical solution of this application.

[0076] In the above-mentioned embodiment, after the return initialization completion instruction, other steps may be included. For example, after the return initialization completion instruction, a data writing operation is performed, and the corresponding steps are as follows: Figure 3 As shown. Combined Figure 3 , the steps of the data writing operation may include:

[0077] Step 301: Receive a data write instruction, where the data write instruction includes data to be written and a write address range.

[0078] Among them, the data write instruction can be an instruction to write the initialization data calculated based on the record formula into the corresponding address range, and the data to be written at this time is the initialization data calculated based on the record formula; or, the data write instruction can also be an instruction received from a certain node to write data within a certain address range, and the data to be written at this time is the data given by the node that issues the data write instruction.

[0079] Step 302: Write the data to be written into the write address range, and set the write flag corresponding to the address range to a first state, wherein the first state indicates that the data has been written into the corresponding address range.

[0080] Each address in the target storage space has a corresponding write flag, which is used to indicate whether data is stored at the corresponding address. When the write flag is in the first state, it indicates that data has been stored at the corresponding address; when the write flag is in the second state, it indicates that the data at the corresponding address is empty, that is, no data has been written.

[0081] After the data to be written is written into the write address range, real data exists in the address range, and the write flag bit of the address range can be set to the first state.

[0082] After the return initialization completion instruction, a data reading operation may also be included. The process of the data reading operation can be found in Figure 4 . Combined Figure 4 As shown, the data reading operation may include:

[0083] Step 401 : Obtain a data read instruction, wherein the data read instruction includes a read address range, and proceed to step 402 or step 403 .

[0084] The data read instruction may be an instruction issued by a node having access rights to the target storage space, and the read address range in the data read instruction is an address range in the target storage space.

[0085] Step 402: If the write flag corresponding to the read address range is in a first state, read the data stored in the read address range and return, wherein the first state indicates that data has been written into the corresponding address range.

[0086] If the write flag corresponding to the read address range is in the first state, indicating that real data has been stored in the read address range, the real data stored in the address range can be directly read and returned.

[0087] Step 403: If the write flag corresponding to the read address range is in the second state, determine the initialization data of the read address range based on the record formula corresponding to the read address range and return the initialization data, and the second state indicates that there is no written data in the corresponding address range.

[0088] If the write flag corresponding to the read address range is in the second state, indicating that no actual data is stored in the read address range and only the corresponding record formula is saved, the record formula corresponding to the read address range can be found from the specified storage queue, and the initialization data of the read address range can be calculated and determined by the record formula to respond to the data read instruction.

[0089] Based on the above disclosed content, after determining the initialization data of the read address range based on the record formula corresponding to the read address range and returning the initialization data, it can also include: if the initialization data is determined based on a record formula of a second style, writing the initialization data into the read address range, and setting the write flag corresponding to the read address range to a first state, wherein the first state indicates that data has been written into the corresponding address range.

[0090] It is understandable that after the initialization data of the read address range is determined based on the record formula, the calculated initialization data can be written into the read address range, or it can be chosen not to be written so that the read address range remains empty. In the implementation of choosing not to write, when a data read instruction for the read address range is received next time, the corresponding record formula can still be called to calculate the initialization data to be returned.

[0091] Specifically, if the recorded formula is a formula set by the user, as long as the input parameter (address) is certain, no matter how many times the corresponding address is read, the results of multiple calculations using the set formula are the same. Therefore, after the initialization data of a certain address is calculated and the data read instruction is responded to, the initialization data can be written to the corresponding address or not.

[0092] However, for implementations where the recording formula is to call a system function, such as the implementation of calling a random system function, since the result (initialization data) calculated each time the system function is called is different, if the random system function is repeatedly run for the same address, the result is not certain. Therefore, after calling the random system function once for the first initialization of a certain address, it is necessary to record the result calculated based on the random system function, that is, write it to the corresponding address; if there is a subsequent repeated access to the address, the recorded data is directly read, and there is no need to run the random system function again, because the result obtained by running the system function again is different from the previous result.

[0093] In this embodiment, for different types of recording formulas, after the first call to calculate the initialization data, the processing of whether to write the calculated initialization data to the corresponding address is different, ensuring that the initialization process and subsequent reading and writing operations on the corresponding address can be executed smoothly and accurately.

[0094] In a specific implementation, during the test and verification of the DUT (design under test), a VIP (verification IP) that can achieve the same function will be built to assist in completing the functional verification of the DUT. For some DUT designs with data storage functions and data in the space can be read and written, such as DMA (Direct Memory Access), the storage space in the VIP usually needs to be initialized before testing. Figure 5 This is a schematic diagram of the architecture for interconnecting the DUT and VIP to achieve digital verification as disclosed in the embodiment of the present application.

[0095] Figure 6 This is a flowchart of a method for operating a storage space disclosed in an embodiment of the present application. Figure 6As shown, the operation scheme of the storage space requires three aspects of processing: a. Initialization style of the target storage space (determine the recording formula); b. Write operation; c. Read operation.

[0096] Combination Figure 6 As shown, the initialization style of the target storage space can generate and save the recording formula according to the user's specified initialization style or by calling the system function. It should be noted that for the same address range, different recording formulas may be configured for it in the future, that is, multiple initialization functions are called for the same address. In this case, the priority of the recording formula with a later time can be increased according to the time sequence of the configured recording formulas, or its sorting position in the specified storage queue can be moved forward, so that the initialization data of the address can be determined based on the recording formula with a later event.

[0097] That is, if there are multiple recording formulas for the same address range in the designated storage queue, the priority of each recording formula is configured in the order of the saving time of each recording formula. The later the saving time, the higher the priority of the recording formula. The priority is used to determine the recording formula for initialization data. For example, for a target storage space of 10G, first configure the initialization style of the storage space of 1G-8G to be a fixed value style; then, configure the initialization style of the storage space of 1G-5G to be a random style; and then, configure the initialization style of the storage space of 1G-3G to be an incremental style. When there is a data read instruction to read 2G storage space, the initialization data of the storage space is determined by calculating according to the formula corresponding to the last configured initialization style, that is, the recording formula of the incremental style.

[0098] Combination Figure 5 and Figure 6 As shown in the figure, for the write operation of the target storage space, the user can use the back door to write, or the front door to write to the memory after unpacking through the driver component. Although the sources of the two are different, they are the same operation for memory. When a write operation occurs, the data is written to the corresponding address space, and the flag position of the address is set to 1.

[0099] Combination Figure 5 and Figure 6As shown in the figure, for the read operation of the target storage space, the initiation of the read operation is the same as the source of the write operation, which can come from the back door or the front door, but it is the same operation for memory. When a read operation occurs, the flag bit of the address will be judged; if it is in the first state, it means that the address has real data, so it can be extracted and returned; if it is in the second state, it means that the address has only been uniformly initialized, and the address range is matched according to the priority of the record formula, and then the initialization data is calculated using the record formula with the highest priority corresponding to the corresponding address range and returned.

[0100] The operation scheme of the storage space described in this embodiment does not actually write the initialization data to the target storage space when the target storage space needs to be initialized. It only generates and saves the record formula of the target storage space. The subsequent read operation on the target storage space can directly calculate the initialization data return according to the corresponding record formula, or write the real data to the corresponding position of the target storage space based on the write operation on the target storage space. The entire initialization process is imperceptible to the user and will not affect the read and write operations of the target storage space.

[0101] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0102] The method is described in detail in the embodiments disclosed in the above-mentioned application. The method of the application can be implemented by various forms of devices. Therefore, the application also discloses a device, and a specific embodiment is given below for detailed description.

[0103] Figure 7 This is a schematic diagram of the structure of a storage space operating device disclosed in an embodiment of the present application. Figure 7 As shown, the storage space operating device 70 may include:

[0104] The instruction acquisition module 701 is used to obtain an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range.

[0105] The formula determination module 702 is used to generate a corresponding record formula based on the initialization style and save it in a specified storage queue. The initialization data corresponding to the address range can be determined based on the record formula.

[0106] The instruction return module 703 is used to return the initialization completion instruction.

[0107] The storage space operating device described in this embodiment does not actually write initialization data to the target storage space when the target storage space needs to be initialized, but only generates and saves the record formula of the target storage space, thereby eliminating the instruction operation time of traversing the address space to write data, greatly reducing the initialization waiting time, and will not affect the subsequent read and write operations on the target storage space, thereby optimizing the user experience.

[0108] In one implementation, the initialization instruction also includes setting data, and the formula determination module can be specifically used to: generate a record formula corresponding to the address range based on the initialization style and the setting data.

[0109] In one implementation, the formula determination module can be specifically used for: the initialization style is a first style, and a corresponding first recording formula is generated based on the first style, and the first recording formula represents that all initialization data to be written within the address range are the set data; the initialization style is a second style, and a corresponding second recording formula is generated based on the second style and the set data, and the second recording formula represents that the corresponding initialization data to be written at each address within the address range are random data; the initialization style is a third style, and a corresponding third recording formula is generated based on the third style and the set data, and the third recording formula represents that the initialization data to be written within the address range changes along the address according to a preset rule.

[0110] In one implementation, the recorded formula corresponding to the initialization style is a system function or a set formula, and the set formula is a formula set by the user based on initialization requirements.

[0111] In one implementation, the operating device of the storage space may also include: a write operation processing module, used to receive a data write instruction, the data write instruction includes the data to be written and the write address range; write the data to be written into the write address range, and set the write flag corresponding to the address range to a first state, wherein the first state indicates that the data has been written into the corresponding address range.

[0112] In one implementation, the instruction acquisition module is also used to: obtain a data read instruction, the data read instruction includes a read address range; the device may also include: a read operation processing module, used to read and return the data stored in the read address range when the write flag corresponding to the read address range is in a first state, the first state indicating that the corresponding address range has written data; when the write flag corresponding to the read address range is in a second state, determine the initialization data of the read address range based on the record formula corresponding to the read address range and return the initialization data, the second state indicating that the corresponding address range has no written data.

[0113] In one implementation, the operating device of the storage space may also include: a write control module, which is used to write the initialization data into the read address range if the initialization data is determined based on a recording formula of the second style, and set the write flag corresponding to the read address range to a first state, wherein the first state indicates that data has been written into the corresponding address range.

[0114] In one implementation, if there are multiple recording formulas for the same address range in the designated storage queue, the priority of each recording formula is configured in the order of their saving time. The later the saving time, the higher the priority of the recording formula. The priority is used to determine the recording formula for initializing data.

[0115] The specific implementation of the operating device of the above storage space and the modules it contains, as well as other possible implementations can be found in the corresponding parts of the method embodiment, which will not be repeated here.

[0116] Any one of the storage space operating devices described in the above embodiments includes a processor and a memory. The instruction acquisition module, formula determination module, instruction return module, read operation processing module, write operation processing module, write control module, etc. in the above embodiments are all stored in the memory as program modules, and the processor executes the above program modules stored in the memory to implement corresponding functions.

[0117] The processor includes a kernel, which retrieves the corresponding program module from the memory. One or more kernels can be set, and the processing of the access data can be realized by adjusting the kernel parameters.

[0118] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0119] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the above-mentioned storage space operation method.

[0120] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software codes. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the storage space operation method described above.

[0121] Furthermore, an embodiment of the present application provides an electronic device. Figure 8 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. Figure 8 As shown, the electronic device includes at least one processor 801, and at least one memory 802 and a bus 803 connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the above-mentioned storage space operation method.

[0122] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0123] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for operating a storage space, the method include: Obtaining an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range; Based on the initialization pattern, a corresponding recording formula is generated and saved in a designated storage queue, and initialization data corresponding to the address range can be determined based on the recording formula; Returns the initialization completion instruction.

2. The storage space operation method according to claim 1, wherein the initialization instruction further comprises setting data, and the corresponding recording formula is generated based on the initialization pattern. include: A recording formula corresponding to the address range is generated based on the initialization pattern and the setting data.

3. The method for operating the storage space according to claim 2, wherein the generating of the recording formula corresponding to the address range based on the initialization pattern and the setting data comprises any one of the following: The initialization style is a first style, and a corresponding first recording formula is generated based on the first style, wherein the first recording formula indicates that all the initialization data to be written within the address range are the setting data; The initialization style is a second style, and a corresponding second recording formula is generated based on the second style and the setting data, wherein the second recording formula indicates that the initialization data to be written corresponding to each address within the address range is random data; The initialization style is a third style. A corresponding third recording formula is generated based on the third style and the setting data. The third recording formula represents that the initialization data to be written within the address range changes along the address according to a preset rule.

4. The method for operating a storage space according to claim 1, in, The recorded formula corresponding to the initialization style is a system function or a setting formula, and the setting formula is a formula set by the user based on initialization requirements.

5. The method for operating the storage space according to claim 1, further comprising: include: receiving a data writing instruction, wherein the data writing instruction includes data to be written and a writing address range; The data to be written is written into the write address range, and a write flag corresponding to the address range is set to a first state, wherein the first state indicates that data has been written into the corresponding address range.

6. The method for operating the storage space according to claim 5, further comprising: include: Obtaining a data read instruction, wherein the data read instruction includes a read address range; If the write flag bit corresponding to the read address range is in the first state, the data stored in the read address range is read and returned, and the first state indicates that the corresponding address range has been written with data; If the write flag corresponding to the read address range is in the second state, the initialization data of the read address range is determined based on the record formula corresponding to the read address range and the initialization data is returned, and the second state indicates that no data is written to the corresponding address range.

7. The method for operating a storage space according to claim 6, after determining the initialization data of the read address range based on the record formula corresponding to the read address range and returning the initialization data, further include: If the initialization data is determined based on a recording formula of the second style, the initialization data is written into the read address range, and the write flag corresponding to the read address range is set to a first state, wherein the first state indicates that data has been written into the corresponding address range.

8. According to the storage space operation method described in claim 1, if there are multiple recording formulas for the same address range in the designated storage queue, the priority of each recording formula is configured in the order of the saving time of each recording formula, and the later the saving time, the higher the priority of the recording formula, and the priority is used to determine the recording formula for initializing data.

9. A storage space operating device, include: An instruction acquisition module, used to obtain an initialization instruction for a target storage space, wherein the initialization instruction includes an initialization style and an address range; A formula determination module, used to generate a corresponding record formula based on the initialization pattern and save it in a specified storage queue, and to determine the initialization data corresponding to the address range based on the record formula; The instruction return module is used to return the initialization completion instruction.

10. The storage space operation device according to claim 9, wherein the instruction acquisition module is further used to: obtain a data read instruction, wherein the data read instruction includes a read address range; The device also include: A read operation processing module, configured to read and return data stored in the read address range when the write flag bit corresponding to the read address range is in a first state, wherein the first state indicates that data has been written into the corresponding address range; When the write flag corresponding to the read address range is in the second state, the initialization data of the read address range is determined based on the record formula corresponding to the read address range and the initialization data is returned, and the second state indicates that no data is written to the corresponding address range.

11. An electronic device comprising a processor and a memory, in: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the storage space operation method as described in any one of claims 1-8.