Gateway-based node scanning method and related device

Through asynchronous processing and multi-threaded parallel scanning technology, it solves the problem of low scanning efficiency caused by the large number of physical devices in the OPCUA gateway and repeated scanning caused by network interruption, and achieves efficient node information acquisition in the industrial Internet.

CN118694634APending Publication Date: 2024-09-24NINGBO HOLLYSYS INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410830234.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the industrial Internet, the number of physical devices in the OPCUA gateway is huge, resulting in low scanning efficiency. Especially when the network environment is unstable, scanning will be interrupted and scanning needs to be repeated from the beginning, resulting in low efficiency.

Method used

By sending a scan request to the gateway, the response is processed asynchronously, the failed node information is stored, and scanning continues when the network recovers. Multi-threaded parallel scanning is used to store successful node information in different areas to improve scanning efficiency.

Benefits of technology

It reduces repeated scanning when the network environment is unstable, improves scanning efficiency, ensures rapid recovery of scanning after the network is restored, and improves the overall node information acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694634A
    Figure CN118694634A
Patent Text Reader

Abstract

The invention provides a gateway-based node scanning method and a related device, and the method comprises the steps: sending a scanning request to a gateway by an application, responding to a scanning response sent by the gateway, carrying out the sending of a next scanning request and the processing of the scanning response in a concurrent and asynchronous manner, and responding to a condition that the scanning response is not received, the sending of the next scanning request and the storage of the information of the first node failed in scanning are executed asynchronously and concurrently, the scanning request comprises the information of the node, the scanning response at least indicates that the scanning of the first node is successful or failed, and the processing of the scanning response comprises: storing the information of the first node under the condition that the scanning response indicates that the scanning of the first node is failed. No matter whether the scanning response is received or not, the application asynchronously executes the subsequent steps in parallel, so that the scanning efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial Internet technology, and in particular to a gateway-based node scanning method and related devices. Background Art

[0002] The OPCUA gateway is a gateway created in accordance with the OPCUA protocol.

[0003] like Figure 1 As shown in the figure, each physical device in the Industrial Internet is a logical node. Figure 1 Taking industrial equipment and information systems as an example, the collected data is reported to the OPCUA gateway through the data collection driver. The OPCUA gateway performs protocol analysis and unified conversion on the received data, and performs edge computing on some data. The OPCUA gateway exposes the standard OPCUA protocol interface to the outside world. The external system can interact with each physical device in the Internet of Things through the OPCUA protocol interface without paying attention to the specific situation of each physical device (such as address changes).

[0004] The OPC UA gateway includes logical nodes corresponding to the physical devices on the Internet. The upper-level applications in the external system obtain the data collected by the physical devices by scanning the logical nodes in the OPC UA gateway.

[0005] Because the number of physical devices in the Internet of Things is huge, how to improve scanning efficiency has become a problem that needs to be solved at present. Summary of the invention

[0006] The present application provides a gateway-based node scanning method and related devices, aiming to solve the problem of how to improve the scanning efficiency of physical devices in the Internet.

[0007] In order to achieve the above objectives, this application provides the following technical solutions:

[0008] A first aspect of the present application provides a node scanning method based on a gateway, which is applied to an application for scanning the node, and the method includes:

[0009] Sending a scan request to a gateway, wherein the scan request includes information of nodes, and the nodes include at least a first node;

[0010] In response to receiving a scan response sent by the gateway, concurrently and asynchronously performing the following steps: sending a next scan request and processing the scan response, the scan response at least indicating a scan success or a scan failure of the first node, the processing of the scan response comprising: storing information of the first node if the scan response indicates a scan failure of the first node;

[0011] In response to not receiving the scan response, the following steps are performed concurrently and asynchronously: sending a next scan request and storing the information of the first node.

[0012] In some implementations, the method further includes:

[0013] In response to receiving the scan completion message sent by the gateway, based on the stored node information, the nodes whose information is stored are scanned again.

[0014] In some implementations, when the scan response indicates that the first node fails to scan, storing the information of the first node includes:

[0015] If the scan response indicates that the scan of the first node fails, storing the information of the first node in a preconfigured queue;

[0016] In response to not receiving the scan response, the following steps are performed asynchronously and concurrently: sending a next scan request and storing information of the first node, including:

[0017] In response to not receiving the scan response, concurrently and asynchronously performing the following steps: sending a next scan request and storing the information of the first node in a pre-configured fission failure storage area;

[0018] The step of rescanning the nodes where the information is stored based on the information of the stored nodes includes:

[0019] The nodes in the fission failure storage area are scanned.

[0020] In some implementations, before sending a scan request to the gateway, the method further includes:

[0021] Receiving information of nodes to be scanned sent by the gateway, where the nodes to be scanned include the first node and the second node;

[0022] The step of sending a scan request to the gateway includes:

[0023] A scan request for the first node is sent to the gateway through a first process, and a scan request for the second node is sent to the gateway through a second thread.

[0024] In some implementations, the method further includes:

[0025] Based on the characteristic values ​​of the successfully scanned nodes, the successfully scanned nodes are stored in different areas. The characteristic values ​​include the angles of the successfully scanned nodes, which are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

[0026] In some implementations, the feature value further includes:

[0027] The information of the successfully scanned node and the level of the node in the gateway.

[0028] A second aspect of the present application provides a node scanning device based on a gateway, comprising:

[0029] A sending module, used for sending a scanning request to the gateway, wherein the scanning request includes information of nodes, and the nodes include at least a first node;

[0030] A first processing module is configured to, in response to receiving a scan response sent by the gateway, concurrently and asynchronously perform the following steps: sending a next scan request and processing the scan response, wherein the scan response at least indicates that the scan of the first node succeeded or failed, and the processing of the scan response includes: storing information of the first node when the scan response indicates that the scan of the first node failed;

[0031] The second processing module is used for concurrently and asynchronously executing the following steps in response to not receiving the scan response: sending a next scan request and storing the information of the first node.

[0032] In some implementations, the method further includes:

[0033] The third processing module is used to store the successfully scanned nodes in different areas based on the characteristic values ​​of the successfully scanned nodes. The characteristic values ​​include the angles of the successfully scanned nodes, and the angles are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

[0034] In some implementations, the method further includes:

[0035] The third processing module is used to store the successfully scanned nodes in different areas based on the characteristic values ​​of the successfully scanned nodes. The characteristic values ​​include the angles of the successfully scanned nodes, and the angles are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

[0036] A third aspect of the present application provides an electronic device, including:

[0037] Memory and processor;

[0038] The memory is used to store a computer program, and the processor is used to run the computer program to implement the gateway-based node scanning method provided in the first aspect of the present application.

[0039] The fourth aspect of the present application provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the gateway-based node scanning method provided in the first aspect of the present application.

[0040] The fifth aspect of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the gateway-based node scanning method provided in the first aspect of the present application.

[0041] The present application provides a gateway-based node scanning method and related devices, wherein an application sends a scanning request to a gateway, and in response to receiving a scanning response sent by the gateway, asynchronously executes sending the next scanning request and processing the scanning response concurrently, and in response to not receiving the scanning response, asynchronously executes sending the next scanning request and storing information of the first node that failed to scan concurrently, wherein the scanning request includes information of the node, and the scanning response at least indicates whether the scanning of the first node succeeded or failed, and processing the scanning response includes: storing information of the first node when the scanning response indicates that the scanning of the first node failed. It can be seen that regardless of whether the scanning response is received, the application asynchronously and parallelly executes subsequent steps, thereby improving the efficiency of the scanning. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 An example diagram of industrial Internet communication including an OPC UA gateway and industrial equipment;

[0044] Figure 2 This is an example diagram of the architecture of the Industrial Internet platform;

[0045] Figure 3 An example diagram of the logical nodes (i.e., the internal structure) included in the OPC UA gateway;

[0046] Figure 4 A gateway-based node scanning method provided in an embodiment of the present application

[0047] Figure 5 Create a multi-threaded asynchronous and scan sample graph for the application;

[0048] Figure 6 An example diagram of storing information indicating that the callback information of the node that failed to be scanned into a queue;

[0049] Figure 7 An example diagram showing that a network failure occurs during the application scanning of nodes in the OPCUA gateway, resulting in a scanning interruption;

[0050] Figure 8 An example diagram of storing scanned node data in different regions provided in an embodiment of the present application;

[0051] Fig. 9 An example diagram of a string for configuring a node for calculating a hash value provided in an embodiment of the present application;

[0052] Fig.10 An example diagram of nodes at different angles being stored in different areas provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0054] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0055] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0056] Figure 2 As an example of the architecture of the industrial Internet platform, the edge layer is connected to on-site industrial equipment, systems, and products through a variety of industrial communication technologies, collects relevant data, performs protocol analysis and unified conversion of heterogeneous data, and performs edge computing on some data. It is a solid foundation for the entire industrial Internet platform. From a technical perspective, the OPC UA gateway is in the unified conversion and convergence layer of the edge layer.

[0057] exist Figure 2 In the scenario shown, the specific functions of the OPC UA gateway include conversion and aggregation.

[0058] Conversion can be understood as converting various heterogeneous protocols into the OPC UA unified protocol currently recognized by the industry, so as to realize the interaction of device data information and the interconnection of information systems, greatly reduce the difficulty of device networking, and realize the unification of access protocols.

[0059] Convergence can be understood as bringing together trillions of real-time data in the industrial field and recording the connection access channels of each physical device. All upper-layer applications based on the Industrial Internet, such as industrial real-time data analysis, smart production line applications, smart coal mines, etc., can greatly save the past one-to-many scenarios by scanning the OPCUA gateway, and can ignore the specific protocols of various devices. Only the standard OPCUA protocol is needed. For example, there are 100 devices on the production line, including dozens of different device protocols. If there is an OPCUA gateway, then the smart production line application only needs to connect and scan the OPCUA gateway to communicate standard protocol data with these 100 devices. The OPCUA gateway aggregates 100 devices into a unified and standard data set by building an OPCUA address space node based on the standard protocol.

[0060] Figure 3 This is an example diagram of the logical nodes (i.e., the internal structure) included in the OPC UA gateway. It can be seen that the OPC UA gateway brings together multiple physical devices in the form of logical nodes, and sets the hierarchical relationship of the logical nodes according to the hierarchical relationship between the physical devices.

[0061] The upper-layer application interacts with the nodes (i.e., industrial equipment) by scanning the logical nodes in the OPC UA gateway, for example, reading the data in the nodes.

[0062] Based on the above application scenarios, the inventors found in the process of research that the upper-layer application has the following specific problems in the process of scanning nodes in the OPC UA gateway:

[0063] 1. The OPCUA gateway connects to various underlying devices through various heterogeneous protocols, and at the same time builds a standard OPCUA protocol data address space. The address space contains a large amount of device node data, forming a huge, almost mesh-like hierarchical structure. How various applications on the upper layer of the industrial Internet can quickly scan all nodes of the entire OPCUA gateway in a short time is a problem that needs to be solved.

[0064] 2. The upper-layer application scanning the OPC UA gateway depends on the network environment. When the network between the upper-layer application and the OPC UA gateway is disconnected (or the network signal is poor), the upper-layer application's scanning of the OPC UA gateway will be interrupted. After waiting for the network to recover, how the upper-layer application can start from the node scanned last before the disconnection and avoid repeated scanning from the beginning is another problem that needs to be solved.

[0065] The above problems 1 and 2 can be summarized as how to improve the scanning efficiency of the upper-layer application on the OPC UA gateway.

[0066] In order to solve the above technical problems, the embodiments of the present application provide a method for scanning nodes based on a gateway. It can be understood that the OPC UA gateway is only an example of a gateway, and the method described in the embodiments of the present application is not limited to the OPC UA gateway. The following embodiments all take the OPC UA gateway as an example. In the following embodiments, the upper-layer application is referred to as an application.

[0067] like Figure 4 As shown, the gateway-based node scanning method provided in the embodiment of the present application includes the following steps:

[0068] S101. Based on the Nodejs protocol, the application applies for a callback storage area, a callback failure storage area, and a fission failure storage area in the memory.

[0069] The callback storage area is used to store the information of each node requested to be scanned in the OPCUA gateway and the corresponding response callback information. It is denoted as CalQueue and has a size of 1024 bits. The response callback information indicates whether the corresponding node requested to be scanned is successful or failed.

[0070] The callback failure storage area is used to store the information of the node that failed in the response callback information. It is denoted as CalFailQueue and has a size of 1024 bits.

[0071] The fission failure storage area is used to store information of nodes that have failed to fission. Fission can be understood as scanning of lower-level nodes. Fission failure can be understood as failure to scan lower-level nodes. In some implementations, the fission failure storage area is a continuous storage area, denoted as FailQueue, with a size of 1024 bits.

[0072] In some implementations, the node information includes the node ID. That is, the OPC UA gateway configures an ID for each node in the process of aggregating nodes. In other implementations, the node information includes the node ID and the node name, such as the name "root node".

[0073] S102: The application sends a scan request to the OPC UA gateway.

[0074] The scan request includes node information, indicating information of the nodes that the application is going to scan.

[0075] Because the nodes are stored in the OPCUA gateway, the OPCUA gateway needs to inform the application of the node information before the application can request to scan the nodes. Therefore, it can be understood that in some implementations, the application sends a scan request to the OPCUA gateway for the first time, and the application does not know the information of the nodes in the OPCUA gateway. Therefore, the node information in the scan request sent by the application for the first time is empty.

[0076] Combination Figure 3 As shown, because the application is unknown to the node information in the OPC UA gateway, the node information in the scan request sent for the first time is empty.

[0077] In this embodiment, the node scanning is implemented between the application and the gateway based on the TCP / IP network protocol. The TCP / IP network protocol is a typical protocol in a question-and-answer mode. That is, after the OPC UA gateway receives the scanning request, it sends a scanning response to the application, and the scanning response includes the information of the next-level node of the node in the scanning request.

[0078] In some implementations, the application has sent a scan request to the OPC UA gateway and received a scan response to the scan request. The application can then obtain information about the next-level node of the node in the last scan request sent from the scan response, and can continue to send scan requests to scan the next-level node.

[0079] Combination Figure 3As shown, as mentioned above, the node information in the scan request sent by the application for the first time is empty, and the node information parsed by the OPCUA gateway is empty, so a scan response including the root node information is sent to the application. Based on the scan response including the root node information, the application sends the scan request again, and the scan request sent again includes the root node information, indicating that the root node will be scanned.

[0080] In some implementations, the application sends a scan request to the OPC UA gateway based on the Nodejs protocol.

[0081] S103. The OPC UA gateway sends a scan response to the application in response to the scan request.

[0082] As mentioned above, in some implementations, the node information in the received scan request is empty, and the scan response includes the information of the root node in the OPC UA gateway, in order to inform the application to start scanning from the root node.

[0083] The scan response also includes a callback message, which indicates whether the scan of the node indicated by the scan request is successful. It can be understood that when the node information in the received scan request is empty, the callback message is empty.

[0084] In some other implementations, the node information in the received scan request is not empty, and the scan response includes information about the next-level node of the node indicated by the scan request. Figure 3 As shown, the node information in the scan request received by the OPC UA gateway is the information of the root node, and the scan response sent by the OPC UA gateway to the application includes the information of the next level node of the root node, such as Figure 3 As shown, the next level nodes of the root node are nodes named "conveyor belt", "temperature vibrator" and "tape machine" respectively.

[0085] In response to receiving the scan response, the application concurrently and asynchronously executes S104 and S105 .

[0086] S104: The application sends the next scan request to the OPC UA gateway.

[0087] It can be understood that “next time” means the time after the most recent time the request message is sent.

[0088] The next scan request includes the information of the node indicated by the most recently received scan response. Continuing with the above example, if the node in the scan response most recently received by the application is the root node, the node information included in the next scan request is the root node information. For another example, if the nodes in the scan response most recently received by the application are "conveyor belt", "temperature vibrator" and "tape machine", the node information included in the next scan request is "conveyor belt", "temperature vibrator" and "tape machine".

[0089] In some implementations, when there are multiple nodes to be scanned, multiple threads are created, each thread is used to scan one node. For example, if the nodes to be scanned are "conveyor belt", "temperature vibrator" and "tape machine", three threads are created, respectively referred to as the first thread, the second thread and the third thread. The first thread is used to scan the node named "conveyor belt", the second thread is used to scan the node named "temperature vibrator", and the third thread is used to scan the node named "tape machine".

[0090] After the thread is triggered, a scan request is sent to the OPCUA gateway. For example, after the first thread is triggered, a scan request for a node named "conveyor belt" is sent to the OPCUA gateway. After the second thread is triggered, a scan request for a node named "thermal vibrator" is sent to the OPCUA gateway.

[0091] After the OPCUA gateway receives the scan request sent by the thread, it sends a scan response to the thread according to the above steps. The thread then continues to send scan requests based on the scan response until the last node is scanned.

[0092] Another example Figure 5 As shown, the scan response received by the application includes the next-level nodes of the tape machine, "power distribution cabinet" and "pipe cutter". The application creates two threads, triggering one thread to send a scan request including "power distribution cabinet" to the OPCUA gateway, and the other thread to send a scan request including "pipe cutter" to the OPCUA gateway. The OPCUA gateway feeds back the scan response of each scan request to the application until the last level of nodes is scanned. For example, for sending a scan request including "pipe cutter", the last level of nodes includes "voltage", "speed" and "status".

