CN108319661A - A kind of structured storage method and device of spare part information - Google Patents

A kind of structured storage method and device of spare part information Download PDF

Info

Publication number
CN108319661A
CN108319661A CN201810023342.3A CN201810023342A CN108319661A CN 108319661 A CN108319661 A CN 108319661A CN 201810023342 A CN201810023342 A CN 201810023342A CN 108319661 A CN108319661 A CN 108319661A
Authority
CN
China
Prior art keywords
spare part
information
stored
field
template
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
CN201810023342.3A
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.)
Lianjia Beijing Technology Co Ltd
Original Assignee
Lianjia Beijing 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 Lianjia Beijing Technology Co Ltd filed Critical Lianjia Beijing Technology Co Ltd
Priority to CN201810023342.3A priority Critical patent/CN108319661A/en
Publication of CN108319661A publication Critical patent/CN108319661A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures

Abstract

The embodiment of the present invention provides a kind of structured storage method and device of spare part information.The method includes:Acquisition includes the spare part information to be stored of at least one field information, and field information includes field name and field value;According to the field name in spare part information to be stored target spare part template is obtained with the field name in each spare part template;Key-value pair is generated if judging to know that the field value of spare part information to be stored meets the regular expression for corresponding to aiming field title in target spare part template, and key-value pair is stored.Described device is for executing the method.The embodiment of the present invention obtains target spare part template by the field name in spare part information to be stored, corresponding key-value pair is generated according to the regular expression of each field in target spare part template, and the key-value pair of generation is stored, its spare part template can be made more efficient when being inquired according to actually asking money to be extended modification by more rational storage mode.

Description

A kind of structured storage method and device of spare part information
Technical field
The present embodiments relate to big data processing technology field more particularly to a kind of institutional storage sides of spare part information Method and device.
Background technology
Entire house deal, lease flow in, intermediary need to record a large amount of user information (include but unlimited In:Identity card, property ownership certificate, residence booklet etc.), in general, the information such as identity card, property ownership certificate, residence booklet are known as spare part information.In the past Mode be all each using uploading every time, and only stored in the form of picture, merely serve as voucher to use. User rents a house, buys and sells house and be required for resubmiting a large amount of certificate information every time in this way.However it is burning hot nowadays in big data, This approach is difficult to associate the behavior of user, for statistical analyses works such as source of houses recommendation, room rate prediction, thermodynamic charts of renting a house Produce prodigious technical barrier.
Some companies start that these information are collected and are arranged at present, but different type spare part is due to data knot Structure, field type etc. can not be adapted in traditional database using usual manner well.Mode general at present is needle Different database tables is used to the spare part of different data structure, adding new spare part every time in this way may need to create newly Table.And if inquired between variety classes spare part, needs to establish additional relation table and be inquired.Another scheme is to use JSON formats store all field names and information in the form of text, although in this way without the concern for format the problem of, It will appear problem when retrieval, additional system needed to support function of search.
By the way of different spare part Structure Creating different data database table structures, it is that autgmentability is very poor first, increases new Spare part type needs to create new table structure, and secondly, General query needs to safeguard more additional relation tables, and it is more when It may not be logic of the binary across table, the conjunctive query of three tables, four tables or even more structures, this storage side may be risen to Formula results in the low problem of search efficiency.Second of mode using JSON formats storage field name and value, in certain journey It can solve the problems, such as that above-mentioned data list structure is skimble-scamble on degree, a certain row of database are stored in using JSON as a field, Compatibility is made that for data format unification.But crucial search index problem is there is no solving, and what is deposited due to JSON is one Section character string, if establishing index, hit rate is substantially zero.In addition full-text index efficiency is also very low.
Therefore, how spare part information to be stored using rational storage method, the efficiency to improve inquiry is existing Nowadays project urgently to be resolved hurrily.
Invention content
In view of the problems of the existing technology, the embodiment of the present invention provide a kind of spare part information institutional storage method and Device.
In a first aspect, the embodiment of the present invention provides a kind of institutional storage method of spare part information, including:
Spare part information to be stored is obtained, the spare part information to be stored includes at least one field information, the field letter Breath includes field name and the corresponding field value of the field name;
It is matched, is obtained with the field name in each spare part template according to the field name in the spare part information to be stored Take the spare part template of successful match as target spare part template;The target spare part template includes at least one aiming field title And the corresponding regular expression of the aiming field title;
If judgement knows that the field value of the spare part information to be stored meets in the target spare part template and corresponds to target word The regular expression of name section then generates key-value pair, and the key-value pair is stored.
Second aspect, the embodiment of the present invention provide a kind of structured storage device of spare part information, including:
Acquisition module, for obtaining spare part information to be stored, the spare part information to be stored includes at least one field letter Breath, the field information includes field name and the corresponding field value of the field name;
Matching module, for according to the field name in the spare part information to be stored and the field name in each spare part template Title is matched, and obtains the spare part template of successful match as target spare part template;The target spare part template includes at least one A aiming field title and the corresponding regular expression of the aiming field title;
Memory module, if for judging to know that the field value of the spare part information to be stored meets the target spare part template The regular expression of middle corresponding aiming field title then generates key-value pair, and the key-value pair is stored.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including:Processor, memory and bus, wherein
The processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to refer to Enable the method and step for being able to carry out first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, including:
The non-transient computer readable storage medium stores computer instruction, and the computer instruction makes the computer Execute the method and step of first aspect.
A kind of structured storage method and device of spare part information provided in an embodiment of the present invention, is believed by spare part to be stored Field name in breath obtains target spare part template, is generated according to the regular expression of each field in target spare part template corresponding Key-value pair, and the key-value pair of generation is stored, spare part template can be according to actually asking money to be extended modification, by more Rational storage mode is added to make more efficient when being inquired.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Some bright embodiments for those of ordinary skill in the art without creative efforts, can be with root Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of structured storage method flow schematic diagram of spare part information provided in an embodiment of the present invention;
Fig. 2 is template configuration flow diagram provided in an embodiment of the present invention;
Fig. 3 is field configuration flow diagram provided in an embodiment of the present invention;
Fig. 4 is spare part querying flow schematic diagram provided in an embodiment of the present invention;
Fig. 5 is the storage method flow diagram of spare part information provided in an embodiment of the present invention;
Fig. 6 is a kind of structured storage apparatus structure schematic diagram of spare part information provided in an embodiment of the present invention;
Fig. 7 is a kind of structured storage system entity structural schematic diagram of spare part information provided in an embodiment of the present invention;
Fig. 8 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art The every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is a kind of structured storage method flow schematic diagram of spare part information provided in an embodiment of the present invention, such as Fig. 1 institutes Show, the method, including:
Step 101:Spare part information to be stored is obtained, the spare part information to be stored includes at least one field information, institute It includes field name and the corresponding field value of the field name to state field information;
Specifically, storage device obtains spare part information to be stored input by user, wherein spare part information to be stored can be Identity card, property ownership certificate, residence booklet etc..And spare part information to be stored includes at least one field information, each field information In include field name and the corresponding field value of field name.By taking identity card as an example:The field name that identity card includes has: Name, gender, nationality, home address, the term of validity, photo link.
Step 102:According to the field name in field name and each spare part template in the spare part information to be stored into Row matching, obtains the spare part template of successful match as target spare part template;The target spare part template includes at least one mesh Marking-up name section and the corresponding regular expression of the aiming field title;
Specifically, by the field name in spare part information to be stored and the field name progress in each spare part template Match, it, will if field name all in spare part information to be stored is matched with the field name in one of spare part template The spare part template is as target spare part template, it should be noted that target spare part template includes at least one aiming field name Title and each corresponding regular expression of aiming field title.Regular expression refers to the corresponding field of aiming field title The requirement that value should meet.
Step 103:If it is right in the target spare part template that judgement knows that the field value of the spare part information to be stored meets The regular expression for answering aiming field title then generates key-value pair, and the key-value pair is stored.
Specifically, the storage mode of spare part information to be stored can be newly-increased, or modification.If spare part to be stored Stored mistake before information, there will be a corresponding spare part instance identifications, if spare part information to be stored is not stored It crosses, does not then have corresponding spare part instance identification, therefore, according to whether there is corresponding spare part example mark in spare part information to be stored Knowledge can determine its storage mode.After determining storage mode, judge whether is each field value in spare part information to be stored Meet the regular expression for corresponding to aiming field title in target spare part template, corresponding key-value pair is generated if meeting, After generating the corresponding key-value pair of each field value in spare part information to be stored, all key-value pairs are stored.That is every A field, that is, name etc. are this, are also the requirement having in structure in fact.For example, English alphabet, property cannot occur in name Can only not be man or female etc..Such as:For the spare part template of an identity card, data structure can be:
Identity card:{
Name:The up to character string of Chinese character or the blank character composition of XX length;
Gender:Man or female;
It is national:56 national to enumerate;
Identification card number:18 bit digitals or X;
Home address:The up to character string of the Chinese character of XX length or number composition;
The term of validity:Two time intervals;
Photo links:The link URL of http;
}。
If spare part information to be stored is ID card information, and identification card number is 18 bit digitals, then illustrates the identification card number Meet corresponding regular expression.This is that spare part structure defines meaning with field definition, it defines us and is depositing When storing up some spare part information, it is necessary to which the field of the template and the inside that have been configured according to us is filled in, for follow-up number It lays the first stone according to unified format.
The embodiment of the present invention obtains target spare part template by the field name in spare part information to be stored, standby according to target The regular expression of each field generates corresponding key-value pair in part template, and the key-value pair of generation is stored, spare part mould Plate can so that efficiency is more when being inquired according to actually asking money to be extended modification by more rational storage mode It is high.
On the basis of the above embodiments, the method further includes:
It is pre-configured with each spare part template, the spare part template includes the first Template Information or the second Template Information;Wherein, institute Stating the first Template Information includes:Spare part template identification, field name and the field name are corresponding just in expression formula;It is described Second Template Information includes:Spare part template identification, field name, the field name are corresponding just in expression formula and compound list Information;The compound list information includes compound fields title and the corresponding regular expression of the compound fields title.
Specifically, being pre-configured with various spare part templates, which template of concrete configuration can be according to specific business demand.Figure 2 be template configuration flow diagram provided in an embodiment of the present invention, as shown in Fig. 2, including:
Step 201:Spare part information is set;When being pre-configured with a spare part template, first need that spare part information is arranged, wherein Spare part information may include the information such as the title of spare part template, execute step 202;
Step 202:Associate field;Before configuring spare part template, first field can be configured, concrete configuration which Field can be selected according to actual conditions.The required field of spare part template is closed with pre-configured field Connection determines which field and the corresponding regular expression of these fields are needed in spare part template, execute step 203;
Step 203:Whether unique value field;Judge whether associated field is unique value successively, it is to be understood that body Identification card number in part card is unique value, because everyone identification card number is all different;If it is unique value field, execute Step 204, no to then follow the steps 206;
Step 204:With the presence or absence of unique value field;Judge unique value field whether is had existed in spare part template, if It has existed, thens follow the steps 205, it is no to then follow the steps 206;
Step 205:Unique value field can not be added again;It, cannot if having had existed unique value in spare part template Unique value field is added again.The reason is that as the mark for distinguishing spare part example uniqueness, it is desirable to be able to which logic simply makees area Point.Mark of the field relatively independent in business scenario as uniqueness should so be chosen.Such as the ID of certain certificates, It is natural to carry the attribute distinguished, then only existing one in each template can.
Step 206:Preserve incidence relation;The incidence relation of spare part template and field is preserved, step 207 is executed;
Step 207:Whether compound list is needed;Judge whether the spare part template needs that compound list is arranged, if it is desired, Then follow the steps 208, it is no to then follow the steps 209;
Step 208:Compound form fields setting;In compound list also include corresponding compound fields title and it is corresponding just Then expression formula, it is therefore desirable to it is configured, step 209 is executed;
Step 209:Asynchronous generation operation note message;After all fields in spare part template are all provided with, asynchronous life At operation note information, at this point, completing the configuration of spare part template.
From the foregoing, it will be observed that some spare part templates include compound list, there is no compound list in some templates, therefore, if It is the spare part template of no compound list, then includes that spare part template identification, field name and the field name are corresponding just In expression formula, if include the spare part template of compound list, including spare part template identification, field name, the field name It is corresponding just in expression formula and compound form information;The compound list information includes compound fields title and the compound fields The corresponding regular expression of title.
It should be noted that the concept of compound list is:Certain spare part templates, it is understood that there may be one group or multi-group data, Specific number is different, but the field attribute in each group is all corresponding.For example, household registers, the inside includes householder With this family member.The number of wherein this family member is uncertain, but the format of each this family member be it is the same, all by The attribute such as { name, with householder's relationship, former name, gender } is constituted, and multiple members attribute of oneself should be corresponded 's.The presence of compound list is exactly in order to which spare part template is pulled out some field attributes.It is filled according to group.Specifically have Several groups uncertain, but every group of data format is the same.Or for the example of household registers, its template definition knot Structure is:
Household registers:{
Family is other:The up to character string of the Chinese character of XX or number composition;
Householder's name:The up to character string of the Chinese character of XX or blank character composition;
Family number:The number of length position XX;
Address:The up to character string of the Chinese character of XX or number composition;
Home address:The up to character string of the Chinese character of XX length or number composition;
Population information registers compound list:{
Name:The up to character string of the Chinese character of XX or blank character composition;
With householder's relationship:Enumerated value;
It is national:56 national to enumerate;
Religious belief:Religion is enumerated;
……
}.
……
}
Fig. 3 is field configuration flow diagram provided in an embodiment of the present invention, as shown in figure 3, including:
Step 301:Field is set and is applicable in city;For real estate intermediary, some fields may be only suitable for some city City does not need in other cities, therefore, the city that field is applicable in can be arranged first, it is to be understood that field into When row configuration, the applicable city of field can not also be configured, execute step 302;
Step 302:Select field type;Field type can be divided into:Date, character, numerical value and enumerate, different field its Corresponding field type is different, therefore, field type is arranged according to the concrete condition of field, if the field type of the field is Character or numerical value then need that field length and setting unit is arranged, if the field type of the field is to enumerate, need to be arranged Enumeration type, enumeration order and scope of application etc. execute step 303:;
Step 303:Preserve field;After the above-mentioned attribute of field is provided with, setting is preserved, executes step 304;
Step 304:Asynchronous generation operation note message;After the completion of preservation, asynchronous generation operation note message, the word at this time Section configuration is completed.
The embodiment of the present invention is carried out by being pre-configured with each spare part template, and to the data structure in each spare part template Setting directly requires to be filled in i.e. when needing to store spare part to be stored by the field in target spare part template Can, unify format for follow-up data and lays the first stone.
On the basis of the above embodiments, the method further includes:
Inquiry request is obtained, the inquiry request includes spare part template identification, spare part instance identification or key-value pair information;
It is inquired, and is returned according to the spare part template identification, the spare part instance identification or the key-value pair information Query result.
Specifically, Fig. 4 is spare part querying flow schematic diagram provided in an embodiment of the present invention, as shown in figure 4, including:
Step 401:Proof of identity;Inquiry request input by user is obtained, when some user needs to inquire from database When spare part information, it is necessary first to be verified to the identity of user, verify and successfully then follow the steps 402;
Step 402:Whether inquired according to spare part template identification;Judge user whether by spare part template according to inquiry request Mark is inquired, no to then follow the steps 403 if it is thening follow the steps 405;
Step 403:Whether inquired according to spare part instance identification:Judge user whether by spare part example according to inquiry request Mark is inquired, no to then follow the steps 404 if it is thening follow the steps 405;
Step 404:Obtain inquiry key-value pair information;It is looked into if not according to spare part template identification and spare part instance identification It askes, then should obtain inquiry key-value pair information, be inquired according to key-value pair, execute step 405;
Step 405:Assembled querying condition;Querying condition in inquiry request is subjected to assembly, one is constituted and completely looks into Inquiry condition, it is to be understood that querying condition refers to that spare part template identification, spare part instance identification or inquiry key-value pair information are held Row step 406;
Step 406:Inquire database;It is inquired from database according to querying condition, executes step 406;
Step 407:Data conversion;The data format of the query result obtained from database is listings format, at this time may be used To carry out format conversion to query result, json formats are converted into, other data formats can also be converted to, execute step Rapid 408;
Step 408;Returned data and paging information;Transformed data are returned into user, and in the form of paging into Row displaying.
The embodiment of the present invention by inquiry request, according to spare part template identification, spare part instance identification or key-value pair information from It is inquired in database, the conjunctive query of various dimensions field is provided, conjunctive query function is provided to configurable field, it is more square Just allow user can across spare part template query and analysis.
On the basis of the above embodiments, the method further includes:
If not including spare part instance identification in the spare part information to be stored, judge to learn that the storage mode is new Increase;
If the spare part information to be stored includes the spare part instance identification, judge to learn the storage mode to repair Change.
Specifically, can be the spare part letter to be stored if a spare part information to be stored stored in the database Breath generates corresponding spare part instance identification, then the storage mode of spare part information to be stored is modification.If spare part letter to be stored Breath was not stored, then corresponding spare part instance identification is not present, illustrates that the storage mode of spare part information to be stored is at this time It is newly-increased, therefore can be by judging in spare part information to be stored whether including spare part instance identification can learn the spare part to be stored The corresponding storage mode of information is newly-increased or modification.
On the basis of the above embodiments, if described judge to know described in the field value satisfaction of the spare part information to be stored The regular expression that aiming field title is corresponded in target spare part template then generates key-value pair, and the key-value pair is deposited Storage, including:
Judge whether the spare part information to be stored is compound list;
If the spare part information to be stored is compound list, according to the second Template Information in the target spare part template Judge whether the field value of the spare part information to be stored meets the corresponding canonical of field name in second Template Information Expression formula or the corresponding regular expression of compound fields title generate key-value pair if meeting, the key-value pair are stored, And generate spare part instance identification;
If the spare part information to be stored is not compound list, believed according to the first template in the target spare part template Breath judges that the field name whether field value of the spare part information to be stored meets in first Template Information is corresponding just In expression formula, key-value pair is generated if meeting, the key-value pair is stored, and generate spare part instance identification.
The method further includes:
If the storage mode is modification, after generating the key-value pair, the update spare part information to be stored corresponds to Version information.
Specifically, Fig. 5 is the storage method flow diagram of spare part information provided in an embodiment of the present invention, as shown in figure 5, Including:
Step 501:Proof of identity;Receive user send spare part information to be stored and User Identity, according to The identity at family carries out proof of identity to the user, executes step 502;
Step 502:It is matched with spare part template;By each field name and each spare part mould in spare part information to be stored The corresponding field name of plate is matched, and step 503 is executed;
Step 503:Judge whether successful match;After overmatching, all field name energy in spare part information to be stored It is enough to be exactly matched with the field name in a spare part template, then illustrate successful match, executes step 504, it is no to then follow the steps 520;
Step 504:Whether spare part instance identification is carried;Judge in spare part information to be stored whether to include spare part example mark Know, if illustrating that the corresponding storage mode of spare part information to be stored is modification including if, executes step 506, it is otherwise to be stored standby The corresponding storage mode of part information is newly-increased, executes step 505;
Step 505:Into newly-increased flow;Into newly-increased flow, and execute step 508;
Step 506:Into modification process;It modifies flow, and executes step 507;
Step 507:It whether there is spare part instance identification in database;Judge to whether there is the spare part to be stored in database Otherwise the corresponding spare part instance identification of information enters if there is thening follow the steps 508 and increases flow newly, execute step 505;
Step 508:Data Format Transform;The data format of usual spare part information to be stored is json data formats, at this time It needs to be converted into list data formats, makes its flattening, execute step 509;
Step 509:Data deduplication;Duplicate removal processing is carried out to data, executes step 510;
Step 510:Whether compound fields are had;Judge in spare part information to be stored whether to include compound fields, if including Then follow the steps 511, it is no to then follow the steps 512;
Step 511:Meet the regular expression of field in the second Template Information;Include field in spare part information to be stored Title and compound fields title, judge whether the corresponding field value of field name meets corresponding field in the second Template Information respectively The corresponding regular expression of title, and to judge whether the corresponding field value of compound fields title meets corresponding in the second template The corresponding regular expression of compound fields title if it is satisfied, then generating corresponding key-value pair, and key-value pair is stored. It is understood that being known as compound for the field name in compound list in the spare part information to be stored with compound list Name section, in addition to the field in compound list, the title of other fields is known as field name, executes step 513;
Step 512:Meet the regular expression of field in the first Template Information;If not including in spare part information to be stored Compound list, then judge whether the corresponding field value of each field name in spare part information to be stored meets target spare part template In the corresponding field name of the first Template Information regular expression, if meet if generate corresponding key-value pair, by key assignments To storing, and spare part instance identification is generated, executes step 513;
Step 513:Generate key-value pair;The field value for meeting regular expression is generated into key-value pair, executes step 514;
Step 514:Whether increase newly;Judge whether the spare part information to be stored is newly-increased again, if it is, executing step Rapid 517, it is no to then follow the steps 515;
Step 515:Inquire version information;If storage mode is modification, illustrate that the spare part information to be stored has passed through Storage is crossed, storage for the first time can initialize a version number, and modification is required for more new version number every time later, according to spare part example Mark can get corresponding version number from database, execute step 516;
Step 516:Update version information;More new version number, specific update mode can carry out version number to be incremented by place Reason executes step 517;
Step 517:Data store;The key-value pair that each field value generates in spare part information to be stored is stored, is held Row step 518;
Step 518:Asynchronous generation message;After storage, asynchronous generation message executes step 519;
Step 519:Returned data operation information;It, wherein can in data operation information to user's returned data operation information To include spare part instance identification, version number etc., step 520 is executed;
Step 520:Terminate.
The embodiment of the present invention obtains target spare part template by the field name in spare part information to be stored, standby according to target The regular expression of each field generates corresponding key-value pair in part template, and the key-value pair of generation is stored, spare part mould Plate can so that efficiency is more when being inquired according to actually asking money to be extended modification by more rational storage mode It is high.
On the basis of the above embodiments, the method further includes:
It is table data by the Data Format Transform of the spare part information to be stored.
Specifically, before being stored spare part information to be stored, need to modify to its data format, can incite somebody to action Json data format modifications are list data formats, correspondingly, when inquiring spare part information from database, it can be by list numbers It is json data formats according to format conversion.
The embodiment of the present invention obtains target spare part template by the field name in spare part information to be stored, standby according to target The regular expression of each field generates corresponding key-value pair in part template, and the key-value pair of generation is stored, spare part mould Plate can so that efficiency is more when being inquired according to actually asking money to be extended modification by more rational storage mode It is high.
Fig. 6 is a kind of structured storage apparatus structure schematic diagram of spare part information provided in an embodiment of the present invention, such as Fig. 6 institutes Show, described device, including:Acquisition module 601, matching module 602 and memory module 603, wherein
For acquisition module 601 for obtaining spare part information to be stored, the spare part information to be stored includes at least one field Information, the field information include field name and the corresponding field value of the field name;Matching module 602 is used for according to institute The field name stated in spare part information to be stored is matched with the field name in each spare part template, obtains the standby of successful match Part template is as target spare part template;The target spare part template includes at least one aiming field title and the target word The corresponding regular expression of name section;If memory module 603 is used to judge to know that the field value of the spare part information to be stored to be full The regular expression that aiming field title is corresponded in the foot target spare part template, then generate key-value pair, and by the key-value pair It is stored.
Specifically, acquisition module 601 obtains spare part information to be stored input by user, wherein spare part information to be stored can To be identity card, property ownership certificate, residence booklet etc..And spare part information to be stored includes at least one field information, each field Include field name and the corresponding field value of field name in information.By taking identity card as an example:The field name that identity card includes Title has:Name, gender, nationality, home address, the term of validity, photo link.Matching module 602 will be in spare part information to be stored Field name is matched with the field name in each spare part template, if field name all in spare part information to be stored It matches with the field name in one of spare part template, then using the spare part template as target spare part template, should illustrate It is that target spare part template includes at least one aiming field title and each corresponding regular expressions of aiming field title Formula.Regular expression refers to the requirement that the corresponding field value of aiming field title should meet.Memory module 603 judges to be stored Whether each field value in spare part information meets the regular expression that aiming field title is corresponded in target spare part template, if Satisfaction then generates corresponding key-value pair, will after the corresponding key-value pair of each field value in generating spare part information to be stored All key-value pairs are stored.
The embodiment of device provided by the invention specifically can be used for executing the process flow of above-mentioned each method embodiment, Details are not described herein for function, is referred to the detailed description of above method embodiment.
The embodiment of the present invention obtains target spare part template by the field name in spare part information to be stored, standby according to target The regular expression of each field generates corresponding key-value pair in part template, and the key-value pair of generation is stored, spare part mould Plate can so that efficiency is more when being inquired according to actually asking money to be extended modification by more rational storage mode It is high.
Fig. 7 is a kind of structured storage system entity structural schematic diagram of spare part information provided in an embodiment of the present invention, such as Shown in Fig. 7, the system comprises part warehouse 701, field acquisition platform 702, storage service 703 and information inquiry platform 704, In:
Part warehouse 701 is responsible for getting through for entire operation flow.On the one hand, it is responsible for the data structure definition of spare part template. It is defined in general, the definition of data structure is normally placed at database level, different data structures uses different numbers It is stored according to database table structure.And herein, the database for being stored the data structure of spare part and bottom by part warehouse service Table structure separates so that under the premise of bottom data database table structure is consistent, according to different field incidence relations, encapsulation Go out different upper layer data structures, to achieve the purpose that data structure is configurable.On the other hand, part warehouse is waited for by obtaining Spare part information is stored, according to the field name in the spare part information to be stored and the field name progress in each spare part template Match, obtains the spare part template of successful match as target spare part template, if the field of the spare part information to be stored is known in judgement Value meets the regular expression that aiming field title is corresponded in the target spare part template, then generates key-value pair, and by the key Value is to storing.In addition, also providing field verification interface and information inquiry interface.The data structure defined by early period, And the field type that spare part is possessed, system can safety by external data, come according to specification typing.And it is directed to and looks into Inquiry demand, provides the query capability of field level granularity and old version index, and is merged with permission system, ensures system The safety of calling.
Field acquisition platform 702 is responsible for the typing of spare part field configuration and the definition of data structure, it is made for user External platform is interacted by the typing interface of part warehouse with part warehouse.
Storage service 703 is responsible for storing the key-value pair that part warehouse 701 generates, including spare part metadata, number of examples According to, operation data etc..It has invoked the memory interface of part warehouse, provides the storage service of physical layer;
Information inquiry platform 704 is responsible for the comprehensive inquiry of spare part, it is then utilized part warehouse spare part and inquires relevant interface, With visualization as a result, providing the displaying of data to the user.
Fig. 8 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention, as shown in figure 8, the electronic equipment, Including:Processor (processor) 801, memory (memory) 802 and bus 803;Wherein,
The processor 801 and memory 802 complete mutual communication by the bus 803;
The processor 801 is used to call the program instruction in the memory 802, to execute above-mentioned each method embodiment The method provided, such as including:Spare part information to be stored is obtained, the spare part information to be stored includes at least one field letter Breath, the field information includes field name and the corresponding field value of the field name;According to the spare part information to be stored In field name matched with the field name in each spare part template, the spare part template for obtaining successful match is standby as target Part template;The target spare part template includes at least one aiming field title and the corresponding canonical of the aiming field title Expression formula;If judgement knows that the field value of the spare part information to be stored meets in the target spare part template and corresponds to aiming field The regular expression of title then generates key-value pair, and the key-value pair is stored.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating Computer program on machine readable storage medium storing program for executing, the computer program include program instruction, when described program instruction is calculated When machine executes, computer is able to carry out the method that above-mentioned each method embodiment is provided, such as including:Obtain spare part letter to be stored Breath, the spare part information to be stored includes at least one field information, and the field information includes field name and the field The corresponding field value of title;According to the field name in field name and each spare part template in the spare part information to be stored into Row matching, obtains the spare part template of successful match as target spare part template;The target spare part template includes at least one mesh Marking-up name section and the corresponding regular expression of the aiming field title;If the spare part information to be stored is known in judgement Field value meets the regular expression that aiming field title is corresponded in the target spare part template, then generates key-value pair, and by institute Key-value pair is stated to be stored.
The present embodiment provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage medium Computer instruction is stored, the computer instruction makes the computer execute the method that above-mentioned each method embodiment is provided, example Such as include:Spare part information to be stored is obtained, the spare part information to be stored includes at least one field information, the field information Including field name and the corresponding field value of the field name;According in the spare part information to be stored field name with it is each Field name in spare part template is matched, and obtains the spare part template of successful match as target spare part template;The target Spare part template includes at least one aiming field title and the corresponding regular expression of the aiming field title;If judgement obtains Know that the field value of the spare part information to be stored meets the regular expressions that aiming field title is corresponded in the target spare part template Formula then generates key-value pair, and the key-value pair is stored.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer read/write memory medium, the program When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light The various media that can store program code such as disk.
The embodiments such as device described above are only schematical, wherein the unit illustrated as separating component It may or may not be physically separated, the component shown as unit may or may not be physics list Member, you can be located at a place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of module achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness Labour in the case of, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on Stating technical solution, substantially the part that contributes to existing technology can be expressed in the form of software products in other words, should Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including several fingers It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation Method described in certain parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although Present invention has been described in detail with reference to the aforementioned embodiments, it will be understood by those of ordinary skill in the art that:It still may be used With technical scheme described in the above embodiments is modified or equivalent replacement of some of the technical features; And these modifications or replacements, various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution spirit and Range.

Claims (10)

1. a kind of structured storage method of spare part information, which is characterized in that including:
Spare part information to be stored is obtained, the spare part information to be stored includes at least one field information, the field information packet Include field name and the corresponding field value of the field name;
It is matched with the field name in each spare part template according to the field name in the spare part information to be stored, acquisition With successful spare part template as target spare part template;The target spare part template include at least one aiming field title and The corresponding regular expression of the aiming field title;
If judgement knows that the field value of the spare part information to be stored meets in the target spare part template and corresponds to aiming field name The regular expression of title then generates key-value pair, and the key-value pair is stored.
2. according to the method described in claim 1, it is characterized in that, the method, further includes:
It is pre-configured with each spare part template, the spare part template includes the first Template Information or the second Template Information;Wherein, described One Template Information includes:Spare part template identification, field name and the field name are corresponding just in expression formula;Described second Template Information includes:Spare part template identification, field name, the field name are corresponding just to be believed in expression formula and compound list Breath;The compound list information includes compound fields title and the corresponding regular expression of the compound fields title.
3. according to the method described in claim 1, it is characterized in that, the method, further includes:
Inquiry request is obtained, the inquiry request includes spare part template identification, spare part instance identification or key-value pair information;
It is inquired according to the spare part template identification, the spare part instance identification or the key-value pair information, and returns to inquiry As a result.
4. according to the method described in claim 1, it is characterized in that, the method, further includes:
If not including spare part instance identification in the spare part information to be stored, judge to learn that the storage mode is newly-increased;
If the spare part information to be stored includes the spare part instance identification, judge to learn the storage mode as modification.
5. if according to the method described in claim 2, the it is characterized in that, word for judging to know the spare part information to be stored Segment value meets the regular expression that aiming field title is corresponded in the target spare part template, then generates key-value pair, and will be described Key-value pair is stored, including:
Judge whether the spare part information to be stored is compound list;
If the spare part information to be stored is compound list, judged according to the second Template Information in the target spare part template Whether the field value of the spare part information to be stored meets the corresponding regular expressions of field name in second Template Information Formula or the corresponding regular expression of compound fields title generate key-value pair if meeting, the key-value pair are stored, and raw At spare part instance identification;
If the spare part information to be stored is not compound list, sentenced according to the first Template Information in the target spare part template It is corresponding just in table whether the field value for the spare part information to be stored of breaking meets the field name in first Template Information Up to formula, key-value pair is generated if meeting, the key-value pair is stored, and generate spare part instance identification.
6. according to the method described in claim 1, it is characterized in that, the method further includes:
If the storage mode is modification, after generating the key-value pair, the corresponding version of the spare part information to be stored is updated This information.
7. according to claim 1-6 any one of them methods, which is characterized in that the method further includes:
It is table data by the Data Format Transform of the spare part information to be stored.
8. a kind of structured storage device of spare part information, which is characterized in that including:
Acquisition module, for obtaining spare part information to be stored, the spare part information to be stored includes at least one field information, institute It includes field name and the corresponding field value of the field name to state field information;
Matching module, for according to the field name in field name and each spare part template in the spare part information to be stored into Row matching, obtains the spare part template of successful match as target spare part template;The target spare part template includes at least one mesh Marking-up name section and the corresponding regular expression of the aiming field title;
Memory module, if right in the target spare part template for judging to know that the field value of the spare part information to be stored meets The regular expression for answering aiming field title then generates key-value pair, and the key-value pair is stored.
9. a kind of electronic equipment, which is characterized in that including:Processor, memory and bus, wherein
The processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to instruct energy It is enough to execute such as claim 1-7 any one of them methods.
10. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited Computer instruction is stored up, the computer instruction makes the computer execute such as claim 1-7 any one of them methods.
CN201810023342.3A 2018-01-10 2018-01-10 A kind of structured storage method and device of spare part information Pending CN108319661A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810023342.3A CN108319661A (en) 2018-01-10 2018-01-10 A kind of structured storage method and device of spare part information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810023342.3A CN108319661A (en) 2018-01-10 2018-01-10 A kind of structured storage method and device of spare part information

Publications (1)

Publication Number Publication Date
CN108319661A true CN108319661A (en) 2018-07-24

Family

ID=62893338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810023342.3A Pending CN108319661A (en) 2018-01-10 2018-01-10 A kind of structured storage method and device of spare part information

Country Status (1)

Country Link
CN (1) CN108319661A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902270A (en) * 2019-01-10 2019-06-18 平安科技(深圳)有限公司 Project data information generating method, device, computer equipment and storage medium
CN110276605A (en) * 2019-04-17 2019-09-24 阿里巴巴集团控股有限公司 Rule generating method, device, electronic equipment and readable storage medium storing program for executing
CN110941586A (en) * 2019-10-25 2020-03-31 深圳市毕美科技有限公司 Engineering design data management method and system
CN110955671A (en) * 2019-11-21 2020-04-03 北京天元创新科技有限公司 Data updating processing method and device
CN110990000A (en) * 2019-11-11 2020-04-10 山东中创软件工程股份有限公司 Data request processing method, device and equipment for MVC (model view controller) pattern design model layer
WO2020134115A1 (en) * 2018-12-26 2020-07-02 百度在线网络技术(北京)有限公司 Data processing method, apparatus and device, and storage medium
CN111444285A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Operation data configuration method and device
CN112001792A (en) * 2020-07-09 2020-11-27 贝壳技术有限公司 Configuration information consistency detection method and device
CN113656430A (en) * 2021-08-12 2021-11-16 上海二三四五网络科技有限公司 Control method and device for automatic expansion of batch table data
CN112001792B (en) * 2020-07-09 2024-04-23 贝壳技术有限公司 Configuration information consistency detection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615188A (en) * 2009-07-22 2009-12-30 山东中创软件工程股份有限公司 A kind of method and apparatus of importing multi-source data into data template
CN103927353A (en) * 2014-04-10 2014-07-16 北京网秦天下科技有限公司 Method and device for generating service tables
US20170147540A1 (en) * 2015-11-24 2017-05-25 Bank Of America Corporation Transforming unstructured documents
CN107463680A (en) * 2017-08-07 2017-12-12 山东浪潮通软信息科技有限公司 A kind of method and device for integrating document

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615188A (en) * 2009-07-22 2009-12-30 山东中创软件工程股份有限公司 A kind of method and apparatus of importing multi-source data into data template
CN103927353A (en) * 2014-04-10 2014-07-16 北京网秦天下科技有限公司 Method and device for generating service tables
US20170147540A1 (en) * 2015-11-24 2017-05-25 Bank Of America Corporation Transforming unstructured documents
CN107463680A (en) * 2017-08-07 2017-12-12 山东浪潮通软信息科技有限公司 A kind of method and device for integrating document

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
程彦: "合肥讯飞科技话单分析系统设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020134115A1 (en) * 2018-12-26 2020-07-02 百度在线网络技术(北京)有限公司 Data processing method, apparatus and device, and storage medium
US11593337B2 (en) 2018-12-26 2023-02-28 Baidu Online Network Technology (Beijing) Co., Ltd. Data processing method, device, and a storage medium
JP2021531564A (en) * 2018-12-26 2021-11-18 バイドゥ オンライン ネットワーク テクノロジー (ベイジン) カンパニー リミテッド Data storage methods, devices, equipment and storage media
CN111444285A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Operation data configuration method and device
CN109902270A (en) * 2019-01-10 2019-06-18 平安科技(深圳)有限公司 Project data information generating method, device, computer equipment and storage medium
CN110276605B (en) * 2019-04-17 2022-11-15 创新先进技术有限公司 Rule generation method and device, electronic equipment and readable storage medium
CN110276605A (en) * 2019-04-17 2019-09-24 阿里巴巴集团控股有限公司 Rule generating method, device, electronic equipment and readable storage medium storing program for executing
CN110941586A (en) * 2019-10-25 2020-03-31 深圳市毕美科技有限公司 Engineering design data management method and system
CN110990000A (en) * 2019-11-11 2020-04-10 山东中创软件工程股份有限公司 Data request processing method, device and equipment for MVC (model view controller) pattern design model layer
CN110955671A (en) * 2019-11-21 2020-04-03 北京天元创新科技有限公司 Data updating processing method and device
CN112001792A (en) * 2020-07-09 2020-11-27 贝壳技术有限公司 Configuration information consistency detection method and device
CN112001792B (en) * 2020-07-09 2024-04-23 贝壳技术有限公司 Configuration information consistency detection method and device
CN113656430A (en) * 2021-08-12 2021-11-16 上海二三四五网络科技有限公司 Control method and device for automatic expansion of batch table data
CN113656430B (en) * 2021-08-12 2024-02-27 上海二三四五网络科技有限公司 Control method and device for automatic expansion of batch table data

Similar Documents

Publication Publication Date Title
CN108319661A (en) A kind of structured storage method and device of spare part information
US11876910B2 (en) Systems, methods, and apparatuses for implementing a multi tenant blockchain platform for managing Einstein platform decisions using distributed ledger technology (DLT)
US11875400B2 (en) Systems, methods, and apparatuses for dynamically assigning nodes to a group within blockchains based on transaction type and node intelligence using distributed ledger technology (DLT)
CN109977110A (en) Data cleaning method, device and equipment
CN101183379A (en) Attribute level federation from multiple data sources
JP6582277B1 (en) Block chain history storage system and block chain history storage method
CN105550206B (en) The edition control method and device of structured query sentence
US20170206326A1 (en) Systems and methods for the classification and indexing of contract documentation
EP2965492B1 (en) Selection of data storage settings for an application
US10248668B2 (en) Mapping database structure to software
US20150379112A1 (en) Creating an on-line job function ontology
CN108228762B (en) Method and system for configuring master database universal templates
CN115544183A (en) Data visualization method and device, computer equipment and storage medium
CN110716950A (en) Method, device and equipment for establishing aperture system and computer storage medium
CN109325873A (en) Self-service method for processing business, device, computer equipment and storage medium
CN110019542B (en) Generation of enterprise relationship, generation of organization member database and identification of same name member
CN110209780A (en) A kind of question template generation method, device, server and storage medium
JP2018133044A (en) Webapi execution flow generation device and webapi execution flow generation method
US10885157B2 (en) Determining a database signature
CN116414854A (en) Data asset query method, device, computer equipment and storage medium
CN107533559A (en) Data structure, the model for filling data structure and the method being programmed using data structure to processing unit
CN114860806A (en) Data query method and device of block chain, computer equipment and storage medium
CN110837365A (en) Script aided design method and device based on root table
CN109408704B (en) Fund data association method, system, computer device and storage medium
CN113536149A (en) Social platform public opinion optimization system and method based on alliance chain and text classification

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100085 Floor 102-1, Building No. 35, West Second Banner Road, Haidian District, Beijing

Applicant after: Seashell Housing (Beijing) Technology Co., Ltd.

Address before: 100085 Floor 102-1, Building No. 35, West Second Banner Road, Haidian District, Beijing

Applicant before: Chain home network (Beijing) Technology Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180724