Summary of the invention
In order to solve the above-mentioned problems in the prior art, the present invention proposes a kind of method of the community correction management based on the LBS location-based service.System serves as to rely on the real-time management that has realized object of correction with the LBS location-based service, and concrete technical scheme is:
A kind of community correction management method based on the LBS location-based service is allotted mobile phone by being object of correction, and according to location, mobile phone position object of correction, and it is managed, and may further comprise the steps:
1) object of correction location: the longitude and latitude that obtains the object of correction mobile phone location by the LBS location-based service;
2) judge whether object of correction crosses the border: if locate successfully, then the longitude and latitude of the object of correction mobile phone location that obtains and default longitude and latitude scope are made comparisons,,, then cross the border if go beyond the scope if in this scope, then do not cross the border; If fail and/or cross the border in the location, then send SMS Tip to object of correction and rectification worker by the EIE pager.
Step 3) is checked the position of object of correction on electronic chart if desired, then from the positional information of object of correction mobile phone is submitted to the GIS map server, near from map server this position of download GIS electronic chart, show object of correction position and borderline region scope in the figure, so that contrast with the object of correction current location intuitively.
In the step 1), LBS location-server regulation also provides locating interface, and the interface definition data format is based on the XML agreement, and Data Transport Protocol is an ICP/IP protocol; By linking, resolve the XML data message that obtains from the LBS location-server, and data are write data base administration and backup with the http of LBS location-server foundation based on the http agreement.An XML data message comprises object of correction cell-phone number, positioning states code, position longitude and latitude and positioning time.
Location object of correction mode comprises:
Locate in real time: refer to locate immediately object of correction;
Locate continuously, need definite earlier time range of locating continuously and positioning time at interval, object of correction is located continuously according to these continuous positional parameters;
The reservation location, the reservation of definite location earlier positions object of correction in the time of setting constantly again.
Step 2) in, send the SMS Tip needs earlier according to EIE message interface standard by the EIE pager to object of correction and rectification worker, foundation is connected with the TCP/IP of EIE pager, after connecting with the EIE pager, will keep always.The note of mutual uplink and downlink is written into database with convenient inquiry.The command format of transmitting-receiving note is message header+message body; Request and reply data bag all use text to encapsulate.
The longitude and latitude of described object of correction mobile phone location is relatively realized by calling graphics process JTS kit with the longitude and latitude scope of presetting, method is, earlier with above-mentioned object of correction position longitude and latitude abstract be a some object, one group of default longitude and latitude is abstracted into one in the face of resembling, finishes by the graphics logical process of point, face relation again and judge the function of crossing the border.
In the step 3), download the GIS electronic chart from map server, need elder generation locator data, according to the encapsulation of map interface standard, the mode that links by http passes to map server to realize map operation.Map interface: define the URL destination address of a plurality of band parameters by map server, the form of these destination addresses and parameter forms map interface.
Compared with prior art, advantage of the present invention is:
1) select the LBS positioning service provider of specialty that LBS is provided positioning service, location response is rapid, the accuracy height.
2) numerical map intellectuality, function is outstanding, and is interactive strong.
3) the EIE pager is adopted in short message service, and expense is cheap, dependable performance.
4) utilize mode Data transmission between each platform of Web Service interface, professional platform independence is strong.
5) the invention enables judicial domain that great change has been taken place the way to manage of object of correction.Management in the past mainly is the management of object of correction electronic record data, and now more is the present situation of paying close attention to object of correction, and object of correction is given psychological corrections in time.Help the popularization that community correction is operated in the nationwide.
Embodiment
With reference to the accompanying drawings the specific embodiment of the present invention is described further below.
For object of correction is allotted mobile phone, and locate object of correction, and it managed, may further comprise the steps according to the mobile phone position:
1) object of correction location: the longitude and latitude that obtains the object of correction mobile phone location by the LBS location-based service;
2) judge the object of correction position: if locate successfully, then the longitude and latitude of the object of correction mobile phone location that obtains and default longitude and latitude scope are made comparisons,,, then cross the border if go beyond the scope if in this scope, then do not cross the border; If fail and/or cross the border in the location, then send SMS Tip to object of correction and rectification worker by the EIE pager.In the present embodiment, by calling graphics process JTS kit, described object of correction position longitude and latitude abstract be a some object, one group of default longitude and latitude finally is abstracted into one in the face of resembling, finish by the graphics logical process of point, face relation and judge and cross the border.
3) check the position of object of correction on electronic chart if desired, then from the positional information of object of correction mobile phone is submitted to the GIS map server, near from map server this position of download GIS electronic chart, show object of correction position and borderline region scope in the figure, so that contrast with the object of correction current location intuitively.
In the step 1), LBS location-server regulation also provides locating interface, and the interface definition data format is based on the XML agreement, and Data Transport Protocol is an ICP/IP protocol; By linking, resolve the XML data message that obtains from the LBS location-server, and data are write data base administration and backup with the http of LBS location-server foundation based on the http agreement.An XML data message comprises object of correction cell-phone number, positioning states code, position longitude and latitude and positioning time.
Step 2) in, send the SMS Tip needs earlier according to EIE message interface standard by the EIE pager to object of correction and rectification worker, foundation is connected with the TCP/IP of EIE pager, after in a single day connecting with the EIE pager, will keep always.The note of mutual uplink and downlink is written into database with convenient inquiry.The command format of transmitting-receiving note is message header+message body; Request and reply data bag all use text to encapsulate.
In the step 3), download the GIS electronic chart from map server, need elder generation locator data, according to the encapsulation of map interface standard, the mode that links by http passes to map server to realize map operation.Map interface: define the URL destination address of a plurality of band parameters by map server, the form of these destination addresses and parameter forms map interface.
In this embodiment, inventing described method is to rely on equipment shown in Figure 4 and network realization.LSB location-server, map server, system's use side, EIE pager, Web server, database server, they are connected to Internet, carry out information interaction by Internet; This described system also comprises the object of correction mobile phone, and mobile LSB location-server obtains the object of correction mobile phone location by the position data that obtains from the base station; The EIE pager is received and sent messages by SMS gateway and object of correction mobile phone.Web server is subsidiary Web service interface, is used for interaction data.Described EIE pager, Web server, database server connect Internet by switch, and the switch end is provided with fire compartment wall, and the EIE pager is the EIE of a Huawei pager.
In the present embodiment, finish community correction management by LBS location-based service, numerical map service, short message service and the service of community correction work basic function and Web service five parts.
As shown in Figure 1, in the LBS positioning service, location object of correction 1 is divided into three kinds of modes: locate 2 in real time, locate 3 and reservation location 4 continuously.Location 2 is meant and locatees object of correction at the moment in real time; Located continuously 3 o'clock, and needed continuous time range of locating of elder generation's setting and positioning time at interval, after setting was finished, system located object of correction continuously according to the continuous positional parameter of setting; Preengage and located 4 o'clock, need set the reservation moment of location earlier, after setting was finished, system can position object of correction in the time of setting.Simultaneously a plurality of object of correction are positioned, done effective efficiency optimization in the system, the time of location is not along with the linear growth of quantity of locating object of correction.
For the processing of positioning result relate to report to the police handle, short message service judges and reports to the police (the place longitude and latitude of promptly judging the location is whether within the scope of activities that this object of correction allowed) and short message service.The scope of activities that object of correction allowed is provided with 11 by the user of system at map boundary line and finishes.Obtain the one group of longitude and latitude that can determine the object of correction scope of activities thus.The longitude and latitude that this group longitude and latitude and LBS location are obtained carries out logic decision via the program of plane geometry point face relation, learns whether this object of correction crosses the border this moment.If cross the border or LBS location return state for the location failure, then trigger alert program, system ejects warning window, send the emergency alarm bell sound, note 6 foundations as this object of correction examination marking of this time reporting to the police, send note 7 to object of correction and rectification worker simultaneously, prompting is this time reported to the police.Code is as follows:
/**
* cross the border and then return true; Do not cross the border and then return false;
*@param?longitude
*@param?latitude
* @param boundary border, content format is
118.22,32.3343;118.42,32.4343;118.72,32.7343
*@return
*/
public?static?final?boolean?isOverSpace(double?longitude,double
latitude,String?boundary){
valueArray=boundary.split(″;″);
GeometryFactory?gf=new?GeometryFactory();
Coordinate[]coordinates=new?Coordinate[valueArray.length+1];
for(int?i=0;i<valueArray.length;i++){
coordinates[i]=new
Coordinate(Double.parseDouble(valueArray[i].substring(0,
valueArray[i].indexOf(″,″))),
Double.parseDouble(valueArray[i].substring(valueArray[i].indexOf(″,″)+1,
valueArray[i].length())));
}
coordinates[valueArray.length]=new
Coordinate(Double.parseDouble(valueArray[0].substring(0,
valueArray[0].indexOf(″,″))),
Double.parseDouble(valueArray[0].substring(valueArray[0].indexOf(″,″)+1,
valueArray[0].length())));
Polygon?polygon=
gf.createPolygon(gf.createLinearRing(coordinates),null);
return!gf.createPoint(new?Coordinate(longitude,
Latitude)) .within (polygon); // cross the border and then return true; Do not cross the border and then return false;
}
Map Services is that positional information is illustrated on the map.System searching position 8 submits the data in the map server and handles, and downloads near the map this position.During trace playback 9, system inquires track data according to the query argument of user's input earlier, then track is illustrated on the map.Show positioning time on each tracing point during trace playback,, make that the broadcasting speed of track is controlled, can suspend during broadcast by the fusion of Ajax technology and Map Services.When checking digitally Figure 10, a plurality of object of correction are simultaneously displayed on the map and refresh latest position automatically, support range finding and the map center point is moved on to certain object of correction operation.The border is provided with 11 and is meant on map the manual zone of drawing, and should the zone as the scope of activities of object of correction.
Illustrate that below in conjunction with Fig. 2 and Fig. 3 the relation between each module and the data of intermodule flow.LBS locating module M1 handles the locator data that obtains from the LBS location-server.Wireless signal between location-server detection of handset terminal and a plurality of base station is got in touch, and calculates the radius distance of mobile phone terminal from the base station, determines moving target butt position and state really.For certain was once located, the state that may occur is as follows: the cellphone subscriber did not exist; The black and white lists failed authentication; Location server can't calculating location; User's roaming, and this service is not opened in the purpose city; Locate successfully.Location server sends to system with the final result of this location with the encapsulation of xml form.The http that both sides set up based on the http agreement connects, and the xml data message P1.1 that system analysis obtains from location server also writes database with data.An xml locator data information comprises location object of correction cell-phone number, positioning states code, position longitude and latitude and positioning time.LBS locating module M1 provides locator data D2 for Map Services module M2 and community correction work basic function module M3.
Map Services module M2 provides the numerical map service for community correction work basic function module M3, and service is handled P1.3 by invocation map and realized.Format map adopts the mapInfo form of numerical map industrywide standard, and engineer's scale is from 1: 10000, between 1: 40000000, and totally eight echelons.The map datum scope covers the whole nation, if any special needs, can the map datum by the GPS mapping be joined in the map server.Most of Map Services all have amplification to dwindle map scale, pull the basic functions such as map area of checking with change on map, what native system adopted is intelligentized map, except possessing above-mentioned basic function, also realized following function: the longitude and latitude position that 1, the map center point can be moved to appointment; 2, manual line, picture on map; 3, in self-defining picture identification of certain position display of map; 4, functions such as the bubble content of self-defined picture sign and form.On the basis of above-mentioned map function, interactive stronger in order to make user experience, speed is Map Services faster, has introduced the Ajax technology in this embodiment.The original intention of Ajax technology is to make up web application more dynamic and that response is sensitiveer.The key of this method be to browser end JavaScript, DHTML and with the combination of server asynchronous communication.Invocation map is handled P1.3 and according to the request of invocation map service object of correction information D 1 and locator data D2 is handled, and gives system personnel the Map Services responsive feedback.Interface specification:
1.zoomtoperson
Import x, y coordinate into, map with this coordinate as the map center point.
With the submittype assignment is " zoomtoperson ", with zomtopersonx, zoomtopersony assignment.
2.zoomtopersonextents
Import the coordinate range on border into, map zooms to this coordinate range.
With the submittype assignment is " zoomtopersonextents ", with zoomtopersonextentsminx, zoomtopersonextentsminy, zoomtopersonextentsmaxx, zoomtopersonextentsmaxy assignment.
3.drawpersons
Import the id of object of correction into, name, x, y, img adds or upgrades object of correction marking.Form is id, name, x, y, img|id, name, x, y, img| ...Wherein img for the mark icon, can call similar http: // the url address; Separate with " | " between the object, number of objects is not limit.Behind the mark, on map, click the mark picture of object, response onclick incident.During click, show ToolTip, the id that will click object simultaneously is saved in being called among " hiddenpersonid " hiddn on the map page.The id of the object of clicking got in available similar document.getElementById (' hiddenpersonid ') .value statement.With the submittype assignment is " drawpersons ", with the txtpersons assignment.
4.handpolygon
Current map state is set to the drawing polygonal state.The drawing polygonal operating process: rolling mouse on map, click left button drawing polygonal border, click right is drawn and is finished.Draw end back coordinate figure and be saved in being called among " hiddenpolygon " hiddn on the map page.Coordinate figure got in available similar document.getElementById (' hiddenpolygon ') .value statement.
With the submittype assignment is " handpolygon ", with handpolygonstate assignment (true/false).
5.playtrack
The playback of object of correction event trace.Track is a string coordinate, and form is x, y|x, y| The blanking time of drawing, unit is a millisecond.
With the submittype assignment is " playtrack ", with persontrack, personinterval assignment.<INPUTtype=" text " id=" trackicon_src " NAME=" trackicon_src "〉be the URL address of the picture that on map, shows.
6.removetrack
Remove the track of trace playback.
With the submittype assignment is " removetrack ".
7.drawpersonboundary
The movable boundary scope of drawing the limit object of correction is imported border id and boundary coordinate into.
With the submittype assignment is " drawpersonboundary ".With boundaryid, boundarystring, txtpersons assignment.
8.removeall
Remove all drafting elements on the map, comprise object of correction mark, polygon, track.
With the submittype assignment is " removeall ".Submit to carrying out submit after the hidden assignment.
Short message service module M4 provides short message service for community correction work basic function module M3.By EIE message interface agreement, the short message interacting between realization system and object of correction, the rectification worker.System is initiatively created and being connected of EIE pager, and connects in case after setting up, will keep always.Short message service comprises that the up reception note of note is handled P1.5, descending transmission note is handled functions such as P1.6, mass-sending and status poll.Native system has been realized sending the caution note automatically when object of correction crosses the border or shuts down, and the short message interacting space of similar chatroom character is provided.The note of mutual uplink and downlink is written into database with convenient inquiry.Community correction work basic function module M3 provide basic data for short message service module M4.
EIE data interaction pattern is:
Enterprises end uses the syn ack pattern with the data interaction of pager end on connecting.Be that enterprises end at first sends a request data package, the pager termination is carried out inter-process after receiving the request package of enterprises end transmission, then the result packing is returned.
All requests and reply data bag all use text to encapsulate.Adopt the form of similar message header+message body.Message header becomes multirow by two Character segmentation of new line, message parameter of every line display, and message parameter comprises parameter name and parameter value, and parameter name and parameter value use colon to separate.Message header is represented to finish with a null.Message body is immediately following the null (annotating: also need new line character after the null) of message header.Must use a message parameter specify message body length parameter in head for the message that has message body, the parameter of this parameter is by name
Content-Length。
For example: EIE-Proxy-Command:SubmitSM
Submit-Time:2004-06-0410:20:20
Source-Address:1860
Destination-Address:13512345678
StateReport-Request:0
ServiceID-Request:EIE
FeeType-Request:01
FeeCode-Request:10
Content-Length:6
Hello!
Enterprises end is used the process that sends a request message to pager echo reply message to pager and is called session, and session is different and different according to each request that sends.
Some parameters general in message header have been defined at present.Be listed as follows:
EIE-Proxy-Command: this parameter all must definition in all request message heads.It is used for representing what processing the solicited message machine finishes.Session also is to classify by this parameter.5 value: SubmitSM, SubmitSMEX, GetSM, QuerySM, Quit have been defined at present.Expression sends note, transmission note (supporting the account number cipher verification), receives note, short message enquiry, withdraws from interface respectively.
EIE-Proxy-Response: this parameter all must definition in all response message heads.The state of its expression request result.Defined two state values at present, one is OK, represents successfully; Another is Error, and expression makes mistakes.
Additional-Info: this parameter may be used in the response message head.It is used for preserving some extraneous informations of result.Usually when the EIE-Proxy-Response of response message parameter value is Error, this parameter will comprise and wrong reason description occur.
Content-Length: in all have comprised the message of message body, all will comprise this parameter.It is used for defining the length of message body.Enterprises end application program when two new line character strings (promptly in the Socket buffering area, read continuous) after running through message header.From message header, read the parameter value of this parameter, continue from the Socket buffering area, to read the data of designated length then.(annotate: the unit of this reference record message body length is a byte)
Web Service module M5 is the interface that the data of each subordinate's platform reported and looked into place name, has realized striding the application of development platform.The bureaus of justice at different levels that consider various places may use independently system management object of correction, the present invention's Web Service technology interaction data between each platform.Web Service module M5 reports by data and handles the data that P1.4 provides subordinate's platform to report for community correction work basic function module M3.System of city-level bureau of justice obtains the data of distinguishing system of level bureau of justice by Web Service interface, and level (at county level) bureau of justice in district's reports some statistical report form data of city-level bureau of justice termly by Web Service interface.Web Service module M5 also provides the placename-querying interface for LBS locating module M1.