Online query method and device of equipment, computer equipment, storage medium and program product

By setting up two filters in the memory for online status query, the problem of low query efficiency in the existing technology is solved, and faster query speed and higher accuracy are achieved.

CN119377269APending Publication Date: 2025-01-28CHINA GRIDCOM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411233433.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art is low in query efficiency when monitoring and managing the online status of massive devices, especially when the number of devices increases, disk reading and writing is required for database query, resulting in reduced efficiency.

Method used

By setting up two filters (such as the Bloom filter and cloth bird filter) in the memory to conduct online status query of the device in turn, the first filter is performed quickly and roughly, and the second filter is accurate. Equipment information to reduce query data.

Benefits of technology

The efficiency of equipment status query has been improved. Compared with the disk query method faster, the query accuracy is guaranteed through dual query and unnecessary query operations are reduced, and the balance and accuracy of efficiency and accuracy are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377269A_ABST
    Figure CN119377269A_ABST
Patent Text Reader

Abstract

The invention discloses an online query method and device of equipment, a chip, a storage medium and a program product. The method comprises the steps that under the condition that a state query request of target equipment is received, the state of the target equipment is queried through a first filter to obtain a first query result, the first query result is offline or online, and the target equipment is any equipment; under the condition that the first query result is online, the state of the target equipment is queried through a second filter so as to obtain a second query result, the second query result is offline or online, information of all online equipment is stored in the first filter and the second filter, and the first filter and the second filter run in a memory; and under the condition that the second query result is online, determining that the target equipment is online. According to the technical scheme, the query efficiency can be improved, unnecessary query operation is reduced under the condition that the query accuracy is guaranteed through double query, and balance of the query accuracy and the query efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of Internet of Things, and in particular, relates to an online query method for a device, an online query device, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the rapid development of Internet of Things technology, the number of devices connected to the network has exploded. How to efficiently monitor and manage the online status of massive devices has become a problem that needs to be solved urgently.

[0003] Traditional equipment online status monitoring methods usually use databases (such as MySQL) or caches to store equipment status information. For example, a field is maintained for each device to record its online status. However, when querying the database, disk reading and writing are required. As the number of devices increases, the amount of data required to be queried also increases, resulting in reduced query efficiency. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes an online query method, an online query device, a computer device, a computer readable storage medium and a computer program product, which can improve the efficiency of device status query.

[0005] In a first aspect, the present application provides a method for online query of a device, the method comprising, upon receiving a status query request of a target device, querying the status of the target device through a first filter to obtain a first query result, the first query result being offline or online, and the target device being any device; when the first query result is online, querying the status of the target device through a second filter to obtain a second query result, the second query result being offline or online, and information of each online device being stored in the first filter and the second filter, and the first filter and the second filter running in memory; when the second query result is online, determining that the target device is online.

[0006] In a second aspect, the present application provides an online query device, the online query device comprising:

[0007] A first query module is used to query the status of the target device through a first filter to obtain a first query result when receiving a status query request of the target device, wherein the first query result is offline or online, and the target device is any device;

[0008] A second query module, when the first query result is online, queries the state of the target device through a second filter to obtain a second query result, the second query result is offline or online, and the information of each online device is stored in the first filter and the second filter, and the first filter and the second filter are run in the memory;

[0009] A determination module is used to determine that the target device is online when the second query result is online.

[0010] In a third aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned online query method when executed by a processor.

[0011] In a fourth aspect, the present application provides a computer device comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program implements the above-mentioned online query method when executed by the processor.

[0012] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned online query method when executed by a processor.

[0013] The online query method, online query device, computer equipment, computer-readable storage medium and computer program product provided by the embodiments of the present application perform online status query of the device in sequence by setting two filters running in the memory, and the query speed is faster than the disk query method. When querying the online status of the device, the first filter and the second filter only need to store the online device information, and do not need to store the offline device information. Therefore, the amount of data when querying is small, which can improve the query efficiency.

[0014] In addition, the present application only needs to further perform a status query through the second filter when the first filter confirms that the device is online, so as to quickly determine the offline device. While ensuring the query accuracy through double query, unnecessary query operations are reduced to achieve a balance between query accuracy and query efficiency.

[0015] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0017] Figure 1It is a schematic diagram of an application scenario of the online query method provided in an embodiment of the present application;

[0018] Figure 2 It is a flowchart of the online query method provided in the embodiment of the present application;

[0019] Figure 3 It is a flowchart of the online query method provided in the embodiment of the present application;

[0020] Figure 4 It is a flowchart of the online query method provided in the embodiment of the present application;

[0021] Figure 5 is a module schematic diagram of an online query device provided in an embodiment of the present application; and

[0022] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0024] For ease of understanding, the application scenarios of this application are first introduced below:

[0025] See also Figure 1 , Figure 1 1 is an application scenario diagram of an online query method provided in an embodiment of the present application. The application scenario provided in the present application includes an Internet of Things device 101 and a server 102, and the online query method provided in the present application can be executed by the server 102.

[0026] IoT devices refer to physical devices that can connect to the Internet and exchange data through the network. These devices usually contain sensors, actuators, and other embedded systems to collect data, perform specific tasks, or communicate with other devices.

[0027] IoT devices may include, but are not limited to, smart meters, sensor devices (such as temperature sensors, humidity sensors, light sensors, etc.), actuator devices (smart light bulbs, smart sockets, electronic locks, etc.), embedded devices (smart TVs, smart speakers, smart refrigerators, etc.), vehicle-mounted devices (smart vehicles, vehicle-mounted navigation systems, etc.), etc. The embodiments of this application do not limit this.

[0028] The server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but the embodiments of the present application do not limit this.

[0029] It should be noted that Figure 1 The number of IoT devices and servers is only used as an example, and the number of IoT devices and servers can be more or less, which is not limited here. IoT devices and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.

[0030] In some embodiments, the application scenario further includes a terminal device 103. The terminal device 103 can communicate with the server 102 to query the status information of any IoT device 101.

[0031] Among them, the terminal device 103 may include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, laptops, desktop computers, smart speakers, smart watches, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, wearable devices, etc., and the embodiments of the present application do not limit this.

[0032] The online query method involved in this application can be implemented based on cloud technology.

[0033] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data calculation, storage, processing and sharing.

[0034] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0035] The online query method of the present application can be implemented based on cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0036] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0037] The online query method in the embodiment of the present application can be executed by a computer device, and the computer device can be a server connected to the Internet of Things device. The following description takes the computer device as an example of a server.

[0038] Based on the introduction of the above application scenarios, the embodiment of the present application provides an online query method, which is described in detail below:

[0039] See also Figure 2 An online query method provided in an embodiment of the present application is implemented by steps 011 to 013, which are described in detail below.

[0040] Step 011: when receiving a status query request of a target device, query the status of the target device through a first filter to obtain a first query result, the first query result is offline or online, and the target device is any device.

[0041] Here, the device refers to the IoT device mentioned above.

[0042] The first filter runs in the memory, and the first filter includes a Bloom filter.

[0043] Bloom filter is a highly space-efficient probabilistic data structure used to test whether an element is in a set. It does not store the elements themselves, but maps the elements to a bit array through a hash function. Bloom filter can give an answer that an element "may be in the set", but cannot definitively point out that an element is not in the set. There is a certain false positive rate, that is, it may mistakenly judge that an element exists in the set.

[0044] Specifically, the terminal device can query the status of any target device through the server. The terminal device can send a query request to the server, and the query request includes information of the target device (such as the device identification (i.e., device ID) of the target device). After receiving the query request, the server can query the status of the target device through a first filter (such as a Bloom filter) to obtain a first query result, and the first query result is offline or online, thereby determining whether the target device is online or offline.

[0045] For example, the Bloom filter stores the device IDs of various online devices, which form a set. The Bloom filter is used to determine whether the device ID of the target device is in the set to query the status of the target device. If the device ID of the target device is in the set, it can be determined that the target device may be online, and if the device ID of the target device is not in the set, it can be determined that the target device is offline.

[0046] In this way, the state query of the target device is realized through the Bloom filter which is extremely space efficient and runs in the memory, and the query efficiency is high.

[0047] Step 012: When the first query result is online, query the status of the target device through the second filter to obtain a second query result. The second query result is offline or online. The information of each online device is stored in the first filter and the second filter.

[0048] The second filter runs in the memory, and the second filter includes a cuckoo filter.

[0049] The Cuckoo filter is an improved probabilistic data structure, similar to the Bloom filter, but it can not only efficiently check whether an element exists, but also supports deletion operations and has a lower false positive rate. In other words, the Cuckoo filter has a higher accuracy rate in querying the online status of devices.

[0050] Specifically, when the first query result is online, it can be determined that the target device may be online, and further confirmation is required to ensure the accuracy of the query. Therefore, the state of the target device is queried through the second filter to obtain the second query result, and the second query result is offline or online, thereby accurately determining whether the target device is online.

[0051] In this way, a quick and rough query is performed through the first filter to improve the query efficiency, and then a precise query is performed on the devices that may be online through the second filter, thereby ensuring the accuracy and query efficiency of the online query of the devices.

[0052] Step 013: When the second query result is online, determine that the target device is online.

[0053] Specifically, after double querying the first filter and the second filter, if the results are both online, it can be accurately determined that the target device is online, and the server can give the query result to the terminal device to complete the query request.

[0054] It can be understood that since the second filter and the second filter store the device information of each online device, there may be misjudgment when the query results of the first filter and the second filter are online, but they are generally accurate when the query results of the first filter and the second filter are offline.

[0055] Therefore, when the first query result of the first filter is offline, it can be determined that the device ID of the target device is not in the first filter, and the target device can be quickly and accurately determined to be offline; or, when the second query result of the second filter is offline, it can be determined that the device ID of the target device is not in the second filter, and the target device can be accurately determined to be offline.

[0056] Optionally, when it is determined that the target device is offline, the query result may be sent to the terminal device, and offline alarm information may be sent to the management backend of the server.

[0057] It is understandable that IoT devices generally remain connected after being turned on. If an IoT device is offline, it means that the IoT device may have a fault. If it is not handled at this time, it may affect the smooth progress of the business related to the IoT device.

[0058] Therefore, offline alarm information can be sent to the management background of the server to prompt the administrator to maintain the offline IoT devices in time to ensure the normal operation of the business.

[0059] The online query method provided in the embodiment of the present application sequentially queries the online status of the device by setting two filters running in the memory. Compared with the disk query method, the query speed is faster. When querying the online status of the device, the first filter and the second filter only need to store the online device information, and do not need to store the offline device information. Therefore, the amount of data when querying is small, which can improve the query efficiency.

[0060] In addition, the present application only needs to further perform a status query through the second filter when the first filter confirms that the device is online, so as to quickly determine the offline device. While ensuring the query accuracy through double query, unnecessary query operations are reduced to achieve a balance between query accuracy and query efficiency.

[0061] See also Figure 3 In some embodiments, information of each device is stored in a database, the information of the device includes a device identifier and a heartbeat timestamp, and the method further includes:

[0062] Step 014: When receiving the heartbeat packet of the target device, determine that the target device is online, and update the state identifier and heartbeat timestamp of the target device. The state identifier of the online device is 1.

[0063] Among them, the heartbeat packet is a heartbeat signal. The device will continue to send heartbeat packets to the server at a preset frequency to maintain communication between the two.

[0064] Heartbeat signal is a signal or message sent periodically in communication and network systems to detect connection status or confirm the activity of a communication link. The main purpose of the heartbeat signal is to ensure that the system can promptly detect and handle problems such as communication link interruption or device failure.

[0065] Specifically, after the target device is turned on, it will send a heartbeat packet to the server. When the server receives the heartbeat packet of the target device, it can determine that the target device is online (ie, has been connected to the network), and the status of the target device becomes online.

[0066] The information of each device is stored in the database, and the information of the device mainly includes device identification, heartbeat timestamp, status identification and other device-related information. Among them, the device identification is the unique identification of the device, which is used to determine the identity of the device. The heartbeat timestamp records the timestamp of the last heartbeat packet sent by the device. The status identification is used to identify whether the device is online or offline (for example, the device identification is 1 to indicate that the device is online, and the device identification is 0 to indicate that the device is offline).

[0067] In order to ensure the accuracy of the device information, the device information needs to be maintained in a timely manner. Therefore, when the heartbeat packet of the target device is received, the state identifier and the heartbeat timestamp of the target device can be updated.

[0068] Optionally, the heartbeat packet includes the device identification and sending time of the target device. When it is determined that the heartbeat packet of the target device is received based on the device identification of the heartbeat packet, the status identification of the target device can be updated to 1, and the heartbeat timestamp of the target device can be updated based on the sending time of the received heartbeat packet.

[0069] Optionally, since the device identification is generally unchanged, it is only necessary to store the device identification of the target device when the heartbeat packet of the target device is received for the first time. After the heartbeat packet of the target device is subsequently received, it is only necessary to update the state identification and heartbeat timestamp of the target device.

[0070] See also Figure 4 In some embodiments, information of each device is stored in a database, the information of the device includes a state identifier and a heartbeat timestamp, and the method further includes:

[0071] Step 015: Based on the heartbeat timestamp of each device and the current time stored in the database, timeout detection is performed regularly to obtain the timeout detection result of each device, where the timeout detection result includes timeout or non-timeout;

[0072] Step 016: When the timeout detection result of the target device is timeout, it is determined that the target device is offline, and the status identifier of the target device is updated. The status identifier of the offline device is 0.

[0073] Specifically, the database stores the heartbeat timestamps of each device. After the device goes offline, the device no longer sends heartbeat packets to the server, and the heartbeat timestamp of the device no longer changes. Therefore, if the time difference between the heartbeat timestamp of any device and the current time is too large (such as greater than the preset time difference (such as 1 minute, 5 minutes, etc.)), it can be determined that the heartbeat timestamp of the device has timed out. In the case of the heartbeat timestamp of the device timed out, it can be determined that the device is offline.

[0074] Therefore, in order to detect the offline status of the device in time, the server can perform timeout detection regularly, subtract the heartbeat timestamp of each device from the current time to obtain the timeout detection result of each device, and for the device whose timeout detection result is timeout, the device identification of the device can be updated (such as updated to 0).

[0075] Optionally, for a device with a timeout period that is too long (such as 1 month, 3 months, half a year, etc.), it can be determined that the device is damaged or has been replaced, so the heartbeat timestamp and device identification of the device can be deleted to clear the invalid device.

[0076] Optionally, when the target device changes from an offline state to an online state, the device identification of the target device is stored in the first filter and the second filter. When the target device changes from an online state to an offline state, the device identification of the target device is deleted from the first filter and the second filter.

[0077] Specifically, in order to ensure the accuracy of the information of each device stored in the first filter and the second filter, it is necessary to maintain the information of each device stored in the first filter and the second filter when the status of the device changes (such as from online to offline, or from offline to online).

[0078] For example, when any target device among the devices changes from an offline state to an online state (i.e., a heartbeat packet is received and the state identifier before receiving the heartbeat packet is 0), the device identifier of the target device can be stored in the first filter and the second filter, so that the device identifiers of each online device are stored in the first filter and the second filter.

[0079] When any target device among the devices changes from an online state to an offline state (i.e., the timeout detection result is a timeout and the state identifier before the timeout is 1), the device identifier of the target device can be deleted from the first filter and the second filter. In this way, it can be ensured that there is no offline device identifier in the first filter and the second filter, and the query accuracy of the first filter and the second filter is guaranteed.

[0080] Optionally, information of each device is stored in a database, and the database includes a memory database (eg, a Redis memory database).

[0081] In this way, by using Redis to store device online status information, the load pressure of traditional databases can be effectively reduced, avoiding performance bottlenecks caused by frequent reading and writing of status information. In addition, Redis supports cluster deployment and can be easily expanded horizontally to cope with the continuous growth of the number of devices, with stronger scalability than traditional databases.

[0082] Optionally, the database stores the status identifier of each device via a bitmap.

[0083] The database can create a bitmap to store the status of each device, with each bit representing the status of a device (such as 1 for online and 0 for offline). In this way, compared with the database data plus index method to store device information, which occupies a large amount of space, the use of bitmaps and filters to store device information greatly reduces the storage space.

[0084] And the data storage mainly includes two parts: one is the device identification and heartbeat timestamp, and the other is the device identification and status identification, which are generally stored separately. The storage of device identification and status identification in this application can save 80% of space, that is, the total storage occupation of Bloom filter, cuckoo filter and bitmap in redis memory database is much less than that in common databases.

[0085] For example, if there are 10 billion devices and the device ID length is 19, the data stored in the regular database table will occupy about 2500G in total, while in Redis it will occupy: Figure 1 G, Bloom filter 15G, cuckoo filter 80G, approximately equal to 96G, greatly reducing the space occupied.

[0086] According to the method described in the above embodiment, the present application embodiment also provides an online query device 300, which is used to execute the steps in the above online query method. Figure 5 , Figure 5 : is a schematic diagram of the structure of an online query device 300 provided in an embodiment of the present application. The online query device 300 includes:

[0087] The first query module 301 is used to query the status of the target device through the first filter to obtain a first query result when receiving a status query request of the target device, the first query result is offline or online, and the target device is any device;

[0088] The second query module 302 queries the state of the target device through the second filter to obtain a second query result when the first query result is online. The second query result is offline or online. The information of each online device is stored in the first filter and the second filter. The first filter and the second filter are run in the memory.

[0089] The determination module 303 is used to determine that the target device is online when the second query result is online.

[0090] It should be noted that the specific details of each module unit in the above-mentioned online query device 300 have been described in detail in the embodiment of the above-mentioned online query method, and will not be repeated here.

[0091] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0092] In some embodiments, the online query device in the embodiments of the present application can be implemented in hardware, such as a chip, or a component in a chip, such as an integrated circuit or a chip; the online query device can also be implemented in software, such as as an application installed in a chip.

[0093] Among them, chips, also known as integrated circuits (ICs), microcircuits or microchips, are the core components of modern electronic devices. They are made of semiconductor materials (usually silicon) and integrate millions or even billions of microelectronic components (such as transistors, resistors, capacitors, etc.) through a series of complex manufacturing processes to form an electronic circuit with specific functions. These components and their interconnections are manufactured on the same small silicon wafer. They are small in size, light in weight, but powerful in function. They are the basis of various electronic products such as computers, smart phones, home appliances, automobiles, medical equipment, etc.

[0094] In some embodiments, see Figure 6 , Figure 6 4 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 400 includes a processor 401 and a memory 402. The memory 402 stores a computer program 403 that can be run on the processor 401. When the program 403 is executed by the processor 401, each process of the embodiment of the above-mentioned function restriction method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0095] The embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the embodiment of the above-mentioned online query method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0096] The processor may be the chip in the above embodiment. The computer readable storage medium may be a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0097] Computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that computer storage media are not limited to the above.

[0098] The embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned online query method when executed by a processor. The processor may be a chip in the above-mentioned embodiment. When the computer program is executed by the processor, each process of the embodiment of the above-mentioned online query method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0099] It is understandable that in the specific implementation of this application, data related to user identity or characteristics is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0100] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for online query of a device, characterized in that: include: In case of receiving a status query request of a target device, querying the status of the target device through a first filter to obtain a first query result, wherein the first query result is offline or online, and the target device is any device; In the case where the first query result is online, querying the state of the target device through the second filter to obtain a second query result, the second query result is offline or online, and the information of each online device is stored in the first filter and the second filter, and the first filter and the second filter are run in the memory; When the second query result is online, it is determined that the target device is online.

2. The online query method according to claim 1, characterized in that: The first filter is a Bloom filter, and the second filter is a cuckoo filter.

3. The online query method according to claim 1, characterized in that: The information of each device is stored in a database, wherein the information of the device includes a device identification and a heartbeat timestamp. The method further includes: When the heartbeat packet of the target device is received, it is determined that the target device is online, and the state identifier of the target device and the heartbeat timestamp are updated. The state identifier of the online device is 1.

4. The online query method according to claim 3, characterized in that: The heartbeat timestamp is determined based on the heartbeat packet, and the heartbeat packet includes a device identifier of the target device and a sending time.

5. The online query method according to claim 3 or 4, characterized in that: The method further comprises: When the target device changes from an offline state to an online state, the device identification of the target device is stored in the first filter and the second filter.

6. The online query method according to claim 1, characterized in that: The information of each device is stored in a database, wherein the information of the device includes a status identifier and a heartbeat timestamp. The method further includes: Based on the heartbeat timestamp and current time of each device stored in the database, timeout detection is performed regularly to obtain a timeout detection result of each device, wherein the timeout detection result includes timeout or non-timeout; When the timeout detection result of the target device is timeout, it is determined that the target device is offline, and the state identifier of the target device is updated. The state identifier of the offline device is 0.

7. The online query method according to claim 6, characterized in that: The method further comprises: When the target device changes from an online state to an offline state, the device identification of the target device is deleted from the first filter and the second filter.

8. The online query method according to claim 1, characterized in that: The information of each device is stored in a database, which includes a memory database.

9. The online query method according to any one of claims 3 to 8, characterized in that: The database stores the status identifier of each device via a bitmap.

10. The online query method according to claim 1, characterized in that: Also includes: When the first query result is offline or the second query result is offline, it is determined that the target device is offline.

11. The online query method according to claim 8, characterized in that: Also includes: When the target device is offline, an offline alarm message is issued.

12. An online query device, characterized in that: include: A first query module is used to query the status of the target device through a first filter to obtain a first query result when receiving a status query request of the target device, wherein the first query result is offline or online, and the target device is any device; A second query module, when the first query result is online, queries the state of the target device through a second filter to obtain a second query result, the second query result is offline or online, and the information of each online device is stored in the first filter and the second filter, and the first filter and the second filter are run in the memory; A determination module is used to determine that the target device is online when the second query result is online.

13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the online query method according to any one of claims 1 to 11 is implemented.

14. A computer device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the online query method according to any one of claims 1 to 11 is implemented.

15. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the online query method according to any one of claims 1 to 11.