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

CN116126237BActive Publication Date: 2026-09-04ZEBRED NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211710879.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-09-04
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

[0005]本发明提供一种数据存储方法、装置、设备和计算机可读存储介质,用以解决装置的运行稳定性较差的问题

Benefits of technology

[0039]The data storage method, apparatus, device, and computer-readable storage medium provided by this invention construct a first capability table in the kernel, and when it is detected that the first capability table stores a preset amount of capability data, a second capability table is constructed in the kernel, and the first capability table and the second capability table are associated. In this invention, the device determines the preset amount of capability data that the first capability table can store based on the amount of capabilities it uses. That is, the device first configures a first capability table that can store the amount of capabilities that may be used. If the first capability table is full of capability data, a new capability table is constructed. In other words, the device first configures appropriate memory space for the construction of the capability table, avoiding the instability of the device operation due to excessively large configured memory space, thereby improving the operational stability of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126237B_ABST
    Figure CN116126237B_ABST
Patent Text Reader

Abstract

The application provides a data storage method, device, equipment and computer readable storage medium, the method comprises the following steps: constructing a first capability table in the kernel, the first capability table is used for storing a first preset number of capability data, the first preset number is determined according to the number of capabilities used by the operating system where the kernel is located; when detecting that the first capability table stores the first preset number of capability data, constructing a second capability table in the kernel; the first capability table is associated with the second capability table.In the application, the device determines the preset number of capability data that the first capability table can store based on the number of capabilities used by itself, that is, the device first configures the first capability table that can store the number of capabilities that can be used, if the first capability table stores full capability data, a new capability table is constructed, that is, the device first configures appropriate memory space for the construction of the capability table, avoids that the device runs unstably due to the oversized memory space, and improves the running stability of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a data storage method, apparatus, device, and computer-readable storage medium. Background Technology

[0002] Capability allows the capability holder to access entities (such as devices like USB drives, cameras, etc.) or objects (such as files, directories, network ports, and memory) in a device.

[0003] Currently, the device's kernel allocates memory space to build a capability table, enabling the table to store a large amount of capability data. However, the stability of the device's operation is related to the kernel's available memory. More available memory results in more stable operation, while less available memory leads to instability.

[0004] Because the large data table is set to store a large amount of capability data, the kernel needs to allocate a large amount of memory space to store the capability data, resulting in less available memory for the device to run and poor device stability. Summary of the Invention

[0005] This invention provides a data storage method, apparatus, device, and computer-readable storage medium to solve the problem of poor operational stability of the apparatus.

[0006] On one hand, the present invention provides a data storage method, comprising:

[0007] A first capability table is constructed in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides;

[0008] When it is detected that the first capability table stores a first preset amount of capability data, a second capability table is constructed in the kernel;

[0009] Associate the first capability table with the second capability table.

[0010] In one embodiment, the step of associating the first capability table with the second capability table includes:

[0011] Create the first structural node and the second structural node;

[0012] Control the data content pointer of the first structure node to point to the first capability table, and control the data content pointer of the second structure node to point to the second capability table;

[0013] Configure the relationship between the first structure node and the second structure node to associate the first capability table with the second capability table.

[0014] In one embodiment, the first structural node and the second structural node are singly linked list nodes, and the step of configuring the relationship between the first structural node and the second structural node includes:

[0015] Control the next node pointer of the first structure node to point to the second structure node.

[0016] In one embodiment, the first structural node and the second structural node are doubly linked list nodes, and the step of configuring the relationship between the first structural node and the second structural node includes:

[0017] Control the next node pointer of the first structure node to point to the second structure node;

[0018] Control the pointer of the previous node of the second structure node to point to the first structure node.

[0019] In one embodiment, the first structural node and the second structural node are binary tree nodes, and the step of configuring the relationship between the first structural node and the second structural node includes:

[0020] Set the first child pointer of the first structure node to point to the second structure node.

[0021] In one embodiment, the second capability table is used to store a second preset number of capability data. After the step of pointing the first child pointer of the first structure node to the second structure node, the method further includes:

[0022] When it is detected that the second capability table stores a second preset amount of capability data, a third capability table is constructed in the kernel, and a third structure node is created, wherein the third structure node is a binary tree node;

[0023] The data content pointer of the third structural node is controlled to point to the third capability table;

[0024] The second child pointer of the first structural node is controlled to point to the third structural node, so as to associate the third capability table with the first capability table.

[0025] In one embodiment, after the step of configuring the relationship between the first structural node and the second structural node, the method further includes:

[0026] Obtain the first capability data to be filled, and fill the second capability table with the first capability data;

[0027] Obtain the index number of the position of the first capability data in the second capability table, and obtain the node number of the second structure node corresponding to the second capability table;

[0028] The identifier of the first capability data, the index number, and the node number are associated and stored together.

[0029] When a request to acquire the first capability data is detected, the identifier of the first capability data is acquired according to the acquisition request, and the index number and node number associated with the first capability data are acquired according to the identifier.

[0030] The first capability data is obtained from the second capability table based on the node number and the index number.

[0031] On the other hand, the present invention also provides a data storage device, comprising:

[0032] A construction module is used to construct a first capability table in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides;

[0033] The construction module is configured to construct a second capability table in the kernel when it is detected that the first capability table stores a first preset amount of capability data.

[0034] The association module is used to associate the first capability table with the second capability table.

[0035] On the other hand, the present invention also provides a data storage device, including: a memory and a processor;

[0036] The memory stores computer-executed instructions;

[0037] The processor executes computer execution instructions stored in the memory to perform the data storage method described above.

[0038] On the other hand, the present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the data storage method described above.

[0039] The data storage method, apparatus, device, and computer-readable storage medium provided by this invention construct a first capability table in the kernel, and when it is detected that the first capability table stores a preset amount of capability data, a second capability table is constructed in the kernel, and the first capability table and the second capability table are associated. In this invention, the device determines the preset amount of capability data that the first capability table can store based on the amount of capabilities it uses. That is, the device first configures a first capability table that can store the amount of capabilities that may be used. If the first capability table is full of capability data, a new capability table is constructed. In other words, the device first configures appropriate memory space for the construction of the capability table, avoiding the instability of the device operation due to excessively large configured memory space, thereby improving the operational stability of the device. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0041] Figure 1 This is a flowchart illustrating the first embodiment of the data storage method of the present invention;

[0042] Figure 2 This is a flowchart illustrating the second embodiment of the data storage method of the present invention;

[0043] Figure 3 This is a flowchart illustrating the third embodiment of the data storage method of the present invention;

[0044] Figure 4 This is a schematic diagram showing the association of the various capability tables involved in the present invention;

[0045] Figure 5 This is a flowchart illustrating the fourth embodiment of the data storage method of the present invention;

[0046] Figure 6 This is another related schematic diagram of the various capability tables involved in the present invention;

[0047] Figure 7 This is a flowchart illustrating the fifth embodiment of the data storage method of the present invention;

[0048] Figure 8 This is yet another schematic diagram relating the various capability tables involved in the present invention;

[0049] Figure 9 This is a flowchart illustrating the sixth embodiment of the data storage method of the present invention;

[0050] Figure 10 This is a schematic diagram of the functional modules of the data storage device of the present invention;

[0051] Figure 11This is a schematic diagram of the hardware structure of the data storage device of the present invention.

[0052] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same data in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0054] Capability allows the capability holder to access entities (such as devices like USB drives, cameras, etc.) or objects (such as files, directories, network ports, and memory) in a device.

[0055] Currently, the device's kernel allocates memory space to build a capability table, enabling the table to store a large amount of capability data. However, the stability of the device's operation is related to the kernel's available memory. More available memory results in more stable operation, while less available memory leads to instability.

[0056] The inventors of this disclosure have discovered that because the big data table is set to store a large amount of capability data, the kernel needs to configure a large amount of memory space for storing capability data, resulting in a small amount of memory available for the device to run, which leads to poor operating stability of the device.

[0057] Therefore, the inventors of this disclosure conceived of a device that determines the preset number of capability data that the first capability table can store based on the number of capabilities it uses. In other words, the device first configures a first capability table that can store the number of capabilities that may be used. If the first capability table is full of capability data, a new capability table is then constructed. That is, the device first configures an appropriate memory space to construct the capability table, avoiding the instability of the device due to excessively large memory space, thereby improving the operational stability of the device.

[0058] The technical solutions of the present invention and how they solve the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0059] Reference Figure 1 , Figure 1 This is a first embodiment of the data storage method of the present invention, which includes the following steps:

[0060] Step S101: Construct a first capability table in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides.

