CN111045608A - Method, device and equipment for searching validity code and readable storage medium - Google Patents

Method, device and equipment for searching validity code and readable storage medium Download PDF

Info

Publication number
CN111045608A
CN111045608A CN201911386470.5A CN201911386470A CN111045608A CN 111045608 A CN111045608 A CN 111045608A CN 201911386470 A CN201911386470 A CN 201911386470A CN 111045608 A CN111045608 A CN 111045608A
Authority
CN
China
Prior art keywords
context
validity code
target data
code
validity
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.)
Granted
Application number
CN201911386470.5A
Other languages
Chinese (zh)
Other versions
CN111045608B (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.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN201911386470.5A priority Critical patent/CN111045608B/en
Publication of CN111045608A publication Critical patent/CN111045608A/en
Application granted granted Critical
Publication of CN111045608B publication Critical patent/CN111045608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a searching method of an effectiveness code, which can perform grouping on all contexts in advance according to the serial number of any effectiveness code in each context and a preset grouping rule, and can determine the grouping of the context corresponding to the effectiveness code of target data according to the serial number of the effectiveness code of the target data and the preset grouping rule subsequently, so that the searching range of the contexts can be quickly reduced, the searching of all contexts is not required to be performed by polling in the prior art, the searching speed is improved, and the data reading and writing speed is improved. The invention also discloses a searching device, equipment and a computer readable storage medium of the validity code, which have the same beneficial effects as the searching method of the validity code.

Description

Method, device and equipment for searching validity code and readable storage medium
Technical Field
The invention relates to the field of storage design, in particular to a searching method of an effectiveness code, and also relates to a searching device, equipment and a computer readable storage medium of the effectiveness code.
Background
In the solid state disk, each 4K-sized data corresponds to a validity code, the validity code can represent whether the 4K-sized data is valid, the validity code corresponding to each 4K-sized data is recorded in a local memory space local of the CPU, the validity code corresponding to the read-write data needs to be searched every time data is read or written, however, in the local, every 32 validity codes form a context, and the local includes hundreds of contexts, in the prior art, it can only be determined in sequence whether each context includes a context of the validity code of the target data, after determining the context including the validity code of the target data, then the validity code is found from the context including the validity code of the target data, but the total number of the contexts is huge, and the speed of determining whether each context is a context including the validity code of the target data is slow in sequence, the data read-write rate is reduced.
Therefore, how to provide a solution to the above technical problem is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a searching method of an effective code, which improves the searching speed and the data reading and writing speed; another object of the present invention is to provide a device, an apparatus and a computer readable storage medium for searching validity codes, which improve the searching speed and the data read-write speed.
In order to solve the above technical problem, the present invention provides a method for searching an validity code, including:
grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
determining a group where the context to which the validity code of the target data belongs is located according to the serial number of the validity code of the target data and the preset grouping rule;
and determining the context in which the validity code of the target data belongs from the group in which the context in which the validity code of the target data belongs is located, so as to search for the validity code of the target data.
Preferably, the grouping the contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule specifically includes:
the method comprises the steps that a binary serial number of any validity code in each context is shifted to the right by five bits in advance;
the serial number and 2 which are shifted to the right by five bits in advancen-1 performing a group number corresponding to the result of the operation as said context, toAll of the contexts are divided into 2nGroup (d);
wherein n is a preset integer greater than 1;
the determining, according to the sequence number of the validity code of the target data and the preset grouping rule, that the grouping in which the context to which the validity code of the target data belongs is specifically:
the target data is shifted to the right by five bits to obtain binary serial number and 2n-1 performing an and operation to obtain a target group number;
judging whether the context with the group number same as the target group number exists or not;
if yes, determining that the group corresponding to the group number which is the same as the target group number is the group of the context to which the validity code of the target data belongs.
Preferably, the determining, from the group to which the context to which the validity code of the target data belongs, the context to which the validity code of the target data belongs specifically is:
and in each context with the same group number as the target group number, determining the context with the smallest internal sequence number as the sequence number after the lower five bits of the target data are cleared as the context in which the validity code of the target data is located.
Preferably, the serial number and 2 which are shifted to the right by five bits in advancen-1 performing a group number corresponding to the result of the operation as said context, so as to divide all said contexts into 2nAfter the grouping, the method for searching the validity code further comprises the following steps:
pre-establishing an array size of 2nThe head array of the chain table is used for respectively mounting all the contexts on the head array of the chain table according to the group numbers;
judging whether the context with the group number same as the target group number exists specifically as follows:
and judging whether the context with the group number same as the target group number exists in the head array of the chain table.
Preferably, the pre-right shifting the binary sequence number of any validity code inside each context by five bits specifically is:
the sequence number with the minimum number in the binary form of all the validity codes in each context is shifted to the right by five bits in advance.
Preferably, after grouping the contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule, the method for searching for a validity code further includes:
and grouping the context which is not grouped according to the preset grouping rule when the power is on.
In order to solve the above technical problem, the present invention further provides a device for searching an validity code, including:
the grouping module is used for grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
the first determining module is used for determining the grouping of the context to which the validity code of the target data belongs according to the serial number of the validity code of the target data and the preset grouping rule;
a second determining module, configured to determine, from the group to which the context to which the validity code of the target data belongs, so as to search for the validity code of the target data.
Preferably, the grouping module includes:
the first operation module is used for shifting the serial number of any validity code in each context to the right by five bits in advance;
a grouping submodule for shifting the sequence number shifted to the right by five bits and 2n-1 performing a group number corresponding to the result of the operation as said context, so as to divide all said contexts into 2nGroup (d);
wherein n is a preset integer greater than 1;
the first determining module comprises:
a second operation module for right-shifting the target data by five bits to obtain binary serial number and 2n-1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the group number being the same as the target group number exists or not, and if so, the judging module is triggered;
the judging module is used for judging that the grouping corresponding to the group number which is the same as the target group number is the grouping where the context to which the validity code of the target data belongs is located.
In order to solve the above technical problem, the present invention further provides a device for searching an validity code, including:
a memory for storing a computer program;
a processor for implementing the steps of the method for finding a validity code as described in any one of the above when executing said computer program.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the method for searching for an effectiveness code according to any one of the above items.
The invention provides a searching method of an effectiveness code, which can perform grouping on all contexts in advance according to the serial number of any effectiveness code in each context and a preset grouping rule, and can determine the grouping of the context corresponding to the effectiveness code of target data according to the serial number of the effectiveness code of the target data and the preset grouping rule subsequently, so that the searching range of the contexts can be quickly reduced, the searching of all contexts is not required to be performed by polling in the prior art, the searching speed is improved, and the data reading and writing speed is improved.
The invention also provides a searching device, equipment and a computer readable storage medium of the validity code, which have the same beneficial effects as the searching method of the validity code.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for searching validity codes according to the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for searching validity codes according to the present invention;
fig. 3 is a schematic structural diagram of a validity code lookup apparatus provided in the present invention.
Detailed Description
The core of the invention is to provide a searching method of the validity code, which improves the searching speed and the data reading and writing speed; the other core of the invention is to provide a searching device, equipment and a computer readable storage medium for the validity code, which improve the searching speed and the data reading and writing speed.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for searching an validity code according to the present invention, including:
step S1: grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
specifically, each context has a validity code containing 32 data, for example, the zeroth context contains 0 to 31 validity codes, the first context contains 32 to 63 validity codes, and so on, the sequence numbers of the validity codes inside each context have the same characteristic, that is, because each context contains 32 validity codes, the sequence numbers of the binary form of the validity codes in each group are the same except for the last five bits, so that all contexts can be grouped according to the rule of the sequence numbers of all validity codes in each context and a preset grouping rule, for example, all contexts can be circulated every 32, that is, 0 to 31 contexts, 32 to 63 contexts, wherein the contexts in each circulation in the same order are classified into the same group, i.e. contexts 0, 32 and 64 … belong to the same group, and contexts 1, 33 and 65 … belong to the same group, but the number of groups is at least smaller than the total number of all contexts, so as to achieve the effect of improving the search efficiency.
In particular, grouping facilitates finding the context in which the validity code of the target data is located quickly in subsequent steps.
Step S2: determining a group where the context to which the validity code of the target data belongs is located according to the serial number of the validity code of the target data and a preset grouping rule;
specifically, since the serial number of the validity code of the target data also exists in one context, the packet where the context to which the validity code of the target data belongs is located can be determined according to the serial number of the validity code of the target data and the preset grouping rule, so that the search range of the context to which the validity code of the target data belongs is greatly reduced, that is, only the context to which the validity code belongs needs to be searched in the determined packet, and all contexts in the local do not need to be traversed.
Step S3: and determining the context of the validity code of the target data from the group of the context to which the validity code of the target data belongs so as to search the validity code of the target data.
Specifically, traversal can be performed only in the group where the context to which the validity code of the target data belongs is determined, and the context to which the validity code of the target data belongs is determined, so that the validity code of the target data can be found continuously.
The invention provides a searching method of an effectiveness code, which can perform grouping on all contexts in advance according to the serial number of any effectiveness code in each context and a preset grouping rule, and can determine the grouping of the context corresponding to the effectiveness code of target data according to the serial number of the effectiveness code of the target data and the preset grouping rule subsequently, so that the searching range of the contexts can be quickly reduced, the searching of all contexts is not required to be performed by polling in the prior art, the searching speed is improved, and the data reading and writing speed is improved.
On the basis of the above-described embodiment:
as a preferred embodiment, grouping each context in advance according to a sequence number of any validity code in each context and a preset grouping rule specifically includes:
the method comprises the steps that a binary serial number of any validity code in each context is shifted to the right by five bits in advance;
the serial number of the right shift by five bits and 2n-1 performing a group number corresponding to the result of the operation as a context, so as to divide all contexts into 2nGroup (d);
wherein n is a preset integer greater than 1;
determining the grouping of the context to which the validity code of the target data belongs according to the sequence number of the validity code of the target data and a preset grouping rule specifically as follows:
the target data is shifted to the right by five bits to obtain binary serial number and 2n-1 performing an and operation to obtain a target group number;
judging whether a context with the same group number as the target group number exists or not;
if yes, the grouping corresponding to the group number which is the same as the target group number is judged to be the grouping of the context to which the validity code of the target data belongs.
Specifically, as mentioned above, the serial number of the binary form of the validity code in each group is the same except for the last five bits, so that the serial number of the binary form of any validity code inside each context can be right-shifted by 5 bits, and then the serial number of the binary form right-shifted by 5 bits and 2 bits of the binary formn-1 the result of the operation is taken as the group number of the context in which the validity code corresponding to the sequence number is located, which can be found by calculation, 2nThat is, the number of groups finally divided, where n can be set autonomously, but must be an integer greater than 1, for example, when n is 2, the sequence number of the validity code in the zero-th context is 0-31, so that the sequence number of any validity code is shifted to the right by 5 bits and then becomes 0, and the result obtained by performing an and operation with the two-level system 3 (i.e., 11) is zero, then zero contexts are assigned to the zero-th group, the sequence number of the validity code in the 4-th context is 128-159, for example, 128 is 10000000 in binary form, and then the result obtained by performing an and operation with 11 after shifting five bits to the right is 0, so that the group numbers of the zero, fourth, and eighth … contexts are all zero, and the group numbers of the first, fifth, and ninth … are all one, so that all the contexts can be divided into 4 groups.
Specifically, when the target data is subjected to the target group number operation, the same preset grouping rule is adopted, so that the target group number where the context to which the validity code of the target data belongs can be determined, for example, the target group number can be zero, (assuming that n at this time is 2), the context to which the validity code belongs may be one of the zeroth, fourth, and eighth … contexts, thereby greatly reducing the range of the contexts to be searched, and improving the searching efficiency.
Before searching for the validity code representing the validity of 4K Data in local, a coarse validity code (trimbit) may be first queried in a DDR (Double Data Rate, Double Rate synchronous dynamic random access memory), when querying the coarse validity code, a Data mapping table may be first read to determine the validity of a mapping table of target Data, if valid, the coarse validity code may be found, a specific position (addr) of the coarse validity code corresponding to the target Data in the DDR may be calculated according to the Data mapping table, then the coarse validity code may be found from the specific position, one coarse validity code may represent the validity of 32 4K Data, when the coarse validity code is 1, the 32 4K Data are all invalid, when the coarse validity code is 0, at least one 4K Data in the 32 4K Data is valid, at this time, the validity code corresponding to the target data is searched in local to judge the validity of the target data.
N may be set autonomously, for example, may be set to 5, and the embodiment of the present invention is not limited herein.
Of course, besides the grouping rules listed in the embodiment of the present invention, other types of grouping rules may be used for grouping, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, determining, from the group of the context to which the validity code of the target data belongs, the context to which the validity code of the target data belongs specifically is:
and determining the context with the smallest internal sequence number being the same as the sequence number of the target data after the lower five bits of the target data are cleared in each context with the same group number as the target group number, wherein the context is the context of the validity code of the target data.
Specifically, since the number of validity codes in each context is 32, and 5 bits are needed when the decimal number 31 is represented by binary, no matter in which context, the lower 5 bits of the minimum sequence number must be zero, and the sequence number cleared by the lower five bits of the target data must be identical to the minimum sequence number in the context to which the target data belongs, so that the context of the target validity code can be sequentially searched in the designated group in this way.
Of course, besides this way, other methods may be adopted to find the context of the validity code of the target data in the designated packet, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, the serial number shifted to the right by five bits and 2 are used in advancen-1 performing a group number corresponding to the result of the operation as a context, so as to divide all contexts into 2nAfter the grouping, the method for searching the validity code further comprises the following steps:
pre-establishing an array size of 2nThe head array of the chain table is used for respectively mounting all the contexts on the head array of the chain table according to the group numbers;
then, the specific steps of judging whether the context with the group number being the same as the target group number exists are:
and judging whether the context with the group number being the same as the target group number exists in the head array of the chain table.
Specifically, the linked list head group can be used for storing all contexts, and the contexts with the same group number can be linked together, so that the subsequent context search can be conveniently carried out by corresponding the target group number with the group number on the linked list head group.
Of course, the manner of storing all contexts may be in other various forms besides the linked list head group, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, shifting the serial number of any validity code inside each context to the right by five bits in binary form in advance specifically:
the smallest sequence number of all the binary sequence numbers of the validity codes in each context is shifted to the right by five bits in advance.
Specifically, the smallest sequence number among the sequence numbers of all validity codes inside each context is easy to obtain, so that the processing speed can be improved.
Of course, besides the minimum sequence number, the sequence number of any validity code in the context may also be used for operation, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, after grouping each context in advance according to the sequence number of any validity code in each context and a preset grouping rule, the method for searching for a validity code further includes:
and grouping the context which is not grouped according to a preset grouping rule when the power is on.
Specifically, considering that a new context may be generated in the system in addition to a context subjected to grouping in advance, in the embodiment of the present invention, a context not subjected to grouping may be grouped according to the preset grouping rule when the system is powered on, so that it can be ensured that each context is grouped, and it is convenient to subsequently search for a context in which a validity code of target data is located.
Of course, except at power-on, the context that is not grouped may also be grouped periodically, and the embodiment of the present invention is not limited herein.
It should be noted that, if all the 4K data corresponding to the validity code in a certain context becomes valid data, the context is released, and at this time, the context corresponding to the linked list head group may be deleted.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a device for searching for an validity code according to the present invention, including:
the grouping module 1 is used for grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
the first determining module 2 is configured to determine, according to the serial number of the validity code of the target data and a preset grouping rule, a group to which the context to which the validity code of the target data belongs;
the second determining module 3 is configured to determine, from the group to which the context to which the validity code of the target data belongs, so as to search for the validity code of the target data.
As a preferred embodiment, the grouping module comprises:
the first operation module is used for shifting the serial number of any validity code in each context to the right by five bits in advance;
a grouping sub-module for grouping the sub-modules,sequence number for shifting right by five bits in advance and 2n-1 performing a group number corresponding to the result of the operation as a context, so as to divide all contexts into 2nGroup (d);
wherein n is a preset integer greater than 1;
the first determining module includes:
a second operation module for right-shifting the target data by five bits to obtain binary serial number and 2n-1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the group number being the same as the target group number exists or not, and if so, the judging module is triggered;
and the judging module is used for judging that the group corresponding to the group number which is the same as the target group number is the group of the context to which the validity code of the target data belongs.
For the introduction of the device for searching for an validity code provided by the present invention, reference is made to the foregoing embodiment of the method for searching for a validity code, and the embodiment of the present invention is not described herein again.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device for searching for an validity code according to the present invention, including:
a memory 4 for storing a computer program;
a processor 5 for implementing the steps of the method for finding a validity code as in the previous embodiments when executing the computer program.
For introducing the validity code search device provided by the present invention, refer to the foregoing embodiment of the validity code search method, and the embodiment of the present invention is not described herein again.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for finding an validity code as in the previous embodiments.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the foregoing embodiment of the validity code searching method, which is not described herein again.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for searching for a validity code, comprising:
grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
determining a group where the context to which the validity code of the target data belongs is located according to the serial number of the validity code of the target data and the preset grouping rule;
and determining the context in which the validity code of the target data belongs from the group in which the context in which the validity code of the target data belongs is located, so as to search for the validity code of the target data.
2. The method for searching for an validity code according to claim 1, wherein the grouping each context according to a sequence number of any validity code in each context and a preset grouping rule in advance specifically comprises:
the method comprises the steps that a binary serial number of any validity code in each context is shifted to the right by five bits in advance;
the serial number and 2 which are shifted to the right by five bits in advancen-1 performing a group number corresponding to the result of the operation as said context, so as to divide all said contexts into 2nGroup (d);
wherein n is a preset integer greater than 1;
the determining, according to the sequence number of the validity code of the target data and the preset grouping rule, that the grouping in which the context to which the validity code of the target data belongs is specifically:
the target data is shifted to the right by five bits to obtain binary serial number and 2n-1 performing an and operation to obtain a target group number;
judging whether the context with the group number same as the target group number exists or not;
if yes, determining that the group corresponding to the group number which is the same as the target group number is the group of the context to which the validity code of the target data belongs.
3. The method for searching for an validity code according to claim 2, wherein the determining, from the group to which the context to which the validity code of the target data belongs, the context to which the validity code of the target data belongs specifically is:
and in each context with the same group number as the target group number, determining the context with the smallest internal sequence number as the sequence number after the lower five bits of the target data are cleared as the context in which the validity code of the target data is located.
4. The method according to claim 2, wherein said sequence number shifted to the right by five bits and 2 are used in advancen-1 performing a group number corresponding to the result of the operation as said context, so as to divide all said contexts into 2nAfter the grouping, the method for searching the validity code further comprises the following steps:
pre-establishing an array size of 2nThe head array of the chain table is used for respectively mounting all the contexts on the head array of the chain table according to the group numbers;
judging whether the context with the group number same as the target group number exists specifically as follows:
and judging whether the context with the group number same as the target group number exists in the head array of the chain table.
5. The method for searching for an validity code according to claim 2, wherein the pre-right shifting of the binary sequence number of any validity code within each context by five bits is specifically:
the sequence number with the minimum number in the binary form of all the validity codes in each context is shifted to the right by five bits in advance.
6. The method for searching for an availability code according to any one of claims 1 to 5, wherein after grouping each context in advance according to a sequence number of any availability code inside each context and a preset grouping rule, the method for searching for an availability code further comprises:
and grouping the context which is not grouped according to the preset grouping rule when the power is on.
7. An apparatus for searching validity codes, comprising:
the grouping module is used for grouping each context in advance according to the serial number of any validity code in each context and a preset grouping rule;
the first determining module is used for determining the grouping of the context to which the validity code of the target data belongs according to the serial number of the validity code of the target data and the preset grouping rule;
a second determining module, configured to determine, from the group to which the context to which the validity code of the target data belongs, so as to search for the validity code of the target data.
8. The apparatus for finding a validity code according to claim 7, wherein the grouping module comprises:
the first operation module is used for shifting the serial number of any validity code in each context to the right by five bits in advance;
a grouping submodule for shifting the sequence number shifted to the right by five bits in advance and2 n-1 performing a group number corresponding to the result of the operation as said context, so as to divide all said contexts into2 nGroup (d);
wherein n is a preset integer greater than 1;
the first determining module comprises:
a second operation module for right-shifting the target data by five bits to obtain binary serial number sum2 n-1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the group number being the same as the target group number exists or not, and if so, the judging module is triggered;
the judging module is used for judging that the grouping corresponding to the group number which is the same as the target group number is the grouping where the context to which the validity code of the target data belongs is located.
9. A validity code lookup apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for finding a validity code according to any one of claims 1 to 6 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method for finding a validity code according to any one of claims 1 to 6.
CN201911386470.5A 2019-12-29 2019-12-29 Method, device and equipment for searching validity codes and readable storage medium Active CN111045608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911386470.5A CN111045608B (en) 2019-12-29 2019-12-29 Method, device and equipment for searching validity codes and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911386470.5A CN111045608B (en) 2019-12-29 2019-12-29 Method, device and equipment for searching validity codes and readable storage medium

Publications (2)

Publication Number Publication Date
CN111045608A true CN111045608A (en) 2020-04-21
CN111045608B CN111045608B (en) 2023-12-08

Family

ID=70241165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911386470.5A Active CN111045608B (en) 2019-12-29 2019-12-29 Method, device and equipment for searching validity codes and readable storage medium

Country Status (1)

Country Link
CN (1) CN111045608B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070180429A1 (en) * 2006-01-30 2007-08-02 Microsoft Corporation Context based code analysis
US20140201307A1 (en) * 2013-01-14 2014-07-17 International Business Machines Corporation Caching of look-up rules based on flow heuristics to enable high speed look-up
CN109144422A (en) * 2018-08-31 2019-01-04 浪潮电子信息产业股份有限公司 Data writing method, device and equipment for solid state disk and storage medium
CN109522242A (en) * 2018-10-22 2019-03-26 郑州云海信息技术有限公司 A kind of method and apparatus for searching for Cache data
CN109543080A (en) * 2018-12-04 2019-03-29 北京字节跳动网络技术有限公司 A kind of caching data processing method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070180429A1 (en) * 2006-01-30 2007-08-02 Microsoft Corporation Context based code analysis
US20140201307A1 (en) * 2013-01-14 2014-07-17 International Business Machines Corporation Caching of look-up rules based on flow heuristics to enable high speed look-up
CN109144422A (en) * 2018-08-31 2019-01-04 浪潮电子信息产业股份有限公司 Data writing method, device and equipment for solid state disk and storage medium
CN109522242A (en) * 2018-10-22 2019-03-26 郑州云海信息技术有限公司 A kind of method and apparatus for searching for Cache data
CN109543080A (en) * 2018-12-04 2019-03-29 北京字节跳动网络技术有限公司 A kind of caching data processing method, device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LOW TANG JUNG ET AL.: "Underwater wireless network energy efficiency and optimal data packet size", 2011 INTERNATIONAL CONFERENCE ON ELECTRICAL, CONTROL AND COMPUTER ENGINEERING (INECCE) *
苏孝纯;: "计算机查找算法初探", 数码世界, no. 11 *

Also Published As

Publication number Publication date
CN111045608B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
KR101467589B1 (en) Dynamic fragment mapping
US9292554B2 (en) Thin database indexing
US7895211B2 (en) Method and system for reinserting a chain in a hash table
CN107644070B (en) Data indexing method, data query method and electronic equipment
CN110134335B (en) RDF data management method and device based on key value pair and storage medium
CN107506310B (en) Address searching and keyword storing method and equipment
CN114691721A (en) Graph data query method and device, electronic equipment and storage medium
CN112181902A (en) Database storage method and device and electronic equipment
US20230342395A1 (en) Network key value indexing design
CN112148738B (en) Hash conflict processing method and system
CN104166649B (en) Caching method and equipment for search engine
US9292553B2 (en) Queries for thin database indexing
CN111045608A (en) Method, device and equipment for searching validity code and readable storage medium
CN111597407A (en) Keyword matching method, device, equipment and storage medium based on TCAM
CN110032564B (en) Method and device for determining association relation of data table
CN110825747A (en) Information access method, device and medium
JP4159761B2 (en) In-place memory management for FFT
CN115495462A (en) Batch data updating method and device, electronic equipment and readable storage medium
CN111104435B (en) Metadata organization method, device and equipment and computer readable storage medium
CN114969034A (en) Query method and device for ordered table of LSM-Tree architecture database
CN113468383A (en) Family relation map searching method and device, electronic equipment and storage medium
CN102193942B (en) Search method and device of data block
CN111881168A (en) Data management method, system, electronic equipment and storage medium
US6901396B1 (en) Packed radix search tree implementation
CN111198877B (en) Data storage and query method and device

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