Hierarchical Encryption Smart City Geographic Information Access Control Method and System

By extracting user roles, time and spatial location parameters, and combining multi-dimensional data and pre-trained models, the access permissions of the smart city geographic information system are dynamically adjusted, solving the problem of static permission binding in existing technologies and realizing reasonable permission management and data security within the spatiotemporal range.

CN123116337APending Publication Date: 2026-11-17北京北投智慧城市科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611472784.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing smart city geographic information systems, user permissions are statically bound to the spatiotemporal context of work tasks, making it impossible to dynamically adjust access levels based on time windows and spatial distances. This results in insufficient permission management and an inability to adapt to complex dynamic access business scenarios.

Method used

By receiving user access requests, extracting user role type, current access timestamp and spatial location, calculating spatial distance, combining multi-dimensional user profile data and pre-trained models to determine basic access level, constructing spatiotemporal joint correction factor, dynamically optimizing permission level, and ensuring access control through encryption strategy.

Benefits of technology

It enables reasonable permission management within the time and space scope of user task execution, prevents unauthorized access, ensures data security, and adapts to the dynamic access needs of complex business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123116337A_ABST
    Figure CN123116337A_ABST
Patent Text Reader

Abstract

This invention discloses a hierarchical encryption method and system for access control of geographic information in smart cities, relating to the field of access control technology. It includes: receiving a user's access request for geographic information of a target spatial area; extracting the user's role type, current access timestamp, and current spatial location; calculating the spatial distance to the target area; determining the user's basic spatial data access level; determining a spatiotemporal joint correction factor based on the matching relationship between the timestamp and the user's work task time window and the spatial distance; correcting the basic spatial data access level with this factor to obtain the current level; if the current level is below a threshold, access is denied; otherwise, a hierarchical encryption strategy is determined based on the current level. This invention effectively improves the adaptive adjustment capability of permissions based on spatiotemporal dynamic perception and the security of geographic information access under hierarchical encryption protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of access control technology, specifically to a hierarchical encryption method and system for access control of geographic information in smart cities. Background Technology

[0002] Smart city geographic information systems store a large amount of sensitive spatial data related to public safety and business privacy. Different users have different access permission requirements for the same spatial area due to differences in their roles, tasks, and access scenarios. Existing access control methods typically employ a static user-role-permission binding model. Administrators pre-assign fixed spatial data access permissions to different roles. When a user initiates a geographic information access request, the system extracts the user's role type and, based on the pre-bound role-permission mapping, directly determines whether access to the target spatial area is permitted. The entire authorization process relies on predefined role policies and manually configured management operations.

[0003] However, the traditional static authorization model lacks the ability to intelligently perceive the lifecycle of user tasks and the spatial and temporal context of access. It cannot dynamically adjust the access permission level based on the user's task time window and the distance relationship between the user's current spatial location and the target spatial area. It is difficult to match stable and compliant access permissions for users during task execution and cannot automatically reclaim permissions after the task ends. Overall, the dynamic permission management capability is insufficient and cannot adapt to the complex dynamic access business scenarios of smart cities. Summary of the Invention

[0004] This invention provides a hierarchical encryption method and system for access control of geographic information in smart cities, aiming to solve the technical problem in the prior art where user permissions are statically bound to the spatiotemporal context of work tasks, and access levels cannot be dynamically adjusted according to time windows and spatial distances.

[0005] In view of the above problems, the present invention provides a hierarchical encryption method and system for access control of geographic information in smart cities.

[0006] In a first aspect, the present invention provides a hierarchical encryption method for access control of geographic information in smart cities, comprising:

[0007] Receive a user's access request for geographic information of a target spatial region, extract the user role type, current access timestamp and user's current spatial location carried in the access request, and calculate the spatial distance between the user's current spatial location and the target spatial region;

[0008] The user's basic spatial data access level is determined based on the user role type, and the spatiotemporal joint correction factor is determined based on the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance.

[0009] The spatiotemporal joint correction factor is used to correct the basic spatial data access level to obtain the user's current spatial data access level;

[0010] When the current spatial data access level is lower than a preset access level threshold, the access request is rejected;

[0011] When the current spatial data access level is higher than or equal to the preset access level threshold, a corresponding hierarchical encryption strategy is determined based on the current spatial data access level. The hierarchical encryption strategy includes encryption strength and data return granularity.

[0012] Secondly, this invention provides a hierarchical encrypted smart city geographic information access control system, comprising:

[0013] The request parsing and ranging module is used to receive user access requests for geographic information of a target spatial area, extract the user role type, current access timestamp and current spatial location carried in the access request, and calculate the spatial distance between the current spatial location of the user and the target spatial area.

[0014] The level factor calculation module is used to determine the user's basic spatial data access level based on the user role type, and to determine the spatiotemporal joint correction factor based on the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance.

[0015] The current level correction module is used to correct the basic spatial data access level using the spatiotemporal joint correction factor to obtain the user's current spatial data access level.

[0016] The level rejection determination module is used to reject the access request when the current spatial data access level is lower than a preset access level threshold;

[0017] The encryption strategy determination module is used to determine a corresponding hierarchical encryption strategy based on the current spatial data access level when the current spatial data access level is higher than or equal to the preset access level threshold. The hierarchical encryption strategy includes encryption strength and data return granularity.

[0018] One or more technical solutions provided in this invention have at least the following technical effects or advantages:

[0019] This invention provides a hierarchical encryption method and system for access control of geographic information in smart cities. By extracting parameters such as user role, access time, and spatial location, it accurately calculates the spatial distance between the user and the target area, determines the basic access level based on the user role, and dynamically optimizes the permission level by constructing a correction factor combined with spatiotemporal dimension parameters. Simultaneously, it achieves access interception and compliant access through permission threshold verification, matching the corresponding encryption strength and data return granularity to valid access requests. This invention can guarantee normal business access permissions within the spatiotemporal range of user task execution, supporting the efficient execution of work tasks. It can also automatically adjust access permissions according to changes in spatiotemporal scenarios, improving the problems of permission retention and delayed revoke in static authorization modes, effectively avoiding the risks of excessive exposure of sensitive data and unauthorized access, and balancing the practicality of smart city geographic information services with data security protection. Attached Figure Description

[0020] Figure 1 A flowchart illustrating the hierarchical encryption smart city geographic information access control method provided in this embodiment of the invention;

[0021] Figure 2 A schematic diagram of the overall logic of the hierarchical encryption smart city geographic information access control method provided in an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram of the preset spatial data access level and encryption strategy mapping table in the hierarchical encryption smart city geographic information access control method provided in the embodiments of the present invention;

[0023] Figure 4 A schematic diagram of the hierarchical encryption smart city geographic information access control system provided in an embodiment of the present invention;

[0024] The components represented by each number in the attached diagram are explained below:

[0025] The request includes the ranging module 11, the level factor calculation module 12, the current level correction module 13, the level rejection judgment module 14, and the encryption strategy determination module 15. Detailed Implementation

[0026] This invention provides a hierarchical encryption method and system for access control of geographic information in smart cities, which addresses the technical problem in existing technologies where user permissions are statically bound to the spatiotemporal context of work tasks, making it impossible to dynamically adjust access levels based on time windows and spatial distances.

[0027] Example 1, as Figure 1 , Figure 2 As shown, this invention provides a hierarchical encryption method for access control of geographic information in smart cities, the method comprising:

[0028] S100: Receive a user's request to access geographic information of a target spatial region, extract the user role type, current access timestamp, and user's current spatial location carried in the access request, and calculate the spatial distance between the user's current spatial location and the target spatial region.

[0029] In the process of geographic information access control in smart cities, the spatial distance between a user's current location and the target spatial area requested for access is a crucial basis for determining whether the user has a legitimate access request. For example, when a user's current location is within or near the target spatial area, their access request typically corresponds to legitimate business scenarios such as on-site operations, field inspections, or emergency responses. Conversely, when a user's current location is far from the target spatial area, their access request may constitute unauthorized access or data snooping unrelated to work. Therefore, it is necessary to accurately calculate the spatial distance between the user's current location and the target spatial area as the basic input for subsequent dynamic permission adjustments. Since the target spatial area is usually presented as an irregular polygon shape on a digital map, while the user's location is a single latitude and longitude coordinate point, the shortest Euclidean distance from the point to the polygon is used as the measure of spatial distance, which can objectively reflect the proximity of the user and the target area in planar space.

[0030] Step S100 in the method provided in this embodiment of the invention includes:

[0031] Receive a user's access request for geographic information of a target spatial area, and extract the user role type and current access timestamp from the access request;

[0032] Obtain the user's current spatial location carried in the access request, wherein the user's current spatial location includes longitude coordinates and latitude coordinates;

[0033] Obtain the spatial boundary of the target spatial region, wherein the spatial boundary is represented by a closed polygon composed of the coordinate sequence of the boundary points of the target spatial region;

[0034] Calculate the shortest Euclidean distance from the user's current spatial location to the closed polygon, and use the shortest Euclidean distance as the spatial distance.

[0035] First, the system receives user requests for access to geographic information of a target spatial area and extracts the user role type and current access timestamp from these requests. The user role type refers to a predefined identity identifier for each type of user within the smart city geographic information management system, which determines the user's functional category. Common user role types include, but are not limited to, surveyors, urban management law enforcement officers, emergency commanders, urban planners, and ordinary citizens. The current access timestamp refers to the moment the user initiated this access request, represented in a unified time encoding format. This timestamp is used in subsequent steps to determine whether the user's access behavior falls within the user's work task time window.

[0036] For example, suppose a user whose job title is surveyor at a smart city operation center in a certain city clicks a request to view the geographic information of a plot of land in the High-tech Zone Science Park on a mobile terminal at 14:30:15 on June 9, 2026. At this time, in the received access request, the user role type field is set to surveyor, and the current access timestamp field is set to 2026-06-09 14:30:15.

[0037] Secondly, the user's current spatial location carried in the access request is obtained. The user's current spatial location includes longitude and latitude coordinates. The user's current spatial location field is extracted from the same access request. The user's current spatial location refers to the user's actual geographical location at the time the access request is initiated. This location is represented by a set of longitude and latitude coordinates, specifically longitude and latitude coordinates. The longitude coordinates range from -180° to +180°, with negative values ​​representing west longitude and positive values ​​representing east longitude; the latitude coordinates range from -90° to +90°, with negative values ​​representing south latitude and positive values ​​representing north latitude.

[0038] Specifically, on the user terminal device, the current latitude and longitude data is obtained through the built-in Global Positioning System (GPS) module or base station positioning technology, and this data is encapsulated in the access request. The receiving end directly reads the longitude and latitude values ​​from the specified fields in the request. For example, when the user initiates the request, their mapping terminal measures their current geographical location as 34°15′30″N, 108°55′20″E using GPS. Converting this value to decimal format yields a latitude coordinate of 34.2583° and a longitude coordinate of 108.9222°. This location information is written into the user's current spatial location field in the access request.

