Resource acquisition method, system, server and storage medium

文档序号:153400 发布日期:2021-10-26 浏览:14次 中文

阅读说明:本技术 资源获取方法、系统、服务器及存储介质 (Resource acquisition method, system, server and storage medium ) 是由 殷佳欣 于 2020-04-23 设计创作,主要内容包括:本申请提供了一种资源获取方法、系统、服务器及存储介质,资源访问方法包括:终端设备向服务器发送资源访问请求信息,资源访问请求信息中携带有用户身份标识和待访问资源标识;服务器对用户身份标识进行认证,若认证通过,服务器获取终端设备的位置信息,位置信息包括地理位置信息以及定位辅助信息;服务器对终端设备的位置信息进行校验;若校验通过,服务器将与待访问资源标识对应的访问令牌发送至终端设备;终端设备根据访问令牌获取待访问资源。由于在终端设备获取待访问资源前,需要对用户身份标识、地理位置信息以及定位辅助信息进行验证,降低了将待访问资源发送至不相关设备的几率,从而提高了资源访问的安全性。(The application provides a resource acquisition method, a system, a server and a storage medium, wherein the resource access method comprises the following steps: the terminal equipment sends resource access request information to the server, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed; the server authenticates the user identity, and if the user identity passes the authentication, the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information; the server checks the position information of the terminal equipment; if the verification is passed, the server sends an access token corresponding to the resource identifier to be accessed to the terminal equipment; and the terminal equipment acquires the resource to be accessed according to the access token. Before the terminal equipment acquires the resource to be accessed, the user identity identification, the geographic position information and the positioning auxiliary information need to be verified, so that the probability of sending the resource to be accessed to irrelevant equipment is reduced, and the safety of resource access is improved.)

1. A resource acquisition method, comprising:

the method comprises the steps that terminal equipment sends resource access request information of access target equipment to a server, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed;

the server passes the authentication of the user identity;

the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information;

the server checks the position information of the terminal equipment;

the server sends an access token corresponding to the resource identifier to be accessed to the terminal equipment;

and the terminal equipment acquires the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

2. A resource acquisition method, comprising:

the method comprises the steps that a server obtains resource access request information of access target equipment sent by terminal equipment, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed;

the server passes the authentication of the user identity;

the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information;

the server checks the position information of the terminal equipment;

and the server sends the access token corresponding to the resource identifier to be accessed to the terminal equipment so as to instruct the terminal equipment to acquire the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

3. The resource acquisition method according to claim 1 or 2, wherein the positioning assistance information comprises positioning accuracy, positioning delay, positioning mode, moving speed and/or moving direction.

4. The resource acquisition method according to claim 3, wherein the server checks the location information of the terminal device, and includes:

and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the positioning auxiliary information meets a preset condition.

5. The resource acquisition method according to claim 4, wherein the resource to be accessed is phase information of a traffic light, and the positioning assistance information includes a moving direction;

correspondingly, the step of determining, by the server, that the terminal device is in a predetermined area according to the geographical location information, and determining that the positioning assistance information meets a preset condition includes:

and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the moving direction of the terminal equipment is consistent with a preset direction.

6. The method for acquiring resources of claim 5, wherein the positioning assistance information further includes positioning delay, and the determining that the positioning assistance information meets a preset condition further includes:

and determining that the positioning time delay is smaller than a preset time length.

7. The resource acquisition method according to claim 4, wherein the resource to be accessed is a navigation map, and the positioning assistance information includes a moving speed;

correspondingly, the step of determining, by the server, that the terminal device is in a predetermined area according to the geographical location information, and determining that the positioning assistance information meets a preset condition includes:

and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the moving speed of the terminal equipment is less than a preset speed.

8. The resource acquisition method according to claim 3, wherein the server checks the location information of the terminal device, and includes:

and the server determines that the terminal equipment is in a preset area according to the geographical position information and the positioning auxiliary information.

9. The resource acquisition method according to claim 8, wherein the resource to be accessed is status information of a door lock, and the positioning assistance information includes positioning accuracy;

correspondingly, the determining, by the server, that the terminal device is in the predetermined area according to the geographical location information and the positioning assistance information includes:

and the server calculates the position range of the terminal equipment according to the geographical position information and the positioning precision, and determines that the position range of the terminal equipment is located in a preset area.

10. The resource acquisition method according to any one of claims 1 to 9, wherein the server acquiring the location information of the terminal device includes:

the server acquires the position information of the terminal equipment acquired by the positioning device; wherein the positioning device comprises at least one of:

the positioning device built in the terminal equipment, the positioning device built in the target equipment, the positioning device within a preset range from the target equipment and the positioning device built in the third-party server.

11. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the resource acquisition method according to any one of claims 2 to 10 when executing the computer program.

12. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the resource acquisition method according to any one of claims 2 to 10.

13. A resource acquisition system comprising a terminal device, a target device, and the server of claim 11.

14. The resource acquisition system of claim 13 wherein the resource acquisition system further comprises a positioning device.

Technical Field

The present application relates to the field of access control, and in particular, to a resource acquisition method, system, server, and storage medium.

Background

When a user uses a terminal device to access resources, if the resources to be accessed are protected resources, a server or a target device generally needs to verify the authority of the terminal device, and the terminal device can acquire the resources to be accessed only if the verification is passed. For example, when a user uses a mobile phone to unlock a door lock, the user needs to verify the authority of the mobile phone at first, and only when the user passes the verification, the mobile phone can access the door lock to acquire the state information of the door lock, so that unlocking is realized. The prior authority verification method generally verifies a user identity or the distance between terminal equipment and target equipment, if the verification is passed, the terminal equipment can obtain protected resources, and because the user identity or the distance between the terminal equipment and the target equipment is easy to forge or have errors, irrelevant equipment can easily obtain the protected resources, the protected resources cannot be reasonably controlled, and the safety of resource access is influenced.

Disclosure of Invention

The embodiment of the application provides a resource acquisition method, a resource acquisition system, a server and a storage medium, which can carry out more reasonable control on protected resources and improve the security of resource access.

In a first aspect, an embodiment of the present application provides a resource obtaining method, including:

the method comprises the steps that terminal equipment sends resource access request information of access target equipment to a server, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed; the server authenticates the user identity; if the authentication is passed, the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information; the server checks the position information of the terminal equipment; if the verification is passed, the server sends an access token corresponding to the resource identifier to be accessed to the terminal equipment; and the terminal equipment acquires the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

In the above embodiment, the terminal device sends the resource access request information of the access target device to the server, the server first authenticates the user identity in the resource access request information, and if the authentication is passed, the server obtains the location information of the terminal device and verifies the location information of the terminal device; the position information comprises geographical position information and positioning auxiliary information, and the server can send the access token to the terminal equipment only when the position information passes the verification, and the terminal equipment is instructed to acquire the resource to be accessed corresponding to the identifier of the resource to be accessed from the target equipment according to the access token, so that the accuracy of the position information verification is improved, the probability of acquiring the resource to be accessed by irrelevant equipment is reduced, the reasonable control of the resource to be accessed is realized, and the safety of resource access is improved.