[0093] S105: The application processes the scan response.

[0094] In some implementations, the callback information and the corresponding node information are stored in a callback storage area. The callback information indicating a scan failure is searched from the callback storage area as target information, and the node information corresponding to the target information is stored in the callback failure storage area.

[0095] by Figure 6 For example, assuming that the target information is the callback information of node 3 and node 4, the information of node 3 and node 4 is stored in the callback failure storage area.

[0096] In some implementations, the callback failure storage area is a queue. After a scan is performed, if there are nodes in the failure queue that have not been scanned successfully, the next scan is performed one by one according to the first-in-first-out principle.

[0097] It is understandable that if Figure 7 As shown in the figure, during the process of the application scanning the nodes in the OPC UA gateway, it is possible that an abnormality occurs in the network between the application and the OPC UA gateway. Figure 7 For example, after scanning for 3 seconds, the scan reaches node 7. Assuming that an abnormality occurs in the network at this time, the nodes after the node cannot be scanned.

[0098] It is understandable that the application may not be aware of the network disconnection, and the scan response cannot be sent after the network disconnection, so the application may process based on the situation of receiving the scan response.

[0099] In response to not receiving the scan response, the application concurrently and asynchronously executes S106 - S107 .

[0100] S106. The application sends the next scan request to the OPC UA gateway.

[0101] The specific implementation of this step may be S104. The purpose of this step is to try to send a scan request so as to perform a scan in time when the network returns to normal.

[0102] S107. Store the information of the nodes that have not received the scan response into the fission failure storage area.

[0103] In some implementations, the fission failure storage area is a first-in-first-out queue, referred to as a first-in-first-out queue.

[0104] It can be seen that no matter whether a scan response is received or not, subsequent scans and other steps are performed asynchronously, which can improve the efficiency of the scan.

[0105] S108. In response to receiving the scan completion message sent by the gateway, based on the stored node information, re-scan the nodes whose information is stored.

[0106] The nodes where the information is stored include nodes where the information is stored in the callback failure storage area and the fission failure storage area.

[0107] One of the purposes of scanning the nodes is to obtain the data of each industrial device. Therefore, after completing the scanning of the nodes, the data of each node obtained must be stored.

[0108] like Figure 8 As shown, the storage process includes the following steps:

[0109] S201. Obtain the hash value of the node that is successfully scanned.

[0110] The hash value includes a hash value of a string consisting of the node's level, name, and angle.

[0111] The level is the level at which the node is located, and the level can be obtained based on at least one of the order of sending the scan request and the order of receiving the scan response. For example, the node information in the scan request sent for the first time is empty, and the scan request sent for the second time includes the root node information, and the corresponding scan response includes "conveyor belt", "temperature vibrator" and "tape machine", then it is determined that "conveyor belt", "temperature vibrator" and "tape machine" are the next level nodes of the root node.

[0112] To simplify calculations, in some implementations, the name is the first letter of the name.

[0113] The angle of any node is determined based on the number of nodes at the same level of the node and a preconfigured total angle value. In some implementations, the sum of the angle of any node and the angles of the nodes at the same level is the total angle value.

[0114] by Fig. 9 For example, there is only one "Tape Machine" node at the same level of the "Tape Machine" node. Assuming the total angle value is 360 degrees, the angle of the "Tape Machine" node is 360 degrees.

[0115] Fig. 9 Also shown are the strings used to calculate the hash values ​​of the various example nodes. Taking the "Tape Machine" node as an example, the level = 1, the first letter of the name is JDL, that is, the first letter = JDL, the angle = 360, and the string used to calculate the hash value is expressed as: Hash = 1_360_JDL.

[0116] S202. Divide the storage space into areas corresponding to the angle range according to the angle range.

[0117] In some implementations, each angle range is obtained by dividing the pre-configured total angle value into multiple parts. For example, the total angle value of 360 degrees is divided into 4 parts, 0-90 degrees corresponds to the first area, 90-180 degrees corresponds to the second area, 180-270 degrees corresponds to the third area, and 270-360 degrees corresponds to the fourth area.

[0118] S203 . Store each node in a different area according to the angle range to which the angle of each node belongs.

[0119] by Fig.10 For example, the data of nodes with an angle of 0 degrees are stored in area 1, the data of nodes with an angle of 120 degrees are stored in area 2, the data of nodes with an angle of 220 degrees are stored in area 3, and the data of nodes with an angle of 320 degrees are stored in area 4.

[0120] When you need to query the data of a certain node, you can quickly calculate the area to which the node belongs based on the node's level and angle, and then query the node's data from the area based on the name.

[0121] The embodiment of the present application further provides a node scanning device based on a gateway, comprising: a sending module, a first processing module and a second processing module. Optionally, a third processing module is also included.

[0122] The first processing module is used to respond to receiving a scan response sent by the gateway and asynchronously perform the following steps concurrently: sending the next scan request and processing the scan response, wherein the scan response at least indicates whether the scan of the first node succeeded or failed, and processing the scan response includes: storing information of the first node when the scan response indicates that the scan of the first node failed.

[0123] The second processing module is used for concurrently and asynchronously executing the following steps in response to not receiving the scan response: sending a next scan request and storing the information of the first node.

[0124] The third processing module is used to store the successfully scanned nodes in different areas based on the characteristic values ​​of the successfully scanned nodes. The characteristic values ​​include the angles of the successfully scanned nodes, and the angles are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

[0125] The device described in this embodiment has a high efficiency in scanning node information of physical devices in the Internet.

[0126] If the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0127] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

Claims

1. A node scanning method based on a gateway, characterized in that: Applied to an application for scanning the node, the method comprises: Sending a scan request to a gateway, wherein the scan request includes information of nodes, and the nodes include at least a first node; In response to receiving a scan response sent by the gateway, concurrently and asynchronously performing the following steps: sending a next scan request and processing the scan response, the scan response at least indicating a scan success or a scan failure of the first node, the processing of the scan response comprising: storing information of the first node if the scan response indicates a scan failure of the first node; In response to not receiving the scan response, the following steps are performed concurrently and asynchronously: sending a next scan request and storing the information of the first node.

2. The method according to claim 1, characterized in that Also includes: In response to receiving the scan completion message sent by the gateway, based on the stored node information, the nodes whose information is stored are scanned again.

3. The method according to claim 2, characterized in that When the scan response indicates that the scan of the first node fails, storing the information of the first node includes: If the scan response indicates that the scan of the first node fails, storing the information of the first node in a preconfigured queue; In response to not receiving the scan response, the following steps are performed asynchronously and concurrently: sending a next scan request and storing information of the first node, including: In response to not receiving the scan response, concurrently and asynchronously performing the following steps: sending a next scan request and storing the information of the first node in a pre-configured fission failure storage area; The step of rescanning the nodes where the information is stored based on the information of the stored nodes includes: The nodes in the fission failure storage area are scanned.

4. The method according to any one of claims 1 to 3, characterized in that: Before sending a scan request to the gateway, the method further includes: Receiving information of nodes to be scanned sent by the gateway, where the nodes to be scanned include the first node and the second node; The step of sending a scan request to the gateway includes: A scan request for the first node is sent to the gateway through a first process, and a scan request for the second node is sent to the gateway through a second thread.

5. The method according to any one of claims 1 to 3, characterized in that: Also includes: Based on the characteristic values ​​of the successfully scanned nodes, the successfully scanned nodes are stored in different areas. The characteristic values ​​include the angles of the successfully scanned nodes, which are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

6. The method according to claim 5, characterized in that The characteristic values ​​also include: The information of the successfully scanned node and the level of the node in the gateway.

7. A node scanning device based on a gateway, characterized in that: include: A sending module, used for sending a scanning request to the gateway, wherein the scanning request includes information of nodes, and the nodes include at least a first node; A first processing module is configured to, in response to receiving a scan response sent by the gateway, concurrently and asynchronously perform the following steps: sending a next scan request and processing the scan response, wherein the scan response at least indicates that the scan of the first node succeeded or failed, and the processing of the scan response includes: storing information of the first node when the scan response indicates that the scan of the first node failed; The second processing module is used for concurrently and asynchronously executing the following steps in response to not receiving the scan response: sending a next scan request and storing the information of the first node.

8. The device according to claim 9, characterized in that Also includes: The third processing module is used to store the successfully scanned nodes in different areas based on the characteristic values ​​of the successfully scanned nodes. The characteristic values ​​include the angles of the successfully scanned nodes, and the angles are obtained based on the number of nodes at the same level of the successfully scanned nodes and a pre-configured total angle value.

9. An electronic device, characterized in that: include: Memory and processor; The memory is used to store a computer program, and the processor is used to run the computer program to implement the gateway-based node scanning method according to any one of claims 1 to 6.

10. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the gateway-based node scanning method according to any one of claims 1 to 6.