[0039] Next, the spatial boundary of the target spatial region is obtained. This boundary is represented by a closed polygon composed of the coordinates of the boundary points of the target spatial region. The target spatial region refers to the physical spatial area corresponding to the geographic information requested by the user. The spatial boundary of the target spatial region is represented by a closed polygon in the digital map. The boundary point coordinate sequence refers to a series of latitude and longitude coordinate points arranged in a clockwise or counterclockwise order. The lines connecting adjacent coordinate points form the sides of the polygon, and the last coordinate point is connected to the first coordinate point, forming a closed shape.

[0040] Specifically, the metadata record of the target spatial region is queried from the geographic information database. This record stores the predefined spatial boundaries of the target spatial region. The spatial boundaries of the target spatial region are read out in text or binary format and parsed into a series of ordered pairs of latitude and longitude coordinates. For example, the spatial boundary information of the High-tech Zone Science Park plot requested by the user, stored in the smart city geographic information system, is: a closed rectangular polygon composed of four boundary points. The latitude and longitude coordinates of the four boundary points, ordered clockwise, are: point A (108.9100°, 34.2600°), point B (108.9300°, 34.2600°), point C (108.9300°, 34.2500°), and point D (108.9100°, 34.2500°). After these four points are connected sequentially, the last point D is connected to the first point A, forming a closed rectangular polygon.

[0041] Finally, the shortest Euclidean distance from the user's current spatial location to the closed polygon is calculated, and this shortest Euclidean distance is taken as the spatial distance. The planar Euclidean distance formula is used to calculate the shortest distance from the user's current spatial location to the closed polygon.

[0042] The specific calculation method is as follows: First, the latitude and longitude coordinates of the user's current spatial location and the latitude and longitude coordinates of each boundary point of the polygon are considered as points in a two-dimensional Cartesian coordinate system, where the longitude coordinates correspond to the horizontal axis values ​​and the latitude coordinates correspond to the vertical axis values. Second, for each edge of the closed polygon, which is determined by the coordinates of its two endpoints, the shortest distance from the user's current spatial location to the line containing that edge is calculated. If the foot of the perpendicular falls between the endpoints of the line segment, then this distance is the distance from the point to the edge; if the foot of the perpendicular falls on the extension of the line segment, then the smaller of the two endpoints of the edge is taken as the distance from the point to the edge. Then, each edge of the closed polygon is traversed to obtain the distance value from the user's current spatial location to each edge. The minimum distance value is taken, and this minimum value is the shortest Euclidean distance from the user's current spatial location to the entire closed polygon. Finally, this shortest Euclidean distance is used as the spatial distance and converted according to the conversion relationship between the latitude and longitude difference and the actual ground distance. Near the equator, a change of 0.00001 degrees in longitude corresponds to approximately 1 meter, and a change of 0.00001 degrees in latitude also corresponds to approximately 1 meter. A spherical approximation formula can be used for accurate conversion, but to simplify the calculation, within a smaller range, the difference in longitude and latitude can be directly multiplied by the meter coefficient corresponding to each degree.

[0043] For example, the user's current spatial location is (108.9222°, 34.2583°). Calculate the distances from this point to each side of the rectangular polygon: Distance to the top: Latitude difference = 34.2600° - 34.2583° = 0.0017°, approximately 189 meters. Distance to the bottom: Latitude difference = 34.2583° - 34.2500° = 0.0083°, approximately 923 meters. Distance to the left: Longitude difference = 108.9222° - 108.9100° = 0.0122°, approximately 1357 meters. Distance to the right: Longitude difference = 108.9300° - 108.9222° = 0.0078°, approximately 868 meters. Taking the minimum value, the shortest Euclidean distance from the user's current spatial location to the closed polygon is 189 meters, which is the spatial distance.

[0044] In this embodiment of the invention, precise quantification of the spatial distance between a user's current spatial location and a target spatial region is achieved. User role type, current access timestamp, and user location information are extracted from the original access request. A standardized method is defined to represent the boundary of the target spatial region using a closed polygon, and the shortest Euclidean distance from a point to the polygon is used as the spatial distance metric. The calculated spatial distance provides an objective and calculable spatial dimension input for determining the spatiotemporal joint correction factor in subsequent steps, enabling access control decisions to effectively reflect the actual geographical proximity of the user to the target region, thereby preventing unauthorized access behavior due to excessive distance.

[0045] S200: Determine the user's basic spatial data access level based on the user role type, and determine the spatiotemporal joint correction factor based on the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance.

[0046] In smart city geographic information access control, different users have different reasonable access permission benchmarks for geographic information in the same spatial area due to differences in their job titles, the security sensitivity of their departments, and their historical access habits. Determining the basic access level solely based on the user's role ignores departmental security levels and historical behavior patterns, which can easily lead to overly broad or strict permission grants. Therefore, it is necessary to integrate multi-dimensional user profile data and use a pre-trained evaluation model to output the most suitable basic spatial data access level. Simultaneously, whether the user's actual access falls within the work task time window, whether the requested target spatial area is within the task's relevance, and whether the spatial distance between the user's current location and the target area is within a reasonable range all jointly determine whether the basic spatial data access level needs to be dynamically adjusted. Therefore, a spatiotemporal joint correction factor needs to be constructed to quantify the reasonableness of the user's access in both time and spatial dimensions, so as to correct the basic spatial data access level in subsequent steps.

[0047] Step S200 in the method provided in this embodiment of the invention includes:

[0048] The determination of the user's basic space data access level based on the user role type includes:

[0049] Acquire multi-dimensional user profile data of the user, including user role type, security level of the department to which the user belongs, historical access space range of the user in a preset historical period, and historical access frequency of the user in the preset historical period.

[0050] The user role type is converted into a one-hot encoded vector, the security level of the user's department is converted into a normalized value, the historical access space range is converted into a normalized space range value, and the historical access frequency is converted into a normalized frequency value.

[0051] The one-hot encoded vector and the normalized numerical value are used as static identity features, and the normalized spatial range value and the normalized frequency value are used as historical behavior features.

[0052] The static identity features and the historical behavior features are input into a pre-trained user access level evaluation model. The user access level evaluation model encodes the static identity features and the historical behavior features respectively, and then performs weighted fusion through a gating fusion mechanism to output the probability distribution of multiple access levels. The access level with the highest probability is taken as the user's basic spatial data access level.

[0053] First, acquire multi-dimensional user profile data. This data includes user role type, the security level of the user's department, the user's historical access space range within a preset historical period, and the user's historical access frequency within a preset historical period. Multi-dimensional user profile data refers to a data set that characterizes a user's identity attributes and historical access behavior across multiple dimensions. This data comprises four components: user role type, the security level of the user's department, the user's historical access space range within a preset historical period, and the user's historical access frequency within a preset historical period.

[0054] The user role type indicates the user's functional category. The security level of the user's department refers to the level of security sensitivity assigned to that department within the smart city management system, typically categorized as Level 1, Level 2, Level 3, etc., with lower numbers indicating higher security levels and more sensitive data. The preset historical time period is a pre-defined time interval used to track past user access behavior. This period can be set according to actual needs, such as the past 30 days or the past 90 days. The historical access spatial range refers to the coverage area of ​​all geographic spatial regions that the user has requested access to within the preset historical time period, usually measured as the union of the boundaries of all target spatial regions accessed by the user. This range can be quantified as a numerical value, such as the total area covered by the union. The historical access frequency refers to the total number of times the user initiated geographic information access requests within the preset historical time period.

[0055] For example, the user is a surveyor working at the Smart City Surveying and Mapping Center, whose security level is rated as Level 2. The preset historical period is the past 30 days. In the past 30 days, the user has accessed a total area of ​​45 square kilometers and initiated 128 access requests.

[0056] Secondly, the user role type is converted into a one-hot encoded vector, the security level of the user's department is converted into a normalized value, the historical access space range is converted into a normalized space range value, and the historical access frequency is converted into a normalized frequency value.

[0057] First, the user role type is converted into a one-hot encoded vector. One-hot encoding is a method of converting a categorical variable into a binary vector. The length of the vector is equal to the number of all possible values ​​of the categorical variable. Only one bit in the vector is 1, and the rest are 0. The position with a value of 1 corresponds to the specific category. Suppose that the smart city geographic information system predefines five user role types: surveyor, urban management law enforcement officer, emergency commander, urban planner, and ordinary citizen. Then the length of the encoded vector is 5. For example, if the user's role type is surveyor, and the encoding position corresponding to this role type is the first bit, then the converted one-hot encoded vector is [1, 0, 0, 0, 0].

[0058] Secondly, the security level of the user's department is converted into a normalized value. Normalization refers to scaling the original value to the range [0, 1]. Assume there are three security levels: Level 1, Level 2, and Level 3, corresponding to original values ​​of 1, 2, and 3 respectively. The minimum-maximum normalization formula is used: Normalized value = (Original value - Minimum value) / (Maximum value - Minimum value). Here, the minimum value is 1, and the maximum value is 3. For example, if the user's department has a security level of Level 2 and the original value is 2, then the normalized value = (2-1) / (3-1) = 0.5.

[0059] Next, convert the historical access space range into a normalized space range value. For example, suppose the largest historical access space range among all users within a preset historical period is 200 square kilometers and the smallest historical access space range is 0 square kilometers. If a user's historical access space range is 45 square kilometers, then the normalized space range value = 45 / 200 = 0.225.

[0060] Then, the historical access frequency is converted into a normalized frequency value. For example, suppose the highest historical access frequency among all users within a preset historical period is 500 times and the lowest is 0 times. If a user's historical access frequency is 128 times, then the normalized frequency value = 128 / 500 = 0.256.

[0061] Furthermore, the one-hot encoded vector and normalized value are used as static identity features, while the normalized spatial range value and normalized frequency value are used as historical behavior features. Static identity features refer to features that are related to a user's inherent identity and remain stable over a relatively long period, including the one-hot encoded vector of the user's role type and the normalized value of the security level of the user's department. For example, a user's static identity features include: a one-hot encoded vector [1, 0, 0, 0, 0] and a normalized security level value of 0.5. Historical behavior features refer to features that reflect a user's past access behavior habits, including the normalized spatial range value and normalized frequency value. For example, a user's historical behavior features include: a normalized spatial range value of 0.225 and a normalized frequency value of 0.256.

[0062] Furthermore, static identity features and historical behavior features are input into a pre-trained user access level evaluation model. The model encodes the static identity features and historical behavior features separately, then performs weighted fusion using a gating fusion mechanism to output a probability distribution of multiple access levels. The access level with the highest probability is selected as the user's base spatial data access level. The user access level evaluation model is a pre-trained neural network model that can output the most likely spatial data access level for a user based on the input static identity features and historical behavior features.

[0063] The user access level assessment model takes two inputs: static identity features and historical behavior features. Internally, the model encodes each feature separately, calculates their weights using a gating fusion mechanism, and maps the weighted fused feature vector to a probability distribution for multiple access levels using a Softmax activation function. The Softmax function converts a set of real numbers into a probability distribution, ensuring that each output value is between 0 and 1 and the sum of all output values ​​is 1. The output layer outputs the probabilities of five access levels: Level 1, Level 2, Level 3, Level 4, and Level 5, where Level 1 represents the lowest privilege and Level 5 represents the highest privilege. The access level with the highest probability is selected as the user's basic spatial data access level.

