CN112667637B - Data management method, device and computer readable storage medium - Google Patents

Data management method, device and computer readable storage medium Download PDF

Info

Publication number
CN112667637B
CN112667637B CN202011634319.1A CN202011634319A CN112667637B CN 112667637 B CN112667637 B CN 112667637B CN 202011634319 A CN202011634319 A CN 202011634319A CN 112667637 B CN112667637 B CN 112667637B
Authority
CN
China
Prior art keywords
array
index
allocable
value
service
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.)
Active
Application number
CN202011634319.1A
Other languages
Chinese (zh)
Other versions
CN112667637A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011634319.1A priority Critical patent/CN112667637B/en
Publication of CN112667637A publication Critical patent/CN112667637A/en
Application granted granted Critical
Publication of CN112667637B publication Critical patent/CN112667637B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a data management method, which comprises the following steps: acquiring a service array and an index array, wherein the index array stores index values of all idle elements in the service array; when the service array has the acquisition requirement of the idle element, applying for the index value of the allocable element in the index array according to a preset rule, and positioning the memory of the allocable element in the service array according to the index value of the allocable element; and allocating the memory serving as the idle element to corresponding service use. The application also provides a data management device and a computer readable storage medium. The data management method provided by the application can efficiently and rapidly search the idle elements.

Description

