CN107862098A - A kind of affiliated partner search method based on full-text search - Google Patents

A kind of affiliated partner search method based on full-text search Download PDF

Info

Publication number
CN107862098A
CN107862098A CN201711393410.7A CN201711393410A CN107862098A CN 107862098 A CN107862098 A CN 107862098A CN 201711393410 A CN201711393410 A CN 201711393410A CN 107862098 A CN107862098 A CN 107862098A
Authority
CN
China
Prior art keywords
search
full
model
text
incidence relation
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
CN201711393410.7A
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.)
CHINACCS INFORMATION INDUSTRY Co Ltd
Original Assignee
CHINACCS INFORMATION INDUSTRY 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 CHINACCS INFORMATION INDUSTRY Co Ltd filed Critical CHINACCS INFORMATION INDUSTRY Co Ltd
Priority to CN201711393410.7A priority Critical patent/CN107862098A/en
Publication of CN107862098A publication Critical patent/CN107862098A/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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2465Query processing support for facilitating data mining operations in structured databases
    • 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
    • G06F16/2272Management thereof
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The invention discloses a kind of affiliated partner search method based on full-text search, it is related to field of metallurgical equipment, technical scheme S1, establishes the object data model of different classes of object;S2, using Map and Reduce methods, establish the relational data model of incidence relation between object;S3, the full-text search that incidence relation database is established according to S2 result index;S4, the search key provided according to user, incidence relation database index is searched for, extract all affiliated partners in relational model, and return to user.The beneficial effects of the invention are as follows:Depth excavates other object informations associated with important object, is the powerful of management of enhancing public security.Big data analytical technology is used in a creative way in public safety field, compared with general search engine technique, the search result using object as base unit can more accurately be obtained, the criminal investigation that is particularly suitable for use in, the clue solved a case etc. between object is the application scenarios being oriented to.

Description