[0064] For example, the user's static identity features and historical behavioral features are input into a pre-trained user access level evaluation model. The user access level evaluation model outputs the probability distribution of five levels as follows: Level 1 0.05, Level 2 0.10, Level 3 0.70, Level 4 0.10, and Level 5 0.05. Among them, Level 3 has the highest probability of 0.70, so Level 3 is taken as the user's basic spatial data access level.

[0065] The pre-training process of the user access level assessment model includes:

[0066] Obtain a historical user access behavior dataset. Each data entry in the historical user access behavior dataset contains a historical user's static identity features, historical behavior features, and a corresponding labeled access level label. The labeled access level label is a multi-category label in one-hot encoding format, and the bit with a value of one corresponds to the historical user's actual access level.

[0067] A user access level evaluation model is constructed, comprising a static identity feature encoding channel, a historical behavior feature encoding channel, a gating fusion layer, and an output layer. The static identity feature encoding channel takes the static identity features as input and outputs a static identity feature vector. The historical behavior feature encoding channel takes the historical behavior features as input and outputs a historical behavior feature vector. The gating fusion layer calculates the gating weights of the static identity feature vector and the historical behavior feature vector, and performs weighted fusion of the static identity feature vector and the historical behavior feature vector according to the gating weights to output a fused feature vector. The output layer maps the fused feature vector to a probability distribution of multiple access levels through a Softmax activation function.

[0068] Using the static identity features and historical behavior features of the historical users as input features, the labeled access level tags as output tags, and minimizing the cross-entropy loss function as the training objective, the user access level evaluation model is trained in a supervised manner until the verification convergence is obtained, thus obtaining the trained user access level evaluation model.

[0069] First, a historical user access behavior dataset is obtained. Each data entry in the historical user access behavior dataset contains a historical user's static identity features, historical behavior features, and a corresponding labeled access level label. The labeled access level label is a multi-category label in one-hot encoding format, and the bit with a value of one corresponds to the historical user's actual access level.

[0070] The historical user access behavior dataset is derived from the historical access log database of the smart city geographic information system. Access records of all users over the past year were collected from this database. Each record contains a historical user's static identity characteristics, historical behavioral characteristics, and a corresponding access level label.

[0071] The static identity features are collected by retrieving the user's role type and the security level of their department from the user registration information table. User role types include five categories: surveyor, urban management law enforcement officer, emergency commander, urban planner, and ordinary citizen. The security level of the department is divided into three levels: Level 1, Level 2, and Level 3.

[0072] The method for collecting historical behavioral characteristics is as follows: statistically analyze the access logs of each historical user in the past 30 days, and calculate the user's historical access spatial range and historical access frequency.

[0073] The method for generating access level labels is as follows: security management personnel manually assess the spatial data access level that each historical user should have based on their job responsibilities, work tasks, and data sensitivity. There are five access levels, with level one being the lowest and level five the highest. The assessment results are converted into multi-category labels in one-hot encoded format, with a label length of 5, where the bits with a value of 1 correspond to the actual access level. For example, if a historical user is assessed as level three, their access level label would be [0, 0, 1, 0, 0].

[0074] Specifically, security management personnel manually assess the access level of each historical user according to the following objective standards: First, based on the historical user's job responsibilities, their level of confidentiality is divided into five levels: no confidentiality, low confidentiality, medium confidentiality, high confidentiality, and extremely high confidentiality. These five levels correspond to access levels one, two, three, four, and five, respectively. Second, based on the spatial data precision required for the historical user's work tasks, it is divided into five levels: no precise coordinates required, street-level precision required, building-level precision required, facility-level precision required, and sub-meter precision required. These five precision levels also correspond to access levels one through five, respectively. Third, based on the sensitivity of the data frequently accessed by the historical user, it is divided into five levels: public data, internal public data, departmental internal data, confidential data, and top secret data. These five sensitivity levels also correspond to access levels one through five, respectively. After determining the corresponding access levels for each of the above three dimensions, the highest level is taken as the final access level label for the historical user.

[0075] After data collection, the dataset was cleaned: records with missing static identity features or abnormal historical behavioral characteristics were removed; outlier detection was performed on the historical access space range and historical access frequency, removing outlier samples exceeding the mean ± 3 standard deviations. For example, after cleaning, 10,000 valid samples were obtained. The samples were divided into training, validation, and test sets in an 8:1:1 ratio, with the training set containing 8,000 samples, the validation set containing 1,000 samples, and the test set containing 1,000 samples.

[0076] Secondly, a user access level evaluation model is constructed. The user access level evaluation model includes a static identity feature encoding channel, a historical behavior feature encoding channel, a gating fusion layer, and an output layer. The static identity feature encoding channel takes static identity features as input and outputs a static identity feature vector. The historical behavior feature encoding channel takes historical behavior features as input and outputs a historical behavior feature vector. The gating fusion layer calculates the gating weights of the static identity feature vector and the historical behavior feature vector, and performs weighted fusion of the static identity feature vector and the historical behavior feature vector according to the gating weights to output a fused feature vector. The output layer maps the fused feature vector to the probability distribution of multiple access levels through the Softmax activation function.

[0077] Specifically, the constructed user access level assessment model comprises the following five layers: input layer, static identity feature encoding channel, historical behavior feature encoding channel, gating fusion layer, and output layer.

[0078] The input layer consists of two input ports. The first input port receives static identity features, which include a one-hot encoded vector of length 5 and normalized values. The one-hot encoded vector corresponds to five user role types, and the normalized values ​​correspond to department security levels, ranging from 0 to 1. The combined static identity feature has a dimension of 6. The second input port receives historical behavior features, which include normalized spatial range values ​​and normalized frequency values. The combined historical behavior feature has a dimension of 2.

[0079] The static identity feature encoding channel consists of two fully connected layers. The first fully connected layer has 64 neurons, with an input dimension of 6 and an output dimension of 64. The activation function is the Rectified Linear Array (ReLU), defined as follows: if the input value is greater than 0, the output is equal to the input value; if the input value is less than or equal to 0, the output is 0. The second fully connected layer has 32 neurons, with an input dimension of 64 and an output dimension of 32. The activation function is also the ReLU. This channel ultimately outputs a static identity feature vector of length 32.

[0080] The historical behavior feature encoding channel consists of two fully connected layers. The first fully connected layer has 32 neurons, with an input dimension of 2 and an output dimension of 32, and uses the ReLU activation function. The second fully connected layer has 16 neurons, with an input dimension of 32 and an output dimension of 16, and also uses the ReLU activation function. This channel ultimately outputs a historical behavior feature vector of length 16.

[0081] The gated fusion layer receives a static identity feature vector and a historical behavior feature vector. First, the two vectors are concatenated into an intermediate vector of length 48. Then, this intermediate vector is input into a gated fully connected layer with one neuron, using the sigmoid function as the activation function, and outputting a gate weight value between 0 and 1. Next, the static identity feature vector is mapped to a vector of length 16 through a linear transformation layer without an activation function. This transformed static identity feature vector is then fused with the historical behavior feature vector using a weighted fusion method: fused feature vector = gate weight × transformed static identity feature vector + (1 - gate weight) × historical behavior feature vector. The length of the fused feature vector is 16.

[0082] The output layer consists of a fully connected layer and a softmax activation function. The fully connected layer has 5 neurons, with an input dimension of 16 and an output dimension of 5. The softmax activation function transforms the 5 real values ​​output by the fully connected layer into a probability distribution. The output layer ultimately outputs 5 probability predictions for each access level, with the sum of the five probabilities equal to 1.

[0083] Next, using the static identity features and historical behavior features of historical users as input features, the access level labels as output labels, and minimizing the cross-entropy loss function as the training objective, the user access level evaluation model is trained in a supervised manner until the validation convergence is achieved, thus obtaining the trained user access level evaluation model.

[0084] Specifically, a supervised learning approach was used to train the constructed user access level evaluation model. Training data consisted of a training set and a validation set. The training method employed batch gradient descent, with the Adam optimizer selected. The initial learning rate was set to 0.001, and 64 samples were randomly selected from the training set in each iteration, resulting in a batch size of 64.

[0085] During training, the classification cross-entropy loss function is used. For a single training sample, let the probability distribution of the five access levels output by the model be [p1, p2, p3, p4, p5], where p1 corresponds to the predicted probability of level one, p2 corresponds to the predicted probability of level two, and so on. Let the labeled access level label of this sample be [y1, y2, y3, y4, y5], which is a one-hot encoded vector, where only one bit is 1 and the rest are 0. The formula for calculating the cross-entropy loss value L is: For all 64 samples in a batch, calculate the arithmetic mean of the loss values ​​of all samples in the batch, and use this as the average loss value for the batch.

[0086] During training, each training epoch updates the parameters sequentially using all batches in the training set. After each training epoch, the average loss on the validation set is calculated using samples from the validation set. Training continues until the average loss on the validation set no longer decreases over 10 consecutive training epochs (i.e., the decrease is less than 0.001), at which point the model is considered converged. The model parameters at the convergence point are saved, resulting in the trained user access level evaluation model. For example, from epoch 25 to epoch 34, if the decrease in loss compared to the previous epoch is less than 0.001, the stopping condition is triggered at the end of epoch 34, the model stops training, and the parameters from epoch 34 are saved.

[0087] After training, the model's performance is evaluated using samples from the test set, and the model's prediction accuracy is calculated. A prediction accuracy of 95% or higher on the test set is required for practical applications. If this is not achieved, the model structure should be adjusted or more training samples should be collected for retraining.

[0088] The spatiotemporal joint correction factor is determined based on the matching relationship between the current access timestamp and the user's corresponding user work task time window, as well as the spatial distance, including:

[0089] Obtain the user's work task time window, which includes the work task start timestamp and the work task end timestamp.

[0090] Obtain the task space range boundary corresponding to the user's work task. The task space range boundary is formed by the union of the space range boundaries of all target space regions associated with the user's work task.

[0091] Determine whether the current access timestamp is within the user's work task time window, and determine whether the target space region and the task space range boundary intersect;

[0092] The spatial distance is compared with a preset spatial distance threshold to determine whether the spatial distance is less than or equal to the preset spatial distance threshold, wherein the preset spatial distance threshold is a preset multiple of the radius of the outer circle of the spatial range boundary of the target spatial region;

[0093] When the current access timestamp is within the user's work task time window, and the target space region intersects with the boundary of the task space range, and the spatial distance is less than or equal to the preset spatial distance threshold, calculate the remaining time from the current access timestamp to the end timestamp of the work task, divide the remaining time by the total time of the user's work task time window to obtain the matching degree within the time window, and use the matching degree within the time window as a spatiotemporal joint correction factor;

[0094] When the current access timestamp is outside the user's work task time window, or the target space region does not intersect with the boundary of the task space range, or the spatial distance is greater than the preset spatial distance threshold, the preset maximum correction value is used as the spatiotemporal joint correction factor, wherein the preset maximum correction value is the value 1.

[0095] First, obtain the user's corresponding work task time window. The user's work task time window includes a work task start timestamp and a work task end timestamp. The user's work task time window refers to the time interval during which the user is assigned to execute a certain work task. This time window includes two timestamps: the work task start timestamp and the work task end timestamp. The work task start timestamp indicates the moment when the user is authorized to start executing the task, and the work task end timestamp indicates the deadline when the task should be completed.

[0096] For example, the user was assigned a task: to conduct on-site surveying of a plot of land in the High-tech Zone Science Park. The user's task time window is: task start timestamp is 8:00:00 on June 9, 2026, and task end timestamp is 17:00:00 on June 9, 2026.

[0097] Secondly, the task spatial boundary corresponding to the user's work task is obtained. The task spatial boundary is the union of the spatial boundaries of all target spatial regions associated with the user's work task. Specifically, a work task may involve multiple target spatial regions, such as multiple plots of land that need to be surveyed. The union of the spatial boundaries of each target spatial region forms the overall task spatial boundary of the work task.

[0098] For example, if the user's surveying task only involves the High-tech Zone Science Park plot, then the boundary of the task space is the closed polygon boundary of that plot, a rectangle enclosed by points A, B, C, and D. If the task involves multiple plots, then the boundary of the task space is the union of the polygon boundaries of each plot.

[0099] Next, determine whether the current access timestamp is within the user's task time window, and whether there is an intersection between the target space region and the task space boundary. Compare the current access timestamp extracted in S100 with the task start timestamp and task end timestamp. If the current access timestamp is greater than or equal to the task start timestamp and less than or equal to the task end timestamp, then the current access timestamp is determined to be within the user's task time window; otherwise, it is determined to be outside the window. Compare the spatial boundary of the target space region requested by the user with the task space boundary. If the two boundary polygons have overlapping areas, or one polygon completely contains the other polygon, then there is an intersection; if the two polygons have no common points, then there is no intersection.

[0100] For example, the current access timestamp is 14:30:15 on June 9, 2026, and the user's work task time window is from 8:00:00 to 17:00:00 on June 9, 2026. 14:30:15 falls within the period from 8:00:00 to 17:00:00, therefore it is determined to be within the user's work task time window. The target spatial area requested for access is the High-tech Zone Science Park plot, and the boundary of the task space is also the boundary of this plot. The two completely overlap, therefore it is determined that there is an intersection.

[0101] Then, the spatial distance is compared with a preset spatial distance threshold to determine whether the spatial distance is less than or equal to the preset spatial distance threshold. The preset spatial distance threshold is a preset multiple of the radius of the circumscribed circle of the target spatial region's spatial extent boundary. The preset spatial distance threshold is an upper limit value calculated based on the spatial extent boundary of the target spatial region. Specifically, the calculation method is as follows: First, calculate the radius of the circumscribed circle of the target spatial region's spatial extent boundary. The circumscribed circle is the smallest circle that can contain the entire closed polygon, and its radius is the radius length of that circle. Multiply this radius by a preset multiple to obtain the preset spatial distance threshold. Then, compare the spatial distance calculated in S100 with this preset spatial distance threshold. If the spatial distance is less than or equal to the preset spatial distance threshold, the condition is deemed met; if the spatial distance is greater than the preset spatial distance threshold, the condition is deemed not met.

[0102] The preset multiplier is determined in advance based on the security sensitivity level of the target spatial area, user role type, or system default configuration. When the security sensitivity level of the target spatial area is Level 1 (highest sensitivity), the preset multiplier is 1.0; when the security sensitivity level is Level 2 (medium sensitivity), the preset multiplier is 1.5; and when the security sensitivity level is Level 3 (general sensitivity), the preset multiplier is 2.0. The preset multiplier ranges from 1.0 to 3.0; the higher the multiplier, the more lenient the spatial distance range allowed to be accessed. During deployment, the security sensitivity level is pre-configured by the system administrator based on the data types involved in the target spatial area and stored in the metadata field of the geographic information database.

[0103] For example, the target spatial area is the rectangular boundary of a plot of land in the High-tech Zone Science Park, with the radius of its circumscribed circle being half the length of the rectangle's diagonal. The width of the rectangle is approximately 2220 meters (longitude difference of 0.0200°), the height is approximately 1110 meters (latitude difference of 0.0100°), and the diagonal length is... The circumscribed circle radius is 1241 meters. The preset multiplier is set to 2, so the preset spatial distance threshold = 1241 meters × 2 = 2482 meters. The spatial distance calculated in S100 is 189 meters, which is less than 2482 meters; therefore, the spatial distance is determined to be less than or equal to the preset spatial distance threshold.

[0104] Furthermore, if the current access timestamp is within the user's work task time window, and the target space region and the task space range boundary intersect, and the spatial distance is less than or equal to a preset spatial distance threshold, calculate the remaining duration from the current access timestamp to the work task end timestamp, divide the remaining duration by the total duration of the user's work task time window to obtain the matching degree within the time window, and use the matching degree within the time window as a spatiotemporal joint correction factor.

[0105] Specifically, if it is determined that the current access timestamp is within the user's work task time window, and it is determined that the target space region and the task space range boundary intersect, and it is determined that the spatial distance is less than or equal to the preset spatial distance threshold, then this step is executed.

[0106] First, calculate the remaining time from the current access timestamp to the task completion timestamp. Remaining time = Task completion timestamp - Current access timestamp. Second, calculate the total duration of the user's task time window. Total duration = Task completion timestamp - Task start timestamp. Then, divide the remaining time by the total duration to obtain the matching degree within the time window. Matching degree within the time window = Remaining time / Total duration. The matching degree within the time window is a value between 0 and 1; the closer the remaining time is to 0, the closer the matching degree is to 0; the closer the remaining time is to the total duration, the closer the matching degree is to 1. Finally, use this matching degree within the time window as a spatiotemporal joint correction factor.

[0107] For example, a user's task starts at 8:00:00 on June 9, 2026, and ends at 17:00:00, for a total duration of 9 hours (32,400 seconds). The current access timestamp is 14:30:15, and the remaining time until the end timestamp is 2 hours, 29 minutes, and 45 seconds (8,985 seconds). The matching degree within the time window is approximately 8985 / 32400 ≈ 0.277. This value is used as a spatiotemporal joint correction factor.

[0108] In addition, when the current access timestamp is outside the user's work task time window, or the target space region and the task space range boundary do not intersect, or the spatial distance is greater than the preset spatial distance threshold, the preset maximum correction value is used as the spatiotemporal joint correction factor, where the preset maximum correction value is the value 1.

[0109] Specifically, this step is executed if the current access timestamp is outside the user's work task time window, or if the target spatial region and the task spatial range boundary do not intersect, or if the spatial distance is greater than a preset spatial distance threshold. In this case, a preset constant value is used as the spatiotemporal joint correction factor. The preset maximum correction value is set to 1. For example, assuming the user initiates the same access request outside of working hours, the current access timestamp is not within the work task time window, and the spatiotemporal joint correction factor is set to 1.

[0110] In this embodiment of the invention, a multi-dimensional fusion evaluation of the user's basic spatial data access level and the quantification of spatiotemporal rationality are achieved. Regarding the determination of the basic spatial data access level, a pre-trained neural network model is used to fuse static identity features and historical behavioral features. A gating fusion mechanism adaptively adjusts the weights of the two types of features, outputting a probability distribution, and taking the maximum value as the basic spatial data access level, avoiding the one-sidedness of a single-dimensional evaluation. Regarding the determination of the spatiotemporal correction factor, a joint judgment of three parallel conditions distinguishes between a user in a reasonable work task scenario and one in an unreasonable scenario: when all three conditions are met, the ratio of remaining time to total time is used as the correction factor, ensuring that subsequent level corrections reflect the progress of the task; when any condition is not met, the correction factor is set to the maximum correction value of 1, ensuring that subsequent corrections reflect a penalty mechanism. This provides a dual input for subsequent level corrections, reflecting both the user's inherent permission baseline and the current spatiotemporal rationality.

[0111] S300: The spatiotemporal joint correction factor is used to correct the basic spatial data access level to obtain the user's current spatial data access level.

[0112] In this embodiment of the invention, the user's basic spatial data access level is a static baseline value, which cannot reflect the strength of the user's actual access needs under the current specific spatiotemporal conditions. When the user is within the time window of the task and in a reasonable spatial location, their access needs gradually decrease as the remaining task time decreases, and the access level should decay smoothly rather than remain unchanged until it suddenly drops to zero after the task ends. When the user's time, space, or distance conditions deviate, their access behavior is suspected of being a violation, and a rigid downgrade is required as a penalty. Therefore, different correction strategies are needed to dynamically adjust the user's basic spatial data access level to obtain a current spatial data access level that matches the current spatiotemporal context.

[0113] Step S300 in the method provided in this embodiment of the invention includes:

[0114] Obtain the level value corresponding to the access level of the basic spatial data, wherein the level value is a positive integer, and the higher the access level, the larger the corresponding level value;

[0115] When the spatiotemporal joint correction factor is the matching degree within the time window, the level value of the basic spatial data access level is multiplied by the matching degree within the time window, the product result is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level.

[0116] When the spatiotemporal joint correction factor is a preset maximum correction value, the level value of the basic spatial data access level is subtracted from the preset maximum correction value, the result of the subtraction is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level.

[0117] First, obtain the level value corresponding to the basic spatial data access level. The level value is a positive integer; the higher the access level, the larger the corresponding level value. Extract the corresponding level value from the basic spatial data access level output by S200. Five pre-defined correspondences between spatial data access levels and level values ​​are established: Level 1 corresponds to value 1, Level 2 to value 2, Level 3 to value 3, Level 4 to value 4, and Level 5 to value 5. The level value is a positive integer; the higher the access level, the larger the corresponding level value. For example, if the user's basic spatial data access level is Level 3, the corresponding level value is 3.

[0118] Secondly, determine the type of the spatiotemporal joint correction factor. The spatiotemporal joint correction factor is determined in S200 and may be one of two types: the first is the matching degree within the time window, a value between 0 and 1; the second is a preset maximum correction value, a fixed value of 1. The type is determined based on the actual value of the correction factor: if the correction factor is less than 1, it is a matching degree within the time window; if the correction factor is equal to 1, it needs to be distinguished in conjunction with the conditions in S200: when all three conditions are met, the matching degree may be exactly 1, which should be considered a multiplicative correction scenario; when any condition is not met, the preset maximum correction value is 1, which should be considered a subtractive correction scenario. In actual implementation, a Boolean flag can be used to record whether the current state is in which all three conditions are met, to distinguish between the two scenarios. For example, if the spatiotemporal joint correction factor is 0.277, this value is less than 1 and greater than 0, and all three conditions are met, therefore it is determined to be a matching degree within the time window type.

[0119] Secondly, when the spatiotemporal joint correction factor is the matching degree within the time window, the level value of the basic spatial data access level is multiplied by the matching degree within the time window. The product is rounded down to obtain the corrected level value, and the access level corresponding to the corrected level value is taken as the user's current spatial data access level. Multiplicative correction is applicable to scenarios where all three conditions are met: the current access timestamp is within the user's work task time window, the target spatial region intersects with the boundary of the task spatial range, and the spatial distance is less than or equal to a preset spatial distance threshold. In this case, the user is in a normal work task access state, and the matching degree within the time window acts as a discount coefficient greater than zero and less than or equal to one, allowing the access privileges to decay smoothly as the task progresses.

[0120] The specific execution method is as follows: The base spatial data access level value is multiplied by the matching degree within the time window to obtain a product. Then, this product is rounded down. The rounding rule is to round down to ensure that permissions are not improperly elevated due to rounding. The rounded value is used as the corrected spatial data access level value. Finally, the access level corresponding to the corrected spatial data access level value is used as the user's current spatial data access level.

[0121] After the calculation is complete, the corrected spatial data access level value needs to be checked. The default minimum spatial data access level is level one, with a value of 1. If the corrected spatial data access level value is less than 1, it is reset to 1. If the corrected spatial data access level value is greater than the highest spatial data access level value of 5, it is reset to 5. The access level corresponding to the finally confirmed corrected spatial data access level value is taken as the user's current spatial data access level.

[0122] For example, the user's base spatial data access level is 3, and the match rate within the time window is 0.277. The product is calculated as: 3 × 0.277 = 0.831. Rounding down gives a corrected level value of 0. However, the lowest possible spatial data access level is 1, therefore the current spatial data access level is reset to 1.

[0123] Secondly, when the spatiotemporal joint correction factor is the preset maximum correction value, the level value of the basic spatial data access level is subtracted from the preset maximum correction value. The result of the subtraction is rounded down to obtain the corrected level value, and the access level corresponding to the corrected level value is taken as the user's current spatial data access level. Subtraction correction is applicable to scenarios where the current access timestamp is outside the user's work task time window, or where the target spatial region and the task spatial range boundary do not intersect, or where the spatial distance is greater than a preset spatial distance threshold—at least one condition is not met, i.e., scenarios of time violation, spatial violation, or distance violation. In this case, the user's access behavior deviates, requiring rigid degradation as a penalty.

[0124] The specific execution method is as follows: Subtract the preset maximum correction value of 1 from the base spatial data access level value to obtain the subtraction result. Then, round the result. Use the rounded value as the corrected level value. Finally, use the access level corresponding to the corrected level value as the user's current spatial data access level. Subtraction correction produces an immediate permission downgrade effect. When the corrected spatial data access level value is less than the preset minimum spatial data access level, the value of 1 needs to be used as the corrected spatial data access level value to ensure that the current spatial data access level is always within a reasonable range.

[0125] For example, suppose a user initiates an access request outside of their work time window. In this case, the time condition among the three conditions is not met, and the spatiotemporal joint correction factor takes the preset maximum correction value of 1. The basic spatial data access level value is 3, and the corrected spatial data access level value = 3-1=2, corresponding to a spatial data access level of level two.

[0126] In this embodiment of the invention, dynamic correction of the access level of basic spatial data is implemented, generating a current spatial data access level adapted to the current spatiotemporal context. Two correction scenarios are distinguished: in spatiotemporal compliance scenarios, multiplicative correction is used, allowing permissions to smoothly decay as the remaining task time decreases, reflecting the principle of trust that diminishes over time; in spatiotemporal violation scenarios, subtractive correction is used, rigidly penalizing deviations, reflecting the principle of deviating and being downgraded. The two correction methods work together, ensuring that the current spatial data access level not only meets reasonable access needs during normal task execution but also automatically shrinks permissions near the end of the task and immediately reduces permissions when unauthorized access occurs, thus providing a precise basis for subsequent access decisions and hierarchical encryption.

[0127] S400: When the current spatial data access level is lower than the preset access level threshold, the access request is rejected.

[0128] In this embodiment of the invention, the user's current spatial data access level comprehensively reflects the user's basic permissions, the matching status of the work task time window, the relevance of the target spatial region, and the spatial distance between the user and the target region. However, the current spatial data access level itself is only a quantitative permission metric, and a minimum admission standard needs to be set to determine whether the user is qualified to receive any form of geographic information. If no lower limit is set for the current spatial data access level, users with too low a level may still be able to obtain geographic information, leading to the leakage of sensitive data to users with severely insufficient permissions. Therefore, it is necessary to preset an access level threshold as the minimum threshold for allowed access, and compare the current spatial data access level with this threshold to decide whether to allow or deny the current access request.

[0129] Specifically, a preset access level threshold is set in advance. This threshold is a positive integer, ranging from level 1 to 5. In actual deployment, this threshold is usually set to 2, corresponding to level 2. That is, only users with a current spatial data access level of level 2 or above are allowed to obtain geographic information, while level 1 users are directly denied access. In implementation, the level value corresponding to the current spatial data access level is obtained from the output of step S300, and this value is compared with the preset access level threshold. If the level value of the current spatial data access level is less than the preset access level threshold, access is denied; if it is greater than or equal to the preset access level threshold, access is allowed, and the subsequent encryption policy determination step S500 is executed. When access is denied, a permission-unauthorized message is returned to the user terminal. This message does not contain any geographic information data and does not reveal the specific sensitive content of the target spatial area; it only informs the user that they currently do not have permission to access the requested geographic information.

[0130] For example, the user's current spatial data access level is Level 1, corresponding to a spatial data access level value of 1. The preset access level threshold is set to the value 2, corresponding to Level 2. Since the current spatial data access level value of 1 is less than 2, it is determined that the current spatial data access level is below the preset access level threshold, and the user's access request is rejected. The user receives a message on their terminal: "Currently, you do not have permission to access the requested geographic information."

[0131] In this embodiment of the invention, by setting a clear minimum access threshold, it is ensured that only users whose current spatial data access level reaches the preset access level threshold can obtain geographic information, while users with insufficient spatial data access level are directly denied access. This allows for immediate security filtering after permission correction. This filtering operation does not rely on any external services or complex calculations; it only requires a single numerical comparison, resulting in high execution efficiency. Furthermore, the message returned upon denial does not reveal any geographic information details, avoiding the security risk of information inference through erroneous feedback and effectively preventing unauthorized access due to excessive permission decay or excessively low initial permissions.

[0132] S500: When the current spatial data access level is higher than or equal to the preset access level threshold, a corresponding hierarchical encryption strategy is determined based on the current spatial data access level. The hierarchical encryption strategy includes encryption strength and data return granularity.

[0133] In this embodiment of the invention, users with different spatial data access levels have significantly different security and data accuracy requirements for geographic information: high-privilege users need high-precision spatial coordinates to support accurate decision-making, and due to their high level of trust, they can use lower-strength encryption to improve response speed; low-privilege users only need low-precision approximate location information, and due to their low level of trust, they must use high-strength encryption to prevent data from being intercepted during transmission and then reconstructed into high-precision information. Therefore, it is necessary to dynamically select the appropriate encryption strength and data return granularity according to the current spatial data access level, to achieve a hierarchical protection strategy where higher privileges, more refined data, and weaker encryption; and lower privileges, more coarse data, and stronger encryption. Simultaneously, to ensure that the encryption key is bound to the user's task lifecycle, a dynamic key needs to be generated based on the task time window, making the key valid within the task window and automatically invalid outside the window, thereby preventing the key from being reused after the task ends.

[0134] Step S500 in the method provided in this embodiment of the invention includes:

[0135] Obtain a preset spatial data access level and encryption strategy mapping table. The spatial data access level and encryption strategy mapping table contains multiple correspondences between spatial data access levels and hierarchical encryption strategies. Each hierarchical encryption strategy includes encryption strength and data return granularity. In the spatial data access level and encryption strategy mapping table, the higher the spatial data access level, the lower the corresponding target encryption strength and the finer the target data return granularity.

[0136] Based on the current spatial data access level, query the corresponding target hierarchical encryption policy in the spatial data access level and encryption policy mapping table, and obtain the target encryption strength and target data return granularity in the target hierarchical encryption policy;

[0137] Obtain the start timestamp and end timestamp of the user's work task time window, and concatenate the string representation of the start timestamp and the string representation of the end timestamp in order to form a key seed string;

[0138] The key seed string is input into a hash algorithm, which performs multiple rounds of iterative compression operations on the key seed string and outputs a hash value of fixed length. The hash value is used as a dynamic encryption key, wherein the dynamic encryption key is valid within the user's work task time window and automatically expires outside the user's work task time window.

[0139] According to the target data return granularity, the spatial accuracy of the target spatial region geographic information is downgraded. The encryption algorithm corresponding to the target encryption strength and the dynamic encryption key are used to encrypt the spatially downgraded target spatial region geographic information. The encrypted and spatially downgraded target spatial region geographic information is then returned to the user.

[0140] First, obtain the preset spatial data access level and encryption strategy mapping table. The spatial data access level and encryption strategy mapping table contains the correspondence between multiple spatial data access levels and hierarchical encryption strategies. Each hierarchical encryption strategy includes encryption strength and data return granularity. In the spatial data access level and encryption strategy mapping table, the higher the spatial data access level, the lower the corresponding target encryption strength and the finer the target data return granularity.

[0141] Specifically, a spatial data access level and encryption strategy mapping table is pre-stored. This table contains the correspondence between multiple spatial data access levels and hierarchical encryption strategies. Each hierarchical encryption strategy includes two parameters: encryption strength and data return granularity. There are five spatial data access levels: Level 1, Level 2, Level 3, Level 4, and Level 5. Encryption strength refers to the security level of the encryption algorithm used when encrypting geographic information data, and is divided into three levels: low strength, medium strength, and high strength. Data return granularity refers to the fineness of the spatial coordinates in the geographic information returned to the user, and is divided into three levels: coarse granularity, medium granularity, and fine granularity.

[0142] like Figure 3As shown in the spatial data access level and encryption strategy mapping table, the higher the spatial data access level, the lower the corresponding target encryption strength and the finer the target data return granularity. Specific correspondences are as follows: Level 1 corresponds to high encryption strength and coarse data return granularity; Level 2 corresponds to high encryption strength and medium data return granularity; Level 3 corresponds to medium encryption strength and medium data return granularity; Level 4 corresponds to low encryption strength and fine data return granularity; Level 5 corresponds to low encryption strength and fine data return granularity.

[0143] Secondly, based on the current spatial data access level, the corresponding target hierarchical encryption policy is queried in the spatial data access level and encryption policy mapping table to obtain the target encryption strength and target data return granularity from the target hierarchical encryption policy. The current spatial data access level output from step S300 is used as the query keyword to perform an exact match search in the spatial data access level and encryption policy mapping table. After finding the corresponding record, the values ​​of two fields are retrieved from that record: target encryption strength and target data return granularity. For example, assuming the user's current spatial data access level is level three, the target encryption strength corresponding to level three in the mapping table is medium strength, and the target data return granularity is medium granularity.

[0144] Next, obtain the start and end timestamps of the user's task time window. Concatenate the string representations of the start and end timestamps in order to form a key seed string. Obtain the user's task time window obtained in S200, which includes the start and end timestamps. Concatenate the string representations of the start and end timestamps in order to form a key seed string. The string representation refers to converting the timestamps into a fixed text format, such as 2026-06-09 08:00:00. The concatenation method is: start timestamp string + end timestamp string, without any separator. For example, the task start timestamp is 2026-06-09 08:00:00, and the end timestamp is 2026-06-09 17:00:00. The concatenated key seed string is 2026-06-09 08:00:002026-06-09 17:00:00.

[0145] Then, the key seed string is input into a hash algorithm. The hash algorithm performs multiple rounds of iterative compression operations on the key seed string, outputting a fixed-length hash value. This hash value is used as a dynamic encryption key, which is valid within the user's task time window and automatically expires outside of that window. The key seed string is then input into a hash algorithm. A hash algorithm is a one-way hash function that can compress input data of arbitrary length through multiple rounds of iterative operations, outputting a fixed-length hash value. The hash algorithm used can be SHA-256, which outputs a 256-bit hash value.

[0146] The automatic expiration of keys is implemented through the following mechanism: During the key generation phase, the start and end timestamps of the user's task are obtained, concatenated, and hashed to generate a dynamic encryption key. This key is temporarily associated with the user session and stored in a memory cache, without persistent storage. During the key usage phase, each time a user initiates a decryption request, the current timestamp is first obtained. It is then determined whether the current timestamp is within the user's task time window, i.e., whether the task start timestamp is less than or equal to the current timestamp, and the current timestamp is less than or equal to the task end timestamp. If the current timestamp exceeds the user's task time window, any decryption operation using the key is refused, a message indicating that the key has expired is returned to the user, and the key is immediately cleared from the memory cache. If the current timestamp is within the user's task time window, decryption using the key is allowed. Furthermore, since the key is only temporarily stored in the memory cache and not written to disk, it is automatically lost upon server restart or user session termination. The user must re-authenticate within the valid time window before a new key can be generated.

[0147] The specific computation process is as follows: The hash algorithm first converts the key seed string into binary data, then pads the data to meet a specific length requirement. Next, the data is divided into several data blocks, and each data block undergoes multiple rounds of compression function operations with the current hash state, finally outputting a fixed-length hash value. This hash value is then used as the dynamic encryption key.

[0148] The validity period of this dynamic encryption key is bound to the user's task time window: within the time window, i.e., when the current access timestamp falls between the task's start and end timestamps, the key is valid; outside the time window, the key automatically expires. Because key generation depends entirely on the time window string, once the window ends, although the key corresponding to that string can be recalculated, subsequent access requests outside the window will be rejected in step S200 or S400 and will not proceed to this encryption step.

[0149] For example, the key seed string "2026-06-09 08:00:00 2026-06-09 17:00:00" is input into the SHA-256 hash algorithm, and a 32-byte hash value is obtained after processing. This hash value is used as a dynamic encryption key, for example, a3f5c2e1b8d9a7c3e4f6a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2.

[0150] Furthermore, the spatial accuracy of the target spatial region geographic information is downgraded according to the granularity of the target data return. The target spatial region geographic information after spatial accuracy downgrade is encrypted using an encryption algorithm corresponding to the target encryption strength and a dynamic encryption key. The encrypted and spatially downgraded target spatial region geographic information is then returned to the user.

[0151] Specifically, the spatial accuracy of the target spatial region geographic information is downgraded according to the granularity of the returned target data. An encryption algorithm corresponding to the target encryption strength and a dynamic encryption key are used to encrypt the downgraded target spatial region geographic information. The encrypted and downgraded target spatial region geographic information is then returned to the user, including:

[0152] The precision level for downgrading the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information is determined based on the target data return granularity. The precision downgrading process is then performed on the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information according to the precision level, resulting in the target spatial region geographic information after spatial precision downgrading. The target data return granularity represents the allowed spatial coordinate precision to be returned to the user based on the current spatial data access level. The higher the current spatial data access level, the finer the target data return granularity, and the higher the allowed spatial coordinate precision.

[0153] The corresponding symmetric encryption algorithm and encryption key length are determined based on the target encryption strength, and a key segment with a length equal to the encryption key length is extracted from the dynamic encryption key as a valid encryption key;

[0154] The sequence of all coordinate points in the geographic information of the target spatial region after spatial accuracy downgrading is converted into a binary data stream. The binary data stream is then encrypted using the symmetric encryption algorithm and the valid encryption key to generate encrypted geographic information data, which is then returned to the user.

[0155] First, the precision level for downgrading the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information is determined based on the target data return granularity. Then, the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information are downgraded according to the precision level to obtain the target spatial region geographic information after spatial precision downgrading. Here, the target data return granularity represents the spatial coordinate precision allowed to be returned to the user based on the current spatial data access level. The higher the current spatial data access level, the finer the target data return granularity and the higher the allowed spatial coordinate precision.

[0156] Specifically, based on the granularity of the target data return, the precision level for downgrading the longitude and latitude values ​​of all coordinate points in the geographic information of the target spatial region is determined. The granularity of the target data return represents the allowed spatial coordinate precision to be returned to the user based on the current spatial data access level: the higher the current spatial data access level, the finer the granularity of the target data return, and the higher the allowed spatial coordinate precision.

[0157] The specific method for accuracy downgrading is as follows: For each coordinate point in the geographic information, according to the preset accuracy level, retain a specified number of decimal places and discard unnecessary decimal places. For example: coarse granularity: retain the integer part of the longitude and latitude values ​​and two decimal places; medium granularity: retain four decimal places; fine granularity: retain six decimal places. The target data return granularity corresponds to the current spatial data access level according to the following rules: when the current spatial data access level is level one or level two, the target data return granularity is coarse granularity, which is only suitable for public queries that only require a general location or regional overview scenarios for low-privilege users; when the current spatial data access level is level three, the target data return granularity is medium granularity, which is suitable for regular access scenarios for general staff; when the current spatial data access level is level four or level five, the target data return granularity is fine granularity, which is suitable for precise operations by high-privilege users or precise operation scenarios by users with the highest privileges. One degree of longitude corresponds to approximately 111 kilometers on the Earth's surface, and one degree of latitude corresponds to approximately 111 kilometers. Therefore, a ground precision of two decimal places corresponds to approximately 1.1 kilometers, four decimal places to approximately 11 meters, and six decimal places to approximately 0.11 meters. The security sensitivity level of the target spatial area has a corrective effect on the granularity selection: when the security sensitivity level of the target spatial area is Level 1, even if the current spatial data access level is Level 4 or Level 5, it is forcibly downgraded to medium granularity to ensure that the geographic information of highly sensitive areas is not leaked with high precision; when the security sensitivity level is Level 2 or Level 3, the corresponding granularity is selected normally according to the current spatial data access level, and no forced downgrading is performed.

[0158] For example, the target data is returned at a medium granularity, requiring four decimal places. The original geographic information contains a coordinate point (108.922200°, 34.258300°). After precision downgrading, this coordinate point becomes (108.9222°, 34.2583°), with the actual value being (108.9222, 34.2583). If the original coordinate precision is higher, such as (108.922234°, 34.258312°), then it is downgraded to (108.9222°, 34.2583°).

[0159] Secondly, based on the target encryption strength, the corresponding symmetric encryption algorithm and encryption key length are determined, and a key segment with a length equal to the encryption key length is extracted from the dynamic encryption key as a valid encryption key.

[0160] Specifically, the process involves determining the corresponding symmetric encryption algorithm and encryption key length based on the target encryption strength, and extracting a key segment of equal length from the dynamic encryption key as the effective encryption key, including:

[0161] Obtain a preset encryption strength and encryption algorithm mapping table. The encryption strength and encryption algorithm mapping table contains multiple correspondences between encryption strength and symmetric encryption algorithm and encryption key length. The higher the encryption strength, the higher the security level of the corresponding symmetric encryption algorithm and the longer the corresponding encryption key length.

[0162] Based on the target encryption strength, look up the corresponding symmetric encryption algorithm and encryption key length in the encryption strength to encryption algorithm mapping table;

[0163] Starting from the first byte of the dynamic encryption key, a byte sequence with a length equal to the length of the encryption key is extracted as the valid encryption key.

[0164] First, obtain a pre-defined encryption strength to encryption algorithm mapping table. This table contains multiple correspondences between encryption strengths, symmetric encryption algorithms, and encryption key lengths. Higher encryption strength corresponds to a higher security level of the symmetric encryption algorithm and a longer encryption key length. A pre-stored encryption strength to encryption algorithm mapping table is also included.

[0165] For example, the mapping table of encryption strength and encryption algorithm contains the following correspondences between multiple encryption strengths, symmetric encryption algorithms, and encryption key lengths: Low-strength encryption: AES-128 algorithm, encryption key length is 128 bits (16 bytes); Medium-strength encryption: AES-192 algorithm, encryption key length is 192 bits (24 bytes); High-strength encryption: AES-256 algorithm, encryption key length is 256 bits (32 bytes).

[0166] Secondly, based on the target encryption strength, the corresponding symmetric encryption algorithm and key length are looked up in the encryption strength-to-encryption algorithm mapping table. Using the target encryption strength as the query keyword, an exact match is performed in the encryption strength-to-encryption algorithm mapping table to obtain the corresponding symmetric encryption algorithm name and key length. For example, if the target encryption strength is medium strength, the query yields the symmetric encryption algorithm AES-192 and the key length 24 bytes.

[0167] Next, starting from the first byte of the dynamic encryption key, a byte sequence of length equal to the encryption key length is extracted as the valid encryption key. To obtain the dynamic encryption key, starting from its first byte, a corresponding number of bytes are continuously extracted according to the encryption key length obtained from the encryption strength to encryption algorithm mapping table. For example, if the dynamic encryption key is a 32-byte hash value and the encryption key length is 24 bytes, then bytes 0 to 23 (a total of 24 bytes) are extracted as the valid encryption key.

[0168] Finally, the sequence of all coordinate points contained in the geographic information of the target spatial region after spatial accuracy downgrading is converted into a binary data stream. The binary data stream is then encrypted using a symmetric encryption algorithm and a valid encryption key to generate encrypted geographic information data, which is then returned to the user.

[0169] Specifically, the entire sequence of coordinate points contained in the geographic information of the target spatial region after spatial precision downgrading is converted into a binary data stream. The conversion method is as follows: according to a predetermined data exchange format, such as GeoJSON or binary encoding format, the coordinate point sequence, attribute information, etc., are organized into a continuous byte sequence. Then, a symmetric encryption algorithm obtained from the encryption strength-to-encryption algorithm mapping table and a truncated valid encryption key are used to encrypt the aforementioned binary data stream. The encryption operation uses a symmetric encryption mode, such as CBC mode, and a preset initialization vector. The encryption operation outputs encrypted geographic information data. Finally, the encrypted geographic information data is returned to the user terminal that initiated the access request through a communication interface. The user terminal decrypts the data using a key derived from the same user task time window and restores the geographic information according to the precision corresponding to its permissions.

[0170] For example, the geographic information data of the high-tech zone science park plots, after being downgraded in accuracy, is converted into a binary data stream, encrypted using the AES-192 algorithm and a truncated 24-byte valid encryption key to generate ciphertext data. This ciphertext data is then returned to the user's surveying terminal.

