CN117591022A - Data storage method and device, data acquisition method and electronic equipment - Google Patents

Data storage method and device, data acquisition method and electronic equipment Download PDF

Info

Publication number
CN117591022A
CN117591022A CN202311568370.0A CN202311568370A CN117591022A CN 117591022 A CN117591022 A CN 117591022A CN 202311568370 A CN202311568370 A CN 202311568370A CN 117591022 A CN117591022 A CN 117591022A
Authority
CN
China
Prior art keywords
storage
data
storage unit
unit
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311568370.0A
Other languages
Chinese (zh)
Inventor
金剑
孙云刚
黄萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202311568370.0A priority Critical patent/CN117591022A/en
Publication of CN117591022A publication Critical patent/CN117591022A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Abstract

The embodiment of the application provides a data storage method, a data storage device, a data acquisition method and electronic equipment. The method comprises the following steps: receiving a data storage request; determining at least one first storage unit from a resource pool comprising a plurality of storage units according to the data storage request, and storing data to be stored indicated by the data storage request into a storage area formed by the at least one first storage unit; and updating the sequence information of the at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating a storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.

Description

Data storage method and device, data acquisition method and electronic equipment
Technical Field
The embodiment of the application relates to the field of data storage, in particular to a data storage method, a data storage device, a data acquisition method and electronic equipment.
Background
With the continuous improvement of communication technology, the explosive increase of data volume is brought, and higher requirements are also put on data storage. In the prior art, the total storage space is generally divided into a plurality of storage units, the data is stored by the small storage units, and when the data is stored, a storage chain table is constructed according to the data to be stored, and part of storage units are connected in series to store the data. However, in the prior art, when data storage is performed, a storage linked list needs to be built in real time according to the storage space requirement of stored data, and when a plurality of items of data to be stored are faced, a plurality of storage linked lists are generally built, so that the efficiency of data storage is reduced, and the complexity of managing the storage linked list is increased.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a data storage method, apparatus, electronic device, and electronic device, so as to solve the foregoing problems.
According to a first aspect of an embodiment of the present application, there is provided a data storage method, including: receiving a data storage request; determining at least one first storage unit from a resource pool comprising a plurality of storage units according to the data storage request, and storing data to be stored indicated by the data storage request into a storage area formed by the at least one first storage unit; and updating the sequence information of the at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating a storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.
In one possible implementation, the sequence information of the storage unit includes pre-unit information and post-unit information; the front unit information of the storage unit is used for indicating the storage unit positioned in front of the storage unit in the storage area to which the storage unit belongs; the post unit information of a memory unit is used to indicate a memory unit located at a position subsequent to the memory unit in a memory area to which the memory unit belongs.
In one possible implementation, the pre-unit information includes a first truncated identification and/or the post-unit information includes a second truncated identification; when the front unit information of the storage unit is a first cut-off mark, the ordering of the storage unit in a storage area to which the storage unit belongs is first; when the post unit information of the storage unit is the second cut-off identification, the ordering of the storage unit in the storage area to which the storage unit belongs is the first last.
In one possible implementation, the method further includes: receiving a data acquisition request for the data to be stored; determining a storage area for storing the data to be stored and the ordering of the first storage units included in the storage area according to the first unit information included in the data acquisition request and the first cut-off identifier and/or the second cut-off identifier in the storage chain table, and extracting the data to be stored from the storage area; the first unit information is used for indicating first storage units which are ordered to be first in a storage area formed by the at least one first storage unit; and responding to the data acquisition request to provide the data to be stored.
In one possible implementation, the method further includes: receiving a data addition request for the data to be stored; determining at least one second storage unit from the resource pool according to the data addition request, storing data to be added indicated by the data addition request into the at least one second storage unit, and adding the at least one second storage unit serving as a new first storage unit into a storage area formed by the at least one first storage unit; and updating the sequence information of the at least one first storage unit and the at least one second storage unit in the storage chain table.
In one possible implementation, the method further includes: receiving a data deleting request for the data to be stored; deleting the data to be deleted indicated by the data deleting request, and determining whether at least one third storage unit needing to be recycled exists in the first storage units in the storage area corresponding to the data to be stored; the third storage unit is a first storage unit in which all the stored data are data to be deleted; if yes, recycling the at least one third storage unit from the storage area corresponding to the data to be stored; and updating the sequence information of the first storage unit remained in the storage chain table.
According to a second aspect of the embodiments of the present application, there is provided a data acquisition method, in which data to be acquired is stored in a storage area formed by at least one first storage unit in a resource pool including a plurality of storage units, where each first storage unit stores at least a portion of the data to be acquired; the method comprises the following steps: acquiring the data to be acquired from the storage area based on the first unit information and a storage linked list; the storage chain table is recorded with the sequence information of each storage unit in the resource pool, and the sequence information of the storage units is used for indicating the storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs; the sequence information comprises a third cut-off identifier, wherein the third cut-off identifier is used for indicating the first storage units which are ranked as the first to last in the storage area formed by the first storage units; the first unit information is used for indicating first storage units which are ordered to be first in a storage area formed by the at least one first storage unit.
In one possible implementation, the method further includes: and when the data to be acquired is transmitted, the first unit information is sent to a destination unit of the data to be acquired, so that the destination unit acquires the data to be acquired based on the first unit information and the storage linked list.
According to a third aspect of embodiments of the present application, there is provided a data storage device comprising: the receiving module is used for receiving the data storage request; a storage module, configured to determine at least one first storage unit from a resource pool including a plurality of storage units according to the data storage request, and store data to be stored indicated by the data storage request into a storage area formed by the at least one first storage unit; the updating module is used for updating the sequence information of the at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating a storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.
According to a fourth aspect of embodiments of the present application, there is provided an electronic device, including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is configured to hold at least one executable instruction that causes the processor to perform a method as described in any embodiment of the first aspect or to perform a method as described in any embodiment of the second aspect.
In the embodiment of the application, through the unit linked list recorded with the sequence information of each storage unit in the resource pool, when at least one first storage unit is determined from the resource pool comprising a plurality of storage units and the data to be stored indicated by the data storage request is stored in the storage area formed by the at least one first storage unit, the storage linked list with the storage information of the data to be stored is obtained by updating the storage list, and the storage linked list does not need to be reconstructed according to the storage space requirement of the storage data, so that the data storage efficiency can be remarkably improved; when the plurality of items of data to be stored are faced, the corresponding first storage units are only needed to be determined for the plurality of items of data to be stored respectively, the sequence information of the storage units in the storage chain table is updated according to the sequence of the first storage units, a plurality of storage chain tables are not needed to be established for the plurality of items of data to be stored respectively, only one storage chain table is needed to be managed, and the complexity of management of the storage chain table can be simplified.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings may also be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a system architecture diagram of a data storage method embodying one embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a method for storing data according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a resource pool and a storage list comparison according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a flow chart for updating a storage list according to an embodiment of the present application;
FIG. 5 is a schematic diagram of another embodiment of a storage list update process;
FIG. 6 is a schematic diagram of another embodiment of a storage list update process;
FIG. 7 is a flowchart illustrating steps of a method for data acquisition according to an embodiment of the present application;
FIG. 8 is a block diagram of a data storage device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
Detailed Description
In order to better understand the technical solutions in the embodiments of the present application, the following descriptions will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the embodiments of the present application shall fall within the scope of protection of the embodiments of the present application.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
As described above, in the prior art, when data storage is performed, a storage linked list needs to be constructed in real time according to the requirement of data storage, and when data to be stored with a large data volume is faced, a plurality of storage linked lists are generally constructed for storing the data, so that the efficiency of data storage is reduced, and the complexity of management of a storage unit is increased.
A first aspect of embodiments of the present application provides a data storage method to solve the above-mentioned problem.
Fig. 1 is a system architecture diagram to which the data storage method according to the embodiment of the present application is applied. The system architecture includes a data source unit and a memory. The data source unit is a unit for requesting to store data; the memory is used to store data, such as RAM memory, nonvolatile memory (non-volatile memory), and the like. After the data source unit sends a data storage request to the memory, the memory can store the data to be stored indicated by the request.
The memory comprises a memory linked list and a resource pool composed of memory units. A memory location is understood to be a partitioned unit of memory (e.g., 1 byte, 4 bytes, or 8 bytes, etc.) in memory, and a resource pool is a collection of memory locations. The storage chain table is an information storage structure and is used for storing the logic relation of the data in each storage unit. The storage chain table is composed of a series of nodes, each node comprising two parts: one part is a storage position corresponding to the node, and is used for indicating the storage unit corresponding to the node, and can be the identification information such as the address, the number and the like of the storage unit; the other part is the sequence information of the storage unit corresponding to the node, which is used for indicating the storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs. In the storage linked list provided by the embodiment of the application, each node corresponds to the unit identifier and the sequence information of each storage unit in the resource pool respectively, that is, the storage linked list records the unit identifiers and the sequence information of all the storage units in the resource pool. The sequence information of a memory cell may indicate a next and/or a previous memory cell of the memory cell.
In the embodiment of the application, through the unit linked list recorded with the sequence information of each storage unit in the resource pool, when at least one first storage unit is determined from the resource pool comprising a plurality of storage units and the data to be stored indicated by the data storage request is stored in the storage area formed by the at least one first storage unit, the storage linked list with the storage information of the data to be stored is obtained by updating the storage list, and the storage linked list does not need to be reconstructed according to the storage space requirement of the storage data, so that the data storage efficiency can be remarkably improved; when the plurality of items of data to be stored are faced, the corresponding first storage units are only needed to be determined for the plurality of items of data to be stored respectively, the sequence information of the storage units in the storage chain table is updated according to the sequence of the first storage units, a plurality of storage chain tables are not needed to be established for the plurality of items of data to be stored respectively, only one storage chain table is needed to be managed, and the complexity of management of the storage chain table can be simplified.
As shown in fig. 1, the data storage method provided in the embodiment of the present application includes:
s201: a data storage request is received.
S202: according to the data storage request, at least one first storage unit is determined from a resource pool comprising a plurality of storage units, and data to be stored indicated by the data storage request is stored in a storage area formed by the at least one first storage unit.
S203: and updating the sequence information of at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating the storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.
In the storage linked list provided by the embodiment of the application, the storage linked list records the unit identifier and the sequence information of each storage unit in the resource pool, so that all storage units in the resource pool can be managed only through one storage linked list.
In step S202, the data storage request may indicate the data to be stored, and at least one first storage unit for storing the data to be stored may be determined from the resource pool according to the data amount of the data to be stored, for example, the first storage units may be sequentially determined from the resource pool according to the storage space requirement of the data to be stored, and the first storage units may also be determined from the resource pool according to the order of the storage units, which is within the protection scope of the embodiments of the present application. When the data to be stored indicated by the data storage request is stored in the storage area formed by at least one first storage unit, the storage unit sequence information in the storage linked list is only updated according to the ordering of the first storage unit, and the linked list is not required to be re-linked.
It should be noted that, when there are multiple data storage requests and multiple data to be stored are to be stored, the above steps S201-S203 are only required to be executed for each data storage request, and the corresponding storage linked list is not required to be established for each storage request.
As a possible implementation, the method provided by the embodiment of the present application may be applied to a memory of a DPU (Data Processing Unit, dedicated data processor). Of course, the method provided in the embodiment of the present application may also be applied to memories of other electronic devices, which are all within the protection scope of the embodiment of the present application. The DPU is a special data processor which is constructed by taking data as a center and is used for processing 'specific application', adopts a software-defined technical route to support the virtualization of infrastructure layer resources, and can support the services of the infrastructure layer such as storage, security, service quality management and the like.
In the embodiment of the application, through the unit linked list recorded with the sequence information of each storage unit in the resource pool, when at least one first storage unit is determined from the resource pool comprising a plurality of storage units and the data to be stored indicated by the data storage request is stored in the storage area formed by the at least one first storage unit, the storage linked list with the storage information of the data to be stored is obtained by updating the storage list, and the storage linked list does not need to be reconstructed according to the storage space requirement of the storage data, so that the data storage efficiency can be remarkably improved; when the plurality of items of data to be stored are faced, the corresponding first storage units are only needed to be determined for the plurality of items of data to be stored respectively, the sequence information of the storage units in the storage chain table is updated according to the sequence of the first storage units, a plurality of storage chain tables are not needed to be established for the plurality of items of data to be stored respectively, only one storage chain table is needed to be managed, and the complexity of management of the storage chain table can be simplified.
As shown in fig. 3, in some alternative embodiments, the sequence information of the storage unit includes Pre-unit information (Pre) and post-unit information (Next); the front unit information of the storage unit is used for indicating the storage unit positioned in front of the storage unit in the storage area to which the storage unit belongs; the post unit information of a memory unit is used to indicate a memory unit located at a position subsequent to the memory unit in a memory area to which the memory unit belongs.
It should be noted that, the resource pool and the storage linked list in fig. 3 are a resource pool and a storage linked list in an initialized state, and at this time, the storage units in the resource pool are all empty storage units. In fig. 3, a-p are identifiers of storage units, and address information of the storage units may be specifically used to indicate the positions of the storage units in a storage linked list.
According to the method and the device for extracting the data, the ordering of the storage units can be determined according to the front unit information and the rear unit information, so that when the data to be stored are extracted, the ordering of the other first storage units and all the first storage units in the storage area can be determined according to the sequence information in the storage chain table only by determining the position information of the first storage unit and the last first storage unit in the corresponding storage area, and the first storage units for storing the data to be stored in the storage area and the ordering of the first storage units can be determined only by simple information and less operation in the process, and the efficiency of extracting the data can be improved.
In some alternative embodiments, the pre-unit information includes a first truncated identification and/or the post-unit information includes a second truncated identification; when the front unit information of the storage unit is a first cut-off mark, the ordering of the storage unit in a storage area to which the storage unit belongs is first; when the post unit information of the storage unit is the second cut-off identification, the ordering of the storage unit in the storage area to which the storage unit belongs is the first last. The first cut-off identifier may be the same as the second cut-off identifier, or may be different from the second cut-off identifier, which are all within the protection scope of the embodiment of the present application.
In this embodiment, the pre-unit information includes a first cut-off identifier, and/or the post-unit information includes a second cut-off identifier, so that when extracting data to be stored, only a first storage unit in a corresponding storage area needs to be determined, and other first storage units in the storage area can be determined according to sequence information in a storage linked list. For example, according to the storage chain table, starting from the first storage unit, determining the storage units ordered after the first storage unit one by one and the sequence information of the storage units, when the first second truncated identifier after the sequence information of the first storage unit is found, determining the storage unit corresponding to the second truncated identifier as the last first storage unit in the storage area corresponding to the data to be stored, thereby determining all the first storage units and the ordering of the first storage units in the storage area corresponding to the data to be stored; or if the second interception identifier does not exist and only the first interception identifier exists, when the first interception identifier after the sequence information of the first storage unit is found, it can be determined that the storage unit corresponding to the first interception identifier does not belong to the storage area corresponding to the data to be stored, that is, the last storage unit of the storage unit corresponding to the first interception identifier is the last first storage unit in the storage area corresponding to the data to be stored, so that all the first storage units and the ordering of the first storage units in the storage area corresponding to the data to be stored are determined. It should be understood that, in the embodiment of the present application, the first/last first storage unit in the storage area is the first storage unit in the storage area ordered as first/last first.
From the above, in the embodiment of the present application, only the first storage unit in the corresponding storage area needs to be determined when the data to be stored is extracted, and other first storage units in the storage area can be determined according to the sequence information in the storage chain table, so that the information required for extracting the data to be stored can be further simplified, and the process of extracting the data is more convenient.
To facilitate understanding of the foregoing embodiments, a flow of using a store-linked list in an embodiment of the present application is illustrated by fig. 4.
As shown in fig. 4, according to the data storage request, if it is determined from the resource pool that the first storage unit for storing the data to be stored indicated by the request is a, b, c, d, the data to be stored is stored in the storage area formed by a, b, c, d in the order of a-b-c-d. And meanwhile, the sequence information of the first storage units a-d is adjusted in the storage linked list so as to update the storage linked list. The sequence information of a, b and c is unchanged, and the post sequence information of d is adjusted from e to a second truncated flag null to indicate d as the last storage unit in the storage area abcd. And, the pre-sequence information d of e may also be adjusted to the first truncated flag at the same time to indicate that the storage unit e becomes the first storage unit in the next storage area.
In some optional embodiments, the data storage method provided in the present application further includes: receiving a data acquisition request for data; determining a storage area for storing data to be stored and the ordering of first storage units included in the storage area according to first unit information included in a data acquisition request and a first cut-off identifier and/or a second cut-off identifier in a storage chain table, and extracting the data to be stored from the storage area; the first unit information is used for indicating a first storage unit which is ordered to be first in a storage area formed by the at least one first storage unit, such as address or position information of the first storage unit; in response to the data acquisition request, data to be stored is provided.
When a data acquisition request is received, a first storage unit which is sequenced to be first in a storage area corresponding to stored data to be stored can be determined according to first unit information included in the data acquisition request, and all first storage units included in the storage area corresponding to the data to be stored and the sequencing of the first storage units can be determined according to the post unit information of the first storage unit and a first cut-off identifier and/or a second cut-off identifier in a storage chain table. For example, in fig. 4, after determining that the first storage unit ordered to be the first storage unit in the storage area abcd is a, it may be determined that the subsequent first storage units are b, c, and d in turn, and according to the second truncated flag null corresponding to the unit information after d, it is known that d is the first storage unit ordered to be the last first storage unit in the storage area abcd. In another embodiment, if only the first truncated identifier exists and the second truncated identifier does not exist, the last storage unit in the storage area may be determined only according to the first truncated identifier, for example, if the information of the last unit of d in fig. 4 is e, the information of the last unit of e is still the first truncated identifier null, and the first truncated identifier null corresponding to e may indicate that d is the first storage list ordered as the last one in the storage area abcd. Therefore, when receiving the data acquisition request for the data to be stored, the embodiment of the application only needs to determine the first unit information in the data storage request, and can determine all the first storage units included in the storage area corresponding to the data to be stored and the ordering of the first storage units according to the storage linked list, so that the function of the storage linked list can be fully played, the information required by the data to be stored is simplified, and the response to the data acquisition request is quicker.
In some optional embodiments, the data storage method provided in the present application further includes: receiving a data addition request for data to be stored; according to the data adding request, determining at least one second storage unit from the resource pool, storing data to be added indicated by the data adding request into the at least one second storage unit, and adding the at least one second storage unit serving as a new first storage unit into a storage area formed by the at least one first storage unit; and updating the sequence information of at least one first storage unit and at least one second storage unit in the storage chain table.
It should be appreciated that the data addition request may indicate the data to be added and the location where the data to be added is inserted in the data to be stored. Similarly to the manner of determining the first storage unit, at least one second storage unit for storing the data to be added can be determined from the resource pool according to the data amount of the data to be added, the data to be added indicated by the data addition request is stored into the at least one second storage unit, and at the same time, the at least one second storage unit is used as a new first storage unit and is added into the storage area formed by the at least one first storage unit.
According to the position of the data to be added, which is inserted into the data to be stored, the ordering position of the second storage unit serving as a new first storage unit in the at least one first storage unit can be determined by reading the data to be stored in each first storage unit, and according to the ordering position, the sequence information of the original first storage unit in the storage chain table and the first storage unit serving as the second storage unit can be updated.
For example, as shown in fig. 5, if it is determined that the second storage unit for storing the data to be stored indicated by the request is e and the ordering position of e in the first storage unit a, b, c, d should be between b and c according to the data addition request, the data to be stored is stored in the second storage unit e, and the second storage unit e is added as a new first storage unit into the storage area abcd. Meanwhile, the sequence information of the first storage unit a, b, c, d and the second storage unit e is updated in the storage linked list, wherein the post-unit information of b is adjusted to e, the pre-unit information of c is adjusted to e, the pre-unit information of e is adjusted to b, and the post-unit information of e is adjusted to c, thereby indicating that the position of e is between b and c.
In this embodiment, after receiving a data addition request for the stored data to be stored, a second storage unit for storing the data to be added may be determined according to the data to be added indicated by the data addition request, and an insertion position of the data to be added indicated by the data addition request may be determined, where the second storage unit is added to a sorting position of the first storage unit, so that the second storage unit storing the data to be added is used as a new first storage unit and is added to a storage area formed by the first storage unit, so that the data to be added is inserted between the stored data to be stored, during which, sequence information of the second storage unit and the first storage unit is adjusted only according to the sorting position of the second storage unit added to the first storage unit, and a storage linked list after the data to be added is inserted may be obtained.
In some optional embodiments, the data storage method provided in the present application further includes: receiving a data deleting request for data to be stored; deleting the data to be deleted indicated by the data deleting request, and determining whether at least one third storage unit needing to be recycled exists in the first storage units in the storage area corresponding to the data to be stored; the third storage unit is a first storage unit in which all the stored data are data to be deleted; if yes, recycling at least one third storage unit from the storage area corresponding to the data to be stored; and updating the sequence information of at least one third storage unit and the first storage unit in the storage chain table.
It should be appreciated that the data deletion request may indicate the data to be deleted as well as the data to be deleted. Deleting the data to be deleted by reading the data in the first storage unit storing the data to be stored; and determining whether the stored data are all first storage units of the data to be deleted, if so, taking the first storage units as third storage units, recovering the first storage units from a storage area formed by the first storage units for storing the data to be stored, obtaining a storage area formed by the rest first storage units, and updating the sequence information of the rest first storage units in a storage chain table.
For example, as shown in fig. 6, if it is determined that the third storage unit to be recycled in the storage area abcd is b according to the data deletion request, b is recycled from the storage area formed by a, b, c, d, after b is recycled, the information of the post unit of a is adjusted to c, and the information of the pre unit of c is adjusted to a, so as to complete updating of the storage linked list.
In this embodiment of the present invention, after receiving a data deletion request for stored data to be stored, whether a first storage unit storing the data to be deleted in a storage area corresponding to the data to be stored is stored in a third storage unit to be recovered or not may be determined according to the data to be deleted indicated by the data addition request, and when the third storage unit exists, the storage unit may be recovered from the first storage unit, and only by adjusting sequence information of the remaining first storage units, an updated storage linked list is obtained.
According to a second aspect of embodiments of the present application, there is provided a data acquisition method, including: and acquiring data to be acquired from the storage area based on the first unit information and the storage linked list.
The data to be acquired is stored in a storage area formed by at least one first storage unit in a resource pool comprising a plurality of storage units, and each first storage unit at least stores part of the data to be acquired. The sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating the storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs. The sequence information includes a third cut-off identifier, where the third cut-off identifier is used to indicate a first storage unit ordered as the first last in the storage area formed by the first storage units, and the third cut-off identifier may be the first cut-off identifier and/or the second cut-off identifier in the above embodiment. The first unit information is used for indicating first storage units which are sequenced to be first in a storage area formed by at least one first storage unit, and the first unit information can be the first unit information fed back when the data to be acquired is stored by adopting the data storage method provided in the first aspect of the embodiment of the application, or can be the first unit information obtained in other modes, which are all within the protection scope of the embodiment of the application.
The data acquisition method provided in the embodiment of the present application and the foregoing embodiment of the data storage method are based on the same inventive concept, so that the same effects can be achieved, and the specific implementation process can refer to the foregoing description in the embodiment of receiving the data acquisition request for the data to be stored and providing the data to be stored, which is not repeated herein.
As shown in fig. 7, in some alternative embodiments, the data acquisition method provided in the present application includes:
s701: and acquiring data to be acquired from the storage area based on the first unit information and the storage chain table.
S702: when the data to be acquired is transmitted, the first unit information is sent to a destination unit of the data to be acquired, so that the destination unit acquires the data to be acquired based on the first unit information and a storage linked list.
For the specific implementation of S701, reference may be made to the above embodiments, and details are not repeated here.
In S702, when the data to be acquired is transmitted, only the first unit information is sent to the destination unit of the data to be acquired, so that the destination unit acquires the data to be acquired based on the first unit information and the storage linked list. The specific implementation manner of the destination unit to acquire the data to be acquired based on the first unit information and the storage linked list is similar to S701, and will not be described herein.
As a possible implementation manner, the method provided in the embodiment of the present application may be applied to a process of data transmission with a DPU, or may be applied to a process of other data transmission, and only a shared memory needs to be set for both parties performing data transmission.
According to the method and the device, the transmission of the data to be acquired can be achieved only by sending the first unit information, the stored data to be acquired does not need to be extracted and then forwarded, the flow of the data to be acquired for transmission is simplified, the transmission of the information to be acquired can be rapidly completed by sending the first unit information to the destination unit, the destination unit can acquire the data to be acquired at any time according to the first unit information, and the flexibility of the data transmission to be acquired can be remarkably improved.
According to a third aspect of embodiments of the present application, as shown in fig. 8, there is provided a data storage device, including:
a receiving module 801, configured to receive a data storage request;
a storage module 802 for determining at least one first storage unit from a resource pool including a plurality of storage units according to a data storage request, and storing data to be stored indicated by the data storage request into a storage area constituted by the at least one first storage unit;
And the updating module 803 is configured to update sequence information of at least one first storage unit in the storage chain table, where the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used to indicate a storage area to which the storage unit belongs and a ranking of the storage unit in the storage area to which the storage unit belongs.
In some alternative embodiments, the sequence information of the storage unit includes pre-unit information and post-unit information; the front unit information of the storage unit is used for indicating the storage unit positioned in front of the storage unit in the storage area to which the storage unit belongs; the post unit information of a memory unit is used to indicate a memory unit located at a position subsequent to the memory unit in a memory area to which the memory unit belongs.
In some alternative embodiments, the pre-unit information includes a first truncated identification and/or the post-unit information includes a second truncated identification; when the front unit information of the storage unit is a first cut-off mark, the ordering of the storage unit in a storage area to which the storage unit belongs is first; when the post unit information of the storage unit is the second cut-off identification, the ordering of the storage unit in the storage area to which the storage unit belongs is the first last.
In some alternative embodiments, the data storage device further comprises a data acquisition module. The receiving module 803 is configured to receive a data acquisition request for data to be stored. The data acquisition module is used for determining a storage area for storing data to be stored according to first unit information included in the data acquisition request and a first cut-off identifier and/or a second cut-off identifier in a storage chain table, and sequencing of first storage units included in the storage area, and extracting the data to be stored from the storage area; the first unit information is used for indicating first storage units which are ordered to be first in a storage area formed by at least one first storage unit; the data to be stored is provided in response to the data acquisition request.
In some alternative embodiments, the data storage device further comprises a data augmentation module. Wherein, the receiving module 803 is configured to receive a data addition request for data to be stored; the data adding module is used for determining at least one second storage unit from the resource pool according to the data adding request, storing the data to be added indicated by the data adding request into the at least one second storage unit, and adding the at least one second storage unit serving as a new first storage unit into a storage area formed by the at least one first storage unit. The updating module 803 is configured to update sequence information of at least one first storage unit and at least one second storage unit in the storage chain table.
In some alternative embodiments, the data storage device further comprises a data deletion module. The receiving module 803 is further configured to receive a data deletion request for data to be stored. The data deleting module is used for deleting the data to be deleted indicated by the data deleting request and determining whether at least one third storage unit needing to be recovered exists in the first storage units in the storage area corresponding to the data to be stored; the third storage unit is a first storage unit in which all the stored data are data to be deleted; if yes, recycling at least one third storage unit from the storage area corresponding to the data to be stored; and, the updating module 803 is configured to update the sequence information of the first storage unit remaining in the storage chain table.
The data acquisition method provided in the embodiment of the present application and the foregoing embodiment of the data storage method are based on the same inventive concept, so that the same effects can be achieved, and the specific implementation process can be referred to the description in the foregoing embodiment of the data storage method, which is not repeated here.
According to a fourth aspect of embodiments of the present application, there is also provided an electronic device. The method comprises the following steps: referring to fig. 9, a schematic structural diagram of an electronic device according to an embodiment of the present application is shown, and the specific embodiment of the present application is not limited to a specific implementation of the electronic device.
As shown in fig. 9, the electronic device may include: a processor 902, a communication interface (Communications Interface), a memory 906, and a communication bus 908.
Wherein:
processor 902, communication interface 904, and memory 906 communicate with each other via a communication bus 908.
A communication interface 904 for communicating with other electronic devices or servers.
The processor 902 is configured to execute the program 910, and may specifically perform relevant steps in the above-described data storage method embodiment.
In particular, the program 910 may include program code including computer-operating instructions.
The processor 902 may be a CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit) or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors comprised by the smart device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 906 for storing a program 910. Memory 906 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 910 may include a plurality of computer instructions, and the program 910 may specifically enable the processor 902 to perform operations corresponding to the data storage method described in any one of the foregoing method embodiments.
The specific implementation of each step in the procedure 910 may refer to the corresponding steps and corresponding descriptions in the units in the above method embodiment, and have corresponding beneficial effects, which are not described herein. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus and modules described above may refer to corresponding procedure descriptions in the foregoing method embodiments, which are not repeated herein.
The present application also provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the method described in any of the foregoing method embodiments. The computer storage media includes, but is not limited to: a compact disk read Only (Compact Disc Read-Only Memory, CD-ROM), random access Memory (Random Access Memory, RAM), floppy disk, hard disk, magneto-optical disk, or the like.
It should be noted that, according to implementation requirements, each component/step described in the embodiments of the present application may be split into more components/steps, and two or more components/steps or part of operations of the components/steps may be combined into new components/steps, so as to achieve the purposes of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The above embodiments are only for illustrating the embodiments of the present application, but not for limiting the embodiments of the present application, and various changes and modifications can be made by one skilled in the relevant art without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also fall within the scope of the embodiments of the present application, and the scope of the embodiments of the present application should be defined by the claims.