In a second aspect, an embodiment of the present application provides a resource obtaining method, including:

the method comprises the steps that a server obtains resource access request information of access target equipment sent by terminal equipment, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed; the server passes the authentication of the user identity; the server acquires the position information of the terminal equipment; the position information comprises geographical position information and positioning auxiliary information; the server checks the position information of the terminal equipment; and the server sends the access token corresponding to the resource identifier to be accessed to the terminal equipment so as to instruct the terminal equipment to acquire the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

In the above embodiment, when receiving the resource access request information of the access target device sent by the terminal device, the server authenticates the identity of the user, and verifies the location information of the terminal device, and only if the location information of the terminal device passes the verification, the terminal device is allowed to access the resource to be accessed, thereby reducing the probability that irrelevant devices acquire the resource to be accessed; and because the position information comprises the geographical position information and the positioning auxiliary information, the server checks the geographical position information of the terminal equipment and also increases the checking of the positioning auxiliary information, thereby improving the accuracy of position information checking, further reducing the probability that irrelevant equipment acquires the resource to be accessed, leading the resource to be accessed to be more reasonably controlled and improving the safety of resource access. And because the authentication of the user identity identification, the verification of the position information of the terminal equipment and the sending of the access token are all executed by the server, the server can conveniently and synchronously carry out authority updating on the terminal equipment and the target equipment, the condition that the use is influenced because any party cannot be updated in time is prevented, and the safety of resource access is further improved.

In a possible implementation manner of the second aspect, the positioning assistance information includes positioning accuracy, positioning delay, positioning manner, moving speed, and/or moving direction. The server acquires the geographical position information of the terminal equipment and corresponding position parameters in the positioning auxiliary information according to an actual application scene, and verifies the geographical position information and the positioning auxiliary information, for example, in one scene, the server verifies the geographical position information, the positioning precision and the positioning delay of the terminal equipment; in another scenario, the server verifies the geographic position information and the moving speed of the terminal device, so that the position parameters in the position information are fully utilized, and the accuracy of position information verification is improved.

Correspondingly, the server checks the position information of the terminal device, and the method comprises the following steps:

and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the positioning auxiliary information meets a preset condition. Namely, the geographic position information and the positioning auxiliary information are verified to be passed, and the position information is verified to be passed, so that counterfeiting or wrong geographic position information is prevented, the probability that irrelevant equipment acquires the resource to be accessed is reduced, and reasonable management and control of the resource to be accessed are realized.

In a possible implementation manner of the second aspect, the resource to be accessed is phase information of a traffic light, and the positioning assistance information includes a moving direction; correspondingly, the server determines that the terminal device is in a predetermined area according to the geographical location information, and determines that the positioning auxiliary information meets a preset condition, including: and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the moving direction of the terminal equipment is consistent with a preset direction. Traffic light phase information corresponding to different moving directions is different, and only when the terminal equipment is in a preset area and the moving direction of the terminal equipment is consistent with the preset direction, the corresponding traffic light phase information can be acquired, so that wrong authorization on irrelevant equipment is prevented, and therefore more reasonable management and control are conducted on resources to be accessed.

Optionally, the positioning assistance information further includes positioning time delay, and the determining that the positioning assistance information meets the preset condition further includes: and determining that the positioning time delay is smaller than a preset time length. If the positioning delay exceeds the preset time, when the server receives the geographical position information of the terminal equipment, the terminal equipment leaves the current position, and the geographical position information received by the server cannot reflect the current actual position of the terminal equipment. By checking the positioning time delay, the server can check the positioning time delay only if the positioning time delay is less than the preset time length, so that the accuracy of the geographical position information acquired by the server is improved.

In a possible implementation manner of the second aspect, the resource to be accessed is a navigation map, and the positioning assistance information includes a moving speed; correspondingly, the server determines that the terminal device is in a predetermined area according to the geographical location information, and determines that the positioning auxiliary information meets a preset condition, including: and the server determines that the terminal equipment is in a preset area according to the geographical position information, and determines that the moving speed of the terminal equipment is less than a preset speed. When the moving speed of the terminal equipment is too high, the server detects the position information of the terminal equipment, the terminal equipment already leaves the position for sending the position information, the acquired position information of the terminal equipment is inaccurate, and the accuracy of the position information acquired by the server is improved by checking the moving speed of the terminal equipment.

In a possible implementation manner of the second aspect, the passing of the verification of the location information of the terminal device by the server includes: and the server determines that the terminal equipment is in a preset area according to the geographical position information and the positioning auxiliary information. For example, the server determines that the terminal device is in the predetermined area according to the geographical location information, the moving speed and the positioning delay of the terminal device, or determines that the terminal device is in the predetermined area according to the geographical location information and the positioning precision of the terminal device, so that the accuracy of location information verification is improved, and the probability that irrelevant devices pass location information verification is reduced.

In a possible implementation manner of the second aspect, the resource to be accessed is state information of a door lock, and the positioning auxiliary information includes positioning accuracy; correspondingly, the determining, by the server, that the terminal device is in the predetermined area according to the geographical location information and the positioning assistance information includes: and the server calculates the position range of the terminal equipment according to the geographical position information and the positioning precision, and determines that the position range of the terminal equipment is located in a preset area. Since the server acquires the geographical location information with an error, the actual location of the terminal device may not be in the predetermined area when the geographical location information is in the predetermined area. And the position range of the terminal equipment is calculated according to the geographical position information and the positioning precision, and when the position range of the terminal equipment is determined to be located in the preset area, the probability that the terminal equipment is located in the preset area is higher, so that the accuracy of position information verification is improved, and the safety of the door lock is further improved.

In a possible implementation manner of the second aspect, the obtaining, by a server, the location information of the terminal device includes: the server acquires the position information of the terminal equipment acquired by the positioning device; wherein the positioning device comprises at least one of: the positioning device built in the terminal equipment, the positioning device built in the target equipment, the positioning device within a preset range from the target equipment and the positioning device built in the third-party server.

In a third aspect, an embodiment of the present application provides a resource obtaining apparatus, including:

the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring resource access request information of access target equipment, which is sent by terminal equipment, and the resource access request information carries a user identity identifier and a resource identifier to be accessed;

the authentication module is used for passing the authentication of the user identity;

the second acquisition module is used for acquiring the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information;

the verification module is used for verifying the position information of the terminal equipment;

and the sending module is used for sending the access token corresponding to the resource identifier to be accessed to the terminal equipment so as to instruct the terminal equipment to obtain the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

In a possible implementation manner of the third aspect, the positioning assistance information includes positioning accuracy, positioning delay, positioning manner, moving speed, and/or moving direction.

In a possible implementation manner of the third aspect, the checking module is specifically configured to:

and determining that the terminal equipment is in a preset area according to the geographical position information, and determining that the positioning auxiliary information meets a preset condition.

In a possible implementation manner of the third aspect, the resource to be accessed is phase information of a traffic light, and the positioning assistance information includes a moving direction;

correspondingly, the verification module is specifically configured to:

and determining that the terminal equipment is in a preset area according to the geographical position information, and determining that the moving direction of the terminal equipment is consistent with a preset direction.

In a possible implementation manner of the third aspect, the positioning assistance information further includes a positioning delay, and the checking module is further configured to: and determining that the positioning time delay is smaller than a preset time length.

In a possible implementation manner of the third aspect, the resource to be accessed is a navigation map, and the positioning assistance information includes a moving speed;

correspondingly, the verification module is specifically configured to:

and determining that the terminal equipment is in a preset area according to the geographical position information, and determining that the moving speed of the terminal equipment is less than a preset speed.

In a possible implementation manner of the third aspect, the checking module is specifically configured to: and determining that the terminal equipment is in a preset area according to the geographical position information and the positioning auxiliary information.

In a possible implementation manner of the third aspect, the resource to be accessed is state information of a door lock, and the positioning auxiliary information includes positioning accuracy;

correspondingly, the verification module is specifically configured to: and calculating the position range of the terminal equipment according to the geographical position information and the positioning precision, and determining that the position range of the terminal equipment is located in a preset area.

In a possible implementation manner of the third aspect, the second obtaining module is specifically configured to:

acquiring the position information of the terminal equipment acquired by a positioning device; wherein the positioning device comprises at least one of:

the positioning device built in the terminal equipment, the positioning device built in the target equipment, the positioning device within a preset range from the target equipment and the positioning device built in the third-party server.

In a fourth aspect, an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the resource obtaining method according to the second aspect when executing the computer program.

In a fifth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the resource obtaining method according to the second aspect.

In a sixth aspect, embodiments of the present application provide a computer program product, which, when run on an electronic device, causes the electronic device to execute the resource acquisition method according to the second aspect.

In a seventh aspect, an embodiment of the present application provides a resource obtaining system, including: a terminal device, a target device and the server of the fourth aspect.

In a possible implementation manner of the seventh aspect, the resource acquiring system further includes a positioning device.

It is to be understood that, the beneficial effects of the third to seventh aspects may be referred to the related description of the second aspect, and are not repeated herein.

Drawings

Fig. 1 is a schematic diagram of a resource acquisition system provided in an embodiment of the present application;

fig. 2 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;

fig. 3 is an application scenario diagram of a resource obtaining method according to an embodiment of the present application;

fig. 4 is an application scenario diagram of a resource obtaining method according to an embodiment of the present application;

fig. 5 is a diagram of another application scenario of the resource obtaining method according to the embodiment of the present application;

fig. 6 is a diagram of another application scenario of the resource obtaining method according to the embodiment of the present application;

fig. 7 is a diagram of another application scenario of the resource obtaining method according to the embodiment of the present application;

fig. 8 is a schematic flowchart of a resource obtaining method according to an embodiment of the present application;

fig. 9 is another schematic flowchart of a resource obtaining method according to an embodiment of the present application;

fig. 10 is a schematic flowchart of a resource obtaining method according to an embodiment of the present application;

fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application.

Detailed Description

In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".

Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.

Fig. 1 is a schematic diagram of a resource acquisition system according to an embodiment of the present application, and as shown in fig. 1, the resource acquisition system includes a terminal device 100, a server 200, and a target device 300. The target device 300 stores a resource to be accessed, where the resource to be accessed may be state information of a door lock, phase information of a traffic light, a navigation map, or a red packet grabbing link. The terminal device 100 sends resource access request information for accessing the target device to the server 200, the resource access request information includes a user identity and a resource identifier to be accessed, the server 200 authenticates the user identity, and if the user identity passes the authentication, the location information of the terminal device 100 is obtained, and the location information includes geographical location information and positioning auxiliary information. The server 200 checks the position information of the terminal device 100 according to the pre-acquired checking information, and if the checking is passed, sends an access token corresponding to the resource identifier to be accessed to the terminal device 100. The terminal device 100 sends the obtained access token to the target device 300, the target device 300 verifies the access token, and if the verification is passed, the terminal device obtains the resource to be accessed corresponding to the identifier of the resource to be accessed. For example, if the resource to be accessed is the state information of the door lock, the terminal device acquires the state information of the door lock corresponding to the identifier of the resource to be accessed, and controls the state information of the door lock to be changed into an unlocking state so as to unlock the door lock; if the resource to be accessed is a navigation map, the terminal equipment can download the navigation map corresponding to the identifier of the resource to be accessed. The server authenticates the user identity identification and verifies the position information of the terminal equipment before the terminal equipment acquires the resource to be accessed, the terminal equipment can acquire the resource to be accessed according to the access token only when the position information is verified to be passed, and the probability of acquiring the resource to be accessed by irrelevant equipment is reduced, so that the safety of resource access is improved.

In this embodiment, the terminal device may be a mobile phone, a tablet computer, a notebook computer, a vehicle-mounted terminal, and the like, and the specific type of the terminal device is not limited in this embodiment.

In a possible implementation manner, the resource obtaining system further includes a positioning device 400 for acquiring location information of the terminal device, where the positioning device may be built in the terminal device 100, or may be independent of the terminal device 100, and for example, the positioning device is a positioning device built in the target device 300, a positioning device within a predetermined range from the target device, or a positioning device built in a third-party server. If the positioning device is built in the terminal device 100, the position information of the positioning device is the position information of the terminal device 100. If the positioning device 400 and the terminal device 100 are two independent devices, the server 200 positions the terminal device 100 according to the position information of the terminal device 100 and/or the position information of the positioning device 400. For example, in an application scenario, the positioning apparatus 400 is a base station, and the server 300 calculates the location information of the terminal device 100 according to the location information of the base station and the coverage area of the base station registered by the terminal device 100. In another application scenario, a GPS positioning module is provided on the terminal device 100, and a WIFI positioning module is provided on the positioning device 400. When the satellite signal is good, the GPS positioning module of the terminal device 100 is selected for positioning, and the position information of the terminal device 100 is calculated based on the positioning information of the GPS positioning module. And when there is no satellite signal, selecting the WIFI positioning module of the positioning device 400 to perform positioning, and calculating the position information of the terminal device 100 according to the position information of the positioning device 400. Due to the fact that the corresponding positioning modes are selected in combination with different network environments, more accurate position information can be obtained in different scenes.

For ease of understanding, a terminal device according to an embodiment of the present application will be described first. Referring to fig. 2, fig. 2 is a schematic structural diagram of a terminal device 100 according to an embodiment of the present application.

The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

It is to be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation to the terminal device 100. In other embodiments of the present application, terminal device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.

The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.

A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.

In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.

The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.

The wireless communication function of the terminal device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.

The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in terminal device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied on the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.

The wireless communication module 160 may provide a solution for wireless communication applied to the terminal device 100, including Wireless Local Area Networks (WLANs), such as wireless fidelity (WIFI) networks, Bluetooth (BT), Global Navigation Satellite Systems (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.

In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150 and the antenna 2 is coupled to the wireless communication module 160 so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).

The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the terminal device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.

The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, a phonebook, etc.) created during use of the terminal device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the terminal device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.

The fingerprint sensor 180H is used to collect a fingerprint. The terminal device 100 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access to an application lock, fingerprint photographing, fingerprint incoming call answering and the like.

The touch sensor 180K is also called a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on the surface of the terminal device 100, different from the position of the display screen 194.

The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The terminal device 100 may receive a key input, and generate a key signal input related to user setting and function control of the terminal device 100.

The SIM card interface 195 is used to connect a SIM card. The terminal device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the terminal device 100 employs eSIM, namely: an embedded SIM card. The eSIM card may be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

The resource acquisition method provided by the embodiment of the present application is described below with reference to a specific application scenario.

In an application scenario, the resource acquisition method provided in the embodiment of the present application is used to open a door lock, as shown in fig. 3, in the scenario, the target device is the door lock, and the resource to be accessed is state information of the door lock.

The terminal equipment sends the resource access request information to the server according to the operation of the user, or the terminal equipment automatically triggers the sending of the resource access request information when entering a preset area. For example, as shown in fig. 4, when the terminal device is in the unlocking interface, if the touch operation of the user on the "unlock" icon is detected, the resource access request information is sent to the server. The resource access request information comprises a user identity identifier and a door lock state information identifier when a user registers, the user identity identifier can be account information of the user or an identification code of terminal equipment bound with the user identity, the door lock state information identifier can be a storage path of the door lock state information, and the door lock state information identifier corresponds to the door lock identifier.

And after receiving the resource access request information, the server authenticates the user identity, for example, verifies whether the user corresponding to the user identity has the access right of the door lock, and if the user corresponding to the user identity has the access right of the door lock, the authentication is passed. If the authentication is passed, the server acquires the position information of the terminal equipment, wherein the server can acquire the position information of the terminal equipment through a positioning device, and the positioning device can be a UWB positioning device positioned near the door lock. Specifically, the server obtains the identifier of the terminal device and the identifier of the positioning device according to the user identity identifier, and sends a positioning instruction to the positioning device corresponding to the identifier of the positioning device, wherein the positioning instruction includes the identifier of the terminal device. The positioning device acquires the relative position of the terminal equipment and the positioning device, namely the position information of the terminal equipment according to the identification of the terminal equipment, and sends the position information of the terminal equipment to the server. The position information comprises geographical position information and positioning auxiliary information, and the positioning auxiliary information comprises positioning accuracy.

And after the server acquires the position information of the terminal equipment, verifying the position information of the terminal equipment. Specifically, the server acquires check information corresponding to the door lock identifier, the check information includes a position parameter to be checked and a range corresponding to the position parameter to be checked, and the server checks the acquired position information according to the range corresponding to the position parameter to be checked. In this embodiment, the location parameters to be checked in the check information include geographic location information and positioning accuracy. The geographical position information is in a format of distance information and angle information, the distance information is a distance between the terminal device and the positioning device, and the angle information is an angle between the terminal device and a preset reference line. The geographical position information is set to be in a format of distance information and angle information, and the distance information and the angle information are verified respectively during position verification, for example, a range corresponding to the angle information is located in a set area outside a door, so that the terminal equipment can pass the verification only when being located outside the door, the door lock is opened, the accuracy of position information verification is improved, and the safety of the door lock is further improved.

For example, as shown in fig. 3, the set unlocking area is a sector area P with a radius of 2 meters and a straight line passing through the positioning device and parallel to the door as a reference line, and the angle is-30 ° to 30 °, and when the terminal device is located in the unlocking area, the door lock can be opened, that is, the user can unlock the door in the set area outside the door. In the location parameters to be checked, the range corresponding to the geographic location information is: the angle is-30 degrees to 30 degrees, and the distance is less than 2 meters. And the server calculates the position range of the terminal equipment according to the acquired geographical position information and the positioning precision of the terminal equipment, and determines whether the position range of the terminal equipment is located in a preset area.

For example, if the terminal device is located at the position a, the angle between the position a and the reference line is-10 °, the distance from the positioning device is 1.5 m, and the positioning accuracy is 0.05 m; the distance to the positioning device calculated according to the distance to the positioning device and the positioning precision is 1.45-1.55 meters and less than 2 meters, the angle is between-30 degrees and 30 degrees, the range corresponding to the geographic position information is consistent, and therefore the verification is passed. If the terminal equipment is located at the position B, the angle between the position B and the datum line is-60 degrees, the distance between the position B and the positioning device is 1 meter, the positioning accuracy is 0.05 meter, and the angle of the position B is not between-30 degrees and 30 degrees, so that the verification is not passed. If the terminal equipment is located at the position C, the angle between the position C and the datum line is 0 degrees, the distance between the terminal equipment and the positioning device is 1.9 meters, the positioning precision is 0.2 meters, the distance between the terminal equipment and the positioning device, which is calculated according to the distance between the terminal equipment and the positioning device and the positioning precision, is 1.7-2.1 meters, and possibly more than 2 meters, so that the terminal equipment does not pass the verification.

It should be noted that, the server may also verify the geographic location information and the positioning accuracy of the terminal device, respectively, and when it is determined that the terminal device is in the predetermined area according to the geographic location information and the positioning accuracy matches the preset positioning accuracy, the verification passes, for example, the preset positioning accuracy is 10 centimeters, and if the geographic location information of the terminal device is in the predetermined area and the positioning accuracy is 5 centimeters, the location information verification passes.

In another possible implementation manner, if the resource to be accessed is state information of a door lock, the positioning auxiliary information includes a positioning manner, that is, the position parameter to be checked in the verification information includes geographical position information and a positioning manner, and the server determines whether the terminal device is in a predetermined area according to the geographical position information of the terminal device, and determines whether the positioning manner is matched with a preset positioning manner. The preset positioning mode may be a UWB positioning mode. For example, the server acquires the position information sent by the terminal device and the position information sent by the UWB positioning device, and if the positioning mode corresponding to the position information sent by the terminal device is GPS positioning, the position information is not verified; and if the geographical position information passes the verification, the position information passes the verification. Because the positioning accuracy corresponding to different positioning modes is different, for example, the positioning accuracy corresponding to the UWB positioning mode can reach centimeter level, if the positioning mode in the position information is verified, the positioning accuracy meets the preset requirement, so that the accuracy of the obtained position information is improved, the probability of obtaining the state information of the door lock by irrelevant equipment is reduced, and the safety level of the access of the door lock is improved.

In other possible implementation manners, if the resource to be accessed is status information of a door lock, the positioning auxiliary information includes a positioning manner and positioning accuracy, and when the server determines that the current positioning manner is consistent with the preset positioning manner, the server also needs to determine whether the terminal device is in a predetermined area according to the geographical location information and the positioning accuracy, and if the terminal device is in the predetermined area, the location information passes the verification.

And if the position information passes the checking, the server sends the access token corresponding to the identification of the state information of the door lock to the terminal equipment. And after the terminal equipment acquires the access token, the access token is sent to the door lock, the door lock verifies the access token, and if the verification is passed, the terminal equipment acquires the state information of the door lock and changes the state information of the door lock into an unlocking state, so that the door lock is opened.

In the embodiment, after the user identity identification passes the authentication, the server also verifies the geographic position information, the positioning precision and the positioning mode of the terminal equipment, and the terminal equipment can open the door lock only when the geographic position information, the positioning precision and the positioning mode pass the verification, so that the accuracy of position information verification is improved, the probability of obtaining the state information of the door lock by irrelevant equipment is reduced, and the safety of the door lock is improved.

In another application scenario, the resource obtaining method provided in the embodiment of the present application is used to obtain phase information of a traffic light, as shown in fig. 5, a target device is a traffic light, and a resource to be accessed is phase information of the traffic light.

And when the terminal equipment enters the set range of the traffic light, sending resource access request information to the server according to the operation of the user, or automatically triggering the sending of the resource access request information. For example, when a vehicle enters a set range of traffic lights, if it is detected that a user selects the traffic light at the current position on a navigation interface of the vehicle, the vehicle sends resource access request information to a server; for another example, when the user scans the corresponding two-dimensional code on the traffic light at the current position by using the mobile phone, the mobile phone sends the resource access request information to the server. As shown in fig. 6, taking the terminal device as a vehicle as an example, in the current navigation interface, if a touch operation of the user on the "traffic light" icon is detected, the terminal device sends resource access request information to the server. The resource access request information comprises a user identity identifier and an identifier of traffic light phase information, wherein the identifier of the traffic light phase information corresponds to the traffic light identifier of the current position.

And after receiving the resource access request information, the server authenticates the user identity. For example, whether the vehicle corresponding to the vehicle identifier has the access right of the traffic light phase information is verified, and if the vehicle corresponding to the vehicle identifier has the access right of the traffic light phase information, the authentication is passed. If the authentication is passed, the server acquires the position information of the terminal device, for example, if the terminal device is a vehicle, the server acquires a vehicle identifier corresponding to the user identity identifier, sends an acquisition request of the position information to the vehicle corresponding to the vehicle identifier, and the vehicle sends the position information to the server. The position information comprises geographical position information and positioning auxiliary information, and the positioning auxiliary information comprises a moving direction. The moving direction may be sent by the vehicle to the server, or determined by the server according to the geographical location information of at least two moments sent by the vehicle.

And after the server acquires the position information of the terminal equipment, verifying the position information of the terminal equipment. Specifically, the server acquires check information corresponding to the traffic light identifier, the check information includes a position parameter to be checked and a range corresponding to the position parameter to be checked, and the server checks the acquired position information according to the range corresponding to the position parameter to be checked. In this embodiment, the location parameters to be verified in the verification information include geographic location information and a moving direction, a range corresponding to the geographic location information is a predetermined area, and a range corresponding to the moving direction is a predetermined direction. And if the server determines that the terminal equipment is in the preset area according to the geographical position information and the moving direction of the terminal equipment is consistent with the preset direction, the verification is passed. For example, in the verification information, the range corresponding to the geographic location information is an area P in fig. 5, the moving direction is north-south, and when it is determined that the terminal device is located in the area P according to the geographic location information and the moving direction is north-south, the verification is passed. Due to the fact that the traffic light phase information corresponding to the vehicles running in different directions is different, for example, the traffic light phase information corresponding to the vehicles running from east to west and from south to north is different, the fact that wrong traffic light phase information is sent to the terminal equipment can be avoided by checking the geographic position information and the moving direction of the terminal equipment.

In other feasible embodiments, if the resource to be accessed is phase information of a traffic light, the positioning auxiliary information further includes positioning time delay, when the server determines that the terminal device is in the predetermined area according to the geographical position information and the moving direction of the terminal device is consistent with the preset direction, it is further required to check whether the positioning time delay in the position information is less than the preset time length, and if the positioning time delay is less than the preset time length, the check is passed. For example, the positioning delay in the verification information is less than 1 second, and if the positioning delay in the location information of the terminal device acquired by the server is less than 1 second, the verification is passed. Because the moving speed of the vehicle is high, if the positioning time delay is too long, when the server acquires the position information of the terminal equipment, the terminal equipment leaves the current position, and if the server indicates the traffic light according to the current position to send the corresponding traffic light phase information to the terminal equipment, the actual requirements of the vehicle cannot be met. By checking the positioning time delay, the real-time performance of the acquired geographic position information is improved, and the probability of sending wrong traffic light phase information to the terminal equipment is reduced.

In other possible implementation manners, the positioning auxiliary information further comprises a positioning manner and a positioning precision, and when the geographical position information, the moving direction, the positioning time delay, the positioning manner and the positioning precision of the terminal equipment are consistent with the corresponding ranges of the position parameters to be verified, the position information can be verified to pass, so that the accuracy of position information verification is further improved, and the probability of sending traffic light phase information to unrelated equipment is reduced.

In a possible implementation manner, a GPS positioning device is provided on the vehicle, and the server acquires a vehicle identifier corresponding to the user identity identifier and sends an acquisition request of the position information of the vehicle to the GPS positioning device corresponding to the vehicle identifier and the operator base station, respectively. The GPS positioning device and the operator base station respectively send the acquired position information to the server, the server verifies the position information corresponding to the two positioning modes, and if the position information corresponding to any one positioning mode is consistent with the range corresponding to the position parameter needing to be verified, the verification is passed. For example, in the verification information, the range of the geographic location information is the area P in fig. 5, the moving direction is north to south, the positioning delay is less than 1 second, the positioning modes are a GPS positioning mode and an operator base station positioning mode, and the positioning accuracy is 10 meters. In the position information sent by the GPS, the positioning mode is GPS positioning, the precision is 5 meters, the time delay is 100 milliseconds, the geographic position information is in an area P, the moving direction calculated according to the geographic position information of at least two moments is north to south, and the moving direction is consistent with the verification information. In the position information sent by the operator base station, the positioning mode is the operator base station positioning, the precision is 10 meters, the time delay is 2 seconds, the geographic position information is in the region P, the moving direction calculated according to the geographic position information of at least two moments is north to south, and the time delay is more than 1 second and is inconsistent with the verification information. In the two positioning modes, the position information corresponding to the GPS positioning mode is consistent with the verification information, and the position information is verified to pass, so that the flexibility of position information verification is improved, and the application range of the product is enlarged.

In other feasible implementation manners, after the server respectively sends the acquisition requests of the position information of the vehicle to the GPS positioning device and the operator base station corresponding to the vehicle, the server verifies the position information acquired first, and if the position information acquired first is consistent with the verification information, the position information verification is passed. For example, since the positioning delay of the GPS positioning system is small, when the satellite signal is good, the server checks the position information transmitted by the GPS positioning device acquired first, and if the position information matches the check information, the check is passed. When the satellite signal is not good, the position information sent by the GPS positioning device cannot be timely acquired, the server verifies the acquired position information sent by the operator base station, and if the position information is consistent with the verification information, the verification is passed, so that the requirements of different scenes are met.

And if the position information passes the verification, the server sends the access token corresponding to the identifier of the traffic light phase information to the terminal equipment. And after the terminal equipment acquires the access token, the access token is sent to the traffic light, the traffic light verifies the access token, and if the verification is passed, the traffic light phase information in the corresponding direction is sent to the terminal equipment. The terminal equipment can calculate the time length of the residual red light or the residual green light according to the traffic light phase information, so that the speed and the travel are planned, and the road traffic safety is favorably improved.

In the above embodiment, after the user identity authentication is passed, the server also verifies the positioning mode, the positioning delay, the positioning precision, the geographical position information and the moving direction of the terminal device, so that the verification accuracy of the position information is improved, and the probability of sending wrong traffic light phase information to the terminal device is reduced.

In another application scenario, the resource obtaining method provided in the embodiment of the present application is used to obtain a navigation map, as shown in fig. 7, where the target device is a garage management device, and the resource to be accessed is the navigation map.

The terminal equipment sends the resource access request information to the server according to the operation of the user, or the terminal equipment automatically triggers the sending of the resource access request information when entering a preset area. The resource access request information comprises a user identity identifier and an identifier of a navigation map, and the identifier of the navigation map corresponds to the identifier of the garage management equipment.

And after receiving the resource access request information, the server authenticates the user identity. For example, whether a vehicle corresponding to the user identity has the navigation map downloading authority is verified, and if the user corresponding to the user identity has the navigation map downloading authority, the authentication is passed. And if the authentication is passed, the server acquires the position information of the terminal equipment. Specifically, the server acquires the identifier of the terminal device according to the user identity identifier, sends a position information acquisition request to the terminal device corresponding to the terminal device identifier, and the terminal device sends the position information to the server. In one possible implementation, taking the terminal device as a vehicle as an example, since the navigation map is generally disposed in a garage, in an underground garage, satellite signals cannot be received generally. The server sends a position information acquisition request to a built-in WIFI positioning module of the vehicle corresponding to the vehicle identification so as to ensure that the position information can be acquired in time. The position information comprises geographical position information and positioning auxiliary information, and the positioning auxiliary information comprises moving speed.

And after the server acquires the position information of the terminal equipment, verifying the position information of the terminal equipment. Specifically, the server acquires verification information corresponding to the identification of the garage management equipment, the verification information comprises position parameters needing to be verified and a range corresponding to the position parameters needing to be verified, and the server verifies the acquired position information according to the range corresponding to the position parameters needing to be verified. In this embodiment, the location parameters to be checked in the check information include geographic location information and moving speed. The server determines the moving speed of the terminal device according to the geographical position information acquired at least two moments, and if the terminal device is determined to be in a preset area according to the geographical position information of the terminal device and the moving speed of the terminal device is smaller than the preset speed, the verification is passed. When the moving speed of the terminal device is high, the terminal device may have left the current position when the server acquires the position information of the terminal device, so that the acquired position information cannot reflect the actual position of the terminal device. The accuracy of the geographic position information acquired by the server is improved by checking the moving speed of the terminal equipment.

In other feasible implementation manners, if the resource to be accessed is a navigation map, the positioning auxiliary information includes positioning accuracy and positioning security in addition to the moving speed, and when the geographic position information, the moving speed, the positioning accuracy and the positioning security of the terminal device are all consistent with the range corresponding to the position parameter to be verified, the position information can be verified. For example, in the verification information, the range corresponding to the geographic location information is the area P in fig. 7, the positioning accuracy is in the sub-meter level, the positioning security is medium, and the moving speed is less than 15 km/h. If the geographic position information of the current vehicle is located in the area P and the positioning mode is WI FI positioning, the corresponding positioning precision is in the sub-meter level, the positioning safety is medium, and the moving speed calculated according to the geographic position information of at least two moments is 10km/h, the verification is passed. The accuracy of the position information verification is further improved by verifying the geographical position information, the moving speed, the positioning precision and the positioning safety of the terminal equipment.

And if the position information passes the verification, the server sends the access token corresponding to the identifier of the navigation map to the terminal equipment. After the terminal equipment acquires the access token, the access token is sent to the garage management equipment, the garage management equipment verifies the access token, and if the access token passes the verification, the navigation map is sent to the terminal equipment so that a user can conveniently and quickly find the parking space.

In the above embodiment, after the user identity authentication is passed, the server also verifies the geographic position information, the positioning precision, the positioning safety and the moving speed of the terminal device, so that the accuracy of the obtained position information is improved, and the navigation map is prevented from being sent to irrelevant terminal devices.

In other application scenarios, the location information of the terminal device may be in other combination manners, for example, in a scenario where the shared automobile opens the shared automobile lock through the mobile phone, the location information that the server needs to obtain includes geographic location information, location accuracy, and a location manner of the mobile phone, and when the location information passes the verification, the user can open the shared automobile lock through the mobile phone; for the scene that the user participates in the shopping mall activity for getting the red envelope through the mobile phone, the position information needing to be acquired by the server comprises the geographic position information and the positioning mode of the mobile phone, and when the position information is verified to be passed, the user can open the link for getting the red envelope through the mobile phone.

Referring to fig. 8, fig. 8 is a schematic specific flowchart illustrating a resource obtaining method provided in an embodiment of the present application, and as shown in fig. 8, the method includes:

s101: the terminal device sends resource access request information of the access target device to the server, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed.

The user identity identifier may be account information of the user, such as a user name, a mobile phone number, a mailbox address, and the like, or may be an identification code of the terminal device bound to the user identity. The Resource Identifier to be accessed corresponds to the Resource to be accessed, the Resource Identifier to be accessed may be a Uniform Resource Identifier (URI), a Universal Unique Identifier (UUID) or other type of Identifier of the Resource to be accessed, and the Resource to be accessed may be stored in the target device, and may be state information of a door lock, phase information of a traffic light, a navigation map, a red packet link, or the like. The terminal device may generate the resource access request information according to an operation of the user on the terminal device, or may generate the resource access request information when entering the preset geographical location information or entering the preset state.

S102: and the server authenticates the user identity.

Specifically, the server authenticates the user identity according to the pre-stored authentication information, for example, whether an identity consistent with the user identity exists in the authentication information is searched, and if the identity exists, the authentication is passed.

S103: and if the authentication is passed, the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information.

Specifically, if the user identity information passes the authentication, the server acquires the identifier of the terminal device corresponding to the user identity identifier, sends an acquisition request of the location information to the corresponding terminal device, and the terminal device sends the location information to the server. In other possible implementation manners, the server acquires an identifier of a corresponding positioning device according to the identity identifier of the user, and sends an acquisition request of position information to the corresponding positioning device, and the positioning device sends the detected position information of the terminal device to the server, wherein the positioning device may be a positioning device built in the terminal device, a positioning device built in the target device, a positioning device within a predetermined range from the target device, or a positioning device built in a third-party server, so that the position information can be acquired in different scenes, and the use range of the product is increased.

The geographical location information may be in a plurality of formats such as latitude and longitude, street + house number, room, etc., and the positioning auxiliary information may be positioning accuracy, positioning delay, positioning safety, positioning mode, moving speed and/or moving direction. Wherein, the positioning precision can be in the order of centimeter, sub-meter, ten meter and hundred meter. Positioning latency is the latency from initiating positioning to obtaining position information. Location security refers to whether the location process is likely to be counterfeited, attacked by a man-in-the-middle, forged, etc. The positioning safety is related to positioning modes, and the positioning modes comprise GPS positioning, Wi-Fi positioning, Bluetooth positioning, UWB positioning, operator base station positioning, visual positioning, radar positioning and the like. Different positioning modes, positioning accuracy and positioning safety are different, for example, UWB positioning has the highest safety, GPS positioning has lower safety, and video and radar-based positioning has the lowest safety. In addition, the positioning accuracy and the positioning safety are also related to environmental factors, and if the surrounding environmental factors are different, the positioning accuracy and the positioning safety are also different. For example, the positioning accuracy of the GPS can reach the meter level in an open environment, but can only reach the ten meter level when there are many urban buildings. The moving speed and the moving direction are calculated by the terminal equipment according to the geographical position information of at least two moments. In other possible implementation manners, the server calculates the moving speed or the moving direction according to the geographical position information of at least two moments sent by the terminal device.

In a possible implementation manner, if the user identity identification passes the authentication, the server judges whether the position verification is required according to the pre-acquired verification information, and if the position verification is required, the position parameter required to be verified is acquired from the verification information. For example, the verification information is a correspondence table as shown in table 1, the correspondence table stores the correspondence between the target device identifier, the resource identifier to be accessed, and the location parameter to be verified, in table 1, the target device identifier and the resource identifier to be accessed are stored in the access resource field, and the geographic location, the positioning accuracy, the positioning delay, the positioning manner, the moving speed, the moving direction, and the positioning security are the location parameters to be verified. When the user identity identification passes the authentication, the server obtains the location parameter to be verified from the corresponding relationship table according to the resource identification to be accessed, for example, in table 1, for the resource URI1, the location mode and the moving speed in the location parameter to be verified are NA, where "NA" indicates that the location mode and the moving speed do not need to be verified, and the location parameter to be verified includes geographic location information, location accuracy, location delay, moving direction and moving security, then the server obtains the geographic location information, the location accuracy, the location delay, the moving direction and the location security of the terminal device.

TABLE 1

S104: and the server checks the position information of the terminal equipment.

Specifically, the server determines whether the terminal device is in a predetermined area according to the geographical location information, and determines whether the positioning assistance information meets a preset condition. Illustratively, the verification information includes, in addition to the location parameter to be verified, a range corresponding to the location parameter to be verified, for example, in table 1, when the access resource is URI2, the range corresponding to the geographic location information to be verified is a predetermined area, i.e., area 2, the range of the positioning accuracy is in the sub-meter level, the range of the moving speed is <15Km/h, and the positioning security is medium. And the server verifies the position information of the terminal equipment according to the range corresponding to the position parameter needing to be verified, and determines whether the position information of the terminal equipment is consistent with the range corresponding to the position parameter needing to be verified. For example, if the location parameter to be verified includes geographic location information, positioning accuracy and a positioning manner, the server calculates a location range where the terminal device is located according to the geographic location information and the positioning accuracy of the terminal device, and if the location range where the terminal device is located is consistent with a range corresponding to the geographic location information in the verification information and the positioning manner is matched with a preset positioning manner in the verification information, the location information is verified to be passed. For another example, if the location parameter to be verified includes geographic location information and a moving direction, if the geographic location information is consistent with a range corresponding to the geographic location information in the verification information, and the moving direction is consistent with a preset direction in the verification information, the location information is verified to pass.

S105: and if the verification is passed, the server sends the access token corresponding to the resource identifier to be accessed to the terminal equipment.

S106: the terminal device sends the access token to the target device.

S107: and the target equipment checks the access token, and if the check is passed, the target equipment sends the resource to be accessed corresponding to the resource identifier to be accessed to the terminal equipment.

For example, the target device compares the access token with a preset token, if the access token is consistent with the preset token, the verification is passed, and if the verification is passed, the terminal device acquires the resource to be accessed corresponding to the identifier of the resource to be accessed from the target device.

In a possible implementation manner, when the terminal device initially accesses the server, if the position information passes the verification, the server sends the access token to the terminal device, and the terminal device stores the access token and sends the access token to the target device; when the terminal equipment accesses the server next time, if the position information passes the verification, the server sends verification passing information to the terminal equipment, and the terminal equipment sends the stored access token to the target equipment according to the verification passing information, so that the times of sending the access token by the server are reduced, and the resource occupation space of the server is saved. When the terminal equipment accesses the server for the preset times, the server sends the new access token to the terminal equipment, meanwhile, the verification information of the new access token is sent to the target equipment, and the terminal equipment obtains the resource to be accessed on the target equipment according to the new access token, so that the safety of resource access is improved.

In the above embodiment, the terminal device sends the resource access request information to the server, the resource access request information carries the user identity and the resource identifier to be accessed, the server authenticates the user identity, if the authentication is passed, the location information of the terminal device is obtained, the server authenticates the location information of the terminal device, if the authentication is passed, the access token corresponding to the resource identifier to be accessed is sent to the terminal device, namely, the server not only authenticates the user identity identification, but also verifies the position information of the terminal equipment, and the terminal equipment can obtain the access token only when the position information is verified, and acquiring the resource to be accessed corresponding to the identifier of the resource to be accessed from the target equipment according to the access token, thereby reducing the probability of sending the resource to be accessed to the phase-free equipment and realizing reasonable control on the resource to be accessed. And because the position information comprises the geographical position information and the positioning auxiliary information, the accuracy of position information verification is improved, and the probability of sending the resources to be accessed to the phase-insensitive equipment is further reduced. And because the authentication of the position information and the sending of the access token are both executed by the server, the synchronous authority updating of the terminal equipment and the target equipment is facilitated, and the condition that the use is influenced because any party cannot update in time is prevented.

Referring to fig. 9, fig. 9 is a flowchart illustrating a resource obtaining method according to an embodiment of the present application, where an execution subject of the method is a terminal device 100. As shown in fig. 9, the method includes:

s201: the terminal device sends resource access request information of the access target device to the server, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed.

S202: the method comprises the steps that terminal equipment receives a position information acquisition request which is sent by a server and corresponds to a user identity, and the position information of the terminal equipment is sent to the server, wherein the position information comprises geographical position information and positioning auxiliary information.

Specifically, if the user identity authentication passes, the terminal device receives the location information acquisition request and sends the location information to the server. The positioning auxiliary information comprises positioning precision, positioning time delay, a positioning mode, a moving speed and/or a moving direction.

S203: and the terminal equipment acquires an access token which is sent by the server and corresponds to the identifier of the resource to be accessed, and acquires the resource to be accessed which corresponds to the identifier of the resource to be accessed from the target equipment through the access token.

Specifically, after acquiring the access token, the terminal device sends the access token to the target device, the target device verifies the access token, and if the verification is passed, the terminal device acquires the resource to be accessed from the target device, for example, downloads the resource to be accessed.

In the above embodiment, when the terminal device sends the resource access request information, the user identity and the resource identifier to be accessed are sent to the server, the server authenticates the user identity, if the authentication is passed, the terminal device obtains the location information obtaining request sent by the server, sends the location information of the terminal device to the server, the server verifies the location information of the terminal device, and if the verification is passed, the terminal device receives the access token sent by the server, and obtains the resource to be accessed from the target device through the access token. The terminal equipment authenticates the user identity identification and verifies the position information of the terminal equipment before acquiring the resource to be accessed, and only when the position information is verified, the terminal equipment can acquire the resource to be accessed according to the access token, so that the safety of resource access is improved. And because the position information comprises the geographical position information and the positioning auxiliary information, the accuracy of position information verification is improved, the probability of sending the resource to be accessed to the phase-insensitive equipment is reduced, and the management and control of the resource to be accessed are more reasonable.

Referring to fig. 10, fig. 10 is a flowchart illustrating a resource obtaining method provided in an embodiment of the present application, where an execution subject of the method is a server 200. As shown in fig. 10, the method includes:

s301: the server acquires resource access request information of access target equipment sent by the terminal equipment, wherein the resource access request information carries a user identity identifier and a resource identifier to be accessed.

S302: and the server authenticates the user identity.

Specifically, the server authenticates the user identity according to the pre-stored authentication information, for example, whether an identity consistent with the user identity exists in the authentication information is searched, and if the identity exists, the authentication is passed.

S303: and if the authentication is passed, the server acquires the position information of the terminal equipment, wherein the position information comprises geographical position information and positioning auxiliary information.

Specifically, the server obtains the position information sent by the terminal device, or obtains the position information of the terminal device collected by the positioning device. The positioning auxiliary information comprises positioning precision, positioning time delay, a positioning mode, a moving speed and/or a moving direction.

S304: and the server checks the position information of the terminal equipment.

Specifically, the server acquires check information corresponding to the resource identifier to be accessed, the check information includes a position parameter to be checked and a range corresponding to the position parameter to be checked, and the server checks the position information of the terminal device according to the range corresponding to the position parameter to be checked.

S305: and if the verification is passed, the server sends the access token to the terminal equipment so as to instruct the terminal equipment to acquire the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment according to the access token.

Specifically, if the location information of the terminal device is consistent with the range corresponding to the location parameter to be verified, the verification is passed. And if the verification is passed, the server sends the access token to the terminal equipment, the terminal equipment sends the access token to the target equipment after acquiring the access token, the target equipment verifies the access token, and if the verification is passed, the terminal equipment acquires the resource to be accessed corresponding to the resource identifier to be accessed from the target equipment.

In the above embodiment, when acquiring the resource access request information sent by the terminal device, the server authenticates the resource access request information, if the authentication passes, the server acquires the location information of the terminal device, verifies the location information, if the verification passes, the server sends the access token to the terminal device, and the terminal device acquires the resource to be accessed according to the access token. The server verifies the position information of the terminal equipment besides the user identity identification, and allows the terminal equipment to acquire the resource to be accessed only when the position information is verified, so that the probability of sending the resource to be accessed to irrelevant equipment is reduced, reasonable control over the resource to be accessed is realized, and the safety of resource access is improved. And because the position information comprises the geographical position information and the positioning auxiliary information, the accuracy of position information verification is improved, and the probability of sending the resources to be accessed to the phase-isolated equipment is further reduced. And because the authentication of the position information and the sending of the access token are both executed by the server, the synchronous authority updating of the terminal equipment and the target equipment is facilitated, and the condition that the use is influenced because any party cannot update in time is prevented.

In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.

Based on the same inventive concept, the embodiment of the application also provides a server. Fig. 11 is a schematic structural diagram of a server provided in the embodiment of the present application, and as shown in fig. 11, the server 200 provided in the embodiment may include: a processor 210, a memory 220, and a network interface 230. The processor 210, memory 220, and network interface 230 are connected by a communication bus 240.

The Processor 210 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. Optionally, processor 210 may include one or more processing units.

The storage 220 may be an internal storage unit of the server 200, such as a hard disk or a memory of the server 200. The memory 220 may also be an external storage device of the server 200, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the server 200. Further, the memory 220 may also include both an internal storage unit of the server 200 and an external storage device. The memory 220 is used to store computer programs and other programs and data required by the server 200. The memory 220 may also be used to temporarily store data that has been output or is to be output.

The network interface 230 may be used for transceiving information, and may include a wired interface and/or a wireless interface, and is generally used for establishing a communication connection between the server 200 and other electronic devices. For example, in the present application, the network interface 230 may receive the location information transmitted by the terminal device 100, and transmit an access token or the like to the terminal device 100.

Optionally, the server 200 may further include a user interface 250, the user interface 250 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 250 may further include a standard wired interface and a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the server 200 and for displaying a visualized user interface.

Those skilled in the art will appreciate that FIG. 11 is merely exemplary of a server and is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.

The server provided in this embodiment may execute the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/electronic device, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

Finally, it should be noted that: the above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

29页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种网页页面内容加密方法及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类