[0061] In this embodiment, the execution entity is a data storage device. For ease of description, the term "device" will be used to refer to the data storage device below. The device can be any terminal device with data processing and data storage capabilities; for example, the device can be a computer. The device's operating system has a corresponding kernel, which stores capability data. Capability data includes the operating system's resource objects and their corresponding capability values. Capability values ​​represent one or more of the following permissions: read, write, execute, allow run, etc. Resource objects include processes, threads, files, network ports, devices, and all other resource objects that require capabilities to access. It should be noted that a capability is equivalent to a token.

[0062] The device configures a first memory space in the kernel, which is used to construct a first capability table. The first capability table can store a first preset number of capability data. This first preset number is determined based on the number of capabilities used by the kernel in the operating system.

[0063] Specifically, the device determines the number of capabilities used based on the operating system's runtime logs, and then sets a first preset number based on that data. For example, if the number of capabilities used in the operating system is 500, then the first preset number is set to 512, meaning that the constructed first capability table can store capability data for 512 capabilities.

[0064] Step S102: When it is detected that the first capability table stores a first preset amount of capability data, a second capability table is constructed in the kernel.

[0065] After constructing the first capability table, whenever a new capability is generated in the device, the corresponding capability data is stored in the first capability table. Once the device detects that the first capability table has stored a first preset number of capability data, it determines that the first capability table is full and needs to construct a new capability table, i.e., constructing a second capability table. The second capability table can store a second preset number of capabilities, which may be the same as or different from the first preset number.

[0066] Step S103: Associate the first capability table with the second capability table.

[0067] The device associates the constructed second capability table with the second capability table, thereby allowing the device to directly skip the first capability table which is filled with capability data, and to find free capability table entries in the second capability table to fill with new capability data.

[0068] In this embodiment, a first capability table is constructed in the kernel. When it is detected that the first capability table stores a preset number of capability data, a second capability table is constructed in the kernel, and the first capability table and the second capability table are associated. In this embodiment, the device determines the preset number of capability data that the first capability table can store based on the number of capabilities it uses. That is, the device first configures a first capability table that can store the number of capabilities that may be used. If the first capability table is full of capability data, a new capability table is constructed. In other words, the device first configures appropriate memory space for the construction of the capability table, avoiding the instability of the device due to excessive memory space, thus improving the operational stability of the device.

[0069] Reference Figure 2 , Figure 2 This is a second embodiment of the data storage method of the present invention. Based on the first embodiment, step S101 includes:

[0070] Step S201: Create the first structural node and the second structural node.

[0071] In this embodiment, the device associates the first capability table and the second capability table through structural nodes. A structural node refers to the node corresponding to a data structure, and the data structure is determined by the relationships between multiple capability tables. For example, if multiple capability tables are associated in a binary tree manner, the data structure is a binary tree structure; if multiple capability tables are associated in a singly linked list manner, the data structure is a singly linked structure; if multiple capability tables are associated in a doubly linked list manner, the data structure is a doubly linked structure.

[0072] After constructing the second capability table, the device creates the first structural node and the second structural node.

[0073] Step S202: Control the data content pointer of the first structure node to point to the first capability table, and control the data content pointer of the second structure node to point to the second capability table.

[0074] Both the first and second structural nodes are equipped with pointers, including data content pointers. The device controls the data content pointer of the first structural node to point to the first capability table, and controls the data content pointer of the second structural node to point to the second capability table.

[0075] Step S203: Configure the relationship between the first structural node and the second structural node to associate the first capability table with the second capability table.

[0076] After the first and second structural nodes are associated with their corresponding capability tables via data content pointers, the device needs to configure the relationship between the first and second structural nodes to associate the first and second capability tables. For example, the first structural node may also have other pointers; by setting these other pointers to the second structural node, the relationship between the first and second structural nodes can be configured.

[0077] In this embodiment, the device creates a first structural node and a second structural node, thereby associating the first capability table and the second capability table through the first structural node and the second structural node.

[0078] Reference Figure 3 , Figure 3 This is a third embodiment of the data storage method of the present invention. Based on the second embodiment, step S203 includes:

[0079] Step S301: Control the next node pointer of the first structure node to point to the second structure node.

[0080] In this embodiment, the first structural node and the second structural node are singly linked list nodes, that is, the first capability table and the second capability table are associated through a singly linked list.

[0081] Both the first and second structural nodes have a next node pointer, and the device controls the next node pointer of the first structural node to point to the second structural node. Furthermore, when the device constructs a third capability table, it constructs a third structural node, sets the data content pointer of the third structural node to point to the third capability table, and controls the next node pointer of the second structural node to point to the third structural node. This process continues, and the device creates and associates multiple capability tables using a singly linked list.