Data management method, device and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of software development, in particular to a data management method, a data management device and a computer readable storage medium.
Background
In the prior art, a method of traversing an array is generally adopted for searching for free elements, as shown in fig. 1, each element in the array defines a Valid field as the validity of the element, valid fields of all elements in the array are initialized to be Valid, when each free element is acquired, the array is traversed to find the element with the Valid field, and after the element is taken out, the Valid field of the element is set to be invalid. When there are more array elements, this lookup approach of the prior art is very inefficient.
Disclosure of Invention
The embodiment of the application aims to provide a data management method which can efficiently and quickly search idle elements.
In order to solve the above technical problems, an embodiment of the present application provides a data management method, including: acquiring a service array and an index array, wherein the index array stores index values of all idle elements in the service array; when the service array has the acquisition requirement of the idle element, applying for the index value of the allocable element in the index array according to a preset rule, and positioning the memory of the allocable element in the service array according to the index value of the allocable element; and allocating the memory serving as the idle element to corresponding service use.
The embodiment of the application also provides a data management device, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the data management method described above.
The embodiment of the application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the data management method described above.
Compared with the prior art, the embodiment of the application adopts a mode of combining the index array and the service array, manages the allocation of the idle elements by managing the index values of the service array, can rapidly realize the resource allocation and recovery of the idle nodes by the association relation direction of the internal elements, and reduces a large number of cyclic traversal operations, thus having high searching efficiency even under the condition of a large number of service array elements.
Preferably, the method further comprises: and after the memory is allocated to the corresponding service, recovering the index value of the allocable element in the index array.
Preferably, after the service data and the index array are acquired, initializing the index array is further included, where the initializing the index array includes: representing the index value of the current allocable element in the index array by a preset CUR_ID, and positioning the memory of the current allocable element in the service array according to the CUR_ID; storing index values of all idle elements in the service array in the index array; defining the array value of each element in the index array as 64 bytes, wherein the first 32 bytes are used for storing the index value of the corresponding last allocable element in the array value of the current allocable element, and the last 32 bytes are used for storing the index value of the corresponding next allocable element in the array value of the current allocable element; initializing the cur_id to 0.
Preferably, the applying for the index value of the allocable element in the index array according to the preset rule includes: applying for the index values of the allocable elements in the index array according to the arrangement sequence of the index values of the allocable elements in the index array.
Preferably, the applying for the index value of the allocable element in the index array according to the preset rule further includes: and applying for a target index value in the index array according to the service requirement.
Preferably, the applying for the index of the allocable element in the index array according to the arrangement order of the index values of the allocable element in the index array includes: step a, when the idle element acquisition requirement exists in the service array, an element represented by the CUR_ID is used as a current assignable element to be assigned as the idle element, and the index value of the next assignable element stored in the array value of the current assignable element in the index array is assigned to the CUR_ID; setting the array value of the element which is already allocated as an invalid value in the index array, and setting the index value of the last allocable element stored in the array value of the element represented by the CUR_ID after being allocated as the invalid value; c, positioning the idle element to the memory of the service array according to the index value of the idle element obtained by allocation to perform service operation; and d, repeating the steps a to c when a new idle element acquisition requirement exists.
Preferably, the applying for the target index value in the index array according to the service requirement includes: according to the service requirement, a target element represented by a target index value is used as a current assignable element and is assigned as an idle element; setting the index value of the last allocable element and the index value of the next allocable element stored in the array value of the target element in the index array as invalid values; and updating the index value of the next allocable element stored in the array value as the target index value to the index value of the next allocable element stored in the array value of the target element, and updating the index value of the last allocable element stored in the array value as the target index value to the index value of the last allocable element stored in the array value of the target element.
Preferably, the recovering the index value of the allocable element in the index array includes: when the designated element to be recovered is obtained, obtaining a current assignable element and a next assignable element in the index array; updating the index value of the next allocable element stored in the current allocable element array value and the index value of the last allocable element stored in the next allocable element array value to be the index value of the appointed element; updating the index value of the last allocable element stored in the array of the designated element to the index value of the current allocable element, and updating the index value of the next allocable element stored in the array of the designated element to the index value of the next allocable element; and positioning the memory of the specified element in the service array according to the index value of the specified element, and clearing the specified element in the memory of the service array.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings.
FIG. 1 is a schematic diagram of a business array created in the prior art;
FIG. 2 is a flow chart of a data management method according to a first embodiment of the present application;
FIG. 3 is a schematic diagram of a service array created in accordance with a first embodiment of the present application;
FIG. 4 is a schematic diagram of an index array created in accordance with a first embodiment of the present application;
FIGS. 5-7 are exemplary diagrams of sequentially applying for index values of allocatable elements in the index array according to a first embodiment of the application;
fig. 8 to 9 are exemplary diagrams of applying a target index value in the index array according to a service requirement in the first embodiment of the present application;
FIGS. 10-12 are exemplary diagrams of reclaiming index values of allocatable elements in the index array according to a first embodiment of the application;
fig. 13 is a schematic structural view of a data management apparatus according to a second embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings. However, those of ordinary skill in the art will understand that in various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. However, the claimed application may be practiced without these specific details and with various changes and modifications based on the following embodiments.
The first embodiment of the application relates to a data management method, and the core of the embodiment is that the index value of the service array is managed through the index array by adopting a mode of combining the index array and the service array, so that the allocation of idle elements is managed, and the resource allocation and recovery of the idle nodes can be rapidly realized through the association relation direction of the internal elements, so that a large number of cyclic traversal operations are reduced. The implementation details of the data management method of the present embodiment are specifically described below, and the following description is merely provided for convenience of understanding, and is not necessary to implement the present embodiment.
A schematic flow chart of a data management method in this embodiment is shown in fig. 2, and the method is applied to a data management apparatus.
In this embodiment, the execution sequence of the steps in the flowchart shown in fig. 2 may be changed, and some steps may be omitted according to different requirements.
Step S101: and acquiring a service array and an index array, wherein the index array stores index values of all idle elements in the service array.
An Array (Array) is a set of data of the same type. However, in the actual programming process, a set of data with different types is often required, for example, for a student information registry, the name is a character string, the school number is an integer, the age is an integer, the learning group where the student information registry is located is a character, the score is a decimal, obviously the data types are not the same, and the data cannot be stored by an array. While a structure (Struct) may store a set of different types of data, the structure may be declared as a variable, pointer, array, or the like, for implementing a more complex data structure. Therefore, in this embodiment, the service array is preferably a structure array. In this embodiment, the service array is used to store real service data in the data management process. In this embodiment, the service array is also initialized after the service array is acquired. As shown in fig. 3, the service array created in the present embodiment includes n element sizes (data 1, data 2 …, data n), and has an index value of 1,2 … n-1, n, and the service array is initialized to 0. In contrast to the prior art in fig. 1, in this embodiment, each element does not need to define a Valid field.
In this embodiment, the obtained index array is created in advance, and is used to save index values of all idle elements in the service array. Likewise, the index array is initialized after it is acquired.
An array is a basic data structure, and a set of finite elements of the same data type arranged in order is an array. The data of the array is continuous, has an upper bound and a lower bound, and the elements in the array all have index values belonging to the elements, also called subscripts, and can be positioned to the array values of the elements through the subscripts. For example, array a [10] is represented as having ten elements, subscripts (also called index values) ranging from 0 to 9, and in array a [10], the index values of ten elements a [0], a [1], a [2], a [3], a [4], a [5], a [6], a [7], a [8], a [9] are 0, 1,2, 3, 4, 5, 6, 7, 8, 9, respectively. The array may be divided into a one-dimensional array, a two-dimensional array, a three-dimensional array, etc. according to the dimensions, and so on. In this embodiment, the dimensions of the array are not limited, and in order to clearly illustrate the present application, a one-dimensional array is taken as an example. In addition, in order to correspond to the index array in this embodiment, the subscripts of the array in this embodiment are collectively referred to as an index value.
In this embodiment, an index array is created, and index values of all idle elements in the service array are stored in the index array, so that when there is a demand for acquiring idle elements in the service array, the allocable idle elements can be quickly found in the index array. The specific searching method will be described in detail in step S104, and will not be described here again. The following describes how the index array is initialized:
the data management device indicates the index value of the currently allocatable free element stored in the index array through the preset CUR_ID, and positions the memory and the array value of the currently allocatable element in the service array according to the CUR_ID. Then, in the index array, the index values of all the free elements (i.e., allocable elements) in the service array are saved, and in the preferred embodiment, all the free elements are saved in the index array in the order of the index values of the free elements in the service array. Wherein, the array value of each element in the INDEX array is defined as 64 bytes, wherein the first 32 bytes are used to store the INDEX value of the corresponding last allocable element in the array value of the current allocable element (e.g. pre_index in fig. 4), the last 32 bytes are used to store the INDEX value of the corresponding NEXT allocable element in the array value of the current allocable element (e.g. next_index in fig. 4), and further, the cur_id is initialized to 0. As shown in fig. 4, an index array with an element size of n+1 is established, the array name is index [ n+1], and the index values 0, 1,2, 3 … n-1, n of the elements of the index array index [ n+1] are shown on the left side of fig. 4, wherein the index values of the index array index [ n+1] are in one-to-one correspondence with the index values of the assignable elements in the service array, and the index values of the index array index [ n+1] are not necessarily continuous in view of that the idle elements in the service array can be continuous or discontinuous, but are illustrated by continuous index values in fig. 4, but are not limited to. The right side of fig. 4 shows the content stored in each element array value of index array [ n+1], for example, the first 32 bits of the array value corresponding to element 0 are the index value of the last assignable element of element 0, and obviously, element 0 is the index value of the last assignable element whose initial value does not exist, and thus, is initialized to an invalid value 0xffffffff, and the last 32 bits of the array value corresponding to element 0 are the index value of the next assignable element of element 0, which is obviously 1. And so on, the index values of all the free elements (allocatable elements) in the service array are stored in the index array index [ n+1], and in addition, as can be seen from fig. 4, the last 32 bits of the array value corresponding to the element n in the index array index [ n+1] are the index values of the next allocatable element of the element n, and since the service array size is n, it is obvious that there is no next allocatable element of n, and therefore, the index value is initialized to the invalid value 0xffffffff. Thus, after the index array index [ n+1] is initialized, the index values of all free elements (allocatable elements) in the service array are saved in a similar manner to a linked list. When the element size of the service array is n, the element size of the index array is n+1, and one more element than the service array is provided, wherein the one more element size is: the first 32 bytes and the last 32 bytes in the array value of the index array are all invalid values. In this embodiment, a global cur_id is set to indicate the index value of the currently allocable element in the index array. As shown in fig. 4, cur_id is initialized to 0.
Step S102: when the service array has the acquisition requirement of the idle elements, applying for the index values of the allocable elements in the index array according to a preset rule, and positioning the memory of the allocable elements in the service array and the array value according to the index values of the allocable elements.
Specifically, the data management device first determines whether the service array has a requirement for acquiring an idle element. Only when the acquisition requirement of the free elements exists, the data management device needs to search the index value of the allocatable elements in the index array, and then index the corresponding allocatable elements in the service array according to the index value.
Further, the applying for the index value of the allocable element in the index array according to the preset rule includes the following steps:
first, applying for the index values of the allocable elements in the index array according to the arrangement sequence of the index values of the allocable elements in the index array. The order of the index values of the allocable elements in the index array may be from small to large (as shown in fig. 4) or from large to small. In the present embodiment, the present application is not limited thereto.
Secondly, applying for a target index value in the index array according to the service requirement.
The following two ways are respectively described:
applying for the index values of the allocable elements in the index array according to the arrangement sequence of the index values of the allocable elements in the index array, including the following steps:
step a, when the idle element acquisition requirement exists in the service array, an element represented by the CUR_ID is used as a current assignable element to be assigned as the idle element, and the index value of the next assignable element stored in the array value of the current assignable element in the index array is assigned to the CUR_ID;
setting the array value of the element which is already allocated as an invalid value in the index array, and setting the index value of the last allocable element stored in the array value of the element represented by the CUR_ID after being allocated as the invalid value;
c, positioning the idle element to the memory of the service array according to the index value of the idle element obtained by allocation to perform service operation;
and d, repeating the steps a to c when a new idle element acquisition requirement exists.
For example, as shown in fig. 4, when there is a free element acquisition requirement in the service array, element 0 is allocated as a free element, INDEX value 1 (next_index is 1) of the NEXT allocable element in the array value of element 0 in the INDEX array is assigned to the cur_id, at this time, the cur_id points to element 1 of INDEX array INDEX [ n+1] (as shown in fig. 5), the array value of element 0 that has been allocated is set to an invalid value 0xffffff, that is, the INDEX value (pre_index) of the last allocable element in the array value of element 0 and the INDEX value (next_index) of the NEXT allocable element are both set to an invalid value 0xffffffff, and at the same time, the INDEX value (pre_index) of the last allocable element in the array value of element 1 is also set to an invalid value 0xffffff (as shown in fig. 6). Thus, the index value 0 of the current allocable element 0 is positioned to the structure body memory and the array value corresponding to the element with the index value 0 in the service array. When the next free element requirement occurs, element 1 pointed to by the cur_id is allocated as the currently allocatable element to the free element, and steps a-c are repeated. And so on, when a new free element is required, sequentially applying for the element pointed by the CUR_ID to be distributed to the free element in the index array according to the arrangement sequence of the index values of the allocable elements in the index array (as shown in fig. 7).
Of course, for some special service requirements, the above sequential application of index values of assignable elements does not meet the actual requirements. For example, some products must acquire data before power-off after power-off restart and reload, thus, the acquisition target idle element must be specified. Therefore, in the present embodiment, the second mode can apply for the index value of the allocatable element as needed to satisfy the situation.
Specifically, applying for the target index value in the index array according to the service requirement includes the following steps:
the data management device takes the target element represented by the target index value as the current assignable element to be assigned as the idle element according to the service requirement; setting the index value of the last allocable element and the index value of the next allocable element stored in the array value of the target element in the index array as invalid values; and updating the index value of the next allocable element stored in the array value as the target index value to the index value of the next allocable element stored in the array value of the target element, and updating the index value of the last allocable element stored in the array value as the target index value to the index value of the last allocable element stored in the array value of the target element.
For example, as shown in fig. 8, it is necessary to allocate an element 3 with an INDEX value of 3 in the INDEX array as a free element, in fig. 8, according to the fact that next_index is 0 and next_index is 4 in the array value of the element 3, the INDEX value of the allocable element in the INDEX array is known, and according to the arrangement order of 0, 3 and 4, after allocating an element with a specified target INDEX value of 3 to the free element, the INDEX value 3 (next_index) of the corresponding NEXT allocable element in the array value of the element 0 is updated to 4, and the INDEX value 3 (pre_index) of the corresponding last allocable element in the array value of the element 4 is updated to 0. In addition, the INDEX value (pre_index) of the last allocatable element and the INDEX value (next_index) of the NEXT allocatable element corresponding to the array value of the element 3 are both set to the invalid value 0xffffffff. Thus, the index array shown in FIG. 9 can be obtained after updating.
Further, after the specified target index value is obtained, the memory of the idle element in the service array and the array value can be positioned according to the target index value so as to expand the service requirement.
Step S103: and allocating the memory serving as the idle element to corresponding service use.
In this embodiment, when there is a need to acquire an idle element in the service expanding process, after acquiring an index value of the allocatable idle element from the index array, the memory of the allocatable idle element may be directly located in the service array according to the acquired index value, and the memory is allocated to a corresponding service for use.
Further, in this embodiment, when the index values of the allocable elements are sequentially applied in the index array, the index values of the allocable elements may be recovered in the index array after the memory is allocated to the corresponding service for use, as required. The method comprises the following specific steps:
when the designated element to be recovered is obtained, obtaining a current assignable element and a next assignable element in the index array;
updating the index value of the next allocable element stored in the current allocable element array value and the index value of the last allocable element stored in the next allocable element array value to be the index value of the appointed element;
updating the index value of the last allocable element stored in the array of the designated element to the index value of the current allocable element, and updating the index value of the next allocable element stored in the array of the designated element to the index value of the next allocable element;
and positioning the memory of the specified element in the service array according to the index value of the specified element, and clearing the specified element in the memory of the service array.
For example, as shown in fig. 10, the element pointed to by the current cur_id is 2, which represents that the current allocatable element in the index array is 2, and the next allocatable element in the order is 3.
When the element 0 with the INDEX value of 0 needs to be recovered, that is, the element 0 with the INDEX value of 0 is re-strung between the element 2 and the element 3, the INDEX value (pre_index) of the last allocatable element and the INDEX value (pre_index) of the next allocatable element corresponding to the array value of the element 0 need to be respectively assigned to the INDEX value 2 with the INDEX value 2 of the currently allocatable element and the INDEX value 3 with the next allocatable element (as shown in fig. 11).
In addition, the INDEX value (next_index) of the NEXT allocatable element corresponding to the array value of the element 2 is assigned to the INDEX value 0 of the element 0 to be recycled, and the INDEX value (pre_index) of the last allocatable element corresponding to the array value of the element 3 is assigned to the INDEX value 0 of the element 0 to be recycled (as shown in fig. 12). And finally, clearing the memory of the element with the index value of 0 in the service array, thereby completing the recovery of the element 0 with the index value of 0.
In the application, the allocation of idle elements is managed by managing the index value (or subscript) of the service array, the consumption time is constant, and the consumption time is not changed along with the size of the array. The larger the array, the higher the performance ratio relative to the prior art.
Compared with the prior art, the method and the device have the advantages that the index array and the service array are combined, the resource allocation and recovery of the idle nodes can be rapidly realized through the association relation direction of the internal elements, and a large number of cyclic traversal operations are reduced. Therefore, even in the case of many traffic array elements, the search efficiency is high. According to the embodiment of the application, the idle elements can be efficiently and quickly searched, distributed and managed.
The above steps of the methods are divided, for clarity of description, and the execution sequence of the steps is not limited, and the steps can be combined into one step or split into a plurality of steps when implemented, so long as the steps comprise the same logic relationship, and the steps are all within the protection scope of the present patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
A third embodiment of the present application relates to a data management apparatus, as shown in fig. 13, comprising at least one processor 301; and a memory 302 communicatively coupled to the at least one processor 301; the memory 302 stores instructions executable by the at least one processor 301, the instructions being executable by the at least one processor 301 to enable the at least one processor 301 to perform the steps of the data management method described above.
Where the processor 301 and the memory 302 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors 301 and the memory 302 together. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 301 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 301.
The processor 301 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 302 may be used to store data used by processor 301 in performing operations.
The embodiment of the application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the data management method described above.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples of carrying out the application and that various changes in form and details may be made therein without departing from the spirit and scope of the application.

Claims (9)

1. A method of data management, comprising:
acquiring a service array and an index array, wherein the index array stores index values of all idle elements in the service array;
when the service array has the acquisition requirement of the idle element, applying for the index value of the allocable element in the index array according to a preset rule, and positioning the memory of the allocable element in the service array according to the index value of the allocable element;
the memory is used as the memory of the idle element to be allocated to the corresponding service for use;
after the service array and the index array are obtained, initializing the index array is further included, wherein initializing the index array includes:
representing the index value of the current allocable element in the index array by a preset CUR_ID, and positioning the memory of the current allocable element in the service array according to the CUR_ID;
storing index values of all idle elements in the service array in the index array;
defining the array value of each element in the index array as 64 bytes, wherein the first 32 bytes are used for storing the index value of the corresponding last allocable element in the array value of the current allocable element, and the last 32 bytes are used for storing the index value of the corresponding next allocable element in the array value of the current allocable element;
initializing the cur_id to 0.
2. The method of data management according to claim 1, wherein the method further comprises:
and after the memory is allocated to the corresponding service, recovering the index value of the allocable element in the index array.
3. The method of claim 1, wherein applying for the index value of the allocable element in the index array according to the preset rule includes:
applying for the index values of the allocable elements in the index array according to the arrangement sequence of the index values of the allocable elements in the index array.
4. The data management method according to claim 3, wherein applying for the index value of the allocable element in the index array according to a preset rule further comprises:
and applying for a target index value in the index array according to the service requirement.
5. A data management method according to claim 3, wherein applying for the indexes of the allocable elements in the index array in the order of the allocable element index values in the index array comprises:
step a, when the idle element acquisition requirement exists in the service array, an element represented by the CUR_ID is used as a current assignable element to be assigned as the idle element, and the index value of the next assignable element stored in the array value of the current assignable element in the index array is assigned to the CUR_ID;
setting the array value of the element which is already allocated as an invalid value in the index array, and setting the index value of the last allocable element stored in the array value of the element represented by the CUR_ID after being allocated as the invalid value;
c, positioning the idle element to the memory of the service array according to the index value of the idle element obtained by allocation to perform service operation;
and d, repeating the steps a to c when a new idle element acquisition requirement exists.
6. The method of claim 4, wherein applying for the target index value in the index array according to the service requirement comprises:
according to the service requirement, a target element represented by a target index value is used as a current assignable element and is assigned as an idle element;
setting the index value of the last allocable element and the index value of the next allocable element stored in the array value of the target element in the index array as invalid values;
updating the index value of the next allocable element stored in the array value of the index array as the index value of the target element,
and updating the index value of the last allocable element stored in the array value in the index array as the index value of the last allocable element stored in the array value of the target element.
7. The method of claim 1, wherein the retrieving the index value of the allocatable element in the index array comprises:
when the designated element to be recovered is obtained, obtaining a current assignable element and a next assignable element in the index array;
updating the index value of the next allocable element stored in the current allocable element array value and the index value of the last allocable element stored in the next allocable element array value to be the index value of the appointed element;
updating the index value of the last allocable element stored in the array of the designated element to the index value of the current allocable element, and updating the index value of the next allocable element stored in the array of the designated element to the index value of the next allocable element;
and positioning the memory of the specified element in the service array according to the index value of the specified element, and clearing the specified element in the memory of the service array.
8. A data management apparatus, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the data management method according to any one of claims 1 to 7.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the data management method according to any one of claims 1 to 7.
CN202011634319.1A 2020-12-31 2020-12-31 Data management method, device and computer readable storage medium Active CN112667637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011634319.1A CN112667637B (en) 2020-12-31 2020-12-31 Data management method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011634319.1A CN112667637B (en) 2020-12-31 2020-12-31 Data management method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112667637A CN112667637A (en) 2021-04-16
CN112667637B true CN112667637B (en) 2023-09-19

Family

ID=75413304

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011634319.1A Active CN112667637B (en) 2020-12-31 2020-12-31 Data management method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112667637B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1024661A2 (en) * 1999-01-27 2000-08-02 Hughes Electronics Corporation Pictographic electronic program guide
CN101080094A (en) * 2007-04-27 2007-11-28 上海华为技术有限公司 URNTI allocation method and its device
CN101222357A (en) * 2007-12-26 2008-07-16 杭州华三通信技术有限公司 Method and system for preserving hardware table item index, master control board and interface board
CN101286160A (en) * 2008-05-30 2008-10-15 同济大学 Data base indexing process
CN102915340A (en) * 2012-02-29 2013-02-06 浙江工商大学 Expanded B+ tree-based object file system
CN103678160A (en) * 2012-08-30 2014-03-26 腾讯科技(深圳)有限公司 Data storage method and device
CN106210021A (en) * 2016-07-05 2016-12-07 中国银行股份有限公司 The method for real-time monitoring of financial application system online business and supervising device
CN107016100A (en) * 2017-04-10 2017-08-04 重庆大学 A kind of metadata management method based on Nonvolatile memory file system
CN108121813A (en) * 2017-12-27 2018-06-05 东软集团股份有限公司 Data managing method, device, system, storage medium and electronic equipment
CN108614734A (en) * 2016-12-13 2018-10-02 迈普通信技术股份有限公司 Security Parameter Index management method and device
CN111597392A (en) * 2020-04-10 2020-08-28 北京百卓网络技术有限公司 Index processing method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7689560B2 (en) * 2000-10-13 2010-03-30 Miosoft Corporation Persistent data storage techniques
US9342528B2 (en) * 2010-04-01 2016-05-17 Avere Systems, Inc. Method and apparatus for tiered storage

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1024661A2 (en) * 1999-01-27 2000-08-02 Hughes Electronics Corporation Pictographic electronic program guide
CN101080094A (en) * 2007-04-27 2007-11-28 上海华为技术有限公司 URNTI allocation method and its device
CN101222357A (en) * 2007-12-26 2008-07-16 杭州华三通信技术有限公司 Method and system for preserving hardware table item index, master control board and interface board
CN101286160A (en) * 2008-05-30 2008-10-15 同济大学 Data base indexing process
CN102915340A (en) * 2012-02-29 2013-02-06 浙江工商大学 Expanded B+ tree-based object file system
CN103678160A (en) * 2012-08-30 2014-03-26 腾讯科技(深圳)有限公司 Data storage method and device
CN106210021A (en) * 2016-07-05 2016-12-07 中国银行股份有限公司 The method for real-time monitoring of financial application system online business and supervising device
CN108614734A (en) * 2016-12-13 2018-10-02 迈普通信技术股份有限公司 Security Parameter Index management method and device
CN107016100A (en) * 2017-04-10 2017-08-04 重庆大学 A kind of metadata management method based on Nonvolatile memory file system
CN108121813A (en) * 2017-12-27 2018-06-05 东软集团股份有限公司 Data managing method, device, system, storage medium and electronic equipment
CN111597392A (en) * 2020-04-10 2020-08-28 北京百卓网络技术有限公司 Index processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112667637A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN107111450B (en) Disk partition stitching and rebalancing using partition tables
CN101661391B (en) Object serializing method, object deserializing method, device and system
EP3260993A1 (en) File operation method and device
CN110704330B (en) Data access control device and method
CN112668181B (en) Simulation test method and device, electronic equipment and storage medium
CN103558998B (en) A kind of method and apparatus of data manipulation
US10437826B2 (en) Data access performance using decompression maps
CN105335223A (en) Virtual machine memory migration device, method and system on source host and destination host
CN105302536A (en) Configuration method and apparatus for related parameters of MapReduce application
CN113183759A (en) Method and device for displaying characters of instrument panel
CN110618883A (en) Method, device, equipment and storage medium for sharing memory linked list
CN107451070B (en) Data processing method and server
US20200073868A1 (en) Space-efficient methodology for representing label information in large graph data for fast distributed graph query
CN112667637B (en) Data management method, device and computer readable storage medium
DE112010004562T5 (en) Assign effectively referenced globally unique identifiers in a multicore environment
CN103294714B (en) The defining method of the memory location of the field attribute value of index field and device
CN114443598A (en) Data writing method and device, computer equipment and storage medium
CN112347101A (en) Tag data storage method, computer device, and storage medium
CN102855115A (en) Method and system for displaying character label based on splicing wall
CN116382692A (en) C++ object serialization and inverse serialization method
CN116186045A (en) Sparse matrix adjustment method and device, electronic equipment and storage medium
CN112162731B (en) Data expansion method, device, storage medium and electronic device
CN109388371B (en) Data sorting method, system, co-processing device and main processing device
CN107291439A (en) A kind of target delta data construction method and device
CN112667152A (en) Heap memory management method and device, readable storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant