Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the embodiments of the present disclosure are described in further detail below with reference to the accompanying drawings and the embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the disclosure and that no limitation to the embodiments of the disclosure is intended.
First, before specifically describing the technical solution of the embodiment of the present disclosure, a technical background or a technical evolution context on which the embodiment of the present disclosure is based is described. In general, in the field of shared vehicle traveling, the current technical background is: when a user uses the shared vehicle, the two-dimensional code of the shared vehicle is scanned through a mobile phone, then the identification of the vehicle is obtained, and the identification of the vehicle and the user information are sent to a server through a network, so that the server unlocks the shared vehicle. Based on the background, the applicant finds that the method of unlocking the shared vehicle by adopting the network is adopted through long-term experimental data collection, demonstration and verification, and when the mobile phone scans the two-dimensional code and the unlocking data is interacted between the mobile phone and the server, the problem that the unlocking time of the shared vehicle is long is easily caused when the network quality is poor. Therefore, how to improve the unlocking efficiency of the shared vehicles under the condition of poor network becomes a difficult problem to be solved urgently at present. In addition, it should be noted that, from the technical problem identified and the technical solutions described in the following embodiments, the applicant has paid a lot of creative efforts.
The following describes technical solutions related to the embodiments of the present disclosure with reference to a scenario in which the embodiments of the present disclosure are applied.
The method for communicating with the shared object provided by the embodiment of the present disclosure may be applied to a system architecture as shown in fig. 1. The system architecture includes a shared object 101, a terminal device 102, and a server 103. The shared object 101 may be an intelligent lock on a non-motorized or motorized vehicle such as a pedal bicycle, an electric bicycle, a scooter, or a motorcycle, or certainly, the shared object may also be a shared power bank, or certainly, a shared access lock, or the like (fig. 1 mainly takes the shared object as an intelligent lock of a vehicle as an example); the terminal device 102 may be an electronic device such as a mobile phone, a tablet computer, an IPAD, or an APP software installed on the electronic device; the server 103 may be an independent server or a server cluster composed of a plurality of servers. The shared object 101 is provided with a communication component, which can communicate with the terminal device 102 or the server 103 in a wireless manner, for example, the terminal device 102 can send an unlocking instruction to the shared object according to an unlocking operation of a user; in addition, the communication mode of the shared object 101 and the terminal device 102 may include bluetooth communication, network communication, NFC near field communication, and the like. In addition, the terminal device 102 and the server 103 may communicate with each other in a wireless or wired manner. The embodiment of the present disclosure does not limit the communication mode among the shared object 101, the terminal device 102, and the server 103.
In one embodiment, as shown in fig. 2, a method for communicating with a shared object is provided, which is described by taking APP software applied to the terminal device in fig. 1 as an example, and may include the following steps:
and S202, when the distance between the shared object and the shared object is within a preset range, acquiring NFC information of the shared object in an NFC mode.
The shared object has a Near Field Communication (NFC) function, that is, the shared object has an NFC function built therein, and can perform data interaction with any other device having the NFC function, where the shared object is generally a shared object only. Optionally, the shared object may include an intelligent lock and a shared power bank of a shared device, where the shared device may be a shared vehicle such as a shared bicycle, a shared electric bicycle, a shared motorcycle, a shared automobile, and the like. In addition, the device with the NFC function may be a reader type or a tag type, and the shared object in this embodiment may be a reader type or a tag type, but generally, the cost of the device of the reader type is higher than that of the device of the tag type, so the preferred shared object in this embodiment is the tag type with lower cost.
In addition, as for the distance to the sharing object mentioned in this step being within a preset range, it means that the distance between the terminal device and the sharing object is within a preset range, that is, the terminal device is close to the sharing object, and the preset range here may be 0-10cm, but of course, other distances are also possible. Based on this, when the terminal device opens the NFC function and approaches the shared object or is directly attached to the shared object, the terminal device may obtain NFC information embedded in the shared object in an NFC communication manner, where the NFC information may be information preset in the shared object.
For example, the shared object is an intelligent lock of the shared device, where the shared object may include modules such as a controller and an NFC tag, and the controller may write the set NFC information into the NFC tag in advance, so that when the terminal device is close to the shared object, the NFC information may be read from the NFC tag.
S204, generating an NFC communication instruction interacting with the shared object according to the NFC information; the NFC information and the NFC communication instruction comprise addresses of shared objects and data information generated by interaction of the shared objects and the terminal equipment in different communication scenes.
In this step, after the terminal device acquires the NFC information, the NFC information includes an address of the shared object and data information generated by interaction between the shared object and the terminal device, and the terminal device may uniquely determine one shared object by using the address of the shared object in the NFC information, and may simultaneously acquire some information corresponding to the address, such as unlocking information, locking information, and the like, from the server according to the address of the shared object. In addition, here, the address of the shared object may be a physical address of the shared object, for example, a MAC address of the shared object, and a unique identification code belonging to the shared object may be used to identify which shared object is.
And then the terminal equipment can generate a corresponding instruction by combining the operation to be executed by the shared object, the generated instruction is used as the data information of the interaction of the shared object and is put into the data information with the same format as the NFC information, and the address of the shared object is also put into the data information with the same format as the NFC information to obtain the NFC communication instruction.
Of course, the NFC communication command may be a command generated after the shared object performs a certain operation based on a command of the terminal device, and the command and an address of the shared object may also be put into data information having the same format as that of NFC information to obtain the NFC communication command, so that the terminal device may obtain the NFC communication command from the shared object by polling or the like.
That is, the NFC communication command may be generated by the terminal device or may be generated by the shared object. The different communication scenes may include unlocking the shared object, locking the shared object, playing audio, acquiring operation and maintenance information of the shared object, or acquiring a dynamic token of the shared object. According to different communication scenes, different NFC communication instructions can be generated by the terminal equipment and the shared object so as to carry out communication interaction and realize different functions in different communication scenes. It should be noted that, here, the data formats of the NFC communication commands that the terminal device and the shared object can generate are identical, but only the data information generated by the interaction between the shared object and the terminal device in different communication scenarios is different in the data formats.
As can be seen from the above description, in the prior art, when the terminal device unlocks the shared object through the network, the two-dimensional code needs to be scanned first, the two-dimensional code information is sent to the server, and the server can send the information of the shared object to the terminal device through the network after verification. In addition, when the terminal device unlocks the shared object through the bluetooth, the terminal device also needs to open the bluetooth of the terminal device, scan bluetooth signals sent by the surrounding shared object, then perform bluetooth pairing connection with the found bluetooth signals, and finally receive the information of the shared object sent by the shared object through the bluetooth after the bluetooth connection is successful. In the scheme, the data format of the NFC information, which includes the address of the shared object and the data information generated by the shared object interacting with the terminal device in different communication scenes, is defined, so that in different communication scenes, the terminal device only needs to be close to the shared object to acquire the NFC information of the shared object in the set data format, and meanwhile, the NFC connection with the shared object is successful, and the NFC connection time and the NFC information acquisition time are very short and can be almost ignored. And then, the terminal equipment can perform subsequent data interaction through the NFC mode and the NFC information and shared object. It can be seen from this that, when the terminal device and the shared object interact with each other, it takes little time to connect the terminal device and the shared object and acquire the NFC information, that is, data interaction of the NFC information can be directly performed, so that time for overall communication between the terminal device and the shared object can be saved, and communication efficiency can be improved. Under the scene of unlocking the shared object, the terminal equipment is not needed to scan the two-dimensional code of the shared object to obtain the information of the shared object, so that unlocking data interaction is performed with the shared object, or the Bluetooth signal of the shared object is not needed to be scanned to establish connection with the shared object, so that unlocking data interaction is performed with the shared object, the time for connecting the shared object and the time for acquiring the information of the shared object through network or Bluetooth scanning can be saved, the shared object can be directly unlocked, the whole unlocking time of the shared object is saved, and the unlocking efficiency is improved.
Furthermore, the NFC communication instruction NFC information includes the address of the shared object and the data information of the interaction between the terminal device and the shared object, so that a shared object can be uniquely determined, accurate communication between the terminal device and the shared object is realized, and the effective performance of the communication process between the terminal device and the shared object is ensured.
In the method for communicating with the shared object, the shared object has a Near Field Communication (NFC) function, and when the distance between the shared object and the shared object is within a preset range, NFC information of the shared object can be acquired in an NFC mode, and an NFC communication instruction interacting with the shared object is generated according to the NFC information; the NFC information and the NFC communication instruction comprise addresses of shared objects and data information generated by interaction of the shared objects and the terminal equipment in different communication scenes. In the method, the terminal equipment and the shared object can perform NFC information interaction in an NFC mode, so that the time of overall communication interaction can be shortened, that is, the efficiency of communication interaction can be improved, and when the method is applied to a scene of unlocking the shared object, the efficiency of unlocking the shared object can be improved. In addition, the information and the communication instruction for the interaction between the terminal equipment and the shared object comprise the address of the shared object and the data information for the interaction between the terminal equipment and the shared object, so that the accuracy of the communication process between the shared object and the terminal equipment can be effectively ensured.
In another embodiment, it is mentioned in the foregoing embodiment that the data formats of the NFC information and the NFC communication instruction are the same, and both include an address of the shared object and data information generated by interaction between the shared object and the terminal device in different communication scenarios. On this basis, the NFC information and the NFC communication instruction may further include start record information of an application APP corresponding to the shared object on the terminal device. Taking the example that the sharing object is an intelligent lock of the sharing device, the APP here may be an APP related to the intelligent lock, for example, an out APP, a WeChat APP, a telephone APP, and the like.
Here, the starting record information of the APP means that when the terminal device approaches the shared object, the APP on the terminal device is automatically opened, the opening time, the opening address and the like of the APP are recorded in the NFC information, and meanwhile, the starting record information of the APP is also put into the NFC communication instruction. Here, the opening time of the APP is the starting time of the terminal device communicating with the shared object.
The NFC information and the NFC communication instruction both include APP start record information, an address of a shared object, and data information generated by interaction, and thus, the three pieces of information generally have corresponding sequence information, so that accurate NFC information and an NFC communication instruction can be obtained. Optionally, in the data format of the NFC information or the NFC communication command, the start record information is located before the address of the shared object, and the address of the shared object is located before the data information.
Here, the data types of the start record information of the APP, the address of the shared object, and the data information generated by interaction may be the same or different. Preferably, in this embodiment, the data type of the start record information of the APP is U (URI, uniform resource locator), the data type of the address of the shared object is T (TEXT), and the data type of the data information generated by interaction is T (TEXT). In addition, the data information generated by the interaction can multiplex the Bluetooth protocol during data interaction.
For example, the data formats of the NFC information and the NFC communication command may be as shown in fig. 3, where the APP start record information, the address of the shared object, and the data information generated by interaction may be stored in three RECOND records, where the first RECOND record stores the APP start record information, the second RECOND record stores the address of the shared object, and the third RECOND record stores the data information generated by interaction.
The data format of the NFC information or the NFC communication command is a data format set according to the NDEF Message protocol. The NDEF Message is used as a top-level protocol of the NFC, which can shield differences between different manufacturers and different protocols of the NFC, and may include a plurality of NFC RECOND records, where both NFC information and data in the NFC communication instruction are interacted in the RECOND records of the NDEF Message top-level protocol. Compared with the data format set by the bottom layer protocol of the NFC, the data format set by the NDEF Message protocol has the advantages that when the terminal equipment or the shared object analyzes the NFC information or the NFC communication instruction, the analyzing difficulty is small, the data analyzing efficiency is naturally high, and therefore the communication efficiency when the terminal equipment and the shared object interact can be improved.
In this embodiment, the NFC information and the NFC communication instruction may further include start record information of an application APP corresponding to the shared object on the terminal device, so that when the terminal device communicates with the shared object, the terminal device or other devices may know the start time of communication interaction in time, and statistics of communication duration is facilitated, so that the communication process may be improved according to communication duration in the future. Further, in the embodiment, the starting record information of the APP, the address of the shared object, and the sequence of the data information generated by interaction in the data formats of the NFC information and the NFC communication instruction are also defined, so that subsequent terminal devices or the shared object can accurately and quickly analyze the NFC information or the NFC communication instruction.
In another embodiment, as shown in fig. 4, another method for communicating with a shared object is provided, and on the basis of the above embodiment, the above S204 may include the following steps:
s402, generating an operation instruction for operating the shared object according to the NFC information, and sending the operation instruction to the shared object in an NFC mode; the operation instruction comprises an address of the shared object and first data information, and the first data information is used for representing an operation type for operating the shared object.
The operation type herein refers to a type of operation that needs to be performed by the shared object, and may include unlocking, locking, playing audio, acquiring operation and maintenance information, acquiring a dynamic token, and the like. And the terminal generates different operation instructions corresponding to each different operation type, so that the shared object executes different operations. The first data information may include an operation type, or may include specific data information corresponding to the operation type, for example, an unlocking instruction, and then the first data information may be unlocking information.
In addition, the operation instruction may include an address of the shared object and the first data information, and may further include the aforementioned start record information of the APP, where an order of the three in the data format of the operation instruction may be the aforementioned order relationship.
Specifically, when the terminal device needs to operate the shared object, the operation type executed by the shared object by the user may be obtained in advance, the start record information of the APP, the address of the shared object, and the operation type executed by the shared object may be encapsulated into an operation instruction, and the operation instruction is sent to the shared object in an NFC communication manner. In general, a terminal device transmits an operation command to a tag of a shared object, and a controller of the shared object reads the operation command from the tag and performs processing.
S404, acquiring a response instruction generated by the shared object in an NFC mode; the response instruction comprises the address of the shared object and second data information generated by the shared object according to the operation instruction.
In this step, as can be seen from the above description, the controller of the shared object may perform processing after reading the operation instruction from the tag, and the processing may include generating second data information according to the first data information in the operation instruction. For example, if the operation instruction is an unlocking instruction, the controller of the shared object may control the smart lock of the shared object to be opened according to the unlocking instruction, and use the opening result as the second data information. Then, the controller of the shared object may encapsulate the address of the shared object and the generated second data information into a response instruction, or the controller of the shared object may encapsulate the aforementioned start record information of the APP, the address of the shared object, and the generated second data information into a response instruction, and in any case, the controller of the shared object may generate a response instruction.
After the controller of the shared object generates the response instruction, the response instruction can be written into the tag in the shared object, so that the terminal device can read the response instruction from the tag in an NFC communication manner.
In this embodiment, an operation instruction for operating a shared object is generated according to NFC information, the operation instruction is sent to the shared object in an NFC manner, and a response instruction generated by the shared object based on the operation instruction is acquired in the NFC manner; the operation instruction comprises the address of the shared object and information of the operation type of the operation of the shared object, and the response instruction comprises the address of the shared object and data information generated based on the operation instruction. The data formats of the operation instruction and the response instruction are the same, so that the terminal equipment and the shared object can conveniently and accurately and quickly analyze the instruction in the interaction process, and the data interaction efficiency is improved. In addition, the operation instruction is an instruction comprising an operation type, and the operation type can be various operation types, so that the types of the operation of the terminal equipment on the shared object can be greatly enriched, and the operation diversity of the terminal equipment is improved.
In the above embodiment, it is mentioned that the operation instruction generated by the terminal device and the response instruction generated by the shared object may be applied in different communication scenarios, and the operation instruction and the response instruction are described in detail below by taking a dynamic token acquisition scenario and an unlocking scenario as examples.
In another embodiment, as shown in fig. 5, another method for communicating with a shared object is provided, where this embodiment relates to a dynamic token obtaining scenario, and on the basis of the foregoing embodiment, the foregoing S402 may include the following steps:
s502, generating a dynamic token acquisition instruction according to the NFC information; the dynamic token obtaining instruction comprises an address of the shared object and first data information, and the first data information is used for representing that the terminal equipment needs to obtain the dynamic token from the shared object.
The dynamic Token obtaining instruction herein may also be referred to as Token obtaining instruction.
Specifically, when the terminal device needs to obtain the dynamic token from the shared object, that is, needs to perform a dynamic token obtaining operation on the shared object, the terminal device may encapsulate the address of the shared object and information that the dynamic token needs to be obtained into a dynamic token obtaining instruction, or the terminal device encapsulates the start record information of the APP, the address of the shared object, and the information that the dynamic token needs to be obtained into a dynamic token obtaining instruction.
And S504, sending the dynamic token acquisition instruction to the shared object in an NFC mode.
After the terminal device generates the dynamic token obtaining instruction, the terminal device may write the dynamic token obtaining instruction into the tag of the shared object in an NFC communication manner, and then the controller of the shared object may read the dynamic token obtaining instruction from the tag to perform subsequent data processing.
Accordingly, after the terminal device sends the dynamic token obtaining instruction to the shared object in the NFC manner and processes the shared object, the terminal device may read information from the shared object, that is, the step S404 may include the following step S506:
s506, obtaining a token response instruction generated by the shared object in an NFC mode; the token response instruction specifically includes an address of the shared object and a dynamic token generated by the shared object according to the dynamic token obtaining instruction.
In this step, as mentioned above, after the controller of the shared object reads the dynamic token obtaining instruction from the tag, the controller of the shared object may parse the dynamic token obtaining instruction to obtain the data information in the third RECOND, which is the information that needs to obtain the dynamic token, and then may use a built-in token generation algorithm (for example, a random number generation algorithm) to generate a set number of random numbers, and use the set number of random numbers as the generated dynamic token. The set number may be determined according to actual conditions, and may be, for example, 3, 4, 5, and so on.
After the controller of the shared object generates the dynamic token, the address of the shared object and the generated dynamic token may be encapsulated into a token response instruction, or the terminal device encapsulates the start record information of the APP, the address of the shared object and the generated dynamic token into a token response instruction, and stores the token response instruction in the storage area of the shared object. Then, the controller of the shared object may write the token response instruction into the tag of the shared object, so that the terminal device may read the token response instruction from the tag in an NFC communication manner.
In this embodiment, the terminal device may generate a dynamic token obtaining instruction according to the NFC information, send the dynamic token obtaining instruction to the shared object in an NFC manner, and read the token response instruction in the NFC manner after the shared object generates the token response instruction according to the dynamic token obtaining instruction; the dynamic token obtaining instruction comprises the address of the shared object and the instruction of the dynamic token to be obtained, so that the shared object can be conveniently and timely known and the dynamic token can be conveniently generated, and meanwhile, the token response instruction comprises the address of the shared object and the generated dynamic token, so that the terminal equipment can conveniently obtain the dynamic token, and safety guarantee is provided for the operation between the subsequent terminal equipment and the shared object.
In another embodiment, as shown in fig. 6, another method for communicating with a shared object is provided, where this embodiment relates to an unlocking scenario, and on the basis of the foregoing embodiment, the foregoing S402 may further include the following steps:
and S602, analyzing the token response instruction to obtain the dynamic token.
In this step, after obtaining the token response instruction, the terminal device may analyze the token response instruction through the data format of the NFC communication instruction mentioned above, that is, the data format of the token response instruction here, to obtain the dynamic token in the token response instruction.
For example, assuming that the data format of the token response instruction is 10 bytes of the start record information of the APP, the address of the shared object is 10 bytes after the start record information of the APP, and 20 bytes after the address of the shared object are the dynamic token, the token response instruction may be parsed from the 21 st byte until the 40 th byte is parsed, and the data parsed from the 20 bytes is the dynamic token.
S604, generating an unlocking instruction of the shared object according to the address of the shared object, the dynamic token and the unlocking password obtained from the server; the unlocking instruction comprises an address of the shared object and third data information, and the third data information comprises a dynamic token and an unlocking password.
In this step, after obtaining the NFC information, the terminal device may generate a password obtaining request through an address of a shared object in the NFC information, and send the password obtaining request to the server, and after obtaining the password obtaining request, the server may obtain an unlocking password and a key corresponding to the address of the shared object from its own database, and return the unlocking password and the key to the terminal device. The server comprises a database, a plurality of shared objects, an unlocking password and a key, wherein the database of the server stores the addresses of the shared objects and the unlocking password and the key corresponding to each address. The key is a parameter of an algorithm for encrypting or decrypting the unlocking password.
After obtaining the unlocking password and the key of the shared object, the terminal device may refer to the previously obtained dynamic token, the unlocking password and the key as third data information, where the third data information corresponds to the first data information, and is generated by the terminal device and is distinguished by name.
And then, the terminal equipment can splice the address of the shared object, the dynamic token, the unlocking password and the key by combining the unlocking password and the key, the address of the shared object and the obtained dynamic token to obtain the unlocking instruction of the shared object. Of course, the operation type for operating the shared object may be added to the unlock instruction.
When the unlocking instruction is obtained by splicing, the address of the shared object and the splicing sequence of the third data information (the dynamic token, the unlocking password and the key) may be that the address of the shared object is before the third data information (the dynamic token, the unlocking password and the key), and optionally, in the data format of the third data information, the dynamic token is before the unlocking password, and the unlocking password is before the key.
And S606, sending the unlocking instruction to the shared object in an NFC mode.
In this step, after the terminal device generates the unlocking instruction, the terminal device may write the unlocking instruction into the tag of the shared object in an NFC communication manner, and then the controller of the shared object may read the unlocking instruction from the tag to perform a subsequent unlocking process.
Accordingly, the above S404 may further include the following step S608:
s608, acquiring an unlocking response instruction generated by the shared object according to the unlocking instruction in an NFC mode; the unlocking response instruction comprises the address of the shared object and the unlocking result.
In this step, as mentioned above, after the controller of the shared object reads the unlocking command from the tag, the controller of the shared object may analyze the unlocking command, and obtain information that the data information in the third RECOND is unlocking, that is, the dynamic token, the unlocking password, and the key, so that the dynamic token may be matched with the dynamic token stored in the shared object (the stored dynamic token is the dynamic token in the token response command), and at the same time, the pre-stored unlocking password may be matched with the unlocking password sent by the terminal device.
When the dynamic token and the unlocking password are successfully matched, the matching is considered to be successful, then the controller of the shared object can unlock the shared object, and the unlocking result is successful unlocking. If at least one of the dynamic token and the unlocking password is failed to be matched, the matching is considered to be failed, the shared object cannot be unlocked by the controller of the shared object, and the unlocking result is unlocking failure.
Then, the controller of the shared object may encapsulate the address of the shared object and the unlocking result into an unlocking response instruction, or the terminal device encapsulates the start record information of the APP, the address of the shared object and the unlocking result into an unlocking response instruction, and stores the unlocking response instruction into the storage area of the shared object. Then, the controller of the shared object can write the unlocking response instruction into the tag of the shared object, so that the terminal device can read the unlocking response instruction from the tag in an NFC communication mode.
In this embodiment, the terminal device obtains the dynamic token by analyzing the token response instruction, generates an unlocking instruction by using the address of the shared object, the dynamic token and the unlocking password obtained from the server, sends the unlocking instruction to the shared object, and receives an unlocking response instruction generated by the shared object according to the unlocking instruction. The shared object can be unlocked without interaction with the shared object through the server, so that the unlocking process of the shared object can be simplified, and the unlocking efficiency is improved. Terminal equipment adopts the NFC mode to unblank to the shared object simultaneously, compares that the network unblanks and the bluetooth is unblanked, and this mode of unblanking is closer to the shared object, and the stability of unblanking is higher.
In the above embodiment, it is mentioned that the terminal device may obtain the unlocking response instruction of the shared object, and then the terminal device may continue to interact with the server after obtaining the unlocking response instruction, so that the server may timely know the unlocking condition of the shared object, based on which, the method may further include the following step a:
and step A, sending an unlocking response instruction to the server so that the server determines the operation and maintenance operation to be executed next step according to the unlocking response instruction.
In this step, after the terminal device obtains the unlocking response instruction, the unlocking response instruction can also be sent to the server, so that the server can know the operation and maintenance operation to be executed next step through the unlocking response instruction. For example: if the unlocking result in the unlocking response instruction is successful, the server can determine that an order is to be created for the terminal device using the shared object, and start charging and the like.
In this embodiment, the terminal device may send an unlocking response instruction to the server, so that the server determines the operation and maintenance operation to be executed next step according to the unlocking response instruction. Therefore, the server can conveniently and quickly determine the operation to be executed next, and the operation efficiency of the company to which the shared object belongs is guaranteed.
An embodiment of the present disclosure is described below with reference to a specific scenario in which a smart lock of a shared vehicle is unlocked by using a mobile phone, and specifically referring to fig. 7, the method includes the following steps:
and S1, opening the NFC switch by the mobile phone, and approaching the intelligent lock.
And S2, the mobile phone acquires the NFC information of the intelligent lock.
And S3, the mobile phone analyzes the NFC information to obtain the physical address of the intelligent lock in the second RECOND in the NFC information.
And S4, the mobile phone requests the server for the cipher key corresponding to the intelligent lock based on the physical address of the intelligent lock.
And S5, the server returns the cipher key corresponding to the intelligent lock to the mobile phone.
And S6, the mobile phone sends a dynamic token acquisition instruction to the intelligent lock.
And S7, the intelligent lock generates a dynamic token, and the dynamic token is put into data information in the third RECOND in the NFC communication instruction to obtain a token response instruction.
And S8, the mobile phone reads the token response instruction.
And S9, the mobile phone analyzes the token response instruction to obtain the dynamic token.
And S10, the mobile phone generates an unlocking instruction according to the dynamic token and the password key, and sends the unlocking instruction to the intelligent lock.
And S11, the intelligent lock verifies the dynamic token and the password key in the unlocking instruction, unlocks after the verification is successful, generates an unlocking response after unlocking, and puts the unlocking response into data information in a third RECOND in the NFC communication instruction to obtain an unlocking response instruction.
And S12, the mobile phone reads the unlocking response instruction.
And S13, the mobile phone analyzes the unlocking response instruction to obtain an unlocking result.
And S14, the mobile phone sends the unlocking response instruction to the server.
And S15, the server determines whether to create an order according to the unlocking response instruction.
It should be understood that although the various steps in the flowcharts of fig. 2, 4-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 4-7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 8, there is provided an apparatus for communicating with a shared object, including: an information acquisition module 10 and a communication instruction generation module 11, wherein:
an information obtaining module 10, configured to obtain NFC information of a shared object in an NFC manner when a distance between the shared object and the shared object is within a preset range;
a communication instruction generating module 11, configured to generate an NFC communication instruction interacting with the shared object according to the NFC information; the NFC information and the NFC communication command both comprise addresses of the shared objects and data information generated by interaction of the shared objects and terminal equipment in different communication scenes.
Optionally, the shared object includes an intelligent lock of the sharing device and a shared power bank.
For specific limitations of the device for communicating with the shared object, reference may be made to the above limitations of the method for communicating with the shared object, which are not described herein again.
In another embodiment, the NFC information and the NFC communication instruction further include start record information of an application APP corresponding to the shared object on the terminal device. Optionally, in a data format of the NFC information or the NFC communication command, the start recording information is located before an address of the shared object, and the address of the shared object is located before the data information. Optionally, the data format of the NFC information or the NFC communication command is a data format set based on an NDEF Message protocol.
In another embodiment, as shown in fig. 9, another apparatus for communicating with a shared object is provided, and on the basis of the above embodiment, the communication instruction generating module 11 may include:
an operation instruction generating and transmitting unit 111 configured to generate an operation instruction for operating the shared object according to the NFC information, and transmit the operation instruction to the shared object in the NFC manner; the operation instruction comprises an address of the shared object and first data information, and the first data information is used for representing an operation type for operating the shared object;
a response instruction obtaining unit 112, configured to obtain, in the NFC manner, a response instruction generated by the shared object; the response instruction comprises the address of the shared object and second data information generated by the shared object according to the operation instruction.
In another embodiment, as shown in fig. 10, another apparatus for communicating with a shared object is provided, and on the basis of the above embodiment, the operation instruction generating and sending unit 111 may include:
a dynamic token generation subunit 1111, configured to generate a dynamic token obtaining instruction according to the NFC information; the dynamic token obtaining instruction comprises an address of the shared object and the first data information, and the first data information is used for representing that the terminal equipment needs to obtain a dynamic token from the shared object;
a dynamic token sending subunit 1112, configured to send the dynamic token obtaining instruction to the shared object in the NFC manner.
Accordingly, the response instruction obtaining unit 112 may include:
a token response instruction obtaining subunit 1121, configured to obtain, in the NFC manner, a token response instruction generated by the shared object; the token response instruction specifically includes an address of the shared object and a dynamic token generated by the shared object according to the dynamic token obtaining instruction.
As shown in fig. 10, the operation instruction generating and sending unit 111 may further include:
an analyzing subunit 1113, configured to analyze the token response instruction to obtain the dynamic token;
an unlocking instruction generating subunit 1114, configured to generate an unlocking instruction for the shared object according to the address of the shared object, the dynamic token, and the unlocking password obtained from the server; the unlocking instruction comprises an address of the shared object and third data information, and the third data information comprises the dynamic token and the unlocking password;
an unlock instruction transmitting subunit 1115 configured to transmit the unlock instruction to the shared object by the NFC method
Optionally, in the data format of the third data information, the dynamic token is located before the unlocking password.
Accordingly, the response instruction obtaining unit 112 may further include:
an unlocking response instruction obtaining subunit 1122, configured to obtain, in the NFC manner, an unlocking response instruction generated by the shared object according to the unlocking instruction; the unlocking response command includes an address of the shared object and an unlocking result.
In another embodiment, as shown in fig. 11, another apparatus for communicating with a shared object is provided, and on the basis of the above embodiment, the apparatus may further include:
and a sending module 12, configured to send the unlocking response instruction to the server, so that the server determines, according to the unlocking response instruction, an operation and maintenance operation to be performed next.
For specific limitations of the device for communicating with the shared object, reference may be made to the above limitations of the method for communicating with the shared object, which are not described herein again. The respective modules in the above-described apparatus for communicating with a shared object may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in hardware or independent of a processor in the electronic device or the terminal device, or can be stored in software in a memory in the electronic device or the terminal device, so that the processor can call and execute operations corresponding to the modules.
Fig. 12 is a block diagram illustrating an electronic device 1300 according to an example embodiment. For example, the electronic device 1300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 12, electronic device 1300 may include one or more of the following components: a processing component 1302, a memory 1304, a power component 1306, a multimedia component 1308, an audio component 1310, an input/output (I/O) interface 1312, a sensor component 1314, and a communication component 1316. Wherein the memory has stored thereon a computer program or instructions for execution on the processor.
The processing component 1302 generally controls overall operation of the electronic device 1300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1302 may include one or more processors 1320 to execute instructions to perform all or part of the steps of the method described above. Further, the processing component 1302 can include one or more modules that facilitate interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate interaction between the multimedia component 1308 and the processing component 1302.
The memory 1304 is configured to store various types of data to support operation at the electronic device 1300. Examples of such data include instructions for any application or method operating on the electronic device 1300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1304 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1306 provides power to the various components of the electronic device 1300. Power components 1306 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for electronic device 1300.
The multimedia component 1308 includes a touch-sensitive display screen that provides an output interface between the electronic device 1300 and a user. In some embodiments, the touch display screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the electronic device 1300 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1310 is configured to output and/or input audio signals. For example, the audio component 1310 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 1300 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1304 or transmitted via the communication component 1316. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.
The I/O interface 1312 provides an interface between the processing component 1302 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1314 includes one or more sensors for providing various aspects of state assessment for the electronic device 1300. For example, the sensor assembly 1314 may detect an open/closed state of the electronic device 1300, the relative positioning of components, such as a display and keypad of the electronic device 1300, the sensor assembly 1314 may also detect a change in the position of the electronic device 1300 or a component of the electronic device 1300, the presence or absence of user contact with the electronic device 1300, orientation or acceleration/deceleration of the electronic device 1300, and a change in the temperature of the electronic device 1300. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1316 is configured to facilitate communications between the electronic device 1300 and other devices in a wired or wireless manner. The electronic device 1300 may access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1316 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1316 also includes a Near Field Communications (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described method of communicating with shared objects.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 1304 comprising instructions, executable by the processor 1320 of the electronic device 1300 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which, when executed by a processor, may carry out the above-mentioned method. The computer program product includes one or more computer instructions. When loaded and executed on a computer, may implement some or all of the above-described methods, in whole or in part, according to the procedures or functions described in the embodiments of the disclosure.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided by the embodiments of the disclosure may include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express a few implementation modes of the embodiments of the present disclosure, and the description thereof is specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for those skilled in the art, variations and modifications can be made without departing from the concept of the embodiments of the present disclosure, and these are all within the scope of the embodiments of the present disclosure. Therefore, the protection scope of the patent of the embodiment of the disclosure should be subject to the appended claims.