[0082] Reference Figure 4 , Figure 4 This is a diagram illustrating the association of various capability tables based on unidirectional links. Figure 4 In the middle, entry0 refers to the capability data that fills the first item in the capability table, entry1 refers to the capability data that fills the second item in the capability table, and entry MAX refers to the capability data that fills the last item in the capability table; the pointers to the corresponding capability tables of nodes 1, 2, and 3 are all data content pointers, and the pointers from node 1 to node 2 and from node 2 to node 3 are all pointers to the next node.

[0083] In this embodiment, the device associates the first capability table with the second capability table in the form of a one-way linked list, which facilitates the filling of capability data in the capability table and enables the quick retrieval of capability data from the capability table based on the associated capability table.

[0084] Reference Figure 5 , Figure 5 This is a fourth embodiment of the data storage method of the present invention. Based on the second embodiment, step S203 includes:

[0085] Step S501: Control the next node pointer of the first structure node to point to the second structure node.

[0086] Step S502: Control the pointer of the previous node of the second structure node to point to the first structure node.

[0087] In this embodiment, the first structural node and the second structural node are doubly linked list nodes. In addition to the data content pointer, the doubly linked node is also provided with a pointer to the previous node and a pointer to the next node.

[0088] The device controls the pointer of the next node of the first structural node to point to the second structural node, and then controls the pointer of the previous node of the second structural node to point to the first structural node. Furthermore, when the device constructs a third capability table, it constructs a third structural node, sets the data content pointer of the third structural node to point to the third capability table, and controls the pointer of the next node of the second structural node to point to the third structural node, and then controls the pointer of the previous node of the third structural node to point to the second structural node. This process continues, and the device creates and links multiple capability tables using a doubly linked list.

[0089] Reference Figure 6 , Figure 6 This is a diagram illustrating the connection between various capability tables based on bidirectional links. Figure 6 In the table, entry0 refers to the capability data that fills the first item in the capability table, entry1 refers to the capability data that fills the second item in the capability table, and entry MAX refers to the capability data that fills the last item in the capability table. The pointers to the corresponding capability tables of nodes 1, 2, and 3 are all data content pointers. The pointers from node 1 to node 2 and from node 2 to node 3 are all pointers to the next node. The pointers from node 2 to node 1 and from node 3 to node 2 are all pointers to the previous node.

[0090] In this embodiment, the device associates the first capability table with the second capability table in the form of a doubly linked list, which facilitates the filling of capability data in the capability table and enables the quick retrieval of capability data from the capability table based on the associated capability table.

[0091] Reference Figure 7 , Figure 7 This is the fifth embodiment of the data storage method of the present invention. Based on the second embodiment, step S203 includes:

[0092] Step S701: Set the first child pointer of the first structure node to point to the second structure node.

[0093] In this embodiment, the first structure node and the second structure node are binary tree nodes. A binary tree node includes a data content pointer and child pointers.

[0094] The device controls the first child pointer of the first structural node to point to the second structural node, thereby indicating that the second structural node is a child node of the first structural node, that is, the second capability table is a child table of the first capability table.

[0095] Furthermore, upon detecting that the second capability table stores a second preset amount of capability data, it can be determined that the second capability table is full. The device then constructs a third capability table in the kernel and creates a third structure node. The third structure node is a binary tree node. The device controls the data content pointer of the third structure node to point to the third capability table, and controls the second child pointer of the first structure node to point to the third structure node.

[0096] Reference Figure 8 , Figure 8 This is a diagram illustrating the association of various capability tables using a binary tree approach. Figure 8 In the middle, entry0 refers to the capability data filled in the first item of the capability table, entry1 refers to the capability data filled in the second item of the capability table, and entry MAX refers to the capability data filled in the last item of the capability table; the pointers of node1, node2, and node3 to the corresponding capability tables are all data content pointers, and the pointers of node1 to node2 and node1 to node3 are all child pointers; the child pointers of node2 and node3 are used to point to the structural nodes corresponding to the capability tables built later.

[0097] In this embodiment, the device associates the first capability table with the second capability table in the form of a binary tree, thereby facilitating the filling of capability data in the capability table and enabling the rapid retrieval of capability data from the capability table based on the associated capability table.

[0098] Reference Figure 9 , Figure 9 This is the sixth embodiment of the data storage method of the present invention. Based on any one of the second to fifth embodiments, after step S203, it further includes:

[0099] Step S901: Obtain the first capability data to be filled and fill the second capability table with the first capability data.