[0171] In this embodiment of the invention, hierarchical encryption and dynamic key management based on the current spatial data access level are implemented. First, a predefined mapping table is used to map access levels to differentiated encryption strengths and data return granularities. This allows high-privilege users to obtain high-precision, low-encryption geographic information, while low-privilege users obtain low-precision, high-encryption geographic information. This ensures on-demand access to sensitive data while preventing low-privilege users from reconstructing sensitive details from high-precision information. Second, dynamic encryption keys are generated based on the user's task time window, strictly binding the key's lifecycle to the task window. Keys automatically expire outside the window, avoiding the security risks caused by the long-term validity of static keys. Finally, combining spatial precision downgrading with symmetric encryption, data precision is reduced before encryption transmission, forming dual protection: even if the encryption is cracked, attackers only obtain low-precision, coarse data; even if the downgraded data is intercepted, the ciphertext cannot be deciphered by those without the key. This step comprehensively balances data availability and transmission security, enabling smart city geographic information services to adaptively provide appropriate security and precision guarantees for users with different permissions.

[0172] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects:

[0173] This invention provides a hierarchical encryption method and system for access control of geographic information in smart cities, realizing dynamic hierarchical access control of geographic information in smart cities. It accurately calculates the spatial distance between the user's current location and the target area, providing a basis for spatiotemporal compliance judgment; it integrates static identity and historical behavior characteristics, uses a pre-trained user access level evaluation model to output a basic access level, and combines task time window matching degree and spatial distance to generate a spatiotemporal joint correction factor; it performs multiplication or subtraction correction on the basic spatial data access level according to the factor type, so that permissions decay smoothly with task progress or rigidly downgrade violations; it intercepts low-level requests through threshold comparison; it dynamically selects encryption strength and data return granularity based on the current level, and uses the task time window to generate a lifecycle-bound dynamic key for hierarchical encryption of downgraded geographic information. This invention organically integrates spatiotemporal context awareness, dynamic permission correction, and hierarchical encryption, effectively solving the problems of permission retention and unauthorized access caused by static authorization, and effectively improving the security of geographic information transmission and use while ensuring the flexibility of business access.

[0174] Example 2, as Figure 4As shown, this invention provides a hierarchical encrypted smart city geographic information access control system, the system comprising:

[0175] The request parsing and ranging module 11 is used to receive a user's access request for geographic information of a target spatial area, extract the user role type, current access timestamp and user's current spatial location carried in the access request, and calculate the spatial distance between the user's current spatial location and the target spatial area.

[0176] The level factor calculation module 12 is used to determine the user's basic spatial data access level according to the user role type, and to determine the spatiotemporal joint correction factor according to the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance.

[0177] Current level correction module 13 is used to correct the basic spatial data access level using the spatiotemporal joint correction factor to obtain the user's current spatial data access level;

[0178] The level rejection determination module 14 is used to reject the access request when the current spatial data access level is lower than a preset access level threshold;

[0179] The encryption strategy determination module 15 is used to determine a corresponding hierarchical encryption strategy based on the current spatial data access level when the current spatial data access level is higher than or equal to the preset access level threshold. The hierarchical encryption strategy includes encryption strength and data return granularity.

[0180] In one embodiment, the request resolution ranging module 11 is further configured to:

[0181] Receive a user's access request for geographic information of a target spatial area, and extract the user role type and current access timestamp from the access request;

[0182] Obtain the user's current spatial location carried in the access request, wherein the user's current spatial location includes longitude coordinates and latitude coordinates;

[0183] Obtain the spatial boundary of the target spatial region, wherein the spatial boundary is represented by a closed polygon composed of the coordinate sequence of the boundary points of the target spatial region;

[0184] Calculate the shortest Euclidean distance from the user's current spatial location to the closed polygon, and use the shortest Euclidean distance as the spatial distance.

[0185] In one embodiment, the level factor calculation module 12 is further configured to:

[0186] The determination of the user's basic space data access level based on the user role type includes:

[0187] Acquire multi-dimensional user profile data of the user, including user role type, security level of the department to which the user belongs, historical access space range of the user in a preset historical period, and historical access frequency of the user in the preset historical period.

[0188] The user role type is converted into a one-hot encoded vector, the security level of the user's department is converted into a normalized value, the historical access space range is converted into a normalized space range value, and the historical access frequency is converted into a normalized frequency value.

[0189] The one-hot encoded vector and the normalized numerical value are used as static identity features, and the normalized spatial range value and the normalized frequency value are used as historical behavior features.

[0190] The static identity features and the historical behavior features are input into a pre-trained user access level evaluation model. The user access level evaluation model encodes the static identity features and the historical behavior features respectively, and then performs weighted fusion through a gating fusion mechanism to output the probability distribution of multiple access levels. The access level with the highest probability is taken as the user's basic spatial data access level.

[0191] The pre-training process of the user access level assessment model includes:

[0192] Obtain a historical user access behavior dataset. Each data entry in the historical user access behavior dataset contains a historical user's static identity features, historical behavior features, and a corresponding labeled access level label. The labeled access level label is a multi-category label in one-hot encoding format, and the bit with a value of one corresponds to the historical user's actual access level.

[0193] A user access level evaluation model is constructed, comprising a static identity feature encoding channel, a historical behavior feature encoding channel, a gating fusion layer, and an output layer. The static identity feature encoding channel takes the static identity features as input and outputs a static identity feature vector. The historical behavior feature encoding channel takes the historical behavior features as input and outputs a historical behavior feature vector. The gating fusion layer calculates the gating weights of the static identity feature vector and the historical behavior feature vector, and performs weighted fusion of the static identity feature vector and the historical behavior feature vector according to the gating weights to output a fused feature vector. The output layer maps the fused feature vector to a probability distribution of multiple access levels through a Softmax activation function.

[0194] Using the static identity features and historical behavior features of the historical users as input features, the labeled access level tags as output tags, and minimizing the cross-entropy loss function as the training objective, the user access level evaluation model is trained in a supervised manner until the verification convergence is obtained, thus obtaining the trained user access level evaluation model.

[0195] The spatiotemporal joint correction factor is determined based on the matching relationship between the current access timestamp and the user's corresponding user work task time window, as well as the spatial distance, including:

[0196] Obtain the user's work task time window, which includes the work task start timestamp and the work task end timestamp.

[0197] Obtain the task space range boundary corresponding to the user's work task. The task space range boundary is formed by the union of the space range boundaries of all target space regions associated with the user's work task.

[0198] Determine whether the current access timestamp is within the user's work task time window, and determine whether the target space region and the task space range boundary intersect;

[0199] The spatial distance is compared with a preset spatial distance threshold to determine whether the spatial distance is less than or equal to the preset spatial distance threshold, wherein the preset spatial distance threshold is a preset multiple of the radius of the outer circle of the spatial range boundary of the target spatial region;

[0200] When the current access timestamp is within the user's work task time window, and the target space region intersects with the boundary of the task space range, and the spatial distance is less than or equal to the preset spatial distance threshold, calculate the remaining time from the current access timestamp to the end timestamp of the work task, divide the remaining time by the total time of the user's work task time window to obtain the matching degree within the time window, and use the matching degree within the time window as a spatiotemporal joint correction factor;

[0201] When the current access timestamp is outside the user's work task time window, or the target space region does not intersect with the boundary of the task space range, or the spatial distance is greater than the preset spatial distance threshold, the preset maximum correction value is used as the spatiotemporal joint correction factor, wherein the preset maximum correction value is the value 1.

[0202] In one embodiment, the current level correction module 13 is further configured to:

[0203] Obtain the level value corresponding to the access level of the basic spatial data, wherein the level value is a positive integer, and the higher the access level, the larger the corresponding level value;

[0204] When the spatiotemporal joint correction factor is the matching degree within the time window, the level value of the basic spatial data access level is multiplied by the matching degree within the time window, the product result is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level.

[0205] When the spatiotemporal joint correction factor is a preset maximum correction value, the level value of the basic spatial data access level is subtracted from the preset maximum correction value, the result of the subtraction is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level.

[0206] In one embodiment, the encryption policy determination module 15 is further configured to:

[0207] Obtain a preset spatial data access level and encryption strategy mapping table. The spatial data access level and encryption strategy mapping table contains multiple correspondences between spatial data access levels and hierarchical encryption strategies. Each hierarchical encryption strategy includes encryption strength and data return granularity. In the spatial data access level and encryption strategy mapping table, the higher the spatial data access level, the lower the corresponding target encryption strength and the finer the target data return granularity.

[0208] Based on the current spatial data access level, query the corresponding target hierarchical encryption policy in the spatial data access level and encryption policy mapping table, and obtain the target encryption strength and target data return granularity in the target hierarchical encryption policy;

[0209] Obtain the start timestamp and end timestamp of the user's work task time window, and concatenate the string representation of the start timestamp and the string representation of the end timestamp in order to form a key seed string;

[0210] The key seed string is input into a hash algorithm, which performs multiple rounds of iterative compression operations on the key seed string and outputs a hash value of fixed length. The hash value is used as a dynamic encryption key, wherein the dynamic encryption key is valid within the user's work task time window and automatically expires outside the user's work task time window.

[0211] According to the target data return granularity, the spatial accuracy of the target spatial region geographic information is downgraded. The encryption algorithm corresponding to the target encryption strength and the dynamic encryption key are used to encrypt the spatially downgraded target spatial region geographic information. The encrypted and spatially downgraded target spatial region geographic information is then returned to the user.

[0212] Specifically, the process involves: performing spatial precision downgrading on the target spatial region geographic information according to the target data return granularity; encrypting the target spatial region geographic information after spatial precision downgrading using the encryption algorithm corresponding to the target encryption strength and the dynamic encryption key; and returning the encrypted and spatially precision downgraded target spatial region geographic information to the user.

[0213] The precision level for downgrading the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information is determined based on the target data return granularity. The precision downgrading process is then performed on the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information according to the precision level, resulting in the target spatial region geographic information after spatial precision downgrading. The target data return granularity represents the allowed spatial coordinate precision to be returned to the user based on the current spatial data access level. The higher the current spatial data access level, the finer the target data return granularity, and the higher the allowed spatial coordinate precision.

[0214] The corresponding symmetric encryption algorithm and encryption key length are determined based on the target encryption strength, and a key segment with a length equal to the encryption key length is extracted from the dynamic encryption key as a valid encryption key;

[0215] The sequence of all coordinate points in the geographic information of the target spatial region after spatial accuracy downgrading is converted into a binary data stream. The binary data stream is then encrypted using the symmetric encryption algorithm and the valid encryption key to generate encrypted geographic information data, which is then returned to the user.

[0216] Specifically, the process involves determining the corresponding symmetric encryption algorithm and encryption key length based on the target encryption strength, and extracting a key segment of equal length from the dynamic encryption key as the effective encryption key, including:

[0217] Obtain a preset encryption strength and encryption algorithm mapping table. The encryption strength and encryption algorithm mapping table contains multiple correspondences between encryption strength and symmetric encryption algorithm and encryption key length. The higher the encryption strength, the higher the security level of the corresponding symmetric encryption algorithm and the longer the corresponding encryption key length.

[0218] Based on the target encryption strength, look up the corresponding symmetric encryption algorithm and encryption key length in the encryption strength to encryption algorithm mapping table;

[0219] Starting from the first byte of the dynamic encryption key, a byte sequence with a length equal to the length of the encryption key is extracted as the valid encryption key.

[0220] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A hierarchical encryption method for access control of geographic information in smart cities, characterized in that, The method includes: Receive a user's access request for geographic information of a target spatial region, extract the user role type, current access timestamp and user's current spatial location carried in the access request, and calculate the spatial distance between the user's current spatial location and the target spatial region; The user's basic spatial data access level is determined based on the user role type, and the spatiotemporal joint correction factor is determined based on the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance. The spatiotemporal joint correction factor is used to correct the basic spatial data access level to obtain the user's current spatial data access level; When the current spatial data access level is lower than a preset access level threshold, the access request is rejected; When the current spatial data access level is higher than or equal to the preset access level threshold, a corresponding hierarchical encryption strategy is determined based on the current spatial data access level. The hierarchical encryption strategy includes encryption strength and data return granularity.

2. The hierarchical encryption method for access control of geographic information in smart cities according to claim 1, characterized in that, Receive a user's access request for geographic information of a target spatial region, extract the user role type, current access timestamp, and user's current spatial location carried in the access request, and calculate the spatial distance between the user's current spatial location and the target spatial region, including: Receive a user's access request for geographic information of a target spatial area, and extract the user role type and current access timestamp from the access request; Obtain the user's current spatial location carried in the access request, wherein the user's current spatial location includes longitude coordinates and latitude coordinates; Obtain the spatial boundary of the target spatial region, wherein the spatial boundary is represented by a closed polygon composed of the coordinate sequence of the boundary points of the target spatial region; Calculate the shortest Euclidean distance from the user's current spatial location to the closed polygon, and use the shortest Euclidean distance as the spatial distance.

3. The hierarchical encryption method for access control of geographic information in smart cities according to claim 1, characterized in that, Determining the user's basic space data access level based on the user role type includes: Acquire multi-dimensional user profile data of the user, including user role type, security level of the department to which the user belongs, historical access space range of the user in a preset historical period, and historical access frequency of the user in the preset historical period. The user role type is converted into a one-hot encoded vector, the security level of the user's department is converted into a normalized value, the historical access space range is converted into a normalized space range value, and the historical access frequency is converted into a normalized frequency value. The one-hot encoded vector and the normalized numerical value are used as static identity features, and the normalized spatial range value and the normalized frequency value are used as historical behavior features. The static identity features and the historical behavior features are input into a pre-trained user access level evaluation model. The user access level evaluation model encodes the static identity features and the historical behavior features respectively, and then performs weighted fusion through a gating fusion mechanism to output the probability distribution of multiple access levels. The access level with the highest probability is taken as the user's basic spatial data access level.

4. The hierarchical encryption smart city geographic information access control method according to claim 3, characterized in that, The pre-training process of the user access level assessment model includes: Obtain a historical user access behavior dataset. Each data entry in the historical user access behavior dataset contains a historical user's static identity features, historical behavior features, and a corresponding labeled access level label. The labeled access level label is a multi-category label in one-hot encoding format, and the bit with a value of one corresponds to the historical user's actual access level. A user access level evaluation model is constructed, comprising a static identity feature encoding channel, a historical behavior feature encoding channel, a gating fusion layer, and an output layer. The static identity feature encoding channel takes the static identity features as input and outputs a static identity feature vector. The historical behavior feature encoding channel takes the historical behavior features as input and outputs a historical behavior feature vector. The gating fusion layer calculates the gating weights of the static identity feature vector and the historical behavior feature vector, and performs weighted fusion of the static identity feature vector and the historical behavior feature vector according to the gating weights to output a fused feature vector. The output layer maps the fused feature vector to a probability distribution of multiple access levels through a Softmax activation function. Using the static identity features and historical behavior features of the historical users as input features, the labeled access level tags as output tags, and minimizing the cross-entropy loss function as the training objective, the user access level evaluation model is trained in a supervised manner until the verification convergence is obtained, thus obtaining the trained user access level evaluation model.

5. The hierarchical encryption method for access control of geographic information in smart cities according to claim 1, characterized in that, Based on the matching relationship between the current access timestamp and the user's corresponding user work task time window, and the spatial distance, a spatiotemporal joint correction factor is determined, including: Obtain the user's work task time window, which includes the work task start timestamp and the work task end timestamp. Obtain the task space range boundary corresponding to the user's work task. The task space range boundary is formed by the union of the space range boundaries of all target space regions associated with the user's work task. Determine whether the current access timestamp is within the user's work task time window, and determine whether the target space region and the task space range boundary intersect; The spatial distance is compared with a preset spatial distance threshold to determine whether the spatial distance is less than or equal to the preset spatial distance threshold, wherein the preset spatial distance threshold is a preset multiple of the radius of the outer circle of the spatial range boundary of the target spatial region; When the current access timestamp is within the user's work task time window, and the target space region intersects with the boundary of the task space range, and the spatial distance is less than or equal to the preset spatial distance threshold, calculate the remaining time from the current access timestamp to the end timestamp of the work task, divide the remaining time by the total time of the user's work task time window to obtain the matching degree within the time window, and use the matching degree within the time window as a spatiotemporal joint correction factor; When the current access timestamp is outside the user's work task time window, or the target space region does not intersect with the boundary of the task space range, or the spatial distance is greater than the preset spatial distance threshold, the preset maximum correction value is used as the spatiotemporal joint correction factor, wherein the preset maximum correction value is the value 1.

6. The hierarchical encryption method for access control of geographic information in smart cities according to claim 1, characterized in that, The user's current spatial data access level is obtained by correcting the basic spatial data access level using the spatiotemporal joint correction factor, including: Obtain the level value corresponding to the access level of the basic spatial data, wherein the level value is a positive integer, and the higher the access level, the larger the corresponding level value; When the spatiotemporal joint correction factor is the matching degree within the time window, the level value of the basic spatial data access level is multiplied by the matching degree within the time window, the product result is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level. When the spatiotemporal joint correction factor is a preset maximum correction value, the level value of the basic spatial data access level is subtracted from the preset maximum correction value, the result of the subtraction is rounded down and used as the corrected level value, and the access level corresponding to the corrected level value is used as the user's current spatial data access level.

7. The hierarchical encryption method for access control of geographic information in smart cities according to claim 1, characterized in that, When the current spatial data access level is higher than or equal to the preset access level threshold, a corresponding hierarchical encryption strategy is determined based on the current spatial data access level, including: Obtain a preset spatial data access level and encryption strategy mapping table. The spatial data access level and encryption strategy mapping table contains multiple correspondences between spatial data access levels and hierarchical encryption strategies. Each hierarchical encryption strategy includes encryption strength and data return granularity. In the spatial data access level and encryption strategy mapping table, the higher the spatial data access level, the lower the corresponding target encryption strength and the finer the target data return granularity. Based on the current spatial data access level, query the corresponding target hierarchical encryption policy in the spatial data access level and encryption policy mapping table, and obtain the target encryption strength and target data return granularity in the target hierarchical encryption policy; Obtain the start timestamp and end timestamp of the user's work task time window, and concatenate the string representation of the start timestamp and the string representation of the end timestamp in order to form a key seed string; The key seed string is input into a hash algorithm, which performs multiple rounds of iterative compression operations on the key seed string and outputs a hash value of fixed length. The hash value is used as a dynamic encryption key, wherein the dynamic encryption key is valid within the user's work task time window and automatically expires outside the user's work task time window. According to the target data return granularity, the spatial accuracy of the target spatial region geographic information is downgraded. The encryption algorithm corresponding to the target encryption strength and the dynamic encryption key are used to encrypt the spatially downgraded target spatial region geographic information. The encrypted and spatially downgraded target spatial region geographic information is then returned to the user.

8. The hierarchical encryption method for access control of geographic information in smart cities according to claim 7, characterized in that, According to the target data return granularity, the spatial accuracy of the target spatial region geographic information is downgraded. Using the encryption algorithm corresponding to the target encryption strength and the dynamic encryption key, the downgraded target spatial region geographic information is encrypted. The encrypted and downgraded target spatial region geographic information is then returned to the user, including: The precision level for downgrading the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information is determined based on the target data return granularity. The precision downgrading process is then performed on the longitude and latitude values ​​of all coordinate points in the target spatial region geographic information according to the precision level, resulting in the target spatial region geographic information after spatial precision downgrading. The target data return granularity represents the allowed spatial coordinate precision to be returned to the user based on the current spatial data access level. The higher the current spatial data access level, the finer the target data return granularity, and the higher the allowed spatial coordinate precision. The corresponding symmetric encryption algorithm and encryption key length are determined based on the target encryption strength, and a key segment with a length equal to the encryption key length is extracted from the dynamic encryption key as a valid encryption key; The sequence of all coordinate points in the geographic information of the target spatial region after spatial accuracy downgrading is converted into a binary data stream. The binary data stream is then encrypted using the symmetric encryption algorithm and the valid encryption key to generate encrypted geographic information data, which is then returned to the user.

9. The hierarchical encryption method for access control of geographic information in smart cities according to claim 8, characterized in that, Based on the target encryption strength, a corresponding symmetric encryption algorithm and encryption key length are determined. A key segment with a length equal to the encryption key length is extracted from the dynamic encryption key as a valid encryption key, including: Obtain a preset encryption strength and encryption algorithm mapping table. The encryption strength and encryption algorithm mapping table contains multiple correspondences between encryption strength and symmetric encryption algorithm and encryption key length. The higher the encryption strength, the higher the security level of the corresponding symmetric encryption algorithm and the longer the corresponding encryption key length. Based on the target encryption strength, look up the corresponding symmetric encryption algorithm and encryption key length in the encryption strength to encryption algorithm mapping table; Starting from the first byte of the dynamic encryption key, a byte sequence with a length equal to the length of the encryption key is extracted as the valid encryption key.

10. A hierarchical encrypted smart city geographic information access control system, characterized in that, The system is used to implement the hierarchical encryption smart city geographic information access control method according to any one of claims 1 to 9, the system comprising: The request parsing and ranging module is used to receive user access requests for geographic information of a target spatial area, extract the user role type, current access timestamp and current spatial location carried in the access request, and calculate the spatial distance between the current spatial location of the user and the target spatial area. The level factor calculation module is used to determine the user's basic spatial data access level based on the user role type, and to determine the spatiotemporal joint correction factor based on the matching relationship between the current access timestamp and the user's corresponding user work task time window and the spatial distance. The current level correction module is used to correct the basic spatial data access level using the spatiotemporal joint correction factor to obtain the user's current spatial data access level. The level rejection determination module is used to reject the access request when the current spatial data access level is lower than a preset access level threshold; The encryption strategy determination module is used to determine a corresponding hierarchical encryption strategy based on the current spatial data access level when the current spatial data access level is higher than or equal to the preset access level threshold. The hierarchical encryption strategy includes encryption strength and data return granularity.