CN117014850B - Device searching method, system, device, computer device and storage medium - Google Patents

Device searching method, system, device, computer device and storage medium Download PDF

Info

Publication number
CN117014850B
CN117014850B CN202311280149.5A CN202311280149A CN117014850B CN 117014850 B CN117014850 B CN 117014850B CN 202311280149 A CN202311280149 A CN 202311280149A CN 117014850 B CN117014850 B CN 117014850B
Authority
CN
China
Prior art keywords
identification
theme
communication
equipment
issuing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311280149.5A
Other languages
Chinese (zh)
Other versions
CN117014850A (en
Inventor
樊晓婷
钟荣钊
余洪波
罗展昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jingshi Technology Co ltd
Original Assignee
Shenzhen Jingshi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jingshi Technology Co ltd filed Critical Shenzhen Jingshi Technology Co ltd
Priority to CN202311280149.5A priority Critical patent/CN117014850B/en
Publication of CN117014850A publication Critical patent/CN117014850A/en
Application granted granted Critical
Publication of CN117014850B publication Critical patent/CN117014850B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data

Abstract

The invention discloses a device searching method, a device searching system, a device searching device, computer equipment and a storage medium. The method is applied to the equipment end and comprises the following steps: verifying whether the equipment end is started and surfing the internet successfully, and reading the unique identifier of the SIM card on the equipment end; issuing the identification theme to the MQTT server through 4G communication, setting a preset issuing period, and issuing the identification theme once every other preset issuing period; judging whether the equipment end normally performs P2P communication with the PC end; if so, stopping issuing the identification theme; if not, the identification theme is reissued. The invention has stronger compatibility without serial port communication, can lead the PC end to search immediately by issuing the identification subject, has stronger instantaneity, saves hardware resources, and has stronger uniqueness because the unique identification of the SIM card on the equipment end is not manually changeable.

Description

Device searching method, system, device, computer device and storage medium
Technical Field
The present invention relates to the field of internet of things, and in particular, to a device searching method, system, apparatus, computer device, and storage medium.
Background
In the field of internet of things, a general communication mode comprises 4G communication (such as mobile phone traffic) and local area network communication, wherein the 4G communication is to search for designated equipment in an internet environment through a PC (personal computer) in a factory test, judge whether the equipment is online or not, and aim to detect whether the equipment is online or not, and then p2p communication can be performed after the equipment is online so as to realize the communication between the equipment and the PC.
In the prior art, a serial data line is always inserted on a PC, and the serial data line has the function of being electrified and communicated. The basic logic of the equipment end is that after the equipment is started and networked, two threads are started: thread 1, the equipment actively sends a request of the local MAC to a server, and the server marks the MAC record sent by the equipment as online in a database; and the thread 2 and the equipment monitor whether new serial port connection exists or not, and if so, the local MAC is sent to the PC end through the serial port. The basic logic of the PC terminal is to monitor whether the serial port has data to send or not, if the serial port has the data to send, the server sends a query request to the acquired equipment MAC through the HTTP protocol, the server queries whether the equipment MAC exists in the database according to the request, and if the equipment MAC exists in the database, the server records that the equipment is on line. After the product is tested, the PC sends a deleting request to the server through the HTTP protocol by using the obtained device MAC, and the device MAC tested before is deleted in the database.
However, the prior art has some objective disadvantages that not all devices have serial ports (for example, microUSB, type-C) for external connection, resulting in low compatibility and no wide application. In addition, the device needs to send the local MAC to the server by connecting the external network, and also needs to monitor the serial port connection, and send the local MAC to the PC by utilizing the serial port, so that hardware resources are wasted, and the MAC can be artificially changed, so that the uniqueness of the MAC is not strong. After the product is tested, if the network problem or the software crash and other problems occur, the server database can permanently store the tested equipment MAC, and the memory space of the server is wasted.
Disclosure of Invention
In view of the above, the present invention aims to overcome the shortcomings in the prior art, and provide a device searching method, system, apparatus, computer device and storage medium.
The invention provides the following technical scheme:
in a first aspect, an embodiment of the present disclosure provides a device searching method, which is applied to a device side, where the method includes:
verifying whether the equipment end is started and surfing the internet successfully, and reading the unique identifier of the SIM card on the equipment end;
issuing an identification theme to an MQTT server through 4G communication, setting a preset issuing period, and issuing the identification theme once every other preset issuing period;
judging whether the equipment end normally performs P2P communication with the PC end;
if so, stopping issuing the identification theme;
and if not, reissuing the identification theme.
Further, the issuing the identification theme to the MQTT server through 4G communication includes:
writing the unique identification into the identification theme, and issuing an identification theme with RETAIN flag bit of 0 to the MQTT server by utilizing an MQTT protocol, wherein the identification theme comprises information of P2P communication between the equipment end and the PC end.
In a second aspect, an embodiment of the present disclosure provides a device searching method, applied to a PC side, where the method includes:
searching a device end, and searching whether a local database of the PC end contains a unique identifier;
if the unique identifier is contained, the memory used for storing the unique identifier in the local database is emptied;
subscribing all identification topics corresponding to the unique identifications stored in the MQTT server, and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched;
if the device is not contained in the local database, storing the corresponding unique identification and the identification theme into the local database, and selecting one device side to perform P2P communication with the PC side.
Further, after the searching whether the local database of the PC side contains the unique identifier of the device side, the method further includes:
if the unique identifier is not contained, acquiring the unique identifier of the target equipment end which is required to be searched and is filled by the user, and searching whether the local database contains the unique identifier of the target or not again.
Further, after subscribing to the identification topics corresponding to all the unique identifications stored in the local database, the method further includes:
setting a preset search period, searching the equipment end every other preset search period, and resetting the preset search period when the equipment end is not searched.
In a third aspect, an embodiment of the present disclosure provides an apparatus search system, where the system includes an apparatus side and a PC side;
the device side is used for verifying whether the device side is started and successfully surfing the internet, reading the unique identifier of the SIM card on the device side, issuing an identifier theme to the MQTT server through 4G communication, setting a preset issuing period, issuing the identifier theme once every the preset issuing period, judging whether the device side normally communicates with the PC side in P2P mode, stopping issuing the identifier theme if the device side normally communicates with the PC side, and re-issuing the identifier theme if the device side normally communicates with the PC side not normally;
the PC end is used for searching the equipment end and searching whether a local database of the PC end contains a unique identifier, if so, the memory used for storing the unique identifier in the local database is emptied, the identification subject corresponding to all the unique identifiers stored in the MQTT server is subscribed, and if so, whether the corresponding unique identifier is contained in the local database is judged, if not, the corresponding unique identifier and the identification subject are stored in the local database, and one equipment end and the PC end are selected for P2P communication.
In a fourth aspect, an embodiment of the present disclosure provides an apparatus searching device, which is applied to an apparatus side, where the apparatus includes:
the reading module is used for verifying whether the equipment end is started and successfully surfing the internet and reading the unique identifier of the SIM card on the equipment end;
the publishing module is used for publishing the identification theme to the MQTT server through 4G communication, setting a preset publishing period and publishing the identification theme once every other preset publishing period;
the judging module is used for judging whether the equipment end normally performs P2P communication with the PC end;
the first judging sub-module is used for stopping issuing the identification theme if the identification theme is normal;
and the second judging sub-module is used for reissuing the identification theme if the identification theme is abnormal.
In a fifth aspect, an embodiment of the present disclosure provides an apparatus search device, which is applied to a PC side, where the device includes:
the searching module is used for searching the equipment end and searching whether the local database of the PC end contains a unique identifier or not;
the emptying module is used for emptying the memory used for storing the unique identifier in the local database if the unique identifier is contained;
the subscription module is used for subscribing the identification topics corresponding to all the unique identifications stored in the MQTT server and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched;
and the communication module is used for storing the corresponding unique identification and identification theme into the local database if the unique identification and identification theme are not contained in the local database, and selecting one equipment end to perform P2P communication with the PC end.
In a sixth aspect, in an embodiment of the present disclosure, there is provided a computer device, including a memory storing a computer program and a processor, where the processor implements the steps of the device search method described in the first and second aspects when the computer program is executed.
In a seventh aspect, in an embodiment of the present disclosure, there is provided a computer readable storage medium storing a computer program, which when executed by a processor, implements the steps of the device search method described in the first and second aspects.
Embodiments of the present application have the following advantages:
the device searching method provided by the embodiment of the application is applied to a device side and comprises the following steps: verifying whether the equipment end is started and surfing the internet successfully, and reading the unique identifier of the SIM card on the equipment end; issuing an identification theme to an MQTT server through 4G communication, setting a preset issuing period, and issuing the identification theme once every other preset issuing period; and judging whether the equipment end normally communicates with the PC end in P2P mode, if so, stopping issuing the identification theme, and if not, reissuing the identification theme. The invention has stronger compatibility without serial port communication, can lead the PC end to search immediately by issuing the identification subject, has stronger instantaneity, saves hardware resources, and has stronger uniqueness because the unique identification of the SIM card on the equipment end is not manually changeable.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Like elements are numbered alike in the various figures.
Fig. 1 shows a flowchart of a device search method applied to a device side according to an embodiment of the present application;
fig. 2 shows a flowchart of a device search method applied to a PC side according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus search device applied to an apparatus side according to an embodiment of the present application;
fig. 4 shows a schematic structural diagram of an apparatus search device applied to a PC side according to an embodiment of the present application.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
It will be understood that when an element is referred to as being "fixed to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. In contrast, when an element is referred to as being "directly on" another element, there are no intervening elements present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for illustrative purposes only.
In the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the templates herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
Example 1
The method aims at solving the problems that in the prior art, due to the serial port of the out-of-band connection of equipment, the compatibility is low and the equipment cannot be widely used; the equipment end is required to be simultaneously connected with the external network to send the local MAC to the server and simultaneously monitor the serial port connection, and the serial port is utilized to send the local MAC to the PC end, so that very wasted hardware resources are caused; the uniqueness is not strong because the MAC can be artificially altered; if a network problem or a software crash occurs in the middle of the network problem, the server database permanently stores the tested device MAC, and the server memory space is very wasted, as shown in fig. 1, which is a flowchart of a device searching method applied to a device end in an embodiment of the present application, where the device searching method applied to the device end provided in the embodiment of the present application is applied to a device searching system, and specifically includes the following steps:
step S110, verifying whether the equipment end is started and successfully surfing the Internet, and reading the unique identification of the SIM card on the equipment end.
In this embodiment, the device search system includes: the device search is performed by using the MQTT protocol, the PC end serves as a subscriber of the MQTT protocol, the device end serves as a publisher of the MQTT protocol, because the 4G communication needs to use SIM cards, each SIM card has a corresponding unique identifier-ICCID, the ICCID is used as the unique identifier of the device end in the embodiment, because the device end is used for product test, all the device ends can repeatedly use the same SIM card for test, for example, each test station is distributed with 4 SIM cards, at most 4 devices can be tested each time, and the SIM cards are unplugged and plugged into the next device to be tested for use after the test is finished.
Specifically, it is first required to ensure that the device is powered on, and after the power on is completed, it is detected whether the connection between the WAN port of the device and the external network is successfully established. When the equipment end is started and surfing the internet successfully, the unique identifier ICCID of the SIM card inserted on the current equipment end is read.
The method uses ICCID as the unique identifier of the equipment, and the ICCID in the SIM card is read every time and cannot be changed artificially, so that the uniqueness is stronger.
And step S120, issuing an identification theme to the MQTT server through 4G communication, setting a preset issuing period, and issuing the identification theme once every other preset issuing period.
Further, the identification theme < ICCID > _device with the RETAIN flag bit of 0 is issued to the MQTT server by the MQTT protocol through 4G communication, and the unique identification of the Device side is written into the identification theme (e.g. 123546_device), where the identification theme includes information that the Device side performs P2P communication with the PC side.
It can be appreciated that in this embodiment, a preset release period needs to be set, and the identification theme is released once every preset release period. Since the traffic of the SIM card on the device side needs to be used for issuing the identification theme, in order to save traffic, the issue is controlled to be performed once every preset issue period, and the preset issue period may be 2 seconds, 3 seconds or 5 seconds, which is not limited in the embodiment of the present application.
The RETAIN flag bit is set to 0 by utilizing the MQTT protocol, so that the MQTT server can not register the identification theme and a local database is not required, the memory space of the MQTT server is greatly saved, and the PC end can immediately receive the release content every time the equipment subscribes the identification theme, so that the real-time performance is stronger.
It should be noted that MQTT is a message transmission protocol based on a publish/subscribe mode of server architecture. It was originally developed by IBM corporation and designed as a lightweight, open, simple and easy to implement messaging protocol. MQTT is well suited for application to message communication between environmentally limited (narrowband, high-latency, unreliable network environments) machines and machines (M2M), internet of things (IoT) devices. It has found widespread use in communicating sensors, occasionally dialed medical devices, smart homes, and some miniaturized devices over satellite links.
The method does not need serial communication, so that the compatibility is stronger, the method is more widely used, and the PC end can search only by using the < ICCID > _device as an identification theme and releasing the P2P communication information as content by using the MQTT protocol equipment end, thereby greatly saving hardware resources.
Step S130, judging whether the equipment end normally performs P2P communication with the PC end;
step S140, if the identification theme is normal, stopping issuing the identification theme;
step S150, if abnormal, reissuing the identification theme.
Further, it is determined whether the device side performs P2P communication with the PC side normally, if so, the issuing of the identification theme is immediately stopped, and if not, the process jumps to step S120 to reissue the identification theme.
It should be noted that, the device side sends a P2P communication request message to the PC side, and when the PC side determines that the authentication information carried in the P2P communication request message sent by the device side is legal, the PC side sends a P2P communication acknowledgement message to the device side, so as to determine whether the device side performs P2P communication with the PC side normally according to whether the above process is correct.
According to the device searching method applied to the device end, whether the device end is started up or not is verified, the device is successfully connected to the internet, and the unique identification of the SIM card on the device end is read; issuing an identification theme to an MQTT server through 4G communication, setting a preset issuing period, and issuing the identification theme once every other preset issuing period; and judging whether the equipment end normally communicates with the PC end in P2P mode, if so, stopping issuing the identification theme, and if not, reissuing the identification theme. The invention has stronger compatibility without serial port communication, can lead the PC end to search immediately by issuing the identification subject, has stronger instantaneity, saves hardware resources, and has stronger uniqueness because the unique identification of the SIM card on the equipment end is not manually changeable.
Example 2
As shown in fig. 2, in an embodiment of the present application, a flowchart of a device searching method applied to a PC side, where the device searching method applied to the PC side provided in the embodiment of the present application includes the following steps:
step S210, searching the equipment end, and searching whether the local database of the PC end contains a unique identifier.
Step S220, if the unique identifier is included, the memory used for storing the unique identifier in the local database is emptied.
The "search device" button popped up on the PC end-click page to search for the device end. In general, a unique identifier ICCID is stored in a local database at the PC end, the ICCID can be reused, a user only needs to add the unique identifier ICCID once, the unique identifier ICCID can be used all the time later, data cannot be cleared after product test software or a computer is restarted, repeated addition is not needed, and the test of the search equipment is continued.
Further, whether the unique identifier ICCID is stored or not is searched in the local database, and if the unique identifier ICCID is contained, the memory for storing the unique identifier in the local database needs to be emptied in order to prevent data repetition.
If the unique identifier is not contained, popping up an interface for managing ICCID, prompting a user to fill in the unique target identifier of the target equipment end to be searched, and searching again whether the unique target identifier is contained in the local database.
And step S230, subscribing the identification topics corresponding to all the unique identifications stored in the MQTT server, and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched.
It should be noted that, the MQTT server stores an identification theme < ICCID > _device corresponding to the unique identification, and subscribes to all the identification themes. Since the searching device consumes PC hardware resources, in order to limit the time of searching the device end, a preset searching period is set, and the device end is searched once every preset searching period, in this embodiment, the preset searching period may be 2 seconds, 3 seconds or 5 seconds, which is not limited in this embodiment of the present application.
Further, whether the equipment is searched or not is judged, if the equipment is not searched, a preset searching period is reset, and if the equipment is searched, whether the unique identifier corresponding to the equipment is contained in the local database is continuously judged.
Through subscribing the identification theme stored in the MQTT server, the PC terminal can immediately receive the identification theme every time the equipment terminal publishes the identification theme, and the instantaneity is stronger.
Step S240, if not included in the local database, storing the corresponding unique identifier and the identifier theme in the local database, and selecting one device side to perform P2P communication with the PC side.
If the unique identifier ICCID corresponding to the searched equipment is contained in the local database, the unique identifier ICCID is not required to be stored in the local database; if the unique identification ICCID is not contained in the local database, the unique identification ICCID of the searched equipment and the corresponding identification subject are required to be stored in the local database in order to prevent the data stored in the local database from being repeated.
Further, a unique identifier ICCID selected by a user is obtained, and the unique identifier ICCID and a preset question-answering mechanism are connected with a designated equipment end to perform P2P communication with a PC end.
It may be understood that, in this embodiment, the preset question-answering mechanism includes some communication questions for matching the unique identifier with the security of the device side, and the specific content may be determined according to the actual situation, which is not limited in this embodiment of the present application.
According to the device searching method applied to the PC end, whether the local database of the PC end contains the unique identifier is searched through the searching device end; if the unique identifier is contained, the memory used for storing the unique identifier in the local database is emptied; subscribing all identification topics corresponding to the unique identifications stored in the MQTT server, and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched; if the device is not contained in the local database, storing the corresponding unique identification and the identification theme into the local database, and selecting one device side to perform P2P communication with the PC side. The method and the device have the advantages that serial port communication is not needed, compatibility is higher, the identification theme can be searched in real time through subscribing the identification theme by the PC side, instantaneity is higher, and hardware resources are saved.
Example 3
The embodiment of the application also provides a device searching system, which comprises a device end and a PC end;
the device side is used for verifying whether the device side is started and successfully surfing the internet, reading the unique identifier of the SIM card on the device side, issuing an identifier theme to the MQTT server through 4G communication, setting a preset issuing period, issuing the identifier theme once every the preset issuing period, judging whether the device side normally communicates with the PC side in P2P mode, stopping issuing the identifier theme if the device side normally communicates with the PC side, and re-issuing the identifier theme if the device side normally communicates with the PC side not normally;
the PC end is used for searching the equipment end and searching whether a local database of the PC end contains a unique identifier, if so, the memory used for storing the unique identifier in the local database is emptied, the identification subject corresponding to all the unique identifiers stored in the MQTT server is subscribed, and if so, whether the corresponding unique identifier is contained in the local database is judged, if not, the corresponding unique identifier and the identification subject are stored in the local database, and one equipment end and the PC end are selected for P2P communication.
According to the equipment searching system provided by the embodiment of the application, serial port communication is not needed, compatibility is stronger, the equipment end can immediately search the PC end by issuing the identification subject, instantaneity is stronger, hardware resources are saved, in addition, the unique identification of the SIM card on the equipment end is not manually changeable, and uniqueness is stronger.
Example 4
As shown in fig. 3, a schematic structural diagram of an apparatus searching device 300 applied to an apparatus side in an embodiment of the present application includes:
a reading module 310, configured to verify whether the device end is powered on and successfully surfing the internet, and read a unique identifier of the SIM card on the device end;
the publishing module 320 is configured to publish an identification topic to an MQTT server through 4G communication, set a preset publishing period, and publish the identification topic once every other preset publishing period;
a judging module 330, configured to judge whether the device side performs P2P communication with the PC side normally;
a first judging sub-module 340, configured to stop issuing the identification topic if the identification topic is normal;
and a second judging sub-module 350, configured to reissue the identification topic if the identification topic is abnormal.
Optionally, the device searching apparatus further includes:
and the issuing sub-module is used for writing the unique identification into the identification theme, and issuing the identification theme with RETAIN zone bit of 0 to the MQTT server by utilizing an MQTT protocol, wherein the identification theme comprises information of P2P communication between the equipment end and the PC end.
The device searching device applied to the device end does not need serial communication, is higher in compatibility, can enable the PC end to search immediately by issuing the identification subject, is higher in instantaneity, saves hardware resources, and is higher in uniqueness, and in addition, the unique identification of the SIM card on the device end cannot be changed manually.
Example 5
As shown in fig. 4, a schematic structural diagram of an apparatus searching device 300 applied to a PC side in an embodiment of the present application includes:
the searching module 360 is configured to search the device side and find whether the local database of the PC side contains a unique identifier;
the emptying module 370 is configured to empty the memory for storing the unique identifier in the local database if the unique identifier is included;
the subscription module 380 is configured to subscribe to identifier topics corresponding to all unique identifiers stored in the MQTT server, and determine whether the corresponding unique identifiers are included in the local database when the device end is searched;
and the communication module 390 is configured to store the corresponding unique identifier and the identifier theme in the local database if the unique identifier and the identifier theme are not included in the local database, and select one of the device sides to perform P2P communication with the PC side.
Optionally, the device searching apparatus further includes:
and the acquisition module is used for acquiring the unique target identifier of the target equipment end which is filled in by the user and needs to be searched if the unique target identifier is not contained, and searching whether the local database contains the unique target identifier or not.
Optionally, the device searching apparatus further includes:
the searching module is used for setting a preset searching period, searching the equipment end every other preset searching period, and resetting the preset searching period when the equipment end is not searched.
The device searching device applied to the PC end does not need serial communication, is higher in compatibility, can search the identification theme in real time through subscribing the identification theme by the PC end, is higher in instantaneity, and saves hardware resources.
There is also provided in an embodiment of the present disclosure a computer device including a memory storing a computer program and a processor implementing the steps of the device search methods described in embodiments 1 and 2 when the computer program is executed by the processor.
Also provided in the embodiments of the present disclosure is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the device search methods described in embodiments 1 and 2.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, of the flow diagrams and block diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules or units in various embodiments of the invention may be integrated together to form a single part, or the modules may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention.

Claims (9)

1. A device search method, applied to a device side, the method comprising:
verifying whether the equipment end is started and successfully surfing the internet, and reading a unique identifier of an SIM card on the equipment end after the equipment end is started and successfully surfing the internet;
writing the unique identification into an identification theme, and issuing an identification theme with RETAIN (RETAIN) flag bit of 0 to an MQTT server through 4G communication by utilizing an MQTT protocol, wherein the identification theme comprises information of P2P communication between the equipment end and the PC end, a preset issuing period is set, and the identification theme is issued once every the preset issuing period;
judging whether the equipment end normally performs P2P communication with the PC end;
if so, stopping issuing the identification theme;
if not, reissuing the identification theme;
the PC terminal subscribes to the identification theme stored in the MQTT server, the equipment terminal issues the identification theme each time, the PC terminal immediately receives and immediately searches equipment, when the equipment terminal is searched, whether the corresponding unique identification is contained in a local database of the PC terminal is judged, if the corresponding unique identification is not contained in the local database, the corresponding unique identification and the identification theme are stored in the local database, and one equipment terminal and the PC terminal are selected to perform P2P communication.
2. A device search method, applied to a PC, comprising:
searching a device end, and searching whether a local database of the PC end contains a unique identifier;
if the unique identifier is contained, the memory used for storing the unique identifier in the local database is emptied;
subscribing all identification topics corresponding to the unique identifications stored in the MQTT server, and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched;
if the unique identification and the identification theme are not contained in the local database, storing the corresponding unique identification and the identification theme into the local database, and selecting one equipment end to perform P2P communication with the PC end;
the identification topics in the MQTT server are identification topics issued to the MQTT server by the equipment end through 4G communication;
after the equipment end is started and is successfully connected to the Internet, reading a unique identifier of a SIM card on the equipment end, writing the unique identifier into the identifier theme, and issuing an identifier theme with a RETAIN (RETAIN) zone bit of 0 to the MQTT server through 4G communication by utilizing an MQTT protocol, wherein the identifier theme comprises information of P2P communication between the equipment end and the PC end, a preset issuing period is set, and the identifier theme is issued once every preset issuing period;
the equipment end judges whether P2P communication is normally carried out with the PC end;
if so, stopping issuing the identification theme;
and if not, reissuing the identification theme.
3. The device searching method according to claim 2, wherein after said searching whether the local database of the PC side contains the unique identifier of the device side, further comprising:
if the unique identifier is not contained, acquiring the unique identifier of the target equipment end which is required to be searched and is filled by the user, and searching whether the local database contains the unique identifier of the target or not again.
4. The device searching method according to claim 2, wherein after subscribing to the identification topics corresponding to all the unique identifications stored in the local database, further comprising:
setting a preset search period, searching the equipment end every other preset search period, and resetting the preset search period when the equipment end is not searched.
5. The equipment searching system is characterized by comprising an equipment end and a PC end;
the device side is used for verifying whether the device side is started and successfully surfing the Internet, reading a unique identifier of a SIM card on the device side after the device side is started and successfully surfing the Internet, writing the unique identifier into an identifier theme, utilizing an MQTT protocol to issue the identifier theme with RETAIN (RETAIN) bit of 0 to an MQTT server through 4G communication, setting a preset issue period, issuing the identifier theme once every preset issue period, judging whether the device side normally communicates with the PC side for P2P, stopping issuing the identifier theme if the device side normally communicates with the PC side, and re-issuing the identifier theme if the device side normally communicates with the PC side;
the PC end is used for searching the equipment end and searching whether a local database of the PC end contains a unique identifier, if so, the memory used for storing the unique identifier in the local database is emptied, the identification subject corresponding to all the unique identifiers stored in the MQTT server is subscribed, and if so, whether the corresponding unique identifier is contained in the local database is judged, if not, the corresponding unique identifier and the identification subject are stored in the local database, and one equipment end and the PC end are selected for P2P communication.
6. A device search apparatus, applied to a device side, comprising:
the reading module is used for verifying whether the equipment end is started and successfully surfing the internet, and reading the unique identifier of the SIM card on the equipment end after the equipment end is started and successfully surfing the internet;
the issuing module is used for writing the unique identifier into an identification theme, issuing the identification theme with RETAIN zone bit of 0 to an MQTT server through 4G communication by utilizing an MQTT protocol, wherein the identification theme comprises information of P2P communication between the equipment end and the PC end, a preset issuing period is set, and the identification theme is issued once every the preset issuing period;
the judging module is used for judging whether the equipment end normally performs P2P communication with the PC end;
the first judging sub-module is used for stopping issuing the identification theme if the identification theme is normal;
the second judging sub-module is used for reissuing the identification theme if abnormal;
the PC terminal subscribes to the identification theme stored in the MQTT server, the equipment terminal issues the identification theme each time, the PC terminal immediately receives and immediately searches equipment, when the equipment terminal is searched, whether the corresponding unique identification is contained in a local database of the PC terminal is judged, if the corresponding unique identification is not contained in the local database, the corresponding unique identification and the identification theme are stored in the local database, and one equipment terminal and the PC terminal are selected to perform P2P communication.
7. A device search apparatus, characterized by being applied to a PC side, comprising:
the searching module is used for searching the equipment end and searching whether the local database of the PC end contains a unique identifier or not;
the emptying module is used for emptying the memory used for storing the unique identifier in the local database if the unique identifier is contained;
the subscription module is used for subscribing the identification topics corresponding to all the unique identifications stored in the MQTT server and judging whether the corresponding unique identifications are contained in the local database when the equipment end is searched;
the communication module is used for storing the corresponding unique identification and identification subject to the local database if the unique identification and identification subject is not contained in the local database, and selecting one equipment end to perform P2P communication with the PC end;
the identification topics in the MQTT server are identification topics issued to the MQTT server by the equipment end through 4G communication;
after the equipment end is started and is successfully connected to the Internet, reading a unique identifier of a SIM card on the equipment end, writing the unique identifier into the identifier theme, and issuing an identifier theme with a RETAIN (RETAIN) zone bit of 0 to the MQTT server through 4G communication by utilizing an MQTT protocol, wherein the identifier theme comprises information of P2P communication between the equipment end and the PC end, a preset issuing period is set, and the identifier theme is issued once every preset issuing period;
the equipment end judges whether P2P communication is normally carried out with the PC end;
if so, stopping issuing the identification theme;
and if not, reissuing the identification theme.
8. A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the device search method of any of claims 1-4 when the computer program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the steps of the device search method of any one of claims 1-4.
CN202311280149.5A 2023-10-07 2023-10-07 Device searching method, system, device, computer device and storage medium Active CN117014850B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311280149.5A CN117014850B (en) 2023-10-07 2023-10-07 Device searching method, system, device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311280149.5A CN117014850B (en) 2023-10-07 2023-10-07 Device searching method, system, device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN117014850A CN117014850A (en) 2023-11-07
CN117014850B true CN117014850B (en) 2024-01-19

Family

ID=88569458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311280149.5A Active CN117014850B (en) 2023-10-07 2023-10-07 Device searching method, system, device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN117014850B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018147A (en) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 A kind of Internet of Things communication means and system, gateway module
CN108965447A (en) * 2018-07-27 2018-12-07 四川爱创科技有限公司 The method and system that data are acquired and remotely controlled
CN111799867A (en) * 2020-07-21 2020-10-20 国网智能科技股份有限公司 Mutual trust authentication method and system between charging equipment and charging management platform
CN113692091A (en) * 2021-08-11 2021-11-23 深圳市智岩科技有限公司 Device control method, device, terminal device and storage medium
CN115883669A (en) * 2022-11-29 2023-03-31 重庆长安汽车股份有限公司 Data distribution method, system, equipment and medium
WO2023077968A1 (en) * 2021-11-04 2023-05-11 武汉路特斯汽车有限公司 On-board communication method, apparatus and device, and storage medium
CN116261065A (en) * 2023-02-15 2023-06-13 北京拓疆者智能科技有限公司 Communication method, equipment and storage medium based on message queue telemetry transmission protocol
CN116388982A (en) * 2023-03-30 2023-07-04 深圳市酷开网络科技股份有限公司 Equipment anonymization data association processing method, device and terminal
CN116546660A (en) * 2023-03-23 2023-08-04 深圳市正浩创新科技股份有限公司 Bluetooth testing method and device, upper computer equipment and storage medium
CN116846959A (en) * 2023-07-07 2023-10-03 东软睿驰汽车技术(大连)有限公司 Message receiving and transmitting method and device based on MQTT protocol

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018147A (en) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 A kind of Internet of Things communication means and system, gateway module
CN108965447A (en) * 2018-07-27 2018-12-07 四川爱创科技有限公司 The method and system that data are acquired and remotely controlled
CN111799867A (en) * 2020-07-21 2020-10-20 国网智能科技股份有限公司 Mutual trust authentication method and system between charging equipment and charging management platform
CN113692091A (en) * 2021-08-11 2021-11-23 深圳市智岩科技有限公司 Device control method, device, terminal device and storage medium
WO2023077968A1 (en) * 2021-11-04 2023-05-11 武汉路特斯汽车有限公司 On-board communication method, apparatus and device, and storage medium
CN115883669A (en) * 2022-11-29 2023-03-31 重庆长安汽车股份有限公司 Data distribution method, system, equipment and medium
CN116261065A (en) * 2023-02-15 2023-06-13 北京拓疆者智能科技有限公司 Communication method, equipment and storage medium based on message queue telemetry transmission protocol
CN116546660A (en) * 2023-03-23 2023-08-04 深圳市正浩创新科技股份有限公司 Bluetooth testing method and device, upper computer equipment and storage medium
CN116388982A (en) * 2023-03-30 2023-07-04 深圳市酷开网络科技股份有限公司 Equipment anonymization data association processing method, device and terminal
CN116846959A (en) * 2023-07-07 2023-10-03 东软睿驰汽车技术(大连)有限公司 Message receiving and transmitting method and device based on MQTT protocol

Also Published As

Publication number Publication date
CN117014850A (en) 2023-11-07

Similar Documents

Publication Publication Date Title
EP3618563B1 (en) System, method, and device for exposing wireless module data storage
EP2667519A1 (en) Bluetooth connection method
KR20180107777A (en) Resource acquisition method and associated device
US20150363182A1 (en) Smart device, wearable device and method for pushing &amp;receiving installation package
KR20160086926A (en) Communication system, beacon device, communication method, and electronic apparatus
CN110912805B (en) Message reading state synchronization method, terminal, server and system
CN111224837B (en) Method and system for automatically identifying CAN communication baud rate of vehicle ECU
CN111159269B (en) Data processing method, device and system
CN117014850B (en) Device searching method, system, device, computer device and storage medium
CN102083058A (en) Smart card, card writing system and method and self-help account opening server
CN108833961B (en) Method, server and system for acquiring flight record data
CN106790653B (en) File transmission processing method and device
CN111200640B (en) Uploading method based on client and client
CN110704198B (en) Data operation method, device, storage medium and processor
US20190208471A1 (en) Smart card control method and device, terminal device and smart card
US7836234B2 (en) Communication in accordance with a master-slave communication protocol
CN106297804B (en) Voice interaction method and system of projector
CN106790269B (en) Recovery method and device for overtime login of application program
CN101315280B (en) Navigator activation method, navigator activation centre and navigator
CN111895620B (en) Air conditioner control method, air conditioner, server and air conditioner control device
CN103067850B (en) Mobile communication service cost inquiry method and device and system
CN112328245A (en) Page display method, system, electronic equipment and storage medium
CN107968739B (en) Group message viewing method and device and server
CN111885097A (en) Network card processing method and device, electronic equipment and storage medium
CN106503600B (en) A kind of RFID active anti-collision method based on timing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant