CN109144962A - A kind of date storage method, querying method, storage device and inquiry unit - Google Patents

A kind of date storage method, querying method, storage device and inquiry unit Download PDF

Info

Publication number
CN109144962A
CN109144962A CN201811012248.4A CN201811012248A CN109144962A CN 109144962 A CN109144962 A CN 109144962A CN 201811012248 A CN201811012248 A CN 201811012248A CN 109144962 A CN109144962 A CN 109144962A
Authority
CN
China
Prior art keywords
data
index
feature
subindex
data block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811012248.4A
Other languages
Chinese (zh)
Inventor
张晓光
张栋
孟玲芝
辛正北
何辉辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengzhi Chongke Haitu Technology Co Ltd
Original Assignee
Beijing Chengzhi Chongke Haitu 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 Chengzhi Chongke Haitu Technology Co Ltd filed Critical Beijing Chengzhi Chongke Haitu Technology Co Ltd
Priority to CN201811012248.4A priority Critical patent/CN109144962A/en
Publication of CN109144962A publication Critical patent/CN109144962A/en
Pending legal-status Critical Current

Links

Abstract

This application provides a kind of date storage method, querying method, storage device and inquiry units, wherein this method comprises: obtaining the source data for describing vehicle pass-through record;The source data is carried out according to the first preset format to be converted to the first data;Obtain the feature that first data include;Preset concordance list is searched, the index to match with the feature is obtained;First data are respectively written into the corresponding data storage file of index respectively to match.The embodiment of the present application provides the method that the current record of a kind of pair of city vehicle is rationally counted.

Description

A kind of date storage method, querying method, storage device and inquiry unit
Technical field
This application involves data storage and retrieval technique fields, in particular to a kind of date storage method, issuer Method, storage device and inquiry unit.
Background technique
With the rapid development of social economy, transport need also increasingly increases, and the use of vehicle is more and more frequent, thus band Come the crowded of urban highway traffic, traffic accident environmental pollution the problems such as also get worse.By believing vehicular traffic Acquisition, storage and the analysis of breath, available urban transportation data provide reliably for traffic monitoring and to the management of illegal vehicle Data supporting improve traffic safety, facilitate the shape of metropolitan integrative traffic system to improve traffic administration and controlled level At.
In the prior art, the current record of city vehicle in storage, is influenced by many factors, and data volume is huge, Storage time is long, and as time increases, and all can newly generate a large amount of data daily needs if storage method is improper A large amount of storage time is consumed, and when carrying out data search, also brings along inconvenience.
To sum up, lack the method that a kind of pair of vehicle pass-through record data are rationally stored now, it is logical to city vehicle Row record is rationally counted.
Summary of the invention
In view of this, the application's is designed to provide a kind of date storage method, querying method, storage device and inquiry Device, rationally to be counted to the current record of city vehicle.
In a first aspect, the embodiment of the present application provides a kind of date storage method, comprising:
Obtain the source data for describing vehicle pass-through record;
The source data is carried out according to the first preset format to be converted to the first data;
Obtain the feature that first data include;
Preset concordance list is searched, the index to match with the feature is obtained;
First data are respectively written into process in the corresponding data storage file of index respectively to match to store.
With reference to first aspect, the embodiment of the present application provides the first possible embodiment of first aspect, and described The feature that one data include includes license plate number, vehicle color, vehicle model and corresponding bayonet number.
With reference to first aspect, the embodiment of the present application provides second of possible embodiment of first aspect, described to incite somebody to action First data are respectively written into process in the corresponding data storage file of the index respectively to match and store, comprising:
From the index to match with the feature, an index is chosen, data storage file corresponding with the index is found;
According to preset data store strategy, determine first data in the data storage file found wait store Position;
It will store described in first data write-in to storage location, finished until index is chosen.
The possible embodiment of second with reference to first aspect, the embodiment of the present application provide the third of first aspect Possible embodiment, the structure of the data storage file include first piece and multiple data blocks, and described first piece records multiple institutes The information of data block is stated, multiple data chunks are at the data link table for constituting the data storage file;It is described according to default Data store strategy, determine first data in the data storage file found to storage location, comprising:
Each subindex value in the data-link in each data block is obtained, subindex value is according to preset algorithm to sub- rope Row operation is introduced to obtain;
The corresponding subindex of the feature is obtained, the corresponding subindex value of subindex of acquisition is calculated;
According to the size relation of each subindex value in the corresponding subindex value of the feature and each data block, determine First data in the data link table described in storage location.
The third possible embodiment with reference to first aspect, the embodiment of the present application provide the 4th kind of first aspect Possible embodiment, it is described according to the big of the corresponding subindex value of the feature and each subindex value in each data block Small relationship, determine first data in the data link table described in storage location, comprising:
When the corresponding subindex value of the feature is less than the smallest subindex value in the data-link, described first is determined The described of data is located in first data block in the data link table to storage location;
When the corresponding subindex value of the feature is greater than maximum subindex value in the data link table, described the is determined The described of one data is located in the data block in the data link table where maximum index value to storage location;
When the corresponding subindex value of the feature is less than in the data link table maximum subindex value in any data block, And when being greater than the smallest subindex value in any data block, determine that the described of first data is located at institute to storage location It states in any data block;
Maximum subindex value in any data block that the corresponding subindex value of the feature is greater than in the data-link, And when being less than the minimum subindex value in the data block after being located at any data block in the data-link, described first is determined Data between the data block to storage location after any one described data block and any data block of data In block.
The 4th kind of possible embodiment with reference to first aspect, the embodiment of the present application provide the 5th kind of first aspect Possible embodiment, after the first data being respectively written into the corresponding data storage file of index respectively to match, institute State method further include:
Data block in first piece in each data storage file and data-link is updated.
Second aspect, the embodiment of the present application provide a kind of data query method, comprising:
Receive the inquiry data that user terminal is sent;
The second data are obtained after formatting according to the second preset format to the inquiry data;
All features that second data include are obtained, it, will using one of feature in the feature as index Other features are as non-index;
Data storage file corresponding with the index is determined based on the index, and based on the corresponding son of the index Index value, the data block where determining second data in the data storage file;
According to the non-index corresponding non-index value, institute corresponding with the non-index value is searched in the data block There are data, and all data are sent to the user terminal.
In conjunction with second aspect, the embodiment of the present application provides the first possible embodiment of second aspect, described to look into Asking in data further includes presetting paging strategy and third preset format, described that all data are sent to the user terminal, Include:
All data are converted according to the third preset format;
According to the paging strategy that the user terminal is set, will successively preset with page number corresponding data amount according to the third Data after format conversion are sent to the user terminal.
The third aspect, the embodiment of the present application provide a kind of data storage device, comprising:
Module is obtained, for obtaining the source data for describing vehicle pass-through record;
Conversion module is converted to the first data for carrying out according to the first preset format to the source data;
The acquisition module is also used to obtain the feature that first data include;For searching preset concordance list, obtain Take the index to match with the feature;
Writing module, for first data to be respectively written into the corresponding data storage file of index respectively to match It is stored.
Fourth aspect, the embodiment of the present application provide a kind of data query device,
Receiving module, for receiving the inquiry data of user terminal transmission;
Conversion module, for obtaining the second number after formatting according to the second preset format to the inquiry data According to;
Module is obtained, all features for including for obtaining second data will be one of special in the feature Sign is as index, using other features as non-index;
Determining module is used to be determined data storage file corresponding with the index based on the index, and is based on institute State the corresponding subindex value of index, the data block where determining second data in the data storage file;
Sending module, for according to the non-index corresponding non-index value, searched in the data block with it is described non- The corresponding all data of index value, and all data are sent to the user terminal.
Compared with prior art, the embodiment of the present application obtains the source data for describing vehicle pass-through record;According to first Preset format carries out source data to be converted to the first data;Obtain the feature that the first data include;Preset concordance list is searched, Obtain the index to match with feature;First data are respectively written into the corresponding data storage file of index respectively to match, The source data for describing vehicle pass-through record is respectively stored in and each feature for including in data according to unified format in this way In corresponding data storage file, in this way because the index to match according to the feature for including with the first data is to institute's active data The storage of progress, corresponding index is all different in each data storage file, the source stored between each data storage file Data content is identical, and no matter user's later period is using which feature as index, can be with quick search to the vehicle pass-through note needed Record, i.e. the embodiment of the present application provide the date storage method that the current record of a kind of pair of city vehicle is rationally counted.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows the first flow diagram of date storage method provided by the embodiment of the present application;
Fig. 2 shows second of flow diagrams of date storage method provided by the embodiment of the present application;
Fig. 3 shows the third flow diagram of date storage method provided by the embodiment of the present application;
Fig. 4 shows a kind of concrete scene schematic diagram of date storage method provided by the embodiment of the present application;
Fig. 5 shows a kind of flow diagram of data query method provided by the embodiment of the present application;
Fig. 6 shows a kind of structural schematic diagram of data storage device provided by the embodiment of the present application;
Fig. 7 shows a kind of structural schematic diagram of data query device provided by the embodiment of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application Middle attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only It is some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is real The component for applying example can be arranged and be designed with a variety of different configurations.Therefore, below to the application's provided in the accompanying drawings The detailed description of embodiment is not intended to limit claimed scope of the present application, but is merely representative of the selected reality of the application Apply example.Based on embodiments herein, those skilled in the art institute obtained without making creative work There are other embodiments, shall fall in the protection scope of this application.
The embodiment of the present application provides a kind of date storage method, as shown in Figure 1, including step 101~105:
101, obtain the source data for describing vehicle pass-through record.
Here vehicle pass-through record may include the attribute information of vehicle, such as: vehicle color, model and license plate number The traffic information of code and vehicle, such as vehicle pass-through time and passing area etc., in addition, also including the card in source data source The serial number of slogan, data acquisition time and data, all data relevant to vehicle pass-through can be used as vehicle pass-through The source data of record, such as a vehicle communication record may include the license plate number of the vehicle, vehicle color, vehicle model, be somebody's turn to do The bayonet number etc. of time and vehicle communication record source that vehicle is travelled in setting regions.
102, source data is carried out according to the first preset format to be converted to the first data.
The source of source data may be camera, data block or other communication interfaces etc., so the format of each source data can Can be not identical, in order to be stored according to unified format to source data, need exist for according to the first preset format to source number According to formatting, so that so source data becomes the first data of unified format.
For example, the format for the vehicle pass-through record for including in source data is: transit time, passing area, license plate number, vehicle Color, vehicle model and source bayonet number, the first preset format refer to according to license plate number, vehicle color, vehicle model, logical The sequence of row time, passing area and source bayonet number describe vehicle pass-through record.
103, obtain the feature that the first data include.
Here, license plate number, vehicle color, vehicle model in the i.e. above-mentioned source data of the feature that the first data include, right Bayonet number, transit time and communication locations for answering etc..
104, preset concordance list is searched, the index to match with feature is obtained.
The concordance list here preset at refers to including with license plate number, vehicle color, vehicle model, corresponding bayonet number, passage Time and communication locations are that the concordance list of index checks the feature for including after getting the first data in the first data, are obtained The index to match with these features, such as the feature that some first data includes are as follows: license plate number, the first data are corresponding Serial number, passing time and the bayonet number of source data input, the then index to match with feature got are license plate number Index, serial number index, passing time index and bayonet number index.
105, the first data are respectively written into the corresponding data storage file of index respectively to match and are stored.
Before writing first data into the corresponding data storage file of the index respectively to match, because the first data can The number that can include is more, if multithreading is carried out while being written to the first all data, may cause the exception of write-in, So in specific implementation, the first all data lines can be written in the queue of a thread-safe, then is mentioned from queue It takes out and data storage file is sequentially written.
For the ease of quick storage and the quick search of user, multiple data storage files, every number can be established here It is identical according to the first data content finally stored in storage file, but each data storage file corresponds to different indexes, Than if any data storage file be with license plate number for index write-in, data storage file be with serial number for index Write-in, data storage file be with the passing time for index write-in, data storage file be to be with bayonet number Index.
Specifically, being directed to each data storage file, the structure of each data storage file, such as the following table 1 have been preset It is shown, it is data storage file structure, including first piece and data block, in table 1, first piece of the first behavior data storage file, Head information including File header information and all data blocks;Second row starts to specifically include each data block for each data block Head information and each data block in storing data.
The structure of 1 data storage file of table
Wherein, the head letter of all data blocks in the head information and the data storage file of data storage file is recorded in first piece It ceases, file mark, file description and data block total number is included in the head information of file;Each data block is divided into data block head information And storing data, the head information of data block include the block number of the data block, the last data block that is connected in logic with it and latter The block number of data block can store a certain size storing data in each data block.
For the head information of a specific data block comprising parameter attribute can be as shown in table 2 below:
Title Data type Initial value Range
Slot int -1 0-8192
PreviousSlot int -1 0-8192
NextSlot int -1 0-8192
MinKey ulong 0
MaxKey ulong 0
Count int 0 0-32384
The parameter attribute of the head information of 2 data block of table
In table 2, Slot indicates the title of current data block, and PreviousSlot indicates the previous data of current data block The title of block, NextSlot indicate the title of the latter data block of current data block, and MinKey indicates minimum subindex value, MaxKey indicates maximum subindex value, and Count indicates the number of data in data block, and -1 indicates that initial value is sky, Range Representation Byte-sized section.
Specifically, in step 105, the first data are respectively written into the corresponding data storage file of index respectively to match It is stored, as shown in Fig. 2, specifically including following steps 201~203:
201, from the index to match with feature, an index is chosen, data storage file corresponding with the index is found.
Each first data can be stored according to different indexes into data storage file corresponding with each index, In specific implementation procedure, an index, such as license plate number index are first found in the index to match with feature, then find with The license plate number indexes corresponding data storage file.
202, according to preset data store strategy, determine the first data in the data storage file found wait store Position.
Specifically, the structure of data storage file includes first piece and multiple data blocks, the first piece of letter for recording multiple data blocks Breath, multiple data chunks are at the data link table for constituting data storage file;In step 202, according to preset data store strategy, Determine the first data in the data storage file found to storage location, as shown in figure 3, specifically including following steps 301 ~303:
301, each subindex value in data-link in each data block is obtained, subindex value is according to preset algorithm to sub- rope Row operation is introduced to obtain.
In data storage file, each data block constitutes the data-link in the data storage file, deposits in data block The data of storage are the subindex value in each data block, such as using license plate number as the corresponding data storage file of index In, the first data stored in each data block are using license plate number as subindex, here to subindex according to preset algorithm Available subindex value here after progress operation, for example license plate number is " XA1005 ", before being stored in data block, can be incited somebody to action License plate number " XA1005 " carries out operation according to certain operation rule, obtains the corresponding subindex value of the license plate number, for example be One specific binary number.
302, the corresponding subindex of feature is obtained, the corresponding subindex value of subindex of acquisition is calculated.
For the first data to be stored, however, it is determined that the corresponding subindex of the first data that should be to be stored is license plate number, The corresponding subindex value of license plate number for obtaining first data to be stored according to above-mentioned preset algorithm.
303, according to the size relation of each subindex value in the corresponding subindex value of feature and each data block, determine First data in data link table described in storage location.
Specifically, in step 303, according to each subindex value in the corresponding subindex value of feature and each data block Size relation, determine the first data in the data link table to storage location, including following a variety of situations, given in conjunction with Fig. 4 Give explanation:
The first situation determines first when the corresponding subindex value of feature is less than the smallest subindex value in data-link Data are located in first data block in data link table to storage location, such as the first situation in Fig. 4.
Second situation determines the when the corresponding subindex value of feature is greater than maximum subindex value in data link table One data are located in the data block in data link table where maximum index value to storage location, such as second in 4 in figure Situation.
The third situation, when the corresponding subindex value of feature is less than in data link table maximum subindex in any data block Value, and greater than when the smallest subindex value, determine the first data is located at any data block to storage location in any data block In, in Fig. 4, which is data block 2, when the corresponding subindex value of feature is less than the sub- rope of maximum in the data block Draw value, and the minimum subindex value being greater than in the data block 2, it is determined that first data are located at the data block to storage location In 2.
4th kind of situation, the maximum subindex in any data block that the corresponding subindex value of feature is greater than in data-link When being worth, and being less than the minimum subindex value in the data block after being located at any data block in data-link, the first data are determined The data block being located at after any one data block and any data block to storage location between data block in.
For example, the maximum subindex in Fig. 4, in the data block 2 for being greater than in data-link when the corresponding subindex value of feature Value, and the minimum subindex value in the data block 5 being less than in data-link, it is determined that first data are located at number to storage location According in the data block between block 2 and data block 5.
Specifically, there are when data block 3 and data block 4, be somebody's turn to do position to be stored to be located between data block 2 and data block 5 In valid data item number less data block, for example, the valid data item number in data block 3 is 50, it is effective in data block 4 Number of data is 28, then is somebody's turn to do position to be stored and is located in data block 4.
203, it writes first data into and is stored to storage location, finished until index is chosen.
First data include multiple features, corresponding multiple data storage files to be stored, according to all feature phases The each index matched stores first data respectively into each data storage file.
Optionally, after being respectively written into the first data in the corresponding data storage file of index respectively to match, also Include:
Data block in first piece in each data storage file and data-link is updated.
By the data block head information stored in first piece of file, construct orderly two-way using data block head information as node Chained list, it is contemplated that the importance of first block number evidence, independent outflow space is used to store the head of notebook data block in each data block Information, thus in the case where first piece of corrupted data of file, can by the head information of data block to file head block number according to progress Again restore.
After by the storage of the first data into data storage file, corresponding number in first piece is updated in the data storage file According to the head information of block, if there is no the head information of the data block in first piece, additional corresponding information, for example original includes 10 The head information of a data block, the first data being newly written are stored in the 11st data block, then additional 11st number in first piece According to the head information of block;If having existed the head information of the data block of the first data storage, original data are covered.
The first data storage into data storage file after, in the data storage file by data chunk at data The node number of chain may accordingly change or some data block in data maximum value and minimum value may become Change, needs to be updated these information.
There is above-mentioned storage method, it can be seen that the storing data of data store internal is written in additional form, same number Be according to the data inside block it is unordered, in order to guarantee what the data between different data block and data block were ordered into logic, It is as follows to the organization regulation of data block:
After getting the first data, the 1st data block is written, the 1st data block in logic previous piece is sky at this time, after One piece is also sky.
When the storing data of the 1st data block is filled with, it will the 2nd data block is used, at this point, by the 1st data block In data stay alone, carry out ascending sort according to subindex value, the 1st data block is written in the previous half data after sequence, sorts The 2nd data block is written in later half afterwards;The 1st data block in logic previous piece is sky at this time, and latter piece is the 2nd data Block;Previous piece of 2nd data block is the 1st data block, and latter piece is sky.
According to storage strategy, if the 1st data block is still written in data of newly arriving, and the data in the 1st data block are deposited Man Shi then uses the 3rd data block, at this point, the data in the 1st data block are read, carries out ascending sort according to index value, The 1st data block is written in previous half data after sequence, and the 3rd data block is written in the latter half data after sequence;It updates simultaneously Their front and back block relationships in logic, i.e. the 1st data block in logic previous piece is sky, and latter piece is the 3rd data block;The Previous piece of 3 data blocks is the 1st data block, and latter piece is the 2nd data block;Previous piece of 2nd data block is the 3rd Data block, latter piece is sky, and so on.
This ensures that all data in the 1st data block are both less than the data in the 3rd data block, the 3rd number It is both less than the data of the 2nd data block according to the data of block, with the structure of this regular weaves data block, passes through data block and number in this way Two-way sequential chained list is constructed according to the context of block in logic.
Based on above-mentioned date storage method, the embodiment of the present application also provides a kind of data query methods, such as Fig. 5 institute Show, include the following steps 501~505:
501, receive the inquiry data that user terminal is sent.
It may include one or more features for indicating vehicle pass-through record in the inquiry data that user terminal is sent.
502, the second data are obtained after formatting according to the second preset format to inquiry data.
User terminal send inquiry data, it is necessary first to first to the inquiry data according to the second preset format to the inquiry number According to being parsed to obtain the second data, it may include one or more features in second data.
503, all features that the second data include are obtained, using one of feature in feature as index, by other Feature is as non-index.
Since the storage content in all data storage files is all the same, in inquiry, only deposited from one of data It is inquired in storage file, when multiple features that the second data include, is made in order to avoid multiple indexes while when inquiring At repetition, different indexes different priority in inquiry can be assigned here, i.e., in multiple features, by highest priority As soon as feature as index, other features are used as it is non-index, for example, priority are as follows: license plate number > data sequence number > The passing time > bayonet card number > vehicle color, when in the second data including license plate number and vehicle color, then by license plate number As index, using vehicle color as non-index, it should be noted that license plate number here is not practical number of vehicle Code, but the data after operation are carried out to actual vehicle number according to preset algorithm, it is possible that can have different vehicles Number corresponds to the case where same data.
504, data storage file corresponding with index is determined based on index, and be based on indexing corresponding subindex value, Data block where determining the second data in data storage file.
For example, if using vehicle number as index, and determining in vehicle number is to index corresponding data storage file Middle inquiry, specifically, it is determined that the subindex value of the vehicle number, then determines in data storage file according to the subindex value Data block where second data.
505, according to non-index corresponding non-index value, all data corresponding with non-index value are searched within the data block, And all data are sent to user terminal.
After finding the data block where second data, it may be found that thering are a plurality of data to be all satisfied item in the data block Part just needs to reduce the range of lookup according to non-index corresponding non-index value at this time, to obtain having for user terminal needs Imitate data.
Optionally, inquiring in data further includes default paging strategy and third preset format, and all data are sent to use Family end, comprising:
All data are converted according to third preset format.
After inquiring the valid data for meeting client needs, these data are being carried out according to the format that client needs Conversion.
According to the paging strategy that user terminal is set, will successively be converted with page number corresponding data amount according to third preset format Data afterwards are sent to user terminal.
For example it is 50 that user terminal, which sets the number of data of every page of displaying, and the valid data inquired are 200, then This part valid data is successively sent to user terminal according to 50 for unit.
The embodiment of the present application provides a kind of data storage device, as shown in Figure 6, comprising:
Module 601 is obtained, for obtaining the source data for describing vehicle pass-through record.
Conversion module 602 is converted to the first data for carrying out according to the first preset format to source data.
Module 601 is obtained, is also used to obtain the feature that the first data include;For searching preset concordance list, obtain with The index that feature matches.
Writing module 603, for being respectively written into the first data in the corresponding data storage file of index respectively to match.
Optionally, writing module 603 are specifically used for:
From the index to match with feature, an index is chosen, data storage file corresponding with the index is found.
According to preset data store strategy, to be stored position of first data in the data storage file found is determined It sets.
It is stored described in writing first data into storage location, is finished until index is chosen.
Optionally, the structure of data storage file includes first piece and multiple data blocks, the first piece of letter for recording multiple data blocks Breath, multiple data chunks are at the data link table for constituting data storage file;Writing module 603, is specifically used for:
Obtain each subindex value in data-link in each data block, subindex value according to preset algorithm to subindex into Row operation obtains.
The corresponding subindex of feature is obtained, the corresponding subindex value of subindex of acquisition is calculated.
According to the size relation of each subindex value in the corresponding subindex value of feature and each data block, first is determined Data in data link table described in storage location.
Optionally, writing module 603 are specifically used for:
When the corresponding subindex value of feature be less than data-link in the smallest subindex value when, determine the first data wait store Position is located in first data block in data link table.
When the corresponding subindex value of feature be greater than data link table in maximum subindex value when, determine the first data wait deposit Storage space is setting in the data block where index value maximum in data link table.
When the corresponding subindex value of feature is less than in data link table maximum subindex value in any data block, and it is greater than and appoints In one data block when the smallest subindex value, being located in any data block to storage location for the first data is determined.
Maximum subindex value in any data block that the corresponding subindex value of feature is greater than in data-link, and it is less than number According in chain be located at any data block after data block in minimum subindex value when, determine the first data to storage location In the data block between data block after any one data block and any data block.
Optionally, data storage device further includes update module, and update module is used for:
Data block in first piece in each data storage file and data-link is updated.
The embodiment of the present application also provides a kind of data query devices, as shown in fig. 7,
Receiving module 701, for receiving the inquiry data of user terminal transmission.
Conversion module 702, for obtaining the second data after formatting according to the second preset format to inquiry data.
Obtain module 703, all features for including for obtaining the second data, using one of feature in feature as Index, using other features as non-index.
Determining module 704, for being corresponded to based on the determining data storage file corresponding with index of index, and based on index Subindex value, the data block where determining second data in data storage file.
Sending module 705, for searching within the data block corresponding with non-index value according to non-index corresponding non-index value All data, and all data are sent to user terminal.
Optionally, inquiring in data further includes default paging strategy and third preset format, and sending module 705 is specific to use In:
All data are converted according to third preset format.
According to the paging strategy that user terminal is set, will successively be converted with page number corresponding data amount according to third preset format Data afterwards are sent to user terminal.
Compared with prior art, the embodiment of the present application obtains the source data for describing vehicle pass-through record;According to first Preset format carries out source data to be converted to the first data;Obtain the feature that the first data include;Preset concordance list is searched, Obtain the index to match with feature;First data are respectively written into the corresponding data storage file of index respectively to match, The source data for describing vehicle pass-through record is respectively stored in and each feature for including in data according to unified format in this way In corresponding data storage file, in this way because the index to match according to the feature for including with the first data is to institute's active data The storage of progress, corresponding index is all different in each data storage file, the source stored between each data storage file Data content is identical, and no matter user's later period is using which feature as index, can be with quick search to the vehicle pass-through note needed Record, i.e. the embodiment of the present application provide the date storage method that the current record of a kind of pair of city vehicle is rationally counted.
In addition, the structure of the data storage file of the embodiment of the present application building, supports the vehicle of storage mass data amount logical Row record source data, supports the dynamic of source data to increase;Construct the date storage method based on data store strategy, Neng Gouman Foot carries out real-time storage to the source data of the vehicle pass-through record of big quantity;The data query method of offer, because according to preferential Grade index, quickly can find query result in the corresponding data storage file of the index of highest priority.
The computer program product of date storage method and data query method is carried out provided by the embodiment of the present application, Computer readable storage medium including storing program code, the instruction that said program code includes can be used for executing front side Method method as described in the examples, specific implementation can be found in embodiment of the method, and details are not described herein.
Data storage device and data query device provided by the embodiment of the present application can be specific hard in equipment Part or the software being installed in equipment or firmware etc..Device provided by the embodiment of the present application, realization principle and generation Technical effect is identical with preceding method embodiment, and to briefly describe, Installation practice part does not refer to place, can refer to aforementioned side Corresponding contents in method embodiment.It is apparent to those skilled in the art that for convenience and simplicity of description, it is aforementioned System, the specific work process of device and unit of description, the corresponding process during reference can be made to the above method embodiment, herein It repeats no more.
In embodiment provided herein, it should be understood that disclosed device and method, it can be by others side Formula is realized.The apparatus embodiments described above are merely exemplary, for example, the division of the unit, only one kind are patrolled Function division is collected, there may be another division manner in actual implementation, in another example, multiple units or components can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in embodiment provided by the present application can integrate in one processing unit, it can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing, in addition, term " the One ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Finally, it should be noted that embodiment described above, the only specific embodiment of the application, to illustrate the application Technical solution, rather than its limitations, the protection scope of the application is not limited thereto, although with reference to the foregoing embodiments to this Shen It please be described in detail, those skilled in the art should understand that: anyone skilled in the art Within the technical scope of the present application, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of the embodiment of the present application technical solution.The protection in the application should all be covered Within the scope of.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.

Claims (10)

1. a kind of date storage method characterized by comprising
Obtain the source data for describing vehicle pass-through record;
The source data is carried out according to the first preset format to be converted to the first data;
Obtain the feature that first data include;
Preset concordance list is searched, the index to match with the feature is obtained;
First data are respectively written into the corresponding data storage file of index respectively to match and are stored.
2. the method according to claim 1, wherein the feature that first data include include license plate number, Vehicle color, vehicle model and corresponding bayonet number.
3. the method according to claim 1, wherein described be respectively written into first data respectively matches It indexes and is stored in corresponding data storage file, comprising:
From the index to match with the feature, an index is chosen, data storage file corresponding with the index is found;
According to preset data store strategy, to be stored position of first data in the data storage file found is determined It sets;
It will store described in first data write-in to storage location, finished until index is chosen.
4. according to the method described in claim 3, it is characterized in that, the structure of the data storage file includes first piece and multiple Data block, the described first piece information for recording multiple data blocks, multiple data chunks store text at the data are constituted The data link table of part;It is described according to preset data store strategy, determine first data in the data storage file found In to storage location, comprising:
Obtain each subindex value in the data-link in each data block, subindex value according to preset algorithm to subindex into Row operation obtains;
The corresponding subindex of the feature is obtained, the corresponding subindex value of subindex of acquisition is calculated;
According to the size relation of each subindex value in the corresponding subindex value of the feature and each data block, determine described in First data in the data link table described in storage location.
5. according to the method described in claim 4, it is characterized in that, described according to the corresponding subindex value of the feature and each The size relation of each subindex value in data block, determine first data in the data link table described in wait store Position, comprising:
When the corresponding subindex value of the feature is less than the smallest subindex value in the data-link, first data are determined Described be located in first data block in the data link table to storage location;
When the corresponding subindex value of the feature is greater than maximum subindex value in the data link table, first number is determined It is located in the data block in the data link table where maximum index value described in storage location;
When the corresponding subindex value of the feature is less than in the data link table maximum subindex value in any data block, and it is big In any data block when the smallest subindex value, determine that the described of first data is located at described appoint to storage location In one data block;
Maximum subindex value in any data block that the corresponding subindex value of the feature is greater than in the data-link, and it is small In the data-link be located at any data block after data block in minimum subindex value when, determine first data The data block being located at after any one described data block and any data block to storage location between data block in.
6. according to the method described in claim 5, it is characterized in that, the first data to be respectively written into the index pair respectively to match After in the data storage file answered, the method also includes:
Data block in first piece in each data storage file and data-link is updated.
7. a kind of data query method characterized by comprising
Receive the inquiry data that user terminal is sent;
The second data are obtained after formatting according to the second preset format to the inquiry data;
All features that second data include are obtained, using one of feature in the feature as index, by other Feature is as non-index;
Data storage file corresponding with the index is determined based on the index, and based on the corresponding subindex of the index Value, the data block where determining second data in the data storage file;
According to the non-index corresponding non-index value, all numbers corresponding with the non-index value are searched in the data block According to, and all data are sent to the user terminal.
8. the method according to the description of claim 7 is characterized in that further including default paging strategy and the in the inquiry data Three preset formats, it is described that all data are sent to the user terminal, comprising:
All data are converted according to the third preset format;
According to the user terminal set paging strategy, successively by with page number corresponding data amount according to the third preset format Data after conversion are sent to the user terminal.
9. a kind of data storage device characterized by comprising
Module is obtained, for obtaining the source data for describing vehicle pass-through record;
Conversion module is converted to the first data for carrying out according to the first preset format to the source data;
The acquisition module is also used to obtain the feature that first data include;For searching preset concordance list, obtain with The index that the feature matches;
Writing module is carried out for first data to be respectively written into the corresponding data storage file of index respectively to match Storage.
10. a kind of data query device, which is characterized in that
Receiving module, for receiving the inquiry data of user terminal transmission;
Conversion module, for obtaining the second data after formatting according to the second preset format to the inquiry data;
Module is obtained, all features for including for obtaining second data make one of feature in the feature To index, using other features as non-index;
Determining module is used to be determined data storage file corresponding with the index based on the index, and is based on the rope Draw corresponding subindex value, the data block where determining second data in the data storage file;
Sending module, for according to the non-index corresponding non-index value, searched in the data block with it is described non-index It is worth corresponding all data, and all data is sent to the user terminal.
CN201811012248.4A 2018-08-31 2018-08-31 A kind of date storage method, querying method, storage device and inquiry unit Pending CN109144962A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811012248.4A CN109144962A (en) 2018-08-31 2018-08-31 A kind of date storage method, querying method, storage device and inquiry unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811012248.4A CN109144962A (en) 2018-08-31 2018-08-31 A kind of date storage method, querying method, storage device and inquiry unit

Publications (1)

Publication Number Publication Date
CN109144962A true CN109144962A (en) 2019-01-04

Family

ID=64826027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811012248.4A Pending CN109144962A (en) 2018-08-31 2018-08-31 A kind of date storage method, querying method, storage device and inquiry unit

Country Status (1)

Country Link
CN (1) CN109144962A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516432A (en) * 2019-08-30 2019-11-29 招商华软信息有限公司 A kind of determination method, apparatus, equipment and the storage medium of vehicle permission
CN111368298A (en) * 2020-02-27 2020-07-03 腾讯科技(深圳)有限公司 Virus file identification method, device, equipment and storage medium
WO2020143181A1 (en) * 2019-01-07 2020-07-16 平安科技(深圳)有限公司 Data storage method, apparatus, computer device and storage medium
CN111427910A (en) * 2020-03-20 2020-07-17 北京百度网讯科技有限公司 Data processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880704A (en) * 2012-09-25 2013-01-16 上海证券交易所 Novel concurrent memory data organization and access method
CN102890719A (en) * 2012-10-12 2013-01-23 浙江宇视科技有限公司 Method and device for fuzzy research of license plate numbers
CN103246749A (en) * 2013-05-24 2013-08-14 北京立新盈企信息技术有限公司 Matrix data base system for distributed computing and query method thereof
CN105653568A (en) * 2014-12-04 2016-06-08 中兴通讯股份有限公司 Method and apparatus analyzing user behaviors
CN106777111A (en) * 2016-12-15 2017-05-31 华南师范大学 A kind of sequential search index system and method for ultra-large data
CN107239571A (en) * 2017-06-28 2017-10-10 浪潮金融信息技术有限公司 Index structuring method based on multidimensional data space technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880704A (en) * 2012-09-25 2013-01-16 上海证券交易所 Novel concurrent memory data organization and access method
CN102890719A (en) * 2012-10-12 2013-01-23 浙江宇视科技有限公司 Method and device for fuzzy research of license plate numbers
CN103246749A (en) * 2013-05-24 2013-08-14 北京立新盈企信息技术有限公司 Matrix data base system for distributed computing and query method thereof
CN105653568A (en) * 2014-12-04 2016-06-08 中兴通讯股份有限公司 Method and apparatus analyzing user behaviors
CN106777111A (en) * 2016-12-15 2017-05-31 华南师范大学 A kind of sequential search index system and method for ultra-large data
CN107239571A (en) * 2017-06-28 2017-10-10 浪潮金融信息技术有限公司 Index structuring method based on multidimensional data space technology

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020143181A1 (en) * 2019-01-07 2020-07-16 平安科技(深圳)有限公司 Data storage method, apparatus, computer device and storage medium
CN110516432A (en) * 2019-08-30 2019-11-29 招商华软信息有限公司 A kind of determination method, apparatus, equipment and the storage medium of vehicle permission
CN111368298A (en) * 2020-02-27 2020-07-03 腾讯科技(深圳)有限公司 Virus file identification method, device, equipment and storage medium
CN111368298B (en) * 2020-02-27 2023-07-21 腾讯科技(深圳)有限公司 Virus file identification method, device, equipment and storage medium
CN111427910A (en) * 2020-03-20 2020-07-17 北京百度网讯科技有限公司 Data processing method and device

Similar Documents

Publication Publication Date Title
CN109144962A (en) A kind of date storage method, querying method, storage device and inquiry unit
CN105550225B (en) Index structuring method, querying method and device
CN107045531A (en) A kind of system and method for optimization HDFS small documents access
CN106156070B (en) A kind of querying method, file mergences method and relevant apparatus
CN110413611A (en) Data storage, querying method and device
CN102567421B (en) Document retrieval method and device
CN103902702A (en) Data storage system and data storage method
CN103020255A (en) Hierarchical storage method and hierarchical storage device
CN102169491B (en) Dynamic detection method for multi-data concentrated and repeated records
CN101710320A (en) Statistical index data processing method and device
CN106682042A (en) Relational data cache and inquiry method and device
CN112765405A (en) Method and system for clustering and inquiring spatial data search results
CN101578579B (en) Taxonomy object modeling method and system
CN106682003A (en) Path segmentation mapping method and device for distributed memory namespace
CN105488471B (en) A kind of font recognition methods and device
CN106326358A (en) Big data-based vehicle passing information inquiry method and device
CN107644050A (en) A kind of querying method and device of the Hbase based on solr
CN105677878B (en) A kind of method and system that the information of vehicles multidimensional based on BI system is shown
CN106570145A (en) Layered mapping-based distributed database result caching method
CN105183391A (en) Method and device for storing data under distributed data platform
CN105468728A (en) Cross-section data acquisition method and system
CN102436504A (en) System and method for processing road data based on dynamic segmentation technology
CN110245118A (en) BIM data information three-dimensional gridding retrieval filing method and filing system thereof
CN108256064B (en) A kind of data search method and device
CN102043856B (en) Data acquisition method and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190104