Claims (10)

1. A method of data storage, comprising:
receiving a data storage request;
determining at least one first storage unit from a resource pool comprising a plurality of storage units according to the data storage request, and storing data to be stored indicated by the data storage request into a storage area formed by the at least one first storage unit;
And updating the sequence information of the at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating a storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.
2. The data storage method according to claim 1, wherein the sequence information of the storage unit includes pre-unit information and post-unit information; the front unit information of the storage unit is used for indicating the storage unit positioned in front of the storage unit in the storage area to which the storage unit belongs; the post unit information of a memory unit is used to indicate a memory unit located at a position subsequent to the memory unit in a memory area to which the memory unit belongs.
3. The data storage method according to claim 2, wherein the pre-unit information comprises a first truncated identification and/or the post-unit information comprises a second truncated identification; when the front unit information of the storage unit is a first cut-off mark, the ordering of the storage unit in a storage area to which the storage unit belongs is first; when the post unit information of the storage unit is the second cut-off identification, the ordering of the storage unit in the storage area to which the storage unit belongs is the first last.
4. A data storage method according to claim 3, wherein the method further comprises:
receiving a data acquisition request for the data to be stored;
determining a storage area for storing the data to be stored and the ordering of the first storage units included in the storage area according to the first unit information included in the data acquisition request and the first cut-off identifier and/or the second cut-off identifier in the storage chain table, and extracting the data to be stored from the storage area; the first unit information is used for indicating first storage units which are ordered to be first in a storage area formed by the at least one first storage unit;
and responding to the data acquisition request to provide the data to be stored.
5. The data storage method of any one of claims 1-4, wherein the method further comprises:
receiving a data addition request for the data to be stored;
determining at least one second storage unit from the resource pool according to the data addition request, storing data to be added indicated by the data addition request into the at least one second storage unit, and adding the at least one second storage unit serving as a new first storage unit into a storage area formed by the at least one first storage unit;
And updating the sequence information of the at least one first storage unit and the at least one second storage unit in the storage chain table.
6. The data storage method of any one of claims 1-4, wherein the method further comprises:
receiving a data deleting request for the data to be stored;
deleting the data to be deleted indicated by the data deleting request, and determining whether at least one third storage unit needing to be recycled exists in the first storage units in the storage area corresponding to the data to be stored; the third storage unit is a first storage unit in which all the stored data are data to be deleted;
if yes, recycling the at least one third storage unit from the storage area corresponding to the data to be stored; and, in addition, the processing unit,
and updating the sequence information of the first storage unit remained in the storage chain table.
7. A data acquisition method, characterized in that data to be acquired is stored in a storage area formed by at least one first storage unit in a resource pool comprising a plurality of storage units, and each first storage unit at least stores part of the data to be acquired;
The method comprises the following steps:
acquiring the data to be acquired from the storage area based on the first unit information and a storage linked list;
the storage chain table is recorded with the sequence information of each storage unit in the resource pool, and the sequence information of the storage units is used for indicating the storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs;
the sequence information comprises a third cut-off identifier, wherein the third cut-off identifier is used for indicating the first storage units which are ranked as the first to last in the storage area formed by the first storage units;
the first unit information is used for indicating first storage units which are ordered to be first in a storage area formed by the at least one first storage unit.
8. The data acquisition method of claim 7, wherein the method further comprises:
and when the data to be acquired is transmitted, the first unit information is sent to a destination unit of the data to be acquired, so that the destination unit acquires the data to be acquired based on the first unit information and the storage linked list.
9. A data storage device, comprising:
The receiving module is used for receiving the data storage request;
a storage module, configured to determine at least one first storage unit from a resource pool including a plurality of storage units according to the data storage request, and store data to be stored indicated by the data storage request into a storage area formed by the at least one first storage unit;
the updating module is used for updating the sequence information of the at least one first storage unit in the storage chain table, wherein the sequence information of each storage unit in the resource pool is recorded in the storage chain table, and the sequence information of the storage unit is used for indicating a storage area to which the storage unit belongs and the ordering of the storage unit in the storage area to which the storage unit belongs.
10. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to hold at least one executable instruction that causes the processor to perform the method of any one of claims 1-6 or to perform the method of any one of claims 7-8.
CN202311568370.0A 2023-11-22 2023-11-22 Data storage method and device, data acquisition method and electronic equipment Pending CN117591022A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311568370.0A CN117591022A (en) 2023-11-22 2023-11-22 Data storage method and device, data acquisition method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311568370.0A CN117591022A (en) 2023-11-22 2023-11-22 Data storage method and device, data acquisition method and electronic equipment

Publications (1)

Publication Number Publication Date
CN117591022A true CN117591022A (en) 2024-02-23

Family

ID=89921384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311568370.0A Pending CN117591022A (en) 2023-11-22 2023-11-22 Data storage method and device, data acquisition method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117591022A (en)

Similar Documents

Publication Publication Date Title
US6154764A (en) On-line forum-type electronic conference system maintaining consistency of messages
US7801883B2 (en) Method and apparatus for improving data processing speed through storage of record information of identity module
CN111258978B (en) Data storage method
CN107786638A (en) A kind of data processing method, apparatus and system
CN111651525A (en) Block chain data storage method and device
CN107025289A (en) The method and relevant device of a kind of data processing
US7751346B2 (en) Apparatus for searching TCP and UDP sockets
CN113051102B (en) File backup method, device, system, storage medium and computer equipment
CN113014510A (en) Data caching method and device in distributed test of inertial navigation system
CN116155828B (en) Message order keeping method and device for multiple virtual queues, storage medium and electronic equipment
CN117591022A (en) Data storage method and device, data acquisition method and electronic equipment
CN111625617A (en) Data indexing method and device and computer readable storage medium
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN111399753B (en) Method and device for writing pictures
CN114579506A (en) Inter-processor communication method, system, storage medium, and processor
CN111209304B (en) Data processing method, device and system
CN116701452A (en) Data processing method, related device, storage medium and program product
CN109783559B (en) Method and device for acquiring real estate transaction data, electronic equipment and storage medium
CN114063931A (en) Data storage method based on big data
CN111061719A (en) Data collection method, device, equipment and storage medium
CN112988905B (en) Node memory synchronization method and device for cluster deployment
CN115544321B (en) Method and device for realizing graph database storage and storage medium
CN111338821B (en) Method, system and electronic equipment for realizing data load balance
CN111107536B (en) User plane function forwarding method, device, system and storage medium
CN111752941B (en) Data storage and access method and device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination