Disclosure of Invention
The application provides an access control method and device for map service information, so that a user can be controlled to access the map service information more reasonably, and the safety of the map service information is improved.
In order to achieve the above object, in one aspect, the present application provides a method for controlling access to map service information, which is applied to a spatial information service platform, and includes:
obtaining a map service request initiated by a client, wherein the map service request is used for requesting map service information and carries a user identifier of a user;
based on the user identification, obtaining authority information corresponding to the user, wherein the authority information at least comprises: the information access range of the user with the access authority;
requesting the map service information from a geographic information server based on the map service request;
obtaining the map service information returned by the geographic information server;
extracting sub-map service information belonging to the information access range of the user from the map service information returned by the geographic information server;
and sending the sub map service information to the client.
In one possible implementation manner, the permission information further includes: the effective time interval of the access authority of the user is provided;
the requesting the map service information from a geographic information server based on the map service request includes:
and if the current time is within the valid time interval corresponding to the user, requesting the map service information from a geographic information server based on the map service request.
In yet another possible implementation, the map service request is for requesting a spatial map;
the information access range of the user with the access right comprises: the space map range of the user with the access authority;
extracting sub-map service information belonging to the information access range of the user from the map service information returned by the geographic information server, wherein the sub-map service information comprises the following steps:
and cutting out a sub-space map belonging to the space map range corresponding to the user from the space map returned by the geographic information server.
In yet another possible implementation, the map service request is used to request attribute data associated with a spatial map;
the information access range of the user with the access right comprises: an attribute field for which the user has access rights;
extracting sub-map service information belonging to the information access range of the user from the map service information returned by the geographic information server, wherein the sub-map service information comprises the following steps:
and extracting target attribute data corresponding to the attribute field with the access authority of the user from the attribute data returned by the geographic information server.
In yet another possible implementation manner, the map service request further carries an access agent address corresponding to the map service information;
the requesting the map service information from a geographic information server based on the map service request includes:
determining an actual access address in the geographic information server to which the access proxy address maps;
requesting the map service information from the geographic information server based on the actual access address.
In another possible implementation manner, the authority information further includes: the authority mark is used for representing whether the user has the authority of accessing the geographic information server;
the requesting the map service information from a geographic information server based on the map service request includes:
and if the permission mark represents that the user has the permission to access the geographic information server, requesting the geographic information server for the map service information based on the map service request.
In another possible implementation manner, after obtaining the map service information returned by the geographic information server, the method further includes:
and if the information access range of the user is not configured in the authority information, sending the map service information to the client.
In another aspect, the present application further provides an access control device for map service information, which is applied to a spatial information service platform, and includes:
the map service request is used for requesting map service information and carries a user identifier of a user;
an authority query unit, configured to obtain, based on the user identifier, authority information corresponding to the user, where the authority information at least includes: the information access range of the user with the access authority;
an information request unit for requesting the map service information from a geographic information server based on the map service request;
the information obtaining unit is used for obtaining the map service information returned by the geographic information server;
the information extraction unit is used for extracting sub-map service information which belongs to the information access range of the user from the map service information returned by the geographic information server;
and the information sending unit is used for sending the sub-map service information to the client.
In a possible implementation manner, the permission information queried by the permission querying unit further includes: the effective time interval of the access authority of the user is provided;
the information requesting unit is specifically configured to request the map service information from a geographic information server based on the map service request if the current time is within the valid time interval corresponding to the user.
In yet another possible implementation manner, the map service request obtained by the request obtaining unit is used for requesting a space map;
the information access range of the user with the access right acquired by the right inquiry unit comprises: the space map range of the user with the access authority;
the information extraction unit includes:
and the map cutting unit is used for cutting out a sub-space map belonging to the space map range corresponding to the user from the space map returned by the geographic information server.
According to the scheme, the access authority control of the map service information is carried out on the map service request initiated by the client of the user through the spatial information service platform except the geographic information server. On the basis, after the spatial information service platform obtains the map service request initiated by the client, the spatial information service platform obtains the information access range of the user with the access authority according to the user identification carried in the map service request. And after the map service information corresponding to the map service request is obtained from the geographic information server, only the sub-map information in the map service information, which belongs to the information access range of the user, is sent to the client, so that the user can only access the map service information, which belongs to the information access range of the user, but cannot access all the map service information, the access of the user to the map service information is controlled in a finer granularity, and the access of the map service information is controlled more reasonably.
Detailed Description
The scheme of the application is suitable for access control of map service information related to the space map stored in the geographic information server. The geographic information server may provide a spatial map-related map service.
The Geographic Information server may be a server of a Geographic Information System (GIS).
For example, the map service information stored in the geographic information server may be a spatial map related to the territorial space planning information, attribute information related to the spatial map, and the like; the information may also be information related to a space map service published in other scenarios, which is not limited to this.
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present disclosure.
As shown in fig. 1, a flowchart of a map service information access control method provided in an embodiment of the present application is shown, where the method of the present embodiment is applied to a spatial information service platform, and the spatial information service platform is a service platform for performing access authority control on a map service, and is other than a geographic information server.
The method of the embodiment may include:
s101, obtaining a map service request initiated by a client.
The map service request is used for requesting map service information, and the map service request carries a user identifier of a user.
It is understood that, in the map service scenario, the map service information refers to data information related to a spatial map.
For example, the map service information may be a spatial map, and accordingly, the map service request may be a request for a spatial map within a certain spatial range, for example, a spatial map within a certain country or geographic spatial range, and the like.
For another example, the map service information may also be attribute data associated with the space map, and specifically, may be attribute data of each element in the space map. For example, attribute data of an element such as a point, a line, or a plane in the space map, for example, attribute data of a house in the space map. The attribute data may relate to attribute data under various attribute fields corresponding to the elements.
It is understood that the client may be a browser or an application client, etc., without limitation.
The map service request initiated by the client may be an access address carrying the requested map service information.
It can be understood that, since the map service request initiated by the client is a request initiated to the spatial information service platform, the access address of the map service request is not directly directed to the geographic information server. Correspondingly, the map service request initiated by the user's client in the application may carry an access proxy address corresponding to the map service information.
The access proxy address points to a spatial information service platform, and a subsequent spatial information service platform can determine an access address in a geographic information server actually corresponding to the access proxy address.
And S102, acquiring authority information corresponding to the user based on the user identification.
The authority information at least includes: the user has an information access range of access rights. The information access range represents the range of the map service information which the user has access right.
The authority information can be configured in advance and stored in the spatial information service platform. Based on the method, different authority information can be configured for different users by using the spatial information service platform according to actual requirements, so that the access authority range of the geographic service information of different users can be reasonably controlled.
In one possible implementation, for the space map, the authority information may include a space map range to which the user has an access authority.
For example, the spatial map range may be information of one or more surface elements of the spatial map to which the user has access, and accordingly, the spatial map range to which the user has access is defined by the range of the surface elements. As another example, the space map range may also be a spatial coordinate range to define a space map range accessible to the user by the spatial coordinate range. Of course, in practical applications, there are many possibilities for configuring the specific implementation of the space map range accessible by the user, which is not limited by the present application.
In yet another possible implementation manner, for the attribute data associated with the space map, the information access range in the authority information of the user may include: the attribute field where the user has access rights. Correspondingly, only attribute data corresponding to the attribute field with the access authority of the user belongs to data accessible by the user.
Certainly, in practical applications, the permission information may also include information on whether the user has permission to access the geographic information server, and the like, and may be specifically set as needed, and is not described herein again.
S103, based on the map service request, map service information is requested from the geographic information server.
It can be understood that, since the map service information requested by the map service request is located in the geographic information server, a data request for requesting the map service information corresponding to the map service request needs to be sent to the geographic information server.
In a possible implementation manner, when the map service request carries an access proxy address corresponding to the map service information indicating the request, the spatial information service platform may first determine an actual access address in the geographic information server to which the access proxy address is mapped. Then, based on the actual access address, corresponding map service information is requested from the geographic information service. For example, an information access request carrying the actual access address is sent to a geographic information server.
In one possible implementation, if the rights information further includes: if the authority mark is used for representing whether the user has the authority to access the geographic information server, whether the authority mark represents that the user has the authority to access the geographic information server can be detected. Correspondingly, only if the authority mark of the user represents that the user has the authority of accessing the geographic information server, the map service information is requested from the geographic information server based on the map service request.
And S104, obtaining the map service information returned by the geographic information server.
And S105, extracting sub-map service information belonging to the information access range of the user from the map service information returned by the geographic information server.
It can be understood that some of the map service information returned by the geographic information server may not belong to data information to which the user has access right, and therefore, the map service information returned by the geographic information server is not directly sent to the client of the user, but the map service information to which the user has access right is extracted from the geographic information server based on the information access range of the user.
For the convenience of distinction, the map service information which belongs to the map service information returned by the geographic information server and has the access authority of the user is called sub-map service information.
For example, in one possible implementation, if the map service information requested by the map service request is a space map, the map service information returned by the geographic information server is necessarily the space map. On the basis, a subspace map belonging to the corresponding space map range of the user needs to be cut out from the space map.
For another example, in yet another possible implementation manner, if the map service information requested by the map service request is attribute data associated with a spatial map, the map service information returned by the geographic information server is necessarily the attribute data. The attribute data includes attribute data of all attribute fields corresponding to the point or the plane requested by the user, but in practice, the user may only access data under some attribute fields.
Correspondingly, the application can extract the target attribute data corresponding to the attribute field with the access authority of the user from the attribute data returned by the geographic information server. The target attribute data is at least part of attribute data returned by the geographic information server.
And S106, sending the sub map service information to the client.
Because the sub-map service information in the information access range based on the access authority possessed by the user is returned to the client, the user can only see the corresponding map service information with the authority, and the map service information which is not suitable for being presented to the user is prevented from being leaked.
According to the scheme, the access authority control of the map service information is carried out on the map service request initiated by the client of the user through the spatial information service platform except the geographic information server. On the basis, after the spatial information service platform obtains the map service request initiated by the client, the spatial information service platform obtains the information access range of the user with the access authority according to the user identification carried in the map service request. And after the map service information corresponding to the map service request is obtained from the geographic information server, only the sub-map information in the map service information, which belongs to the information access range of the user, is sent to the client, so that the user can only access the map service information, which belongs to the information access range of the user, but cannot access all the map service information, the access of the user to the map service information is controlled at a finer granularity, and the access of the map service information is controlled more reasonably.
In the above embodiment of the present application, if it is not necessary to limit the access range of the user to the map service information, the information access range of the user may not be configured in the authority information. On the basis, if the information access range of the user is not configured in the authority information, the map service information returned by the geographic information server can be directly sent to the client without processing operations such as extraction and the like.
It can be understood that, in the embodiment of the present application, the authority information may further include: the user has an effective time interval of the access right, and the effective time interval is a time period during which the user can access the geographic information server.
Correspondingly, before the spatial information service platform requests the map service information from the geographic information server based on the map service request, the spatial information service platform needs to detect whether the current time is in an effective time interval in which the user has the access right, and if so, the spatial information service platform can request the geographic information service for the corresponding geographic service information.
On the contrary, if the current time is not in the valid time interval corresponding to the user, the map service request may not be responded, or prompt information without access right and the like may be returned to the client.
In order to facilitate understanding of the solution of the present application, two cases of requesting a space map and attribute data by a map service request will be described below.
First, a case of requesting a space map is described with reference to a possible implementation manner.
As shown in fig. 2, which shows a flowchart of the access control method for map service information provided by the present application, the method of the present embodiment is applied to a spatial information service platform. The method of the embodiment may include:
s201, obtaining a space map request initiated by a client.
In this embodiment, a map service request is taken as a space map request as an example for explanation. The space map request carries a first access agent address for requesting a space map, and the space map request carries a user identifier of a user.
For the sake of convenience of distinction, the access agent address for requesting the space map is referred to as a first access agent address, and the access agent address for subsequently requesting the attribute data related to the space map is referred to as a second access agent address.
The client can trigger a map service request of the client for the first access proxy address by inputting the first access proxy address in an address input field such as a browser or performing related operations in a displayed map information service page.
S202, acquiring authority information corresponding to the user based on the user identification.
The authority information includes: the authority token for characterizing whether the user has authority to access the geographic information server may further include: the user has an effective time interval of the access right and a space map range.
For example, if the user has the right to access the geographic information server, the right is marked as 1, otherwise the user's right is marked as 0.
It can be understood that when the user does not have the authority to access the geographic information server, it is naturally not necessary to set the valid time and spatial map range in which the user has the access authority.
Under the condition that the user has the authority of accessing the geographic information server, if the range of the map service information accessed by the user is not required to be limited, the valid time interval and the space map range of the user can not be set; accordingly, if the range of the map service information of the user needs to be limited, the information of the valid time interval and the spatial map range is configured in the authority information of the user.
S203, if the user has the authority of accessing the geographic information server, detecting whether the current time belongs to the effective access time interval of the user, and if so, executing the step S204; and if not, returning the transparent picture to the client.
It will be appreciated that if the user does not have access to the geographic information server, the spatial map request may not be responded to, e.g., a transparent picture may also be returned to the client.
If the effective access time of the user is not limited, the current time can be considered to belong to the effective access time interval of the user. If the effective access time interval of the user is limited, whether the current time belongs to the effective access time interval can be directly compared.
In this embodiment, when the current time does not belong to the valid access time interval of the user, the transparent picture is returned to the client as an example, and in an actual application, a prompt message without access right or the like may be returned to the client, which is not limited.
S204, determining that the first access proxy address corresponds to the first actual access address in the geographic information server.
For example, the correspondence between different access agent addresses and actual access addresses in the geographic information server may be stored in advance, and the first actual access address corresponding to the first access agent address may be determined according to the correspondence.
S205, requesting a space map from the geographic information server based on the first actual access address.
And S206, obtaining the space map returned by the geographic information server.
S207, detecting whether the authority information of the user is configured with the space map range of the user, and if so, executing the step S208; if not, step S210 is performed.
S208, cutting out a subspace map belonging to the space map range corresponding to the user from the space map returned by the geographic information server.
For example, if the authority configuration information of the user is configured with the surface information of the space map accessible to the user, the subspace map corresponding to the surface accessible to the user can be cut out from the space map returned by the geographic information server.
S209, the subspace map is sent to the client of the user.
S210, the space map returned by the map server is forwarded to the client.
The following describes a case where attribute data of a space map is requested, in conjunction with one possible implementation.
As shown in fig. 3, which shows a flowchart of the access control method for map service information provided by the present application, the method of the present embodiment is applied to a spatial information service platform. The method of the embodiment may include:
s301, obtaining the attribute data request initiated by the client.
In this embodiment, a map service request is taken as an example of an attribute data request. The attribute data request carries a second access proxy address for requesting attribute data associated with the space map, and the attribute data request carries a user identifier of the user.
For example, after the client displays the space map, the user initiates attribute data of a corresponding point, line or plane by selecting the point, line or plane in the space map. Of course, this is merely an example, and the user may also initiate the attribute data request by inputting the address of the second access agent, and the like, which is not limited to this.
S302, based on the user identification, the authority information corresponding to the user is obtained.
The authority information includes: the authority token for characterizing whether the user has authority to access the geographic information server may further include: the user has a valid time interval and an attribute field for access rights. One or more attribute fields of the user with the access authority can be set according to the requirement.
This part is similar to the previous step S202, and reference may be made to the related description of the previous embodiment, which is not described herein again.
S303, if the user has the authority to access the geographic information server, detecting whether the current time belongs to the effective access time interval of the user, and if so, executing the step S304; if not, the method is used for prompting the no-permission prompt information without the access permission.
It is understood that the step S303 is an optional step, and in practical applications, the step S303 may not be executed if the valid time interval of the user for the attribute data access is not limited.
S304, determining that the second access proxy address corresponds to a second actual access address in the geographic information server.
S305, requesting attribute data from the geographic information server based on the second actual access address.
And S306, acquiring attribute data related to the space map returned by the geographic information server.
S307, detecting whether the authority information of the user is configured with the information of the attribute field of the access authority of the user, if so, executing the step S308; if not, go to step S310
S308, screening out target attribute data corresponding to the attribute field with the access authority of the user from the attribute data returned by the geographic information server.
S309, the target attribute data is sent to the client of the user.
And S310, forwarding the attribute data returned by the map server to the client.
The application also provides an access control device of the map service information.
As shown in fig. 4, which shows a schematic structural diagram of an access control device for map service information according to the present application, the device of this embodiment can be applied to a spatial information service platform, and includes:
arequest obtaining unit 401, configured to obtain a map service request initiated by a client, where the map service request is used to request map service information, and the map service request carries a user identifier of a user;
anauthority querying unit 402, configured to obtain, based on the user identifier, authority information corresponding to the user, where the authority information at least includes: the information access range of the user with the access authority;
aninformation requesting unit 403, configured to request the map service information from a geographic information server based on the map service request;
aninformation obtaining unit 404, configured to obtain the map service information returned by the geographic information server;
aninformation extraction unit 405, configured to extract sub-map service information that belongs to the information access range of the user from the map service information returned by the geographic information server;
aninformation sending unit 406, configured to send the sub-map service information to the client.
In a possible implementation manner, the permission information queried by the permission querying unit further includes: the effective time interval of the access authority of the user is provided;
the information requesting unit is specifically configured to request the map service information from a geographic information server based on the map service request if the current time is within the valid time interval corresponding to the user.
In yet another possible implementation manner, on the basis of the above apparatus embodiment, the map service request obtained by the request obtaining unit is used for requesting a space map;
the information access range of the user with the access right acquired by the right inquiry unit comprises: the space map range of the user with the access authority;
the information extraction unit includes:
and the map cutting unit is used for cutting out a subspace map belonging to the space map range corresponding to the user from the space map returned by the geographic information server.
In yet another possible implementation manner, on the basis of the above apparatus embodiment, the map service request obtained by the request obtaining unit is used for requesting attribute data associated with a space map;
the information access range of the user with the access right acquired by the right inquiry unit comprises: an attribute field for which the user has access rights;
an information extraction unit comprising:
and the data extraction unit is used for extracting target attribute data corresponding to the attribute field with the access authority belonging to the user from the attribute data returned by the geographic information server.
In another possible implementation manner, the map service request obtained by the request obtaining unit further carries an access proxy address corresponding to the map service information;
an information requesting unit comprising:
an address determining subunit, configured to determine an actual access address in the geographic information server to which the access proxy address is mapped;
and the information request subunit is used for requesting the map service information from the geographic information server based on the actual access address.
In another possible implementation manner, the right information obtained by the right querying unit further includes: the authority mark is used for representing whether the user has the authority of accessing the geographic information server;
and the information request unit is specifically used for requesting the map service information from the geographic information server based on the map service request if the permission mark represents that the user has the permission to access the geographic information server.
In yet another possible implementation manner, the apparatus further includes:
and the information forwarding unit is used for sending the map service information to the client if the information access range of the user is not configured in the authority information.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. Meanwhile, the features described in the embodiments of the present specification may be replaced or combined with each other, so that those skilled in the art can implement or use the present application. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.