A kind of affiliated partner search method based on full-text search
Technical field
The present invention relates to public safety technical field, more particularly to a kind of affiliated partner retrieval side based on full-text search Method.
Background technology
In the epoch that Internet technology is maked rapid progress, all things on earth interconnects, data turn into the main carriers that information is propagated, by various Equipment, service, converging information caused by platform are into the ocean of data, and how therefrom quick-searching obtains maximally related information The development of universal search engine technology is expedited the emergence of.Prior art includes following process:Establish information database and its associated Index data base, full-text search, keyword retrieval and systematic searching etc. are carried out to the search term of user's input, by the degree of correlation from height Search result is presented to low order.Prior art preferably solves the demand of universal search, but for some it is special should There is strong relational network with scene, such as searched object, or there is an urgent need to obtain having certain special with searched object by user During other objects of contact, universal search engine is felt inadequate.
Public safety field is exactly one of such special applications scene, related to important object (people, car, thing, case etc.) Other objects of connection are that people most it is expected to obtain while and are difficult to by existing search technique.
The content of the invention
In order to realize foregoing invention purpose, for important object be associated other object search difficulties the problem of, this hair A kind of bright affiliated partner search method based on full-text search of offer, including,
S1, establish the object data model of different classes of object;
S2, using Map and Reduce methods, establish the relational data model of incidence relation between object;
S3, the full-text search that incidence relation database is established according to S2 result index;
S4, the search key provided according to user, incidence relation database index is searched for, the institute extracted in relational model is relevant Join object, and return to user.
Preferably, by the object sequence number in objects association it is ID values in a manner of Map, and object is in itself in the S2 Mapped, be then combined ID identical objects in a manner of Reduce, form correlation model, and travel through all possibility Object relationship form.
Preferably, in the S3, carried out in full in incidence relation database index by using the search key of offer Retrieval, for the candidate result of matching, further obtain associated all objects.
Preferably, the object model of the S1 comprises at least people, car, space, case;
Wherein, people's object model comprises at least name, identification card number, native place attribute, and car object model comprises at least car plate, vehicle Attribute;Spatial object model comprises at least title, address properties;Case object model comprises at least personnel, criminal type attribute.
Preferably, the object relationship that the data model of incidence relation comprises at least between object in the S2 is:Subordinate, family Front yard, rent, go together;According to the object relationship between each object model of the S1;Established pair by Map and Reduce modes Relational model as between, the ID values and object of object relationship are mapped in itself in the Map stages, will be closed in the Reduce stages It is that ID identical objects are combined, forms correlation model;All possibility object relationship forms are traveled through, to include all objects Relation.
Preferably, the step of S4 is the keyword used when user is searched for and the full text rope established in the S3 Row matching search is introduced, according to the order of matching degree from high to low, obtains initial search result;Then each search is tied Fruit, its relational model stored in the S3 is obtained respectively, all objects included in relational model are extracted, as final Search result returns to user.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:Depth is excavated associated with important object Other object informations, be the powerful of management of enhancing public security.Big data is used in a creative way in public safety field Analytical technology, compared with general search engine technique, the search result using object as base unit can be more accurately obtained, Criminal investigation, the clue solved a case etc. between object be particularly suitable for use in as the application scenarios being oriented to., can be straight centered on searched object Connect to obtain the information of each related object, for further analysis cutback in demand search complexity.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.Certainly, specific embodiment described herein is not used to only to explain the present invention Limit the present invention.
Embodiment 1
The present invention provides a kind of affiliated partner search method based on full-text search, including,
S1, establish the object data model of different classes of object;
S2, using Map and Reduce methods, establish the relational data model of incidence relation between object;
S3, the full-text search that incidence relation database is established according to S2 result index;
S4, the search key provided according to user, incidence relation database index is searched for, the institute extracted in relational model is relevant Join object, and return to user.
In S2, the ID values in objects association and object are mapped in itself in a manner of Map, then with Reduce side ID identical objects are combined by formula, form correlation model, and travel through all possibility object relationship forms.
In S3, the search key provided by user carries out full-text search in incidence relation database index, for The candidate result of matching, further obtain associated all objects.
S1 object model comprises at least people, car, space, case;
Wherein, people's object model comprises at least name, identification card number, native place attribute, and car object model comprises at least car plate, vehicle Attribute;Spatial object model comprises at least title, address properties;Case object model comprises at least personnel, criminal type attribute.
The object relationship that the data model of incidence relation comprises at least between object in S2 is:Subordinate, family, rent, together OK;According to the object relationship between S1 each object model;The relation mould established by Map and Reduce modes between object Type, the ID values and object of object relationship are mapped in itself in the Map stages, in the Reduce stages by relations I D identical objects It is combined, forms correlation model;All possibility object relationship forms are traveled through, to include all object relationships.
The step of S4 is that the full-text index established in the keyword and S3 used when user is searched for carries out matching search, According to the order of matching degree from high to low, initial search result is obtained;Then to each search result, obtain respectively its The relational model stored in S3, all objects included in relational model are extracted, user is returned to as final search result.
Referring to Fig. 1, the present invention provides a kind of affiliated partner search method based on full-text search.The operating procedure of the present invention It is as follows:
Step 1, establish a variety of object models.Common object type someone, car, space, case etc., typical people's object model Form is as follows:
Name ID Height
Li Si 18 identification card numbers 170
Typical car object model form is as follows:
Car owner Car owner ID Car plate Color
Li Si 18 identification card numbers X XXXX In vain
Typical spatial object model form is as follows:
Lodging person ID Hotel title Address
Li Si 18 identification card numbers XXXX Beijing XXX
Typical case object model form is as follows:
Name ID Criminal type Tool used in crime
Li Si 18 identification card numbers Theft Waddy
Model above is stored into database.
Step 2, the relational model established between object.By taking subordinate relation as an example, typical Object Relational Model form is such as Under:
ID Name Car plate
18 identification card numbers Li Si X XXXX
The typical model is associated people's object model and car object model by identical ID values.
Step 3, the full-text search index for establishing Object Relational Model.The Object Relational Model obtained in step 2 is stored Enter database, and establish and be indexed for full-text search.
Step 4, search procedure.By taking search key " Li Si " as an example, illustrate specific search procedure.First from step 3 " Li Si " is searched in the index database of foundation, " ID " and " car plate " of correlation is obtained, by incidence relation, further obtains people's model As a result with vehicle model result, and user is returned to as the search result of " Li Si ".
Above procedure can use following codes to realize:
public void map(ImmutableBytesWritable key, Result result, Context context) throws IOException, InterruptedException {
TableSplit sp = ((TableSplit)context.getInputSplit());
String table = Bytes.toString(sp.getTable().getName());
try {
BaseModel bean=(BaseModel) database Util.resultToBean (result, table);
MergeUtil.json2str(bean);
if(bean instanceof Person){
Person entity = (Person)bean;
write(context, bean, entity.getCardNo());
}else if(bean instanceof Vehicle){
Vehicle entity = (Vehicle)bean;
write(context, bean, entity.getPaperNumber());
}else if(bean instanceof AlarmList){
AlarmList entity = (AlarmList)bean;
write(context, bean, entity.getId());
}else if(bean instanceof Mrza){
Mrza entity = (Mrza)bean;
write(context, bean, entity.getId());
}else if(bean instanceof Case){
Case entity = (Case)bean;
if(StringUtils.isNotBlank(entity.getCardNos())){
String[] cardNos = entity.getCardNos().split (",");
for (String cardNo : cardNos) {
write(context, bean, cardNo);
}
}else{
write(context, bean, entity.getId());
}
}else if(bean instanceof PawnshopRecord){
PawnshopRecord entity = (PawnshopRecord)bean;
write(context, bean, entity.getCardNo());
}
Catch (Cdc databases Exception | CdCommonException | IllegalArgumentException | IllegalAccessException e) {
logger.error(e,e);
throw new IOException(e);
}
}
private void write(Context context, BaseModel bean, String rowkey) throws IOException, InterruptedException, CdCommonException {
if(StringUtils.isNotBlank(rowkey)){
context.write(new Text(String.valueOf(rowkey)), new Text (SeralizeFactory.original().serializa(bean)));;}}
protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
List<SolrAIOAttr> personList = new ArrayList<SolrAIOAttr>();
List<SolrAIOAttr> caseList = new ArrayList<SolrAIOAttr>();
List<SolrAIOAttr> vehicleList = new ArrayList<SolrAIOAttr>();
List<SolrAIOAttr> alarmLists = new ArrayList<SolrAIOAttr>();
List<SolrAIOAttr> mrzaLists = new ArrayList<SolrAIOAttr>();
List<SolrAIOAttr> pawnshops = new ArrayList<SolrAIOAttr>();
int size = 0;
try {
String date = null;
for (Text text : values) {
size++;
if(size>10){
return;
}
PhoenixBaseBean bean = (PhoenixBaseBean) SeralizeFactory.original().unSerializa(text.getBytes());
if(bean instanceof Person){
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), null);;
personList.add(aio);
}else if(bean instanceof Case){
Case cases = (Case)bean;
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), cases.getAlarmTime());
caseList.add(aio);
date = updateDate(date, cases.getAlarmTime());
}else if(bean instanceof Vehicle){
Vehicle vehicle = (Vehicle)bean;
String title = vehicle.getVehicleNum();
if(StringUtils.isBlank(title)){
vehicle.getCardNum();
}
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), vehicle.getRegisterDate());
vehicleList.add(aio);
date = updateDate(date, vehicle.getRegisterDate ());
}else if(bean instanceof AlarmList){
AlarmList alarmList = (AlarmList)bean;
if(alarmList.getAlarmNumber()!=null && ! alarmList.getAlarmNumber().trim().equals("") && alarmList.getAlarmDescribe ()!=null && !alarmList.getAlarmDescribe().trim().equals("")){
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), alarmList.getCallTime());
alarmLists.add(aio);
date = updateDate(date, alarmList.getCallTime());
}
}else if(bean instanceof Mrza){
Mrza mrza = (Mrza)bean;
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), mrza.getTitle());
mrzaLists.add(aio);
date = updateDate(date, mrza.getTitle());
}else if(bean instanceof PawnshopRecord){
PawnshopRecord pawnshop= (PawnshopRecord)bean;
SolrAIOAttr aio = new SolrAIOAttr (JsonUtil.bean2json(bean), pawnshop.getDate());
pawnshops.add(aio);
date = updateDate(date, pawnshop.getDate());
}
}
Collections.sort(vehicleList);
Collections.sort(caseList);
Collections.sort(pawnshops);
logger.info("key:"+key.toString());
SolrAIO bean = new SolrAIO(key.toString());
bean.setPerson(JSONArray.fromObject(personList).toString ());
bean.setVehicles(JSONArray.fromObject(vehicleList) .toString());
bean.setCases(JSONArray.fromObject(caseList).toString());
bean.setAlarmList(JSONArray.fromObject(alarmLists) .toString());
bean.setMrzas("");
bean.setPawnshop(JSONArray.fromObject(pawnshops).toString ());
bean.setDateTime(date);
context.write(null, new Text(bean.toCSV()));
} catch (CdCommonException e) {
logger.error(e, e);
} catch (Exception e) {
logger.error(e, e);
throw new IOException(e);
}
}
Presently preferred embodiments of the present invention is the foregoing is only, is not intended to limit the invention, it is all in the spirit and principles in the present invention Within, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.

Claims (6)

1. the affiliated partner search method based on full-text search, it is characterised in that:
S1, establish the object data model of different classes of object;
S2, using Map and Reduce methods, according to S1 object data model, establish the relation number of incidence relation between object According to model;
S3, the full-text search that incidence relation database is established according to S2 result index;
S4, the search key provided according to user, incidence relation database index is searched for, the institute extracted in relational model is relevant Join object, and return to user.
2. the affiliated partner search method according to claim 1 based on full-text search, it is characterised in that in the S2, The object sequence number in objects association and object are mapped in itself in a manner of Map, then by object in a manner of Reduce Sequence number identical object is combined, and forms correlation model, and travel through all possibility object relationship forms.
3. the affiliated partner search method according to claim 1 based on full-text search, it is characterised in that in the S3, The search key provided by user carries out full-text search in incidence relation database index, is tied for the candidate of matching Fruit, further obtain associated all objects.
4. the affiliated partner search method according to claim 1 based on full-text search, it is characterised in that pair of the S1 As model comprises at least people, car, space, case;
Wherein, people's object model comprises at least name, identification card number, native place attribute, and car object model comprises at least car plate, vehicle Attribute;Spatial object model comprises at least title, address properties;Case object model comprises at least personnel, criminal type attribute.
5. the affiliated partner search method according to claim 4 based on full-text search, it is characterised in that right in the S2 The object relationship that the data model of incidence relation comprises at least as between is:Subordinate, family, rent, go together;According to the S1's Object relationship between each object model;The relational model established by Map and Reduce modes between object, in Map ranks Section is mapped the object sequence number of object relationship and object in itself, in the Reduce stages by relationship object sequence number identical object It is combined, forms correlation model;All possibility object relationship forms are traveled through, to include all object relationships.
6. the affiliated partner search method according to claim 1 based on full-text search, it is characterised in that the step of the S4 Suddenly it is that the keyword used when user is searched for carries out matching search with the full-text index established in the S3, according to matching journey The order of degree from high to low, obtains initial search result;Then to each search result, it is obtained respectively and is deposited in the S3 The relational model of storage, all objects included in relational model are extracted, user is returned to as final search result.
CN201711393410.7A 2017-12-21 2017-12-21 A kind of affiliated partner search method based on full-text search Pending CN107862098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711393410.7A CN107862098A (en) 2017-12-21 2017-12-21 A kind of affiliated partner search method based on full-text search

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711393410.7A CN107862098A (en) 2017-12-21 2017-12-21 A kind of affiliated partner search method based on full-text search

Publications (1)

Publication Number Publication Date
CN107862098A true CN107862098A (en) 2018-03-30

Family

ID=61706798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711393410.7A Pending CN107862098A (en) 2017-12-21 2017-12-21 A kind of affiliated partner search method based on full-text search

Country Status (1)

Country Link
CN (1) CN107862098A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108520079A (en) * 2018-04-24 2018-09-11 珠海市新德汇信息技术有限公司 A kind of Migo search engines
CN113191145A (en) * 2021-05-21 2021-07-30 百度在线网络技术(北京)有限公司 Keyword processing method and device, electronic equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645092A (en) * 2008-06-03 2010-02-10 阿尔卡特朗讯 Method for mapping an X500 data model onto a relational database
CN102663044A (en) * 2012-03-28 2012-09-12 福建榕基软件股份有限公司 Method and device for creating search base and method and device for full-text search with authorities
CN102968501A (en) * 2012-12-07 2013-03-13 福建亿榕信息技术有限公司 Universal full-text search method
CN106777110A (en) * 2016-12-15 2017-05-31 武汉邮电科学研究院 A kind of smart city big data integration system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645092A (en) * 2008-06-03 2010-02-10 阿尔卡特朗讯 Method for mapping an X500 data model onto a relational database
CN102663044A (en) * 2012-03-28 2012-09-12 福建榕基软件股份有限公司 Method and device for creating search base and method and device for full-text search with authorities
CN102968501A (en) * 2012-12-07 2013-03-13 福建亿榕信息技术有限公司 Universal full-text search method
CN106777110A (en) * 2016-12-15 2017-05-31 武汉邮电科学研究院 A kind of smart city big data integration system and method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108520079A (en) * 2018-04-24 2018-09-11 珠海市新德汇信息技术有限公司 A kind of Migo search engines
CN108520079B (en) * 2018-04-24 2021-10-26 珠海市新德汇信息技术有限公司 Migo search engine
CN113191145A (en) * 2021-05-21 2021-07-30 百度在线网络技术(北京)有限公司 Keyword processing method and device, electronic equipment and medium
CN113191145B (en) * 2021-05-21 2023-08-11 百度在线网络技术(北京)有限公司 Keyword processing method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN109710701B (en) Automatic construction method for big data knowledge graph in public safety field
CN106991092B (en) Method and equipment for mining similar referee documents based on big data
Srihari Automatic indexing and content-based retrieval of captioned images
CN103368992B (en) Message push method and device
CN109446343A (en) A kind of method of public safety knowledge mapping building
CN105786800A (en) Police standard address acquiring method and system
CN107862098A (en) A kind of affiliated partner search method based on full-text search
CN116108167A (en) Personal sensitive information classification method combined with knowledge graph
CN109376182A (en) The method for realizing affiliated company&#39;s identifying processing based on computer software
CN109344212A (en) A kind of geographical big data of subject-oriented feature excavates the method and system of recommendation
CN112084293B (en) Data authentication system and data authentication method for public security field
CN108153661A (en) The method and apparatus of implementation of test cases
CN112363996B (en) Method, system and medium for establishing physical model of power grid knowledge graph
CN110263021A (en) A kind of theme library generating method based on personalized labels system
CN106779599A (en) A kind of data processing method and system for lost objects
CN116541887B (en) Data security protection method for big data platform
CN111343419B (en) City security system based on social surface surveillance camera
CN109388648B (en) Method for extracting personnel information and relation person from electronic record
CN107016052A (en) A kind of information intelligent processing method
CN116662342A (en) Heterogeneous data fusion indexing system and device based on knowledge graph
CN115269603A (en) Data storage method, device, equipment, storage medium and program product
CN110019237B (en) System and method for analyzing criminal whereabouts based on map
CN116028467A (en) Intelligent service big data modeling method, system, storage medium and computer equipment
CN111881309B (en) Electronic license retrieval method, device and computer readable medium
Moura et al. Integration of linked data sources for gazetteer expansion

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: 20180330