CN111045608B - Method, device and equipment for searching validity codes and readable storage medium - Google Patents

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

Info

Publication number
CN111045608B
CN111045608B CN201911386470.5A CN201911386470A CN111045608B CN 111045608 B CN111045608 B CN 111045608B CN 201911386470 A CN201911386470 A CN 201911386470A CN 111045608 B CN111045608 B CN 111045608B
Authority
CN
China
Prior art keywords
context
validity code
validity
target data
sequence number
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
CN201911386470.5A
Other languages
Chinese (zh)
Other versions
CN111045608A (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

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)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method for searching a validity code, which can be used for grouping all contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule, and then determining the grouping of the context corresponding to the validity code of target data according to the sequence number of the validity code of the target data and the preset grouping rule. The application also discloses a device, equipment and a computer readable storage medium for searching the validity codes, which have the same beneficial effects as the searching method of the validity codes.

Description

Method, device and equipment for searching validity codes and readable storage medium
Technical Field
The application relates to the field of design and storage, in particular to a method for searching a validity code, and also relates to a device, equipment and a computer readable storage medium for searching the validity code.
Background
In the solid state disk, each data with the size of 4K corresponds to one validity code, the validity code can represent whether the data with the size of 4K is valid or not, the validity code corresponding to each data with the size of 4K is recorded in a local memory space of a CPU, when the data is read or written each time, the validity code corresponding to the read and written data is required to be searched, however, in the local memory, each 32 validity codes form a context, and the local memory contains hundreds of contexts, in the prior art, only the context of whether the validity code containing the target data is contained in each context can be judged in sequence, after the context of the validity code containing the target data is determined, then the validity code is found from the context of the validity code containing the target data, but the total number of the contexts is huge, and the speed of judging whether the context is the context containing the validity code containing the target data is slower in sequence, so that the data reading and writing speed is reduced.
Therefore, how to provide a solution to the above technical problem is a problem that a person skilled in the art needs to solve at present.
Disclosure of Invention
The application aims to provide a searching method for a validity code, which improves the searching speed and the data reading and writing rate; another object of the present application is to provide a device, apparatus, and computer-readable storage medium for searching for a validity code, which improves the searching speed and increases the data reading and writing rate.
In order to solve the technical problems, the present application provides a method for searching a validity code, including:
grouping each context in advance according to the sequence number of any validity code in each context and a preset grouping rule;
determining a packet in which the context to which the validity code of the target data belongs is according to the sequence number of the validity code of the target data and the preset packet rule;
and determining the context of the validity code of the target data from the packet of the context of the validity code of the target data so as to search the validity code of the target data.
Preferably, the grouping of the contexts in advance according to the sequence number of any validity code inside each context and a preset grouping rule is specifically:
shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
the sequence number and 2 after shifting right five bits in advance n -1 performing a group number corresponding to the result of the operation as the context, so as to divide all the contexts into 2 n A group;
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, the grouping of the context to which the validity code of the target data belongs is specifically:
sequence number and 2 in binary form after right shifting target data by five bits n -1 performing an and operation to obtain a target group number;
determining whether the context with the same group number as the target group number exists;
if yes, judging that the group corresponding to the group number identical to the target group number is the group where the context to which the validity code of the target data belongs is located.
Preferably, the determining, from the packet in which the context to which the validity code of the target data belongs is specific to the context in which the validity code of the target data belongs:
and determining the context with the smallest internal sequence number which is the same as the sequence number after the lower five bits of the target data are cleared in each context with the same group number as the target group number, and determining the context with the smallest internal sequence number which is the context with the validity code of the target data.
Preferably, the sequence number shifted right five bits in advance and 2 n -1 performing a group number corresponding to the result of the operation as the context, so as to divide all the contexts into 2 n After the group, the searching method of the validity code further comprises the following steps:
pre-establishing array size as 2 n Respectively mounting all the contexts on the chain table head array according to the group numbers;
the determining whether the context with the same group number as the target group number exists specifically is:
and judging whether the context with the same group number as the target group number exists in the chain table head array.
Preferably, the shifting the sequence number of any binary form of the validity code in each context to the right by five bits in advance is specifically:
the minimum sequence number in the binary sequence numbers of all the validity codes in each context is shifted to the right by five bits in advance.
Preferably, after grouping each context according to the sequence number of any validity code in each context and a preset grouping rule, the method for searching the validity code further includes:
and at power-on, grouping the contexts which are not grouped according to the preset grouping rules.
In order to solve the technical problem, the present application further provides a device for searching for a validity code, including:
the grouping module is used for grouping the contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule;
the first determining module is used for determining a packet in which the context to which the validity code of the target data belongs is located according to the sequence number of the validity code of the target data and the preset packet rule;
and the second determining module is used for determining the context in which the validity code of the target data is located from the packet in which the context in which the validity code of the target data is located so as to find the validity code of the target data.
Preferably, the grouping module includes:
the first operation module is used for shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
a grouping sub-module for pre-shifting the sequence number after shifting the sequence number by five bits to the right and 2 n -1 performing a group number corresponding to the result of the operation as the context, so as to divide all the contexts into 2 n A group;
wherein n is a preset integer greater than 1;
the first determination module includes:
a second operation module for right shifting the target data by five bits to obtain the binary sequence number and 2 n -1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the same group number as the target group number exists or not, and triggering the judging module if the context with the same group number is the same as the target group number;
the judging module is used for judging that the packet corresponding to the same group number as the target group number is the packet where the context to which the validity code of the target data belongs.
In order to solve the technical problem, the present application further provides a device for searching for a validity code, including:
a memory for storing a computer program;
a processor for implementing the steps of the method of finding a validity code as in any one of the preceding claims when executing said computer program.
To solve the above technical problem, the present application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method for searching for a validity code according to any one of the above claims.
The application provides a searching method of a validity code, which can be used for grouping all contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule, and then determining the grouping of the context corresponding to the validity code of target data according to the sequence number of the validity code of the target data and the preset grouping rule.
The application also provides a device, equipment and a computer readable storage medium for searching the validity codes, which have the same beneficial effects as the searching method of the validity codes.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required in the prior art and the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for searching a validity code according to the present application;
FIG. 2 is a schematic diagram of a device for searching for validity codes according to the present application;
fig. 3 is a schematic structural diagram of a device for searching for validity codes according to the present application.
Detailed Description
The core of the application is to provide a searching method of the validity code, which improves the searching speed and the data reading and writing rate; another core of the present application is to provide a device, apparatus and computer readable storage medium for searching for a validity code, which improves the searching speed and increases the data reading and writing rate.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a flow chart of a method for searching a validity code according to the present application, which includes:
step S1: grouping the contexts in advance according to the sequence 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-31 validity codes, the first context contains 32-63 validity codes, and so on, and the sequence numbers according to the validity codes inside each context have the same characteristics, that is, since each context contains 32 validity codes, the binary form sequence numbers of the validity codes in each group are the same except the last five bits, so that all contexts can be grouped according to the rule of sequence numbers of all validity codes in each context in combination with a preset grouping rule, for example, all contexts can be made into a cycle every 32 contexts, that is, 0-31 contexts, 32-63 contexts, wherein the contexts with the same sequence in each cycle are grouped into the same group, that is, the 0 th, 32 and 64 … contexts are grouped into the same group, the 1 st, 5733 and … contexts are grouped into the same group, and the efficiency is improved only by the total number of the groups.
Specifically, the grouping is performed to facilitate the rapid finding of the context of the validity code of the target data in the subsequent step.
Step S2: determining a packet in which a context to which the validity code of the target data belongs is according to the sequence number of the validity code of the target data and a preset packet rule;
specifically, since the sequence number of the validity code of the target data also exists in one of the contexts, the packet in which the context to which the validity code of the target data belongs is determined according to the sequence number of the validity code of the target data and the preset packet 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 the contexts in the local need not to be traversed.
Step S3: and determining the context of the validity code of the target data from the packet of the context of the validity code of the target data so as to find the validity code of the target data.
Specifically, the method and the device can only traverse the determined context of the target data, determine which context the target data validity code belongs to, so as to find the validity code of the target data continuously.
The application provides a searching method of a validity code, which can be used for grouping all contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule, and then determining the grouping of the context corresponding to the validity code of target data according to the sequence number of the validity code of the target data and the preset grouping rule.
Based on the above embodiments:
as a preferred embodiment, grouping the contexts in advance according to the sequence number of any validity code inside each context and a preset grouping rule is specifically:
shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
shifting right five digits of sequence number and 2 in advance n -1 performing a group number corresponding to the result of the operation as a context so as to divide all contexts into 2 n A group;
wherein n is a preset integer greater than 1;
the packet in which the context to which the validity code of the target data belongs is determined specifically according to the sequence number of the validity code of the target data and a preset packet rule:
sequence number and 2 in binary form after right shifting target data by five bits n -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 group number corresponding to the same group number as the target group number is judged to be the group where the context to which the validity code of the target data belongs.
Specifically, as described above, the binary form sequence number of the validity code in each group is identical in all the preceding digits except the last five digits, so that the binary form sequence number of any validity code in each context can be shifted right by 5 digits, and then the binary form sequence number shifted right by 5 digits is compared with the binary form 2 n -1 performing a group number in the context of the result of the operation as the validity code corresponding to the sequence number, by calculatingTo find out 2 n That is, the number of groups finally obtained is set autonomously, where n is an integer greater than 1, for example, when n is 2, the number of the validity code in the zeroth context is 0-31, so that the number of any one of the validity codes is shifted right by 5 bits to be 0, the result of the AND operation with 3 (i.e., 11) of the second order is zero, zero contexts are assigned to the zeroth group, the number of the validity code in the 4 th context is 128-159, 128 is given a binary form of 10000000 as an example, the number of the group of the first, fifth and ninth contexts is one, and the result of the AND operation with 11 is 0 after shifting right by five bits is given by 128, so that the group numbers of the zeroth, fourth and eighth contexts are all zero, and the group numbers of the first, fifth and ninth contexts are all one, thereby dividing all contexts into 4 groups can be realized.
Specifically, when the target data is subjected to target group number operation, the same preset grouping rule is adopted, so that the target group number of the context to which the validity code of the target data belongs can be determined, for example, the target group number can be zero, (n is assumed to be 2 at the moment), and then the context to which the target data belongs can be one of the zeroth, fourth and eighth … contexts, so that the range of the context to be searched is greatly reduced, and the searching efficiency is improved.
Before searching the validity code representing the validity of the 4K Data in the local, the coarse validity code (trimbit) may be searched in the DDR (Double Data Rate, double Rate synchronous dynamic random access memory) first, when the coarse validity code is searched, the Data mapping table may be read first to determine the validity of the mapping table of the target Data, the validity represents that the coarse validity code may be found, the specific location (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 location, 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, and at this time, the validity of the target Data is searched in the local may be removed to determine the validity of the target Data.
Wherein n may be set autonomously, for example, may be set to 5, etc., and embodiments of the present application are not limited herein.
Of course, other types of grouping rules may be used for grouping in addition to the grouping rules listed in the embodiments of the present application, which are not limited herein.
As a preferred embodiment, from the packet in which the context to which the validity code of the target data belongs, it is determined that the context in which the validity code of the target data belongs is specifically:
and determining the context with the same internal minimum sequence number 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, and determining the context with the valid 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, in any context, the lower 5 bits of the minimum sequence number must be zero, and the sequence number of the lower five zero 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 found in the specified packet in this way.
Of course, other methods may be used to find the context of the validity code of the target data in the specified packet besides this method, and embodiments of the present application are not limited herein.
As a preferred embodiment, the sequence number after shifting right five bits and 2 are advanced n -1 performing a group number corresponding to the result of the operation as a context so as to divide all contexts into 2 n After the group, the searching method of the validity code further comprises the following steps:
pre-establishing array size as 2 n Respectively mounting all the contexts on the linked list head array according to the group number;
the judging whether the context with the same group number as the target group number exists is specifically as follows:
and judging whether the context with the same group number as the target group number exists in the chain header array.
Specifically, the linked list head group can be used for storing all the contexts, and the contexts with the same group number can be hung together, so that the subsequent search of the contexts by corresponding the target group number to the group number on the linked list head group is also facilitated.
Of course, the manner of storing all contexts other than the linked list header set may take many other forms, and embodiments of the present application are not limited in this regard.
As a preferred embodiment, shifting the sequence number of any binary form of the validity code inside each context by five bits in advance is specifically:
the minimum sequence number is shifted right by five bits in the binary sequence numbers of all the validity codes in each context in advance.
Specifically, among the sequence numbers of all the validity codes inside each context, the smallest sequence number is easier to obtain, and the processing speed can be improved.
Of course, in addition to the minimum sequence number, the operation may be performed by the sequence number of any validity code in the context, and the embodiment of the present application is not limited herein.
As a preferred embodiment, after grouping each context in advance according to the sequence number of any validity code inside each context and a preset grouping rule, the method for searching the validity code further includes:
at power-up, the context which is not grouped is grouped according to a preset grouping rule.
Specifically, considering that a new context may be generated in the system in addition to the context that is previously grouped, in the embodiment of the present application, the contexts that are not grouped may be grouped according to the preset grouping rule when power is on, so that each context is ensured to be grouped, and it is convenient to search the context where the validity code of the target data is located subsequently.
Of course, contexts that are not grouped may be grouped periodically, except at power-up, and embodiments of the present application are not limited in this regard.
It should be noted that if all the 4K data corresponding to the validity code in a certain context becomes valid data, the context will be released, and at this time, the corresponding context in the link table header group may be deleted.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a device for searching for validity codes according to the present application, including:
the grouping module 1 is used for grouping the contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule;
the first determining module 2 is configured to determine, according to a sequence number of a validity code of the target data and a preset grouping rule, a grouping in which a context to which the validity code of the target data belongs is located;
and the second determining module 3 is configured to determine, from the packet in which the context to which the validity code of the target data belongs is located, the context in which the validity code of the target data is located, so as to find the validity code of the target data.
As a preferred embodiment, the grouping module includes:
the first operation module is used for shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
a grouping sub-module for shifting the sequence number after shifting the sequence number by five bits to the right and 2 n -1 performing a group number corresponding to the result of the operation as a context so as to divide all contexts into 2 n A group;
wherein n is a preset integer greater than 1;
the first determination module includes:
a second operation module for right shifting the target data by five bits to obtain the binary sequence number and 2 n -1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the same group number as the target group number exists or not, and triggering the judging module;
and the judging module is used for judging the packet corresponding to the group number identical to the target group number as the packet in which the context to which the validity code of the target data belongs.
For the description of the device for searching the validity code provided by the present application, reference is made to the foregoing embodiment of the method for searching the validity code, and the embodiment of the present application is not repeated herein.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device for searching for validity codes according to the present application, including:
a memory 4 for storing a computer program;
a processor 5 for implementing the steps of the method of finding a validity code in the previous embodiment when executing a computer program.
For the description of the device for searching the validity code provided by the present application, reference is made to the foregoing embodiment of the method for searching the validity code, and the embodiment of the present application is not repeated herein.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of searching for a validity code as in the previous embodiments.
For the description of the computer readable storage medium provided by the present application, reference is made to the foregoing embodiments of the method for searching for the validity code, and the embodiments of the present application are not repeated herein.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
It should also be noted that in this 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. Moreover, 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 one … …" does not exclude the presence of other like 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 application. 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 application. Thus, the present application 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 sequence number of any validity code in each context and a preset grouping rule;
determining a packet in which the context to which the validity code of the target data belongs is according to the sequence number of the validity code of the target data and the preset packet rule;
and determining the context of the validity code of the target data from the packet of the context of the validity code of the target data so as to search the validity code of the target data.
2. The method for searching for validity codes according to claim 1, wherein said grouping each context in advance according to a sequence number of any validity code inside each context and a preset grouping rule specifically comprises:
shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
the sequence number and 2 after shifting right five bits in advance n -1 performing a group number corresponding to the result of the operation as the context, so as to divide all the contexts into 2 n A group;
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, the grouping of the context to which the validity code of the target data belongs is specifically:
sequence number and 2 in binary form after right shifting target data by five bits n -1 performing an and operation to obtain a target group number;
determining whether the context with the same group number as the target group number exists;
if yes, judging that the group corresponding to the group number identical to the target group number is the group where the context to which the validity code of the target data belongs is located.
3. The method for searching for a validity code according to claim 2, wherein the determining, from the packet in which the context to which the validity code of the target data belongs is specific to the context in which the validity code of the target data belongs is:
and determining the context with the smallest internal sequence number which is the same as the sequence number after the lower five bits of the target data are cleared in each context with the same group number as the target group number, and determining the context with the smallest internal sequence number which is the context with the validity code of the target data.
4. The method according to claim 2, wherein the sequence number shifted right five bits in advance and 2 n -1 performingGroup number corresponding to the result of operation as the context so as to divide all the contexts into 2 n After the group, the searching method of the validity code further comprises the following steps:
pre-establishing array size as 2 n Respectively mounting all the contexts on the chain table head array according to the group numbers;
the determining whether the context with the same group number as the target group number exists specifically is:
and judging whether the context with the same group number as the target group number exists in the chain table head array.
5. The method for searching for a validity code according to claim 2, wherein the shifting right five bits of the binary form of the sequence number of any validity code inside each context in advance is specifically:
the minimum sequence number in the binary sequence numbers of all the validity codes in each context is shifted to the right by five bits in advance.
6. The method for searching for a validity code according to any one of claims 1 to 5, wherein after grouping each of said contexts in advance according to a sequence number of any one of the validity codes inside each of the contexts and a preset grouping rule, the method for searching for a validity code further comprises:
and at power-on, grouping the contexts which are not grouped according to the preset grouping rules.
7. A validity code lookup apparatus comprising:
the grouping module is used for grouping the contexts in advance according to the sequence number of any validity code in each context and a preset grouping rule;
the first determining module is used for determining a packet in which the context to which the validity code of the target data belongs is located according to the sequence number of the validity code of the target data and the preset packet rule;
and the second determining module is used for determining the context in which the validity code of the target data is located from the packet in which the context in which the validity code of the target data is located so as to find the validity code of the target data.
8. The apparatus for searching for a validity code according to claim 7, wherein the grouping module includes:
the first operation module is used for shifting the sequence number of any binary form of the validity code in each context to the right five bits in advance;
a grouping sub-module for pre-shifting the sequence number and the sequence number after shifting the sequence number by five bits to the right 2 n -1 performing a group number corresponding to the result of the operation as the context, so as to divide all the contexts into 2 n A group;
wherein n is a preset integer greater than 1;
the first determination module includes:
a second operation module for right shifting the target data by five bits 2 n -1 performing an and operation to obtain a target group number;
the judging module is used for judging whether the context with the same group number as the target group number exists or not, and triggering the judging module if the context with the same group number is the same as the target group number;
the judging module is used for judging that the packet corresponding to the same group number as the target group number is the packet where the context to which the validity code of the target data belongs.
9. A lookup apparatus for a validity code, comprising:
a memory for storing a computer program;
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 the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements 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 CN111045608A (en) 2020-04-21
CN111045608B true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595703B2 (en) * 2006-01-30 2013-11-26 Microsoft Corporation Context based code analysis
US9124540B2 (en) * 2013-01-14 2015-09-01 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Caching of look-up rules based on flow heuristics to enable high speed look-up

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
Underwater wireless network energy efficiency and optimal data packet size;Low Tang Jung et al.;2011 International Conference on Electrical, Control and Computer Engineering (INECCE);全文 *
计算机查找算法初探;苏孝纯;;数码世界(11);全文 *

Also Published As

Publication number Publication date
CN111045608A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
KR101467589B1 (en) Dynamic fragment mapping
CN101826107B (en) Hash data processing method and device
US9292554B2 (en) Thin database indexing
CN108205577B (en) Array construction method, array query method, device and electronic equipment
CN103150362B (en) A kind of video searching method and system
US20110016142A1 (en) Method and apparatus for creating pattern matching state machine and identifying pattern
CN108304409B (en) Carry-based data frequency estimation method of Sketch data structure
JP2015512604A (en) Cryptographic hash database
CN107644070B (en) Data indexing method, data query method and electronic equipment
CN102880628A (en) Hash data storage method and device
CN112579595A (en) Data processing method and device, electronic equipment and readable storage medium
CN107256233B (en) Data storage method and device
CN111930924A (en) Data duplicate checking system and method based on bloom filter
CN111930923A (en) Bloom filter system and filtering method
CN112148738A (en) Hash collision processing method and system
CN104166649B (en) Caching method and equipment for search engine
CN111045608B (en) Method, device and equipment for searching validity codes and readable storage medium
CN105320609A (en) Mobile terminal based data storage method and system
CN116756253B (en) Data storage and query methods, devices, equipment and media of relational database
CN112511629A (en) Data compression method and system for account tree of MPT structure
CN109446198B (en) Trie tree node compression method and device based on double arrays
CN108376054B (en) Processing method and device for indexing identification data
US9292553B2 (en) Queries for thin database indexing
CN113495901B (en) Quick retrieval method for variable-length data blocks
CN115495462A (en) Batch data updating method and device, electronic equipment and readable storage medium

Legal Events

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