Data acquisition method and data acquisition device
By using a data acquisition method and equipment that adaptively switches data transmission protocols and encoding methods, the problem of efficient data acquisition in Telemetry technology on resource-limited devices is solved, enabling flexible data acquisition in complex network environments and reducing the burden on equipment and networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE COMM LTD RES INST
- Filing Date
- 2022-03-04
- Publication Date
- 2026-07-10
AI Technical Summary
The existing Telemetry technology architecture is complex and consumes a lot of resources, making it difficult to collect data efficiently, especially on resource-constrained devices such as gateways.
A data acquisition method and device are provided. By combining a collector and an analyzer, the data transmission protocol is adaptively switched. The gRPC or UDP protocol is dynamically selected for data transmission based on device performance, network conditions and data change frequency. The encoding method is generated to adapt to different devices through a model tool.
Reduce network and device stress without relying on additional tools, enabling flexible and efficient data collection that adapts to network conditions and device resource limitations.
Smart Images

Figure CN116743831B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a data acquisition method and a data acquisition device. Background Technology
[0002] Digital twin applications require information mapping from physical devices to virtual devices. In the architecture of network data twins, the information interaction and virtual-physical mapping of network devices is a crucial part of digital twins. As a digital mirror of the physical network, the more comprehensive and accurate the data, the higher the fidelity of the digital twin network's reproduction of the physical network. The type, frequency, and methods of data acquisition aim to meet the application requirements of digital twin networks, possessing both comprehensiveness and efficiency. There are many network data acquisition methods, each with different characteristics and suitable for different application scenarios. Considering the comprehensive and efficient data acquisition requirements of digital twin networks, network telemetry technology is the preferred solution for data acquisition.
[0003] Telemetry is a technology for high-speed remote data acquisition from devices. Devices periodically report information to the data collector via push mode, achieving real-time and efficient data acquisition. Telemetry organizes data acquisition based on the YANG model, encodes the data using the GPB (Google Protocol Buffer) encoding format, and then reports the encoded data to the data collector for reception and storage via a transmission protocol (such as gRPC).
[0004] YANG is a data modeling language that can be used to model configuration data, status data, remote calls, and notifications for network configuration management protocols, forming a tree-structured YANG model.
[0005] GBP is a language-independent, platform-independent serialized structured data format that stores data in binary format. It describes the encoded data structure through .proto files, using numbers instead of tag names.
[0006] The gRPC protocol framework uses GPB encoding by default and carries multiplexed bidirectional data streams based on the HTTP / 2 protocol. It can also optionally use TLS to encrypt the transmission. Furthermore, the gRPC framework uses the TCP protocol at its core to ensure reliable transmission.
[0007] Telemetry technology enables high-speed data acquisition, but it also places a significant burden on devices and networks. Currently, telemetry is mainly used for monitoring and managing large and complex network devices such as switches. However, for devices with relatively limited resources, such as gateways, the telemetry architecture is quite cumbersome. At the data encoding level, although GPB stores data in binary, its encoding and decoding rely on .proto files; devices and collectors can only communicate if they have the same .proto file. At the transmission protocol level, the gRPC framework uses the TCP-based HTTP / 2 protocol to establish data connections, consuming considerable resources. Furthermore, at the data model level, different vendors have designed various YANG models for different devices, often requiring users to search for each YANG model file and write corresponding data acquisition code, which is quite difficult. Summary of the Invention
[0008] The purpose of this invention is to provide a data acquisition method and a data acquisition device to solve the problems of complex architecture and high resource consumption in existing Telemetry technology.
[0009] To achieve the above objectives, the present invention provides a data acquisition method using a data acquisition device, the data acquisition device including a collector and an analyzer, the method comprising:
[0010] The data collector acquires data from the target device;
[0011] The analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results.
[0012] The data collector acquires data from the target device, including:
[0013] The data collector calls the software development kit (SDK) for data acquisition to subscribe to data from the target device;
[0014] The collector receives data sent by the target device.
[0015] The data acquisition device further includes a model tool, which is used to generate a data acquisition SDK based on the data selected by the user.
[0016] Before the collector collects data from the target device, the method further includes:
[0017] The data collector establishes a gRPC connection with the target device via the gRPC protocol.
[0018] The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the encoding method of the data based on the encoding methods supported by the target device.
[0019] The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the data encoding method based on the encoding methods supported by the target device, including:
[0020] The collector sends a capability query request message to the target device, the capability query message being used to query the encoding methods supported by the target device;
[0021] The collector receives a capability query response message sent by the target device, the capability query response message including: data structure fields;
[0022] If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
[0023] The analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results, including:
[0024] The analyzer determines the current network status based on the time when the collector receives the data and the time when the target device sends the data;
[0025] The analyzer determines the device performance of the target device based on the time when the target device sends data;
[0026] The analyzer determines the frequency of data changes based on the historical data received by the collector;
[0027] The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the frequency of data changes.
[0028] The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the data change frequency, including:
[0029] If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol;
[0030] or,
[0031] If the current network conditions meet the first condition and the data change frequency is less than the second threshold, the data transmission protocol is switched to or maintained as UDP.
[0032] or,
[0033] If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol shall be switched to or maintained as UDP.
[0034] or,
[0035] If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
[0036] The analyzer determines the current network status based on the time the collector receives data and the time the target device sends data, including:
[0037] If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
[0038] The analyzer determines the device performance of the target device based on the time when the target device sends data, including:
[0039] If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
[0040] The data acquisition device further includes: a controller;
[0041] The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
[0042] The model tool is also used to: generate the YANG model selected by the user based on user-defined parameters;
[0043] Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects a YANG model through the model library.
[0044] This invention also provides a data acquisition device, which includes a collector and an analyzer:
[0045] The data collector is used to: collect data from the target device;
[0046] The analyzer is used to: analyze the data received by the collector and adaptively switch the data transmission protocol between the collector and the target device based on the analysis results.
[0047] The collector is used for:
[0048] The software development kit (SDK) for data acquisition is invoked to subscribe to data from the target device;
[0049] Receive data sent by the target device.
[0050] The data acquisition device further includes a model tool, which is used to generate a data acquisition SDK based on the data selected by the user.
[0051] The collector is also used for:
[0052] Establish a gRPC connection with the target device via the gRPC protocol;
[0053] The encoding methods supported by the target device are obtained through the gRPC connection, and the encoding method of the data is determined based on the encoding methods supported by the target device.
[0054] The collector is further used for:
[0055] Send a capability query request message to the target device, the capability query message being used to query the encoding methods supported by the target device;
[0056] Receive a capability query response message sent by the target device, the capability query response message including: data structure fields;
[0057] If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
[0058] The analyzer is used for:
[0059] The current network status is determined based on the time when the collector receives the data and the time when the target device sends the data.
[0060] The device performance of the target device is determined based on the time when the target device sends data;
[0061] The frequency of data change is determined based on the historical data received by the collector;
[0062] The data transmission protocol is adaptively switched based on the current network conditions, the device performance of the target device, and the frequency of data changes.
[0063] The analyzer is further used for:
[0064] If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol;
[0065] or,
[0066] If the current network conditions meet the first condition and the data change frequency is less than the second threshold, the data transmission protocol is switched to or maintained as UDP.
[0067] or,
[0068] If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol shall be switched to or maintained as UDP.
[0069] or,
[0070] If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
[0071] The analyzer is also used for:
[0072] If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
[0073] The analyzer is also used for:
[0074] If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
[0075] The data acquisition device further includes: a controller;
[0076] The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
[0077] The model tool is also used to: generate the YANG model selected by the user based on user-defined parameters;
[0078] Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects a YANG model through the model library.
[0079] The above-described technical solution of the present invention has at least the following beneficial effects:
[0080] In the data acquisition method and data acquisition device of this invention, the analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results. Without relying on additional network detection or device monitoring tools, the analyzer selects the data transmission protocol by comprehensively considering device performance, network conditions and data change frequency, so as to realize flexible data acquisition and reduce the pressure on the network and device when the network conditions are poor or the device resources are limited. Attached Figure Description
[0081] Figure 1 This is a flowchart illustrating the steps of the data acquisition method provided in this embodiment of the invention.
[0082] Figure 2 This diagram illustrates an example of the interaction between the data acquisition device and the data acquisition method provided in this embodiment of the invention.
[0083] Figure 3 This diagram illustrates an example of adaptive switching of data transmission protocols in the data acquisition method provided in this embodiment of the invention.
[0084] Figure 4 This diagram illustrates the structure of the data acquisition method provided in this embodiment of the invention.
[0085] Figure 5 This diagram illustrates an interaction example of Example 1 provided in this embodiment of the invention.
[0086] Figure 6 This diagram illustrates an example of determining the encoding method in the data acquisition method provided in this embodiment of the invention.
[0087] Figure 7 This is a schematic diagram showing the structure of the data acquisition device provided in an embodiment of the present invention. Detailed Implementation
[0088] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0089] like Figure 1 As shown, this embodiment of the invention provides a data acquisition method using a data acquisition device, which includes a collector and an analyzer. The method includes:
[0090] Step 101: The collector collects data from the target device;
[0091] Step 102: The analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results.
[0092] In at least one embodiment of the present invention, step 102 includes:
[0093] The analyzer determines the current network status based on the time when the collector receives the data and the time when the target device sends the data;
[0094] The analyzer determines the device performance of the target device based on the time when the target device sends data;
[0095] The analyzer determines the frequency of data changes based on the historical data received by the collector;
[0096] The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the frequency of data changes.
[0097] In this embodiment of the invention, the data collector directly interacts with the target device to receive and store data sent by the device. The analyzer reads and analyzes the data received by the data collector and determines whether to switch the data transmission protocol based on device performance, network conditions, and data change frequency.
[0098] Traditional telemetry technology uses a gRPC framework to establish connections for high-speed data acquisition, which puts pressure on devices and networks. The method provided in this invention comprehensively considers device performance, network conditions, and the frequency of data changes, enabling the switching of the data transmission protocol to UDP (User Datagram Protocol), which does not require connection maintenance and has a smaller packet header. For example, the devices connected to a digital twin network platform are often dynamically changing. For instance, a gateway might need to send a large number of logs to the platform at a certain time, consuming network resources of edge devices and other devices. Or, an edge device might experience delays in data transmission due to increased access and resource consumption from processing tasks. In these situations, it is necessary to dynamically switch the data transmission protocol to adapt to network conditions and device performance.
[0099] In this embodiment of the invention, since the data sent by the device to the collector contains the timestamp of the data or message generation, the device performance and network status can be determined based on the time when the collector receives the data and the timestamp of the data itself.
[0100] In at least one embodiment of the present invention, the analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the data change frequency, including:
[0101] If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol;
[0102] or,
[0103] If the current network conditions meet the first condition and the data change frequency is less than the second threshold, the data transmission protocol is switched to or maintained as UDP.
[0104] or,
[0105] If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol shall be switched to or maintained as UDP.
[0106] or,
[0107] If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
[0108] In this context, if the current network condition meets the first condition, it can be understood as a poor network condition; if the current network condition does not meet the first condition, it can be understood as a good network condition.
[0109] If the performance of the target device meets the second condition, it can be understood that the performance of the target device is poor; if the performance of the target device does not meet the second condition, it can be understood that the performance of the target device is good.
[0110] As an optional embodiment, the analyzer determines the current network status based on the time the collector receives the data and the time the target device sends the data, including:
[0111] If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
[0112] As another optional embodiment, the analyzer determines the device performance of the target device based on the time when the target device sends data, including:
[0113] If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
[0114] For example, such as Figure 2 As shown, the data collector and the device first establish a gRPC connection. Assume the data collector subscribes to data from the device, requiring data to be uploaded every time interval t. The time when the data collector sends the Subscribe Request is T. c0 The device receives the request at time T. d0 The timestamps included in the (Subscribe Response) periodically sent by the device to the collector are T. d1 T d2 , ..., T dn The time when the collector receives the data is T. c1 T c2 , ..., T cn Then it can be used. Characterize equipment performance, Characterizes the network status. When When the average time interval between data transmissions from the device exceeds the time interval specified by the data collector, it indicates that the device is under heavy processing pressure and its performance is poor. An increase in latency indicates increased network transmission delay and poor network conditions. The analyzer adaptively switches the data transmission protocol between the collector and the device based on network conditions, device performance, and the frequency of data changes in historical data received by the collector. For example... Figure 3 As shown, the specific process is as follows:
[0115] a. Determine the current network status based on the time the data is received by the collector. When edge devices or other devices connected to the digital twin network platform need to upload large amounts of data (such as log files), network congestion can easily occur. In this situation, if... If the network condition increases, indicating poor network conditions, proceed to step b; otherwise, if... If no significant changes occur, indicating a good network condition, proceed to step c.
[0116] b. Determine the frequency of historical data changes. To ensure that the data collected by the data collector accurately reflects the device's status, when network conditions are poor, frequently changing data (such as network traffic) is still transmitted using the gRPC framework, while infrequently changing data (such as device ID and system version number) is transmitted using the lighter UDP protocol. The frequency of data changes can be determined by whether the data has changed in the last three data points. If the data received by the data collector remains unchanged for three consecutive times, the transmission protocol between the data collector and the device is switched to UDP; after switching to UDP, if the data received by the data collector changes for three consecutive times, the transmission protocol between the data collector and the device is switched back to gRPC.
[0117] c. Determine the current device performance based on the timestamps in the messages sent by the device. If the average time interval between data transmissions by the device... If the data acquisition time interval t exceeds the data acquisition interval specified by the collector, the gRPC connection between the collector and the device will be disconnected, and the connectionless UDP protocol will be used instead to reduce the device load; otherwise, the gRPC connection will be maintained.
[0118] In at least one embodiment of the present invention, step 101 includes:
[0119] The data collector calls the software development kit (SDK) for data acquisition to subscribe to data from the target device;
[0120] The collector receives data sent by the target device.
[0121] Optionally, the data acquisition device further includes a modeling tool, which generates a data acquisition SDK based on the data selected by the user to be acquired.
[0122] As an optional embodiment, the data acquisition device further includes: a controller;
[0123] The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
[0124] Optionally, the model tool is also used to: generate the user-selected YANG model based on user-defined parameters;
[0125] Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects a YANG model through the model library.
[0126] This invention provides a YANG model library, YANG model generation tools, and a data acquisition SDK to reduce the difficulty of user management and maintenance.
[0127] like Figure 4 and Figure 5 As shown, the data acquisition device provided in this embodiment of the invention includes:
[0128] The model library contains YANG models of commonly used devices for users to search and select. The model tools can be used to generate custom YANG model files and data acquisition SDKs for the data collector to call according to user needs.
[0129] The controller is used to issue configurations to the devices and manage them.
[0130] The data collector is used to call the data acquisition SDK to interact directly with the device, and is used to receive and save the data sent by the device; the data collector is also used to communicate with the device and select different encoding formats according to the device model.
[0131] The analyzer is used to read and analyze the data received by the data collector, and to determine whether to switch the transmission protocol based on the device performance, network conditions and data change frequency.
[0132] In at least one embodiment of the present invention, before the collector collects data from the target device, the method further includes:
[0133] The data collector establishes a gRPC connection with the target device via the gRPC protocol.
[0134] The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the encoding method of the data based on the encoding methods supported by the target device.
[0135] The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the data encoding method based on the encoding methods supported by the target device, including:
[0136] The collector sends a capability query request message to the target device, the capability query message being used to query the encoding methods supported by the target device;
[0137] The collector receives a capability query response message sent by the target device, the capability query response message including: data structure fields;
[0138] If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
[0139] For example, such as Figure 6 As shown, the process by which the data collector communicates with the device regarding the encoding method is as follows:
[0140] a. The data collector sends an Encoding Request to the device to query the encoding methods supported by the device. Optionally, the request may indicate the encoding method the data collector expects to use, such as GPB;
[0141] b. The device determines whether it supports the encoding method in the request and returns an Encoding Response. This response contains only one field: data_struct (data structure). The data_struct field is only filled in when the encoding method is GPB, transmitting the data structure defined in the proto file in JSON format. That is, if the device supports GPB encoding, the data_struct field is filled with the data structure defined in the proto file in JSON format; otherwise, an empty message is returned.
[0142] c. The collector parses the Encoding Response and selects the encoding method accordingly. If data_struct is empty, JSON is used as the encoding method. If data_struct is not empty, the JSON data in the field is parsed and converted into a proto file, which allows the collector to complete the proto file that only exists on the device side, thus enabling GPB encoding and decoding.
[0143] The embodiments of the present invention can flexibly select the encoding method according to the device capabilities, and can complete the proto file that only exists on the device side in the collector to realize GPB encoding and decoding.
[0144] Example 1, such as Figure 5 As shown, the data acquisition method provided in this embodiment of the invention includes:
[0145] Step 1. Users can retrieve YANG models from the model library or customize new YANG models using the model tool according to their device requirements.
[0146] Step 2. The controller sends configurations to the devices based on the YANG model.
[0147] Step 3. The user selects the data to be collected based on the model file using the model tool, and generates a data collection SDK for the collector to call.
[0148] Step 4. The data collector and the device establish a connection and communicate the encoding method via the gRPC protocol, as follows: Figure 6 As shown.
[0149] Step 5. The collector calls the data acquisition SDK to subscribe to data from the device.
[0150] Step 6. The device sends data to the data collector.
[0151] Step 7. The analyzer reads the data received by the collector and performs statistical analysis on the data.
[0152] Step 8. The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the data change frequency.
[0153] In summary, in this embodiment of the invention, the analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results. Without relying on additional network detection or device monitoring tools, the analyzer selects the data transmission protocol by comprehensively considering device performance, network conditions, and data change frequency, thereby achieving flexible data collection as needed and reducing the pressure on the network and device when network conditions are poor or device resources are limited.
[0154] like Figure 7 As shown in the figure, this embodiment of the invention also provides a data acquisition device, which includes a collector and an analyzer:
[0155] The data collector is used to: collect data from the target device;
[0156] The analyzer is used to: analyze the data received by the collector and adaptively switch the data transmission protocol between the collector and the target device based on the analysis results.
[0157] As an optional embodiment, the collector is used for:
[0158] The software development kit (SDK) for data acquisition is invoked to subscribe to data from the target device;
[0159] Receive data sent by the target device.
[0160] As an optional embodiment, the data acquisition device further includes: a modeling tool, which is used to generate a data acquisition SDK based on the data to be acquired selected by the user.
[0161] As an optional embodiment, the collector is also used for:
[0162] Establish a gRPC connection with the target device via the gRPC protocol;
[0163] The encoding methods supported by the target device are obtained through the gRPC connection, and the encoding method of the data is determined based on the encoding methods supported by the target device.
[0164] As an optional embodiment, the collector is further used for:
[0165] Send a capability query request message to the target device, the capability query message being used to query the encoding methods supported by the target device;
[0166] Receive a capability query response message sent by the target device, the capability query response message including: data structure fields;
[0167] If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
[0168] As an optional embodiment, the analyzer is used for:
[0169] The current network status is determined based on the time when the collector receives the data and the time when the target device sends the data.
[0170] The device performance of the target device is determined based on the time when the target device sends data;
[0171] The frequency of data change is determined based on the historical data received by the collector;
[0172] The data transmission protocol is adaptively switched based on the current network conditions, the device performance of the target device, and the frequency of data changes.
[0173] As an optional embodiment, the analyzer is further used to:
[0174] If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol;
[0175] or,
[0176] If the current network conditions meet the first condition and the data change frequency is less than the second threshold, the data transmission protocol is switched to or maintained as UDP.
[0177] or,
[0178] If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol shall be switched to or maintained as UDP.
[0179] or,
[0180] If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
[0181] As an optional embodiment, the analyzer is also used for:
[0182] If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
[0183] As an optional embodiment, the analyzer is also used for:
[0184] If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
[0185] As an optional embodiment, the data acquisition device further includes: a controller;
[0186] The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
[0187] As an optional embodiment, the model tool is also used to: generate the user-selected YANG model based on user-defined parameters;
[0188] Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects a YANG model through the model library.
[0189] In this embodiment of the invention, the analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results. Without relying on additional network detection or device monitoring tools, the analyzer selects the data transmission protocol by comprehensively considering device performance, network conditions, and data change frequency, thereby achieving flexible data collection as needed and reducing the pressure on the network and device when network conditions are poor or device resources are limited.
[0190] It should be noted that the data acquisition device provided in the embodiments of the present invention is a device capable of performing the above-described data acquisition method. Therefore, all embodiments of the above-described data acquisition method are applicable to this device and can achieve the same or similar beneficial effects.
[0191] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0192] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 A device for one or more processes and / or the functions specified in one or more boxes.
[0193] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce a paper article including an instruction means, the instruction means being implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0194] These computer program instructions can also be loaded onto a computer or other programmable data processing equipment, causing the computer or other programmable equipment to perform a series of operational steps to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0195] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A data acquisition method, employing a data acquisition device, said data acquisition device comprising a collector and an analyzer, characterized in that, The method includes: The data collector acquires data from the target device; The analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results; The analyzer analyzes the data received by the collector and adaptively switches the data transmission protocol between the collector and the target device based on the analysis results, including: The analyzer determines the current network status based on the time when the collector receives the data and the time when the target device sends the data; The analyzer determines the device performance of the target device based on the time when the target device sends data; The analyzer determines the frequency of data changes based on the historical data received by the collector; The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the frequency of data changes.
2. The method according to claim 1, characterized in that, The data collector acquires data from the target device, including: The data collector calls the software development kit (SDK) for data acquisition to subscribe to data from the target device; The collector receives data sent by the target device.
3. The method according to claim 2, characterized in that, The data acquisition device also includes a model tool, which is used to generate a data acquisition SDK based on the data to be acquired selected by the user.
4. The method according to claim 1, characterized in that, Before the data collector collects data from the target device, the method further includes: The data collector establishes a gRPC connection with the target device via the gRPC protocol. The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the encoding method of the data based on the encoding methods supported by the target device.
5. The method according to claim 4, characterized in that, The collector obtains the encoding methods supported by the target device through the gRPC connection, and determines the data encoding method based on the encoding methods supported by the target device, including: The collector sends a capability query request message to the target device, the capability query request message being used to query the encoding methods supported by the target device; The collector receives a capability query response message sent by the target device, the capability query response message including: data structure fields; If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
6. The method according to claim 1, characterized in that, The analyzer adaptively switches the data transmission protocol based on the current network conditions, the device performance of the target device, and the data change frequency, including: If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol; or, If the current network conditions meet the first condition and the data change frequency is less than the second threshold, switch or maintain the data transmission protocol as UDP. or, If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol is switched to or maintained as UDP. or, If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
7. The method according to claim 6, characterized in that, The analyzer determines the current network status based on the time the collector receives data and the time the target device sends data, including: If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
8. The method according to claim 6, characterized in that, The analyzer determines the device performance of the target device based on the time when the target device sends data, including: If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
9. The method according to claim 1 or 3, characterized in that, The data acquisition device further includes: a controller; The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
10. The method according to claim 9, characterized in that, The model tool is also used to: generate the YANG model selected by the user based on user-defined parameters; Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects a YANG model through the model library.
11. A data acquisition device, the data acquisition device comprising a collector and an analyzer, characterized in that: The data collector is used to: collect data from the target device; The analyzer is used to: analyze the data received by the collector and adaptively switch the data transmission protocol between the collector and the target device based on the analysis results; The analyzer is used for: The current network status is determined based on the time when the collector receives the data and the time when the target device sends the data. The device performance of the target device is determined based on the time when the target device sends data; The frequency of data change is determined based on the historical data received by the collector; The data transmission protocol is adaptively switched based on the current network conditions, the device performance of the target device, and the frequency of data changes.
12. The data acquisition device according to claim 11, characterized in that, The collector is used for: The software development kit (SDK) for data acquisition is invoked to subscribe to data from the target device; Receive data sent by the target device.
13. The data acquisition device according to claim 12, characterized in that, The data acquisition device also includes a model tool, which is used to generate a data acquisition SDK based on the data to be acquired selected by the user.
14. The data acquisition device according to claim 11, characterized in that, The collector is also used for: Establish a gRPC connection with the target device via the gRPC protocol; The encoding methods supported by the target device are obtained through the gRPC connection, and the encoding method of the data is determined based on the encoding methods supported by the target device.
15. The data acquisition device according to claim 14, characterized in that, The collector is further used for: Send a capability query request message to the target device, the capability query request message being used to query the encoding methods supported by the target device; Receive a capability query response message sent by the target device, the capability query response message including: data structure fields; If the data structure field is empty, the data is determined to be encoded as JSON; or, if the data structure field is not empty, the data is determined to be encoded as GPB, and the JSON data in the data structure field is converted into a proto file.
16. The data acquisition device according to claim 11, characterized in that, The analyzer is further used for: If the current network conditions meet the first condition and the data change frequency is greater than the first threshold, switch or maintain the data transmission protocol as the gRPC framework protocol; or, If the current network conditions meet the first condition and the data change frequency is less than the second threshold, switch or maintain the data transmission protocol as UDP. or, If the current network conditions do not meet the first condition, and the device performance of the target device meets the second condition, the data transmission protocol is switched to or maintained as UDP. or, If the current network conditions do not meet the first condition and the device performance of the target device does not meet the second condition, the data transmission protocol shall be switched to or maintained as the gRPC framework protocol.
17. The data acquisition device according to claim 16, characterized in that, The analyzer is also used for: If the average time difference between the time the data collector receives data and the time the target device sends data increases, it is determined that the current network state meets the first condition; otherwise, it is determined that the current network state does not meet the first condition.
18. The data acquisition device according to claim 16, characterized in that, The analyzer is also used for: If the average time interval between data transmissions by the target device is greater than a preset time interval, it is determined that the device performance of the target device meets the second condition; otherwise, it is determined that the device performance of the target device does not meet the second condition.
19. The data acquisition device according to claim 11 or 13, characterized in that, The data acquisition device further includes: a controller; The controller is used to send configuration information matching the YANG model to the target device based on the YANG model selected by the user.
20. The data acquisition device according to claim 19, characterized in that, The model tool is also used to: generate the YANG model selected by the user based on user-defined parameters; Alternatively, the data acquisition device may further include: a model library; the model library stores multiple YANG models, and the user selects the YANG model through the model library.
Citation Information
Patent Citations
A fishing vessel adaptive transmission content selection and communication network switching system
CN108988992A