[0100] In this embodiment, after the device associates the first capability table with the second capability table, if it is necessary to store capability data, the capability data is stored in the second capability table.

[0101] When creating a structure node corresponding to a capability table, the device configures a node number (e.g., M) for the structure node. After obtaining the first capability data to be filled, the device determines the capability table pointed to by the structure node corresponding to the node number, finds an empty capability table entry in that table, and then fills the first capability data into that capability table entry. For example, the device obtains the latest node number, the structure node corresponding to the latest node number is the structure node corresponding to the new capability table, the new capability table has an empty capability table entry, and the device fills the first capability data into the empty capability table entry.

[0102] Step S902: Obtain the index number of the position of the first capability data in the second capability table, and obtain the node number of the second structure node corresponding to the second capability table, and store the identifier, index number and node number of the first capability data together.

[0103] The capability table entry that populates the first capability data has an index number N. The device obtains the index number corresponding to the first capability data and the node number of the structure node corresponding to the capability table containing index number N. The device stores the identifier, index number, and node number of the first capability data in association, as an index handle for the next search of the first capability data.

[0104] Step S903: When a request to acquire first capability data is detected, the identifier of the first capability data is acquired according to the acquisition request, and the index number and node number associated with the first capability data are acquired according to the identifier.

[0105] When the device needs to obtain the first capability data, that is, when it detects a request to obtain the first capability data, it obtains the identifier of the first capability data from the request and obtains the node number and index number associated with the identifier from the stored information.

[0106] Step S904: Obtain the first capability data from the second capability table based on the node number and index number.

[0107] The device determines the structural node corresponding to the node number and locates the capability table to which the first capability data is filled based on the data content of the structural node. The device can determine the position of the first capability data in the capability table based on the index number, and thus retrieve the first capability data from that position.

[0108] In this embodiment, when the device stores capability data in the capability table, it records the index number of the storage location of the capability data in the capability table and the node number of the structure node corresponding to the capability table. When the device needs to obtain capability data, it can quickly obtain the capability data from the capability data based on the index number and the node number.

[0109] In one embodiment, the first capability table and the second capability table are located in the kernel's data segment. Specifically, the first capability table and the second capability table can be located in the kernel's data segment as global variables. For example, the first capability table is set as a global variable with a pointer to root_table, and after storing the first capability table in the kernel's data segment, root_table is set to point to node 1. The device can store the constructed capability tables in the kernel's data segment in this way. Furthermore, the first capability table and the second capability table are located in each process of the kernel. Specifically, the capability table is stored as process-associated data in the process's context data structure. It is understood that the various capability tables in the device are located in the kernel's data segment or in each process of the kernel.

[0110] The present invention also provides a data storage device, with reference to Figure 10 The data storage device 1000 includes:

[0111] The construction module 1010 is used to construct a first capability table in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides;

[0112] The construction module 1010 is used to construct a second capability table in the kernel when it is detected that the first capability table stores a first preset amount of capability data;

[0113] The association module 1020 is used to associate the first capability table with the second capability table.

[0114] In one embodiment, the data storage device 1000 includes:

[0115] Create a module to create the first structural node and the second structural node;

[0116] The control module is used to control the data content pointer of the first structure node to point to the first capability table, and to control the data content pointer of the second structure node to point to the second capability table;

[0117] The configuration module is used to configure the relationship between the first structure node and the second structure node, so as to associate the first capability table with the second capability table.

[0118] In one embodiment, the data storage device 1000 includes:

[0119] The control module is used to control the next node pointer of the first structure node to point to the second structure node.

[0120] In one embodiment, the data storage device 1000 includes:

[0121] The control module is used to control the next node pointer of the first structure node to point to the second structure node;

[0122] The control module is used to control the pointer of the previous node of the second structure node to point to the first structure node.

[0123] In one embodiment, the data storage device 1000 includes:

[0124] The control module is used to point the first child pointer of the first structure node to the second structure node.

[0125] In one embodiment, the data storage device 1000 includes:

[0126] The construction module 1010 is used to construct a third capability table in the kernel and create a third structure node when it is detected that the second capability table stores a second preset amount of capability data. The third structure node is a binary tree node.

[0127] The control module is used to control the data content pointer of the third structure node to point to the third capability table;

[0128] The control module is used to control the second child pointer of the first structure node to point to the third structure node, so as to associate the third capability table with the first capability table.

[0129] In one embodiment, the data storage device 1000 includes:

