Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the embodiment of the invention, the mobile terminal is accessed to the local area network where the intelligent terminal device is located, and the intelligent terminal device needing to interact data is searched according to the IP address and the port number, so that the problem that the mobile terminal is constrained by the signal strength when the geographical position of the intelligent terminal device is far away from the geographical position of the intelligent terminal device can be avoided, the difficulty of data interaction is reduced, the stability of data interaction is improved, the user experience degree is improved, meanwhile, the intelligent terminal device does not need to add extra physical settings, the cost of device consumables is reduced compared with the existing data interaction method, and the data interaction is effectively realized.
In the embodiment of the invention, the intelligent terminal device is a device with an embedded computer system, and supports various functions such as audio, video, data acquisition and the like, for example, various security devices such as an attendance machine, an access controller and the like. It should be understood that the data interaction method provided by the embodiment of the invention is still applicable to intelligent terminal devices in various other fields and data in various other fields besides the access controller and the attendance machine.
Fig. 1 is a system architecture diagram applicable to the data interaction method provided by the embodiment of the present invention, and for convenience of description, only the relevant parts to the embodiment are shown.
Referring to fig. 1, the system is composed of an intelligent terminal device 11 and a plurality of mobile terminals 12, wherein the intelligent terminal device 11 is configured to perform an interactive operation with the connected mobile terminals 12 according to stored attendance data and entrance and exit data. Preferably, the attendance data and the entrance guard entry and exit data information may be stored in a background database 13 connected to the intelligent terminal device, including but not limited to data information such as data records and exception logs of each time period, each user, each intelligent terminal device, and the intelligent terminal device 11 stores, manages, and screens the information according to the data types, and interacts with other external devices, users, or the mobile terminal 12. Meanwhile, the intelligent terminal device 11 is further configured to provide data query, upload, and download services for the mobile terminal 12, so that the mobile terminal 12 can feed back to an actual user according to a result of data processing.
In the system, the mobile terminal 12 may provide a terminal device with a network access function for a notebook computer, a tablet computer, or a mobile phone, and the communication with the intelligent terminal device 11 is ensured by interacting information with the intelligent terminal device 11 through an application client or a web client running on the device. Each mobile terminal 12 may serve as a request client, submit a data interaction request to the intelligent terminal device 11, and control the operation of each component in the intelligent terminal device 11 or directly output data to the mobile terminal 12 according to an interaction result returned by the intelligent terminal device 11.
Fig. 2 shows a flowchart of an implementation of the data interaction method provided by the embodiment of the present invention, which is detailed as follows:
in S201, the mobile terminal accesses a local area network where the intelligent terminal device is located.
In this embodiment, when the intelligent terminal device is installed and debugged or actually operated, the intelligent terminal device is often successfully accessed to the local area network of the location through network wiring in an actual application scene. For example, when the attendance machine is installed on a wall at the door of a company, a network connection for connecting an internal network of the company is preset at a position behind the attendance machine, and the connection is connected to the door of the attendance machine, which is then successfully connected to the local area network of the company.
After the local area network where the intelligent terminal device is located is expanded through the wireless AP inside the company, the wireless coverage range of the local area network can be expanded, and the fact that the mobile terminal can be accessed into the local area network where the intelligent terminal device is located and wirelessly connected with the intelligent terminal device is guaranteed only by being connected to the wireless access point inside the company.
In S202, the mobile terminal obtains an IP address and a port number of the intelligent terminal device.
As an embodiment of the present invention, the acquiring, by the mobile terminal, the IP address and the port number of the intelligent terminal device includes:
the intelligent terminal equipment displays a two-dimensional code based on the IP address and the port number information;
and the mobile terminal scans the two-dimensional code to acquire the IP address and the port number of the intelligent terminal equipment.
The two-dimensional code is a planar pattern for recording data symbol information by using a certain specific geometric figure or black and white figures distributed in a two-dimensional direction according to a certain rule. The two-dimensional code is formed by a plurality of geometric shapes corresponding to binary information of the IP address and port number data of the intelligent terminal device, and is displayed on a screen of the intelligent terminal device, pasted on a shell of the intelligent terminal device or displayed in other external information carriers. When the IP address changes, the two-dimension code displayed on the screen can be updated in real time, and other external display modes update the two-dimension code through manual modification. The two-dimensional code is scanned by using the mobile terminal with the photoelectric scanning function, information in the two-dimensional code can be automatically identified and read, processing can be automatically executed, and the real IP address and the port number of the intelligent terminal device can be obtained.
Fig. 3 is a schematic diagram of acquiring an IP address and a port number of the intelligent terminal device in a two-dimensional code manner. As shown in fig. 3, the attendance machine No. 1, whose left side is an intelligent terminal device, displays a two-dimensional code having information of an IP address and a port number of the device on a screen, and the mobile terminal on the right side starts a scanning function, aligns a scanning frame with the two-dimensional code on the attendance machine screen, identifies the two-dimensional code, and finally obtains a real IP address and a port number of the attendance machine No. 1.
As another embodiment of the present invention, the IP address and port number may also be specified by the user directly entering information on the mobile terminal. As shown in fig. 4, specifically, the mobile terminal obtains the IP address and the port number about the intelligent terminal device, which are input by the user, through an input box and a prompt displayed on the screen. The user can know the IP address and the port number of the intelligent terminal equipment with which data is to be interacted by consulting an intelligent terminal equipment administrator or inquiring the information openly recorded by the intelligent terminal equipment, and inputs the IP address and the port number into an input box shown by a mobile terminal screen.
In S203, the mobile terminal sends a connection request to the intelligent terminal device according to the IP address and the port number of the intelligent terminal device.
The IP address allocates a unique logical address to each intelligent terminal device in the local area network, and the mobile terminal searches the intelligent terminal device corresponding to the IP address from the local area network by using the IP address and sends a connection request to the intelligent terminal device.
Since an intelligent terminal device having an IP address can provide many different types of data services, these data services can be implemented by one IP address. In order to determine the specific services required by the mobile terminal, this problem is solved by means of one port number per service.
Preferably, the intelligent terminal device only opens one port to provide data service when in operation.
In the embodiment, according to the IP addresses and the port numbers obtained from multiple ways, the mobile terminal can break the limitation of the geographic spatial position, and interacts with the remote intelligent terminal equipment through a wireless network, so that the stability and the flexibility of data interaction are improved.
As an embodiment of the present invention, the sending, by the mobile terminal, the connection request to the intelligent terminal device includes:
the mobile terminal acquires identity information of a user;
and the mobile terminal sends a connection request based on the identity information to the intelligent terminal equipment.
And acquiring account information which is input by a user and related to the identity at one side of the mobile terminal. The account number includes, but is not limited to, an entity card account number such as a job number, an access control card number, an identity card number, and other virtual account numbers, such as an equipment administrator account number, an office system account number, and the like. The mobile terminal can acquire the user identity account on the current system platform in a mode of directly jumping to other system platforms in the interactive program.
And the mobile terminal sends a connection request to the intelligent terminal equipment, wherein the connection request information contains the account content and can also contain a password corresponding to the identity account.
In S204, the intelligent terminal device returns connection confirmation information to the mobile terminal.
And the mobile terminal waits for the response of the intelligent terminal equipment and receives a connection confirmation packet returned by the intelligent terminal equipment. If the mobile terminal does not receive the response of the intelligent terminal equipment or the sent data packet within the preset time, the data interaction connection request fails; and if receiving the connection confirmation information returned by the mobile terminal, starting the mobile terminal to enter a data interaction state.
As an embodiment of the present invention, the above S203 and S204 are specifically as follows:
the mobile terminal sends a connection request to the intelligent terminal equipment based on a private communication protocol;
and the intelligent terminal equipment judges whether the identity information meets a preset condition or not according to the received connection request based on the identity information, and if so, returns connection confirmation information to the mobile terminal based on a private communication protocol.
In this embodiment, the private communication protocol represents a self-defined communication protocol, and can only be used between devices manufactured by the same manufacturer, and the intelligent terminal device cannot communicate with devices manufactured by other manufacturers by using the private communication protocol, and thus has no compatibility.
In particular, the private communication protocol in this embodiment is a UDK (Universal Development Kit) communication protocol, and is implemented by a private offline UDK. The offline UDK is a cross-platform version of an offline SDK (Software development kit), can be used for various application platforms such as IOS, android, Linux and the like, is a development kit tool capable of managing and configuring various data on intelligent terminal equipment, and provides an interface for data communication with the intelligent terminal equipment such as an offline fingerprint machine, a door access machine, a card machine and the like.
Before initiating a data interaction request, the mobile terminal processes the value of a specified field in the request data packet through a preset algorithm stored in the mobile terminal to obtain a first check value related to the data packet, attaches the check value to the interaction request data packet, and sends the interaction request data packet to the intelligent terminal equipment.
After receiving the request data packet based on the private UDK communication protocol, one end of the intelligent terminal equipment performs the following processing: and processing the value of the specified field in the data packet by using a preset algorithm to obtain a second check value related to the data packet.
And the intelligent terminal equipment compares whether the second check value is the same as the first check value in the data packet, and if the second check value is the same as the first check value in the data packet, the intelligent terminal equipment determines that the request data packet is not subjected to illegal tampering by a third party and is a complete data packet. At the moment, the intelligent terminal equipment creates a session window, takes the session information as connection confirmation information and transmits the connection confirmation information to the mobile terminal through a private UDK communication protocol.
According to the embodiment, data can be received and transmitted between the mobile terminal and the intelligent terminal device through the private communication protocol, and the mobile terminal using other communication protocols can not be connected with the intelligent terminal device, so that lawless persons can be prevented from using mobile terminal application programs matched with the intelligent terminal devices of the manufacturers to perform data interaction and management on the intelligent terminal devices of other manufacturers. In addition, the embodiment of the invention further ensures the safe transmission of the data by carrying out integrity check on the received data packet.
Fig. 5 is a flowchart of a specific implementation of the data interaction method S204 according to an embodiment of the present invention, which is specifically as follows:
in S501, the intelligent terminal device obtains a connection request based on the identity information.
And the intelligent terminal equipment extracts the identity account of the user from the connection request, and if the password information corresponding to the identity account also exists in the connection request, the identity account is extracted together. In S502, it is determined whether a record corresponding to the identity account exists in a preset identity information base.
The identity information base is preset with legally authorized user account information, and only the account existing in the identity information base can perform data interaction with the intelligent terminal equipment. The identity information base can be arranged in the intelligent terminal equipment or in a background identity information database connected with the intelligent terminal equipment through a network
And matching and comparing the identity account acquired from the connection request with legal account information in an identity information base one by one, and judging whether the same record items exist. If yes, go to step S503; otherwise, the intelligent terminal equipment returns connection rejection information to the mobile terminal.
In S503, it is determined whether the password information of the account needs to be verified.
When an entry identical to the identity account obtained in the connection request exists in the identity information base, reading the entry information, judging whether the entry of the identity account has a password attribute, if so, verifying the password validity of the account, and executing a step S504; if the entry of the identity account does not have the password attribute, step S505 is executed.
In S504, it is determined whether the identity password carried in the connection request matches a preset password.
And when the entry which is the same as the identity account acquired in the connection request has the password attribute, reading the password of the account stored in the entry, namely the preset password. Comparing the identity password obtained from the connection request with the preset password, and if the identity password is different from the preset password, returning connection rejection information to the mobile terminal by the intelligent terminal equipment; if the two are the same, step S505 is executed.
In S505, the intelligent terminal device returns connection confirmation information to the mobile terminal.
And after receiving the connection confirmation information, the mobile terminal switches an interface interacting with the user, receives an interaction instruction of the user and prepares for data interaction with the intelligent terminal equipment.
As an embodiment of the present invention, the intelligent terminal device obtains the interaction right corresponding to the identity account according to the received connection request based on the identity information, so that the mobile terminal can only interact information with the intelligent terminal device within a range specified by the right.
In this embodiment, through increasing user authentication function in intelligent terminal equipment, can avoid illegal user to acquire the inside secret data of system, prevent to cause because of information leakage and be difficult to the loss of property of estimation, through the authority level that sets up the identification account number, guaranteed that different users can acquire the data of different secret levels in the intelligent terminal equipment, be favorable to carrying out the management and control to the transmission range of data.
In S205, the mobile terminal obtains the data in the intelligent terminal device based on the private communication protocol according to the data interaction instruction input by the user.
After the mobile terminal and the intelligent terminal device are stably connected, a user can input an instruction on the mobile terminal and send the instruction to the intelligent terminal device through a network so as to finish interaction between data. For example, the operation of the intelligent terminal device is controlled or data on the intelligent terminal device is exported.
In the embodiment of the invention, the mobile terminal is accessed to the local area network where the intelligent terminal device is located, and the intelligent terminal device needing to interact data is searched according to the IP address and the port number, so that the problem that the mobile terminal is constrained by the signal strength when the geographical position of the intelligent terminal device is far away from the geographical position of the intelligent terminal device can be avoided, the difficulty of data interaction is reduced, the stability of data interaction is improved, the user experience degree is improved, meanwhile, the intelligent terminal device does not need to add extra physical settings, the cost of device consumables is reduced compared with the existing data interaction method, and the data interaction is effectively realized.
As an embodiment of the present invention, the intelligent terminal device performs data screening according to the data interaction instruction, and after the data obtained by the data screening is transmitted to the mobile terminal, the UDK inside the mobile terminal automatically determines whether the currently received data is continuous with the data received last time.
If the currently received data is not continuous with the previously received data, it indicates that the data packet is lost, and at this time, the mobile terminal initiates a data interaction request again to request to acquire the lost data packet.
As an embodiment of the present invention, the data interaction method provided by the present invention further includes:
the mobile terminal caches the node position or the deviation position of the data obtained from the intelligent terminal equipment at present;
when the connection between the mobile terminal and the intelligent terminal device is disconnected, after the mobile terminal is reconnected to the intelligent terminal device, the mobile terminal sends the node position or the deviation position of the data to the intelligent terminal device.
In the process of downloading or acquiring data by the mobile terminal, if the connection between the mobile terminal and the intelligent terminal device is disconnected and the mobile terminal and the intelligent terminal device are reconnected after the disconnection, the mobile terminal sends the node position or the deviation position corresponding to the downloaded partial data to the intelligent terminal device before the disconnection.
And the intelligent terminal equipment analyzes the node position or the deviation position corresponding to the data according to the received information, and reads the data again from the position. And transmitting the subsequent part of the read data to the mobile terminal, thereby realizing the breakpoint continuous transmission of the data.
When the mobile terminal receives the subsequent part of the information of the data, if all the information corresponding to the data is received completely, the currently received data is stored; if all the information corresponding to the data is not received completely, storing the currently received partial data, and meanwhile caching a new node position or a deviation position corresponding to the data, so that the cached new node position or the deviation position can be sent after the intelligent terminal equipment is disconnected and reconnected next time.
Fig. 6 is a block diagram illustrating a data interaction system according to an embodiment of the present invention, where the data interaction system is used to execute the data interaction method according to the embodiments of fig. 1 to fig. 5. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 6, the data interaction system includes an intelligent terminal device 61 and a mobile terminal 62,
the mobile terminal 62 is used for accessing to a local area network where the intelligent terminal device 61 is located.
The mobile terminal 62 is further configured to obtain an IP address and a port number of the intelligent terminal device 61.
The mobile terminal 62 is further configured to send a connection request to the intelligent terminal device 61 according to the IP address and the port number of the intelligent terminal device 61.
The intelligent terminal device 61 is configured to return connection confirmation information to the mobile terminal 62.
The mobile terminal 62 is further configured to obtain data in the intelligent terminal device 61 based on a private communication protocol according to a data interaction instruction input by a user.
Optionally, the intelligent terminal device 61 is specifically configured to display a two-dimensional code based on the IP address and the port number information;
optionally, the mobile terminal 62 is specifically configured to obtain the IP address and the port number of the intelligent terminal device 61 by scanning the two-dimensional code.
Optionally, the mobile terminal 62 is specifically configured to obtain, through an input box displayed on a screen, an IP address and a port number, which are input by a user, of the intelligent terminal device 61.
Optionally, the mobile terminal 62 is further configured to send a connection request based on the identity information to the intelligent terminal device 61.
Optionally, the mobile terminal 62 is further configured to send a connection request to the intelligent terminal device 61 based on a private communication protocol.
The intelligent terminal device 61 is further configured to determine whether the identity information meets a preset condition according to the received connection request based on the identity information, and if so, return connection confirmation information to the mobile terminal 62 based on a private communication protocol.
Optionally, the mobile terminal 62 is further configured to cache a node position or a deviation position of data that has been currently acquired from the intelligent terminal device 61;
when the connection between the mobile terminal 62 and the intelligent terminal device 61 is disconnected, after the mobile terminal 62 reconnects the intelligent terminal device 61, the mobile terminal 62 is further configured to send the node position or the deviation position of the data to the intelligent terminal device 61.
In the embodiment of the invention, the mobile terminal is accessed to the local area network where the intelligent terminal device is located, and the intelligent terminal device needing to interact data is searched according to the IP address and the port number, so that the problem that the mobile terminal is constrained by the signal strength when the geographical position of the intelligent terminal device is far away from the geographical position of the intelligent terminal device can be avoided, the difficulty of data interaction is reduced, the stability of data interaction is improved, the user experience degree is improved, meanwhile, the intelligent terminal device does not need to add extra physical settings, the cost of device consumables is reduced compared with the existing data interaction method, and the data interaction is effectively realized.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.