[0130] The acquisition module is used to acquire the first capability data to be filled and to fill the second capability table with the first capability data;

[0131] The acquisition module is used to acquire the index number of the position of the first capability data in the second capability table, and to acquire the node number of the second structure node corresponding to the second capability table;

[0132] The storage module is used to associate and store the identifier, index number, and node number of the first capability data.

[0133] The acquisition module is used to acquire the identifier of the first capability data according to the acquisition request when the acquisition request of the first capability data is detected, and to acquire the index number and node number associated with the first capability data according to the identifier;

[0134] The acquisition module is used to retrieve the first capability data from the second capability table based on the node number and index number.

[0135] Figure 11 This is a schematic diagram of the hardware structure of a data storage device according to an exemplary embodiment.

[0136] Data storage device 1100 may include: a processor 1101, such as a CPU, a memory 1102, and a transceiver 1103. Those skilled in the art will understand that... Figure 11The structure shown does not constitute a limitation on the data storage device and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Memory 1102 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0137] The processor 1101 can call the computer program stored in the memory 1102 to complete all or part of the steps of the above data storage method.

[0138] Transceiver 1103 is used to receive information sent by external devices and to send information to external devices.

[0139] A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of a data storage device, the data storage device is able to perform the aforementioned data storage method.

[0140] A computer program product includes a computer program that, when executed by a processor of a data storage device, enables the data storage device to perform the aforementioned data storage method.

[0141] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0142] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data storage method, characterized in that, include: A first capability table is constructed in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides; When it is detected that the first capability table stores a first preset amount of capability data, a second capability table is constructed in the kernel; Associate the first capability table with the second capability table.

2. The data storage method according to claim 1, characterized in that, The step of associating the first capability table with the second capability table includes: Create the first structural node and the second structural node; Control the data content pointer of the first structure node to point to the first capability table, and control the data content pointer of the second structure node to point to the second capability table; Configure the relationship between the first structure node and the second structure node to associate the first capability table with the second capability table.

3. The data storage method according to claim 2, characterized in that, The first structural node and the second structural node are singly linked list nodes, and the step of configuring the relationship between the first structural node and the second structural node includes: Control the next node pointer of the first structure node to point to the second structure node.

4. The data storage method according to claim 2, characterized in that, The first structural node and the second structural node are doubly linked list nodes, and the step of configuring the relationship between the first structural node and the second structural node includes: Control the next node pointer of the first structure node to point to the second structure node; Control the pointer of the previous node of the second structure node to point to the first structure node.

5. The data storage method according to claim 2, characterized in that, The first structural node and the second structural node are binary tree nodes, and the step of configuring the relationship between the first structural node and the second structural node includes: Set the first child pointer of the first structure node to point to the second structure node.

6. The data storage method according to claim 5, characterized in that, The second capability table is used to store a second preset number of capability data. After the step of pointing the first child pointer of the first structure node to the second structure node, the method further includes: When it is detected that the second capability table stores a second preset amount of capability data, a third capability table is constructed in the kernel, and a third structure node is created, wherein the third structure node is a binary tree node; The data content pointer of the third structural node is controlled to point to the third capability table; The second child pointer of the first structural node is controlled to point to the third structural node, so as to associate the third capability table with the first capability table.

7. The data storage method according to any one of claims 2-6, characterized in that, After the step of configuring the relationship between the first structural node and the second structural node, the method further includes: Obtain the first capability data to be filled, and fill the second capability table with the first capability data; Obtain the index number of the position of the first capability data in the second capability table, and obtain the node number of the second structure node corresponding to the second capability table; The identifier of the first capability data, the index number, and the node number are associated and stored together. When a request to acquire the first capability data is detected, the identifier of the first capability data is acquired according to the acquisition request, and the index number and node number associated with the first capability data are acquired according to the identifier. The first capability data is obtained from the second capability table based on the node number and the index number.

8. A data storage device, characterized in that, include: A construction module is used to construct a first capability table in the kernel, wherein the first capability table is used to store a first preset number of capability data, and the first preset number is determined according to the number of capabilities used by the operating system on which the kernel resides; The construction module is configured to construct a second capability table in the kernel when it is detected that the first capability table stores a first preset amount of capability data. The association module is used to associate the first capability table with the second capability table.

9. A data storage device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to perform the data storage method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data storage method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and apparatus for managing a memory for storing potentially configurable entries in a list

    CN101420635A

  • Container creation method, related device and computer storage medium

    CN107643940A