An access method, device, program product and storage medium of an Internet of Things device
By constructing a meta-learning support set and generating parsing units, the problem of rapid access for IoT devices is solved, achieving efficient parsing and flexible adaptation under conditions of a small number of samples, and shortening the access time for new devices.
Patent Information
- Application Number
- CN202611425415.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-20
AI Technical Summary
When faced with the rapid access of new IoT devices, existing technologies require a large amount of labeled data to train a single model, resulting in long access cycles, poor flexibility, and a lack of rapid adaptation capabilities.
Construct a meta-learning support set containing semantically related input request and response data sample pairs, generate a semantic adaptation model and a protocol structure template, and achieve fast protocol parsing and business communication sessions through a parsing unit.
It enables rapid adaptive access to new IoT devices with a small number of samples, reduces reliance on massive amounts of labeled data, improves protocol recognition and adaptability, and shortens access adaptation time.
Smart Images

Figure CN123145346A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet of Things (IoT) technology, and in particular to an access method, apparatus, software product, and storage medium for IoT devices. Background Technology
[0002] With the rapid development of IoT technology, the types and numbers of IoT devices have exploded, and their applications have widely covered multiple fields such as smart homes, industrial control, and smart cities. However, the rapid and efficient access of massive heterogeneous IoT devices has become a key bottleneck for industry development. Especially in scenarios where new devices are constantly emerging or existing devices undergo frequent firmware / protocol iterations, shortening the cycle of new devices accessing the system is a core challenge for achieving the flexibility and scalability of IoT systems.
[0003] In the field of IoT device access, protocol identification and classification schemes based on traditional machine learning are common techniques. These schemes typically begin by collecting massive amounts of historical communication data, constructing a training dataset through manual annotation, and then using supervised learning algorithms (such as support vector machines, random forests, and ordinary convolutional neural networks) to train a classification model for a specific protocol set. Once trained, this model can extract and classify the communication traffic characteristics of newly accessed devices, thereby identifying the protocol type to which the device belongs. However, this model requires a large amount of labeled data to train a single model, and for new protocol devices, a large amount of data needs to be collected and retrained, resulting in long access cycles, poor flexibility, and a lack of rapid adaptation capabilities. Summary of the Invention
[0004] This disclosure provides an access method, apparatus, program product, and storage medium for Internet of Things (IoT) devices, which helps to achieve rapid adaptive access to new IoT devices under limited sample conditions.
[0005] In a first aspect, this application provides an access method for an Internet of Things (IoT) device, comprising: in response to detecting a newly accessed first IoT device, determining a first communication protocol adopted by the first IoT device; if it is determined that the first communication protocol is not included in a preset protocol library, constructing a support set for meta-learning adaptation; wherein the support set includes at least one sample pair, the sample pair including a first data unit and a second data unit with semantic association, the first data unit being used to characterize an input request that triggers communication interaction, and the second data unit being response data of the input request; generating a parsing unit for the first communication protocol based on the support set; wherein the parsing unit includes a semantic adaptation model and a protocol structure template, the semantic adaptation model being used to perform semantic parsing on the communication data of the first IoT device, and the structure template being used to describe the message structure features and parsing logic of the first communication protocol; and using the parsing unit to extract the service data of the first IoT device to establish a service communication session with the first IoT device.
[0006] This solution constructs a support set containing semantic association pairs of input request and response data. Using only a small number of sample pairs from this support set, it can quickly establish the mapping relationship between message features and semantic tags, effectively reducing reliance on massive amounts of labeled data. Combined with a semantic adaptation model dynamically generated based on the support set and a protocol structure template, it achieves automated protocol structure inference and semantic reasoning, significantly reducing reliance on manually predefined rules. This solution effectively shortens the access adaptation time for IoT devices under unknown communication protocols, facilitating efficient parsing and flexible adaptation of unknown protocols in scenarios with limited data, thereby successfully establishing business communication sessions with new devices.
[0007] In some possible implementations, constructing a support set for meta-learning adaptation includes: obtaining historical communication logs under a first communication protocol; filtering input requests that trigger communication interactions and response data for each input request from the historical communication logs; and pairing the input requests and response data according to semantic association to construct at least one sample pair in the support set.
[0008] This scheme directly parses historical communication logs under the first communication protocol, filters out the input requests that trigger the interaction and their corresponding response data, and uses semantic association to pair them to construct sample pairs. This achieves the transformation from raw unstructured logs to structured training samples, reducing the workload of manually constructing samples. At the same time, since the sample pairs are directly derived from real historical communication records, the authenticity of the constructed support set in terms of protocol features and interaction scenarios is guaranteed, avoiding the bias that may be caused by manually constructed samples. This provides the meta-learning model with practically representative basic data, which helps to improve the model's ability to identify and adapt to communication protocol features.
[0009] In some possible implementations, constructing a support set for meta-learning adaptation includes: acquiring the original message stream uploaded by the first IoT device; aggregating the original message stream into at least one message cluster using an unsupervised clustering algorithm based on the message length or byte distribution characteristics of the original message stream; wherein each message cluster contains a group of messages whose communication semantics belong to the same communication type; acquiring the semantic annotation information of the user for each message cluster; and constructing a support set based on the original message stream and the semantic annotation information.
[0010] This solution uses an unsupervised clustering algorithm based on the length or byte distribution characteristics of the original message stream to automatically aggregate massive messages into clusters with the same communication semantics, thus achieving preliminary semantic classification of unknown protocol messages. On this basis, users only need to perform semantic annotation on a small number of representative message clusters to efficiently construct a sample support set covering different communication types, significantly reducing the workload and time cost of manual annotation.
[0011] In some possible implementations, the semantic adaptation model is determined as follows: Features are extracted from the support set using a pre-trained feature extraction network to obtain feature vectors and corresponding semantic labels for each sample in the support set; the feature vectors are mapped using the adaptation layer in the meta-learning network to obtain the predicted output; the loss function between the predicted output and the corresponding semantic labels in the support set is calculated; the parameters of the adaptation layer in the meta-learning network are updated using gradients through backpropagation; wherein, the parameters in the meta-learning network other than the adaptation layer remain frozen; and the semantic adaptation model is constructed based on the updated adaptation layer parameters.
[0012] This approach freezes the main parameters of the meta-learning network and only updates the adaptation layer parameters based on the support set's gradient. This leverages the existing general feature extraction capabilities of the meta-learning network, avoiding the large amount of data and computational resources required for training from scratch. Furthermore, it allows for rapid adaptation to the unique semantic distribution of the first communication protocol through fine-tuning of the adaptation layer. This approach can efficiently construct a semantic adaptation model relying only on a small number of samples in the support set, significantly reducing the time cost of model training and the demand for computational resources, while ensuring the model's generalization performance and parsing accuracy in unknown protocol scenarios.
[0013] In some possible implementations, the protocol structure template is determined based on the following method: performing structural feature analysis on multiple second data units under the same instruction type to identify fixed structure fields and variable structure fields in the message; deriving the message structure features and parsing logic of the first communication protocol based on the distribution characteristics and change patterns of the variable structure fields in the message; and constructing the protocol structure template according to the message structure features and parsing logic.
[0014] This scheme compares and analyzes multiple data units under the same instruction type, distinguishes between fixed and variable fields, and derives protocol parsing logic based on the distribution pattern of variable fields to construct a structured template. This achieves automated identification and standardization of communication protocol message structure, reducing the workload of manually analyzing message structure one by one. At the same time, the parsing logic derived from actual data patterns can accurately reflect the general characteristics of the protocol, improving the accuracy of protocol parsing and providing a reliable structured basis for subsequent data screening and sample construction.
[0015] In some possible implementations, the parsing unit is used to extract the business data of the first IoT device, including: using the parsing unit to perform field segmentation on the communication data of the first IoT device based on the protocol structure template, and extracting binary data fragments of the communication data; calling the semantic adaptation model to perform semantic parsing on the binary data fragments to obtain parsing results containing semantic tags; and generating business data based on the parsing results containing semantic tags.
[0016] This solution employs a step-by-step processing strategy. First, a protocol structure template is used to segment complex binary communication data into independent field fragments, resolving parsing difficulties caused by inconsistent protocol formats across different devices. Then, a semantic adaptation model is invoked to perform semantic mapping on these fragments, directly converting meaningless binary data into information with clear business meaning. This approach automates the conversion from underlying communication data to upper-layer business data, effectively reducing parsing errors caused by significant protocol differences or the difficulty of covering manually defined rules, and improving the accuracy and versatility of business data extraction.
[0017] In some possible implementations, the parsing results are evaluated for validity to obtain the parsing accuracy and confidence score. If the parsing accuracy does not meet a preset qualification condition, a rollback mechanism is triggered. If the parsing accuracy meets the preset qualification condition but the confidence score does not meet a preset credibility condition, an optimization process is triggered. If the parsing accuracy meets the preset qualification condition and the confidence score meets the preset credibility condition, it is determined that the parsing unit and the first communication protocol of the first IoT device are successfully adapted. The rollback mechanism includes: returning to the step of constructing a support set to supplement training data, and regenerating the parsing unit based on the supplemented support set. The optimization process includes: obtaining semantic annotation information of at least one data sample to be processed with the highest uncertainty; using the obtained semantic annotation information as an incremental sample of the support set, and regenerating the parsing unit based on the support set containing the incremental sample.
[0018] This scheme determines the reliability of results by simultaneously evaluating accuracy and confidence scores, and takes different measures for different situations: if the accuracy is below standard, the model is retrained; if the accuracy is high but the confidence score is low, sample data with low confidence is added for fine-tuning; only when both meet the standard is the adaptation confirmed as successful. This mechanism allows the system to automatically identify situations where the reliability of the parsing results is insufficient, and to supplement specific data to improve the model, avoiding errors caused by directly using or forcibly parsing when the parsing results are questionable. This improves the model's adaptability to IoT device protocols and the stability of the parsing results.
[0019] Secondly, this application provides an access device for an Internet of Things (IoT) device, comprising: a determining module for determining a first communication protocol adopted by a first IoT device; a processing module for constructing a support set for meta-learning adaptation when it is determined that the first communication protocol is not included in a preset protocol library; wherein the support set includes at least one sample pair, the sample pair including a first data unit and a second data unit with semantic association, the first data unit being used to characterize an input request that triggers communication interaction, and the second data unit being response data of the input request; a generating module for generating a parsing unit for the first communication protocol based on the support set; wherein the parsing unit includes a semantic adaptation model and a protocol structure template, the semantic adaptation model being used to perform semantic parsing on the communication data of the first IoT device, and the structure template being used to describe the message structure features and parsing logic of the first communication protocol; the processing module is further configured to extract business data of the first IoT device using the parsing unit to establish a business communication session with the first IoT device.
[0020] Thirdly, this application provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the method of any of the above aspects or any implementation thereof.
[0021] Fourthly, this application provides a computer program product including computer program instructions that, when executed by a processor, implement a method for any of the above aspects or any implementation thereof.
[0022] The technical effects of any of the implementation methods in the second to fourth aspects can be found in the technical effects of the corresponding implementation method in the first aspect, and will not be repeated here.
[0023] It should be noted that any of the possible implementations of any of the above aspects can be combined, provided that the solutions do not contradict each other. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in this disclosure, the accompanying drawings used in some embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.
[0025] Figure 1 This disclosure provides an architectural diagram of an access system for an Internet of Things (IoT) device, based on some embodiments thereof. Figure 1 ; Figure 2 A flowchart of an Internet of Things (IoT) device access method provided for some embodiments of this disclosure Figure 1 ; Figure 3 This disclosure provides an architectural diagram of an access system for an Internet of Things (IoT) device, based on some embodiments thereof. Figure 2 ; Figure 4 A flowchart of an Internet of Things (IoT) device access method provided for some embodiments of this disclosure Figure 2 ; Figure 5 A schematic diagram illustrating a meta-learning fast adaptation process provided in some embodiments of this disclosure; Figure 6 This is a schematic diagram illustrating the composition of an access device for an Internet of Things (IoT) device, provided in some embodiments of this disclosure. Figure 7 This is a schematic diagram of the structure of an access device for an Internet of Things (IoT) device provided in some embodiments of this disclosure. Detailed Implementation
[0026] The technical solutions of this disclosure will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0027] It should be noted that, in this disclosure, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this disclosure should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0029] In the description of this disclosure, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "more than one" means two or more.
[0030] In IoT device access scenarios, automatic protocol identification is a crucial step in achieving rapid device interoperability. Currently, solutions based on traditional machine learning (such as support vector machines and random forests) are common. Their core logic is to train a specific protocol identification model using a large amount of manually labeled historical communication data, enabling the model to accurately distinguish and identify known protocol types. However, the main limitation of this approach is insufficient model generalization ability: whenever a new protocol device connects, the existing model cannot directly identify it, requiring re-collection of data, re-labeling, and retraining of a new dedicated model. This process results in high data preparation costs and long cycles, forcing new device access to wait for a lengthy retraining process, causing response delays and failing to meet the actual needs of rapid deployment in IoT scenarios with multiple device types and dynamic access.
[0031] To address the aforementioned technical issues, this disclosure provides an access method for IoT devices. The approach involves: when a new access device is detected and its communication protocol is not present in a preset protocol library, the system automatically constructs a meta-learning support set, thereby quickly generating a dedicated parsing unit containing a semantic adaptation model and a protocol structure template; this parsing unit is used to directly perform semantic parsing and structural matching on the device's communication data, extracting key business data, thus rapidly establishing a business communication session without requiring extensive training, which helps to achieve rapid adaptive access to new IoT devices under limited sample conditions.
[0032] The IoT device access method proposed in this solution can be widely applied to IoT scenarios requiring heterogeneous device access. For example, in the smart home field, when users introduce new or unpredefined protocol-branded smart appliances, the solution can automatically complete preliminary protocol feature extraction and parsing unit generation, quickly integrating the device into the home network management. In the industrial IoT field, facing the frequent replacement of new sensors, actuators, or heterogeneous industrial control equipment on production lines, this solution can significantly shorten the new equipment commissioning cycle. This solution is also applicable to various scenarios such as vehicle networking and energy metering, which will not be elaborated here.
[0033] The following is a detailed description of an Internet of Things (IoT) device access system provided by the present disclosure, with reference to the accompanying drawings.
[0034] See Figure 1 This is a schematic diagram of the architecture of an Internet of Things (IoT) device access system provided in some embodiments of this disclosure. Figure 1 As shown, the access system 100 for the Internet of Things (IoT) device includes: IoT device 10, smart gateway 20, and cloud training platform 30.
[0035] In this context, IoT device 10 refers to any intelligent terminal node connected to the IoT network, which can be one or more. This application does not impose any limitations on the specific physical form, application scenario, or functional type of IoT device 10. IoT device 10 can be a smart light bulb, temperature and humidity sensor, smart door lock, human infrared sensor, or robot vacuum cleaner in a home setting; it can also be a vibration monitor, radio frequency identification (RFID) electronic tag, or smart electricity and water meter in an industrial setting; or an environmental monitoring station, smart manhole cover, or shared bicycle in urban management.
[0036] The intelligent gateway 20 can be a standalone physical gateway device, an embedded industrial router, an intelligent host with edge computing capabilities, or an edge computing cluster or distributed system composed of multiple computing nodes. The intelligent gateway 20 integrates a meta-learning inference engine, a protocol plugin container, and an interactive monitoring module to handle unknown or proprietary protocols. This application does not strictly limit the specific hardware form, deployment location, or computing power of the intelligent gateway 20.
[0037] The cloud training platform 30 can be an independent physical server cluster or a cloud server instance running in a public cloud, private cloud, or hybrid cloud environment, such as cloud resources providing cloud hosts, cloud databases, cloud computing, cloud storage, network services, middleware services, big data processing services, or artificial intelligence training platforms. This cloud training platform 30 can be used for training deep learning models. This disclosure does not limit the specific hardware form or deployment location of the cloud training platform 30.
[0038] The IoT device 10 and the smart gateway 20 can be interconnected through various communication links. This disclosure does not limit the specific physical connection form, supporting both wireless and wired communication connections. In wireless connection scenarios, the IoT device can establish a connection with the smart gateway 20 through wireless protocols such as Wi-Fi, Bluetooth, ZigBee, LoRa, NB-IoT, or 5G; while in wired connection scenarios, the two parties can be directly connected through cables such as RS-485, CAN bus, Ethernet (RJ45), or fiber optic cables.
[0039] The smart gateway 20 and the cloud training platform 30 support both stable, high-speed connections via wired fiber optic cables, leased Ethernet lines, or enterprise intranet gateways, and flexible access via wireless wide area networks such as 4G / 5G cellular networks, NB-IoT, or satellite communication links. This application does not limit the specific transmission method between the smart gateway 20 and the cloud training platform 30.
[0040] For example, after detecting the IoT device 10, the smart gateway 20 confirms the communication protocol used by the IoT device 10. If it determines that the communication protocol is not included in the preset protocol library, it constructs a support set for meta-learning adaptation. The smart gateway 20 can also generate a parsing unit for the communication protocol based on the support set, and use the parsing unit to extract the service data of the IoT device 10 to establish a service communication session with the IoT device 10.
[0041] It should be noted that the above-provided figures are merely exemplary architecture diagrams. The number of devices included in the figures and the names of each device are not limited. In addition to the devices shown in the figures, other devices, such as storage devices, may also be included.
[0042] This disclosure also provides an access device for an Internet of Things (IoT) device, which serves as the execution entity for the aforementioned IoT device access method. This device can be an electronic device with IoT device access functionality, or a functional module within that electronic device; there is no limitation on the specific type. For example, when the device is an electronic device, it could be the smart gateway 20 within the aforementioned IoT device access system 100.
[0043] The application scenarios of the embodiments disclosed herein are not limited. The system architecture and business scenarios described in the embodiments of this disclosure are for the purpose of more clearly illustrating the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of this disclosure. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this disclosure are also applicable to similar technical problems.
[0044] The following describes an IoT device access method provided by an embodiment of this disclosure.
[0045] This disclosure provides a method for accessing an Internet of Things (IoT) device, applicable to the aforementioned IoT device access device. For example... Figure 2 As shown, the method includes the following steps: S201. In response to detecting a newly connected first IoT device, determine the first communication protocol used by the first IoT device.
[0046] In some embodiments of this solution, the newly connected first IoT device can be detected through mechanisms such as active scanning, passive listening, and device active reporting.
[0047] For example, an active scanning mechanism can scan the entire local network at preset intervals, checking Internet Protocol (IP) addresses or sending probe signals (such as the Ping command) to detect responses. Once a valid response is found from an IP address, it is determined that a new device has been detected. A passive monitoring mechanism continuously listens to data streams in the network, capturing DHCP requests or ARP broadcasts from devices. By parsing the source address or identification information in the packets, it is determined that a new device has been detected once active communication is detected. Under the device-initiated reporting mechanism, the first newly connected IoT device will proactively send an access request containing identity information such as the Media Access Control address. Receiving this request indicates that a new device has been detected.
[0048] The first communication protocol refers to the message protocol for application layer communication of the first Internet of Things (IoT) device. The first communication protocol specifies the following information: the data frame structure of the communication message (such as frame header, length field, instruction code, data payload and check field), instruction set definition (such as instruction encoding rules for read and write operations), interaction timing (such as the interaction logic of request and response), and data encoding format (such as byte order, data type and check algorithm), etc.
[0049] After detecting a newly connected IoT device, further information is collected to generate device identification information corresponding to that device. Device identification information refers to a set of features that can uniquely identify the device.
[0050] For example, the device identification information can be a device fingerprint, behavioral identifier, etc. The device fingerprint is a hash value generated based on the device's inherent physical attributes through a specific encryption algorithm. The behavioral identifier is a feature vector or dynamic code extracted from the device's dynamic communication behavior during access (such as communication timing, traffic patterns, protocol interaction characteristics, etc.).
[0051] Taking device fingerprinting as an example, before parsing the application layer protocol of the first IoT device, a device fingerprint can be generated by using the physical connection, link layer or network layer characteristics of the first IoT device (such as MAC address, Bluetooth device address, IP port combination, etc.) through a preset hash algorithm or encoding rule to uniquely distinguish and track the device.
[0052] After generating the device fingerprint, this fingerprint is used as the query key to perform real-time retrieval and matching operations in the local registry. The local registry is used to match the device fingerprint with the parsing plugin.
[0053] For example, an efficient hash index or approximate matching algorithm can be used to compare the fingerprint to be identified with historical fingerprints stored in the database bit by bit or calculate the similarity. If the similarity exceeds a preset threshold, the match is considered successful, that is, the first IoT device is determined to be a known device. The first communication protocol corresponding to the device can be determined, and the parsing plugin associated with the communication protocol in the database can be directly called to complete the access process. Conversely, if the search result is a match failure, the device is marked as an unknown device, and the following steps are performed.
[0054] S202. If it is determined that the first communication protocol is not included in the preset protocol library, construct a support set for meta-learning adaptation.
[0055] The support set includes at least one sample pair, which includes a first data unit and a second data unit that are semantically related. The first data unit is used to characterize the input request that triggers the communication interaction, and the second data unit is the response data of the input request.
[0056] For example, the first data unit can be a binary data stream that triggers a communication action by an IoT device, either a raw control command or a query request. It represents the machine representation of a request sent by a user or gateway to the device. The first data unit typically manifests as a specific sequence of bytes sent by an edge smart gateway. This sequence contains protocol-defined command words, opcodes, target addresses, length fields, parameter data, and checksums, among other things.
[0057] The second data unit refers to the underlying binary data stream of the original response message returned by the IoT device to the gateway after receiving the first data unit, through internal logic processing or status feedback. It represents the device's response to the smart gateway's request and may include device status, sensor readings, and confirmation of execution results. The second data unit is typically represented as a sequence of binary bytes returned by the device. This sequence includes the response frame header, status code, actual business data payload, data length identifier, and checksum.
[0058] The first and second data units form a complete sample pair through a temporal causal relationship of triggering and responding. For example, when the smart gateway sends a first data unit containing the intention to 'read the current temperature', the IoT device immediately responds with a second data unit containing the actual temperature value in the communication link.
[0059] The default protocol library stores structured identification information (such as protocol type code, version number, port characteristics, etc.) of various supported communication protocols, as well as corresponding parsing rules and message definitions (i.e. protocol format structure, instruction set mapping logic, etc.), which are used to parse known standard protocol rules.
[0060] The preset protocol library can also be called a protocol parsing library, a general protocol parsing library, or a protocol template library, etc. The preset protocol library in this disclosure may also have other names, which are not limited.
[0061] If the device fingerprint retrieval fails in the local registration database, the first IoT device can be determined to be an unknown device. To further identify its communication protocol type, the identifier (or protocol feature parameter) of the first communication protocol reported by the unknown device during the first communication handshake is extracted and matched against the list of valid protocols registered in the preset protocol library. If the protocol identifier exists in the preset protocol library, the first communication protocol is determined to be included in the preset protocol library, and the system loads the corresponding parsing plugin to complete the device access. For example, for devices using known standard protocols (such as Modbus, MQTT), fast matching and second-level access can be achieved. If the protocol identifier does not exist in the preset protocol library, the first communication protocol is determined to be not included in the preset protocol library and is an unknown protocol, which can then lead to the construction of a support set for meta-learning adaptation.
[0062] Meta-learning is a machine learning method whose core goal is to extract generalizable learning strategies or prior knowledge by having the model learn repeatedly on a large number of different but structurally similar tasks. This allows the model to quickly adapt and optimize when faced with a completely new task, using only a very small number of samples.
[0063] In meta-learning task organization, each task is divided into two parts: a support set and a query set. The support set consists of a small number of explicitly labeled samples, which the model uses for rapid learning or parameter tuning. The size of the support set is usually represented in the form of "N-way K-shot," meaning that the set contains N different categories, and each category provides K labeled samples. The model acquires the key information needed to adapt to new tasks through brief learning from the support set.
[0064] Based on this principle, this scheme employs a meta-learning algorithm. During the training phase, this scheme randomly samples N different protocols from a massive heterogeneous protocol dataset. For each protocol, K samples are provided as a support set, and a certain number of samples are extracted as a query set. Through this task organization method, the model iterates repeatedly across a large number of different but structurally similar tasks, learning how to quickly adjust parameters based on a small number of samples. Through training, the model obtains a set of optimal initial parameters; these parameters enable the model to quickly converge the loss function with a very small number of gradient updates when facing new protocol tasks consisting of only a small support set, thus enabling rapid adaptation and generation of semantically adapted models for new protocols.
[0065] In some embodiments, this scheme can be implemented based on model-agnostic meta-learning (MAML).
[0066] In one possible implementation, when building the support set for meta-learning adaptation, users can be guided to perform minimal interactions (e.g., clicking "Read Measurement Value") through human-computer interfaces (such as web pages, LED indicators and buttons) or associated mobile applications.
[0067] After a user performs an action, the application sends a command to the smart gateway. The smart gateway's interaction monitoring module then activates and completely captures the full original binary message of the response to this action. The user-triggered input request and its corresponding response data are associated and tagged to form tagged sample pairs. The first data unit of each sample pair represents the input request that triggered the communication interaction, and the second data unit is the response data returned by that input request.
[0068] In this context, an input request refers to a raw instruction message actively sent by the gateway during the interaction process to trigger actions on a specific device; it represents the intention to initiate communication. Response data, on the other hand, is a raw message returned by the target device after receiving the request and processing it internally; it contains execution results or status information and represents the device's feedback to the request.
[0069] Users can trigger a few other operations (such as "setting parameters") to generate supplementary sample pairs. Once a small number of sample pairs are accumulated, they form the initial support set. This process requires minimal user involvement to quickly obtain high-quality learning samples, laying the foundation for the model to use the optimal initial parameters for rapid gradient updates and semantic adaptation.
[0070] In one possible implementation, the method for constructing a support set for meta-learning adaptation further includes: obtaining historical communication logs under a first communication protocol; filtering input requests that trigger communication interactions and response data for each input request from the historical communication logs; and pairing the input requests and response data according to semantic associations to construct at least one sample pair in the support set.
[0071] Historical communication logs refer to archived data that records all data interactions on the communication link in chronological order. They completely preserve the original message sequence transmitted between IoT devices and gateways every time through the first communication protocol, covering key communication metadata such as request instructions, response data, communication timestamps, and source / destination addresses.
[0072] The log is typically stored as a binary stream (such as .pcap format) or a hexadecimal / text stream (such as .log, .txt format), and can completely reconstruct the device's communication behavior trajectory within a specific time period.
[0073] For devices that cannot be directly interacted with through a gateway, users can use dedicated debugging tools provided by the device manufacturer to obtain historical communication logs. By connecting the device through a physical interface and enabling data logging or packet capture functions in the software, the tool can automatically persist the raw data streams sent and received during device-terminal interactions into specific log files.
[0074] In some embodiments, users can also use general network protocol analysis tools to obtain historical communication logs. By using general network protocol analysis tools to perform network layer monitoring, placing the terminal device with packet capture software installed in the same network environment as the target device, and enabling the software to monitor the corresponding network interface card, the software will automatically intercept and record all data packets flowing through that network interface after the device completes several normal communication operations. Users can then filter the target device's communication flow through protocol filtering to obtain a historical communication log file containing the complete interaction process.
[0075] After obtaining historical communication logs, the logs are parsed to extract the interaction information in the communication messages. Based on the logic of the session source and response time, the uplink input requests and downlink response data are associated and matched. After removing non-business interference data, the successfully matched requests and responses are combined and encapsulated into standard data pairs, thereby constructing at least one sample in the support set.
[0076] In one possible implementation, a support set for meta-learning adaptation is constructed, including: acquiring the original message stream uploaded by the first IoT device; aggregating the original message stream into at least one message cluster using an unsupervised clustering algorithm based on the message length or byte distribution characteristics of the original message stream; wherein each message cluster contains a group of messages whose communication semantics belong to the same communication type; acquiring the semantic annotation information of the user for each message cluster; and constructing the support set based on the original message stream and the semantic annotation information.
[0077] The raw message stream refers to the sequence of raw network data packets sent by IoT devices to devices such as smart gateways. It completely records all uplink data during the device communication process.
[0078] Unsupervised clustering algorithms automatically divide samples in the original dataset into several disjoint clusters based on a preset similarity metric, without relying on any prior data labels or category information. This results in samples belonging to the same cluster having high intrinsic similarity, while samples in different subsets exhibit significant differences.
[0079] In scenarios where explicit instruction labels are unavailable, the algorithm first extracts features such as the length and internal byte distribution of the original message stream. Then, using an unsupervised clustering algorithm, it automatically aggregates the disorganized messages into several clusters based on the similarity of these features. Since messages corresponding to the same type of communication service (such as specific control commands or data reporting) typically exhibit similar feature patterns in their protocol structure, the algorithm can naturally group these messages belonging to the same service type together by calculating feature distance. Ultimately, each generated message cluster contains a group of messages with the same communication semantics, thus achieving automated classification of communication services without labels.
[0080] After classifying the messages, the semantic annotation information of each message cluster can be obtained from the user.
[0081] In one possible implementation, each message cluster generated by clustering and its representative samples are displayed on the interface. Users are guided to manually input or select the corresponding business name (such as "Temperature Data" or "Status Report") for each cluster based on sample characteristics. The user-input labels are then recorded and associated with the corresponding message clusters, thus completing the annotation. This step transforms the originally unlabeled clustering results into a set of annotated samples containing clear semantic information. Based on the original message stream and semantic annotation information, a support set for meta-learning adaptation can be constructed.
[0082] In one possible implementation, when constructing the support set for meta-learning adaptation, samples selected from historical communication logs can be merged with samples aggregated by an unsupervised clustering algorithm. That is, the support set consists of both types of data: one part based on historical log selection, and the other part based on unsupervised clustering aggregation of the original message stream. In another possible implementation, a certain number of samples can also be reserved as a query set.
[0083] S203. Generate a parsing unit for the first communication protocol based on the support set.
[0084] The parsing unit includes a semantic adaptation model and a protocol structured template. The semantic adaptation model is used to perform semantic parsing on the communication data of the first IoT device, and the structured template is used to describe the message structure characteristics and parsing logic of the first communication protocol.
[0085] The parsing unit is an interpreter automatically generated based on a small number of support set samples, specifically designed for parsing communication data of the first communication protocol. It integrates both semantic understanding and structural definition capabilities. It can describe the message structure characteristics and parsing logic of the first communication protocol according to the loaded protocol structure template, and invoke the semantic adaptation model to perform semantic parsing on the extracted binary fragments.
[0086] The semantic adaptation model is a neural network model fine-tuned using meta-learning techniques, which can identify and understand the specific business meaning of each field in a binary message.
[0087] The protocol structure template is an automatically generated rule description file that defines the data structure of the message, including physical layout, field boundaries, byte order, and verification logic.
[0088] For example, the parsing unit performs field segmentation on the original data stream based on the protocol structure template, and uses a semantic adaptation model to perform semantic annotation on the segmented fields, thereby completing the parsing of the first communication protocol.
[0089] In one possible implementation, the semantic adaptation model is determined as follows: Features are extracted from the support set using a pre-trained feature extraction network to obtain feature vectors and corresponding semantic labels for each sample in the support set; the feature vectors are mapped using the adaptation layer in the meta-learning network to obtain the predicted output; the loss function between the predicted output and the corresponding semantic labels in the support set is calculated; the parameters of the adaptation layer in the meta-learning network are updated using gradients through backpropagation; wherein, the parameters in the meta-learning network other than the adaptation layer remain frozen; and the semantic adaptation model is constructed based on the updated adaptation layer parameters.
[0090] Pre-trained feature extraction networks refer to deep neural network models that have been pre-trained on large-scale datasets. During inference, the network's parameters are frozen, serving only as a fixed mapping function to transform the input data into high-dimensional feature vectors.
[0091] Pre-trained feature extraction networks can also be called shared feature extraction networks, etc., and this disclosure does not limit them.
[0092] For example, the pre-trained feature extraction network can be a convolutional neural network, a recurrent neural network, or a hybrid of the above.
[0093] In this scheme, a pre-trained feature extraction network is used to automatically extract deep features related to protocol structure and semantics from the raw binary message, transforming the unstructured byte stream into a high-dimensional feature vector suitable for processing by the meta-learning model.
[0094] The feature vector and its corresponding instruction label together constitute the input to the meta-learning model. The meta-learning model processes the feature vector and generates a predicted output. The model calculates the loss between the predicted output and the true instruction label (such as cross-entropy loss) to quantify the accuracy of the prediction. Subsequently, during backpropagation, 1 to 5 rounds of gradient updates are performed on the parameters of the last or a few layers responsible for task mapping, rapidly adapting to the characteristics of the new protocol in a short time with a minimal number of parameters; thus constructing a semantic adaptation model specifically for this protocol.
[0095] For example, samples from the support set (including the first and second data units) are input into a pre-trained feature extraction network. The network automatically extracts the deep semantic information of the samples and outputs feature vectors and corresponding semantic labels for each sample in the support set. Subsequently, the adaptation layer of the meta-learning network maps the feature vectors to obtain the predicted output. The loss function value between the predicted output and the corresponding semantic labels in the support set is calculated. This loss function value quantifies the difference between the model's current predicted output and the true semantic labels, and is a key indicator of the model's prediction accuracy. The parameters of the adaptation layer of the meta-learning network are updated using gradients through backpropagation. Based on the calculated loss function value, optimization algorithms such as gradient descent are used to calculate the gradient of the loss function with respect to the adaptation layer parameters, and the weights and biases of the adaptation layer are adjusted accordingly to make the model evolve in the direction of reducing loss, thus obtaining the completed semantic adaptation model.
[0096] In some embodiments, during the process of updating the adaptation layer parameters through backpropagation, all parameters of the pre-trained feature extraction network remain frozen, and the parameters of the meta-learning network, except for those of the adaptation layer, remain frozen. For example, the parameters of the convolutional or fully connected layers (i.e., all layers except the adaptation layer) in the pre-trained feature extraction network responsible for extracting general low-level features are locked during training and do not participate in gradient updates; only the parameters of the adaptation layer are updated.
[0097] All parameters of the pre-trained feature extraction network are kept frozen, and the parameters of the meta-learning network, except for the adaptation layer, are also kept frozen. Only the parameters of the adaptation layer in the meta-learning network are updated, so as to make full use of the general feature representation capabilities learned in the pre-trained feature extraction network and the meta-learning network. This avoids destroying the original feature extraction structure during training with a small number of samples, while significantly reducing the consumption of computing resources and preventing overfitting. This allows the semantic adaptation model to converge quickly with a small number of samples and has strong generalization ability.
[0098] For example, the pre-trained feature extraction network can be a deep neural network containing multiple convolutional layers and / or recurrent layers; this disclosure does not limit the specific number of layers in the feature extraction network. During the edge adaptation stage, all parameters of the pre-trained feature extraction network are frozen. The meta-learning network includes an adaptation layer, which can be a fully connected layer or a few network layers. During training, the support set is input into the pre-trained feature extraction network to obtain feature vectors corresponding to each sample in the support set; the feature vectors are input into the meta-learning network to obtain the predicted output; the loss function value between the predicted output and the corresponding semantic label in the support set is calculated; through backpropagation, only the parameters of the adaptation layer in the meta-learning network are updated, while the parameters of the meta-learning network other than the adaptation layer remain frozen. After a preset number of iterations, a semantic adaptation model is constructed based on the updated adaptation layer parameters. This semantic adaptation model includes the pre-trained feature extraction network with frozen parameters and the meta-learning network adaptation layer with updated parameters, thereby possessing the ability to perform semantic parsing of the first communication protocol.
[0099] In one possible implementation, the protocol structure template is determined as follows: structural feature analysis is performed on multiple second data units under the same instruction type to identify fixed structure fields and variable structure fields in the message; based on the distribution characteristics and change patterns of variable structure fields in the message, the message structure characteristics and parsing logic of the first communication protocol are derived; and the protocol structure template is constructed according to the message structure characteristics and parsing logic.
[0100] The second data unit is the response data collected in response to the instruction request.
[0101] The protocol structure template is a data structure automatically generated by the system based on historical data, used to define message parsing rules.
[0102] Fixed structure fields are those whose positions and contents remain unchanged across all similar messages. For example, all "temperature read" messages will always begin with 0xAA, or the third byte will always be 0x01. Fixed structure fields typically include the message header, command code, and fixed delimiters.
[0103] A variable structure field is a part of a message whose position may be fixed but whose content may change, or whose position itself may change with the length of the content. This variable structure field may be a data value, sequence number, checksum, etc.
[0104] Distribution characteristics and variation patterns refer to the probability of occurrence, length distribution, numerical range, and relative positional relationship of variable fields with fixed fields in a message.
[0105] In this scheme, multiple response messages of the same instruction type are compared using binary sequences to identify fixed and variable fields.
[0106] By analyzing the length, value range changes, and appearance positions of variable fields in different instruction responses, we can infer the position of the length field, preliminarily determine the possible algorithm of the checksum field (such as CRC16), and the offset, byte order (big-endian / little-endian), and encoding format (such as integer, floating-point, ASCII string) of the data field.
[0107] The deduced parsing rules are formalized into a standardized protocol structured template file (e.g., using XML or a specific schema language). This protocol structured template file strictly defines the physical layout and parsing logic of the message, specifically including key technical parameters such as field start offsets, data length, byte order rules, data type definitions, and checksum calculation positions.
[0108] S204. Use the parsing unit to extract the service data of the first IoT device in order to establish a service communication session with the first IoT device.
[0109] Extracting business data refers to using a parsing unit to break down the raw binary messages reported by IoT devices into independent fields and translate them into clear business meanings (such as which binary sequences correspond to the response of the "measurement value" command).
[0110] Based on the extracted key business data, the system automatically verifies the legitimacy of the device in the background and dynamically activates the corresponding business communication session, thereby completing the automatic access of the first IoT device.
[0111] In one possible implementation, the parsing unit extracts the business data of the first IoT device, including: using the parsing unit to perform field segmentation on the communication data of the first IoT device based on the protocol structure template, and extracting binary data fragments of the communication data; calling the semantic adaptation model to perform semantic parsing on the binary data fragments to obtain parsing results containing semantic tags; and generating business data based on the parsing results containing semantic tags.
[0112] First, the parsing unit segments the raw communication data uploaded by the first IoT device according to the protocol's structured template, separating independent binary data fragments from the binary message according to preset length rules and positions. The semantic adaptation model is then invoked to perform deep semantic parsing on these fragments, converting the raw byte values into specific business meanings through a mapping algorithm (e.g., recognizing the value 0x1A as "26.0" and the instruction code 0x01 as "temperature read"), thereby generating intermediate parsing results with clear semantic labels (e.g., {field name: temperature, unit: ℃, value: 26.0}). Finally, these semantically labeled parsing results are structurally assembled to generate standardized business data objects, providing accurate data for subsequent communication session establishment.
[0113] In one possible implementation, the method further includes: evaluating the validity of the parsing results to obtain the parsing accuracy and confidence score; if the parsing accuracy does not meet the preset qualification conditions, a fallback mechanism is triggered; if the parsing accuracy meets the preset qualification conditions but the confidence score does not meet the preset credibility conditions, an optimization process is triggered; if the parsing accuracy meets the preset qualification conditions and the confidence score meets the preset credibility conditions, it is determined that the parsing unit and the first communication protocol of the first IoT device are successfully adapted. The rollback mechanism includes: returning to the step of building the support set to supplement the training data, and regenerating the parsing unit based on the supplemented support set.
[0114] The optimization process includes: obtaining semantic annotation information of at least one data sample to be processed with the highest uncertainty; using the obtained semantic annotation information as an incremental sample of the support set; and regenerating the parsing unit based on the support set containing the incremental sample.
[0115] Accuracy refers to the proportion of predictions that the model correctly identifies in all predictions, reflecting the overall correctness of the model. In this scheme, accuracy is the ratio of the number of correctly identified samples to the total number of samples involved in the prediction.
[0116] The confidence score represents the model's probabilistic judgment on a specific prediction. In this scheme, when the device signal is interfered with or the protocol definition is unclear, the model cannot be 100% certain. The confidence score can quantify this uncertainty, thereby enabling more cautious decision-making.
[0117] For example, confidence scores can be used to measure prediction uncertainty by calculating the entropy of the model's output probability distribution, or by simulating multiple forward propagations using Monte Carlo Dropout to calculate prediction variance.
[0118] In this solution, after successful parsing, a verification command can be sent to compare the parsing result with the actual device status, thereby calculating the accuracy.
[0119] Scenario 1: The parsing accuracy does not meet the preset qualification conditions. If the parsing accuracy does not meet the preset qualification conditions, the rollback mechanism will be triggered.
[0120] The fallback mechanism involves reverting to the step of building the support set to supplement the training data, and then regenerating the parsing unit based on the supplemented support set.
[0121] The method for supplementing training data can be found in S202, and will not be elaborated here.
[0122] For example, after obtaining the supplemented support set, the support set is used to drive the meta-learning model for rapid backpropagation and gradient updates to obtain more accurate semantic adaptation parameters, enabling it to more accurately identify the meaning of instructions in the protocol. At the same time, based on the supplemented support set, the message is subjected to global comparison and deep analysis to correct the original byte offset, field length, verification algorithm, and data type inference, generating a more accurate protocol structured template. Finally, based on the updated semantic adaptation model and the newly generated structured template, a new parsing unit is generated to ensure that the system can generate more accurate results in the next parsing.
[0123] Scenario 2: The parsing accuracy meets the preset qualification conditions, but the confidence score does not meet the preset credibility conditions. If the parsing accuracy meets the preset qualification conditions but the confidence score does not meet the preset credibility conditions, the optimization process is triggered.
[0124] The optimization process includes: obtaining semantic annotation information of at least one data sample to be processed with the highest uncertainty; using the obtained semantic annotation information as an incremental sample of the support set; and regenerating the parsing unit based on the support set containing the incremental sample.
[0125] For example, in the optimization process, the confidence score of the data is first calculated in real time, and the sample with the highest entropy value, i.e. the most uncertain sample of the model, is selected. Then, a label confirmation request for these specific samples is sent to human users or devices (e.g., highlighting them on the interface and asking "Is this temperature data?"). Once the confirmed semantic label information is obtained, it is added to the support set as an incremental sample. The meta-learning model is then driven again to fine-tune based on the support set containing the incremental sample, and the protocol structure template is corrected in parallel, thereby generating a new parsing unit with higher accuracy.
[0126] Scenario 3: The parsing accuracy meets the preset qualification conditions and the confidence score meets the preset credibility conditions. If the parsing accuracy meets the preset qualification conditions and the confidence score meets the preset credibility conditions, then it is determined that the parsing unit and the first communication protocol of the first IoT device are successfully adapted.
[0127] For example, the preset qualification condition can be an accuracy rate of not less than 95%. The preset confidence condition can be a confidence score of greater than or equal to 93%. When the parsing unit successfully adapts to the first communication protocol of the first IoT device, that is, when the parsing accuracy meets the preset qualification condition and the confidence score meets the preset confidence condition, a lightweight protocol parsing plugin can be generated according to the parsing unit and registered to the gateway plugin library to ensure that all subsequent communications of the IoT device are standardized and data is uniformly reported through this plugin.
[0128] For example, this protocol parsing plugin can be a configuration file in JSON or YAML format, flexibly defining message field mappings, parsing rules, and validation logic, facilitating rapid iteration and debugging. This protocol parsing plugin can also be compiled as a WebAssembly module, which can be directly called in the gateway runtime environment, thereby achieving high parsing performance.
[0129] After local adaptation and parsing plugin generation, the system will encrypt the key features of the successful case and securely upload them to the cloud training platform asynchronously. These selected incremental materials will be incorporated into a large-scale database in the cloud to enrich the diversity of the training set of the meta-learning model, thereby optimizing the initial parameter distribution of the next generation of public meta-learning models and enabling them to have stronger generalization capabilities when facing new and unknown protocols in the future.
[0130] This solution constructs a support set containing semantic association pairs of input request and response data. Using only a small number of sample pairs from this support set, it can quickly establish the mapping relationship between message features and semantic tags, effectively reducing reliance on massive amounts of labeled data. Combined with a semantic adaptation model dynamically generated based on the support set and a protocol structure template, it achieves automated protocol structure inference and semantic reasoning, significantly reducing reliance on manually predefined rules. This solution effectively shortens the access adaptation time for IoT devices under unknown communication protocols, facilitating efficient parsing and flexible adaptation of unknown protocols in scenarios with limited data, thereby successfully establishing business communication sessions with new devices.
[0131] This disclosure also provides a schematic diagram of the architecture of an access system for Internet of Things (IoT) devices, such as... Figure 3 As shown, the system adopts a layered and progressive architecture, which includes, from top to bottom: a device discovery and identification layer, a protocol parsing and matching layer, and a meta-learning adaptive layer.
[0132] 1. Device Discovery and Identification Layer This layer primarily handles the registration or querying of device fingerprints for new devices. The physical network sensing module monitors network traffic in real time to capture newly connected IoT devices. Then, using a device fingerprint generation engine, it extracts the device's physical connection, link layer, or network layer characteristics (such as MAC address, Bluetooth address, IP port combination, etc.) to generate a unique device fingerprint. This fingerprint is then used as a key for retrieval in a local registry.
[0133] If the search is successful (matching a known device), the device is determined to be a known device, and the pre-stored protocol parsing plugin associated with that device in the local registry is automatically invoked to complete the access and data parsing process within seconds. If the search fails (matching an unknown device), the device is determined to be an unknown device, and the case is transferred to the protocol parsing and matching layer for processing.
[0134] 2. Protocol Parsing and Matching Layer This layer aims to quickly cover known standard protocols using a pre-defined protocol library, avoiding redundant calculations. It extracts the communication protocol identifier (or protocol characteristic parameters) of unknown devices and performs a matching query in the pre-defined protocol library. This library structurally stores the identifier information, message definitions, and parsing rules for various standard communication protocols (such as Modbus, MQTT, etc.).
[0135] If the protocol identifier matches successfully, the system determines that the protocol belongs to a known standard protocol, immediately loads the corresponding protocol matching engine, and completes the device access. If the protocol identifier fails to match, the system determines that the device uses a proprietary or unknown protocol that cannot be directly parsed using the preset protocol library. In this case, the system will trigger the meta-learning adaptive process, transferring the unknown protocol to the meta-learning adaptive layer.
[0136] 3. Meta-learning adaptive layer This layer consists of two parts: a cloud-based training platform and an edge intelligent gateway.
[0137] The cloud-based training platform is responsible for pre-training the meta-learning model using massive amounts of heterogeneous protocol data and optimizing the model's initial parameters. It is also responsible for managing and distributing model versions, as well as aggregating adaptation experience uploaded from various edge nodes to drive model evolution.
[0138] The edge intelligent gateway integrates a meta-learning inference engine, an automatic protocol specification summarization module, a protocol plugin container, and an interactive monitoring module.
[0139] The interaction monitoring module is responsible for guiding and monitoring the user's minimal interaction with the device (or through log uploads, etc.) after the device is determined to be an unknown protocol, fully capturing the input request and the device's response data, and building a high-quality support set sample pair.
[0140] The meta-learning inference engine receives support set samples generated by the interactive monitoring module and uses a pre-trained feature extraction network to transform the original message into a high-dimensional feature vector. Based on the principles of model-agnostic meta-learning and other algorithms, this engine can quickly fine-tune model parameters with only a few gradient updates, generating a semantically adapted model for the current unknown protocol.
[0141] The protocol specification auto-summarization module performs automated analysis of the support set. Through message comparison, it identifies fixed and variable fields, infers the protocol's data structure, and generates a structured protocol template description file.
[0142] The protocol plugin container module is responsible for receiving the semantic adaptation model and protocol template description file, and automatically compiling or configuring them into a lightweight, independently runnable protocol parsing plugin. Once generated, the plugin is immediately registered and loaded into the gateway runtime environment, taking over all subsequent communication data parsing tasks for the unknown device and completing the final access.
[0143] A deep model and knowledge collaboration mechanism has been established between the cloud-based training platform and the edge intelligent gateway. The cloud distributes pre-trained and optimized initial parameters and the latest version of the meta-learning model to the edge intelligent gateway. After successfully adapting to the unknown protocol locally, the edge intelligent gateway asynchronously uploads the successfully adapted cases to the cloud. The cloud will then drive the evolution and upgrade of the next-generation meta-learning model based on these adapted cases.
[0144] Some embodiments of this disclosure also provide flowcharts of methods for accessing IoT devices, such as... Figure 4 As shown.
[0145] First, the system discovers and identifies new IoT devices. The system monitors network interfaces in real time, and once a new device is detected, it immediately collects the device's multi-dimensional characteristics, including its physical address (such as MAC address and Bluetooth device address) and link layer frame structure characteristics. Based on these multi-dimensional characteristics, the system generates a unique device fingerprint using a preset hash algorithm. Subsequently, the system compares this fingerprint with a local registry to determine if the fingerprint has already been registered.
[0146] If the fingerprint is already registered, it indicates that the device is a historically known device. The system directly calls the existing parsing plugin to complete the connection within seconds. Once the device connection is complete and standardized data reporting is achieved, this process ends. If the fingerprint is not registered, it indicates that this is an unknown device, and the subsequent protocol parsing and matching process is triggered.
[0147] For unknown devices, the system uses a pre-defined protocol library to perform feature matching and parsing on the raw message stream reported by the device, and determines whether the parsing is successful. If the parsing is successful, it can be determined that the device uses a known standard protocol, and the corresponding existing parsing plugin is invoked to complete the access. If the parsing fails, it can be determined that the protocol is unknown, and the relevant data is transferred to the meta-learning adaptive layer.
[0148] After entering the meta-learning adaptive layer, the system executes the following core process: First, triggering and sample collection are performed. The system guides the user to perform simple interactive operations through the interactive listening module, thereby capturing complete input request and device response data to build an initial support set. Then, rapid model adaptation is performed. The initial support set is input into a pre-trained feature extraction network to generate high-dimensional feature vectors. Gradient updates are performed using the inference engine of the meta-learning network to quickly fine-tune the model parameters and generate a semantically adapted model for this specific unknown protocol.
[0149] Simultaneously, the automatic summarization of the execution protocol structure and specifications involves byte-level comparison of the support set messages, automatic identification of fixed and variable fields, inference of information such as offset, byte order and bit field definitions, and generation of a structured protocol template description file.
[0150] After completing the core processing described above, the system loads the generated semantic adaptation model and protocol template into the general parsing engine to perform real-time parsing of device data and accuracy verification. Different branches are then executed based on the verification results.
[0151] Scenario 1: Accuracy verification passed If the parsing accuracy meets the preset qualification criteria, the adaptation is deemed successful. The system immediately performs plugin generation and persistence, registering the lightweight parsing plugin to the gateway plugin container. Subsequently, the feature vectors and protocol templates from this adaptation are used for experience feedback and asynchronously uploaded to the cloud training platform for subsequent model evolution.
[0152] Scenario 2: Accuracy verification passes, but confidence level is insufficient. If the parsing accuracy meets the preset qualification criteria, but the confidence score does not meet the preset credibility criteria, the active learning process is triggered. Based on the uncertainty of the model prediction (such as entropy value), the system sorts and filters out the most ambiguous samples, guiding the user to reconfirm or supplement the annotations of the samples. After obtaining incremental samples, the system re-executes the rapid adaptation and other operations in the above steps until the verification is successful.
[0153] Scenario 3: Accuracy verification fails, but confidence level meets the requirements. If the parsing accuracy does not meet the preset qualification criteria, but the confidence score meets the preset credibility criteria, the system will return to guide the collection of more samples and then re-enter the model rapid adaptation stage until the verification is successful.
[0154] Some embodiments of this disclosure also provide a schematic diagram of a meta-learning fast adaptation process, such as... Figure 5 As shown.
[0155] The rapid adaptation of meta-learning mainly includes the cloud training stage (offline) and the edge adaptation stage (online).
[0156] 1. Cloud-based training phase During the meta-training phase, the system utilizes massive amounts of historical heterogeneous protocol data to construct numerous "N-way K-shot" meta-learning tasks. Each task contains N different protocol categories, with each category providing K support set samples and several query set samples. Through iterative optimization on these multi-tasks, the system trains the pre-trained feature extraction network and initializes the parameters.
[0157] The goal of training is not to teach the model to directly recognize a specific protocol, but to train it to obtain an optimal set of initial parameters θ. This set of parameters allows the model to quickly reduce the loss function when faced with any new protocol task, requiring only a few gradient update steps, thus enabling it to quickly adapt to the new task.
[0158] After obtaining the optimal initial parameters θ through training in the cloud, the pre-installed model containing these initial parameters can be distributed to the edge gateway.
[0159] 2. Edge adaptation stage Once the edge gateway detects a new protocol device and obtains a small number of support set samples, it enters the rapid adaptation phase: The support set samples are input into the pre-trained feature extraction network and transformed into high-dimensional feature vectors.
[0160] Using the acquired optimal initial parameters, a loss function (such as cross-entropy loss) is calculated based on a small number of support set samples. The system performs rapid gradient updates within 1 to 5 steps over hundreds of milliseconds, typically fine-tuning only the parameters of the last few layers of the model. The model is then quickly transformed into a semantically adapted model for the current new protocol (where parameter updates are...). ).
[0161] The performance of the adapted model is verified using query set sample parsing. If the loss function converges and the error meets the requirements, the adaptation is considered successful.
[0162] The foregoing mainly describes the solutions provided by the embodiments of the present invention from the perspective of the access process of IoT devices. It is understood that each device, etc., includes corresponding hardware structures and / or software modules to perform each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0163] This disclosure also provides a schematic diagram of the composition of an access device for an Internet of Things (IoT) device, such as... Figure 6 As shown, the access device 600 for IoT devices includes a determining module 601, a processing module 602, and a generating module 603. In some embodiments, the access device 600 may further include an acquiring module 604.
[0164] The system comprises the following modules: Determination module 601, used to determine the first communication protocol adopted by the first IoT device; Processing module 602, used to construct a support set for meta-learning adaptation when the first communication protocol is not included in a preset protocol library; wherein the support set includes at least one sample pair, the sample pair including a first data unit and a second data unit with semantic association, the first data unit representing an input request that triggers communication interaction, and the second data unit being the response data of the input request. Generation module 603, used to generate a parsing unit for the first communication protocol based on the support set; wherein the parsing unit includes a semantic adaptation model and a protocol structure template, the semantic adaptation model being used to perform semantic parsing on the communication data of the first IoT device, and the structure template being used to describe the message structure features and parsing logic of the first communication protocol; Processing module 602 is also used to extract the business data of the first IoT device using the parsing unit to establish a business communication session with the first IoT device.
[0165] In one possible implementation, the acquisition module 604 is used to acquire historical communication logs under the first communication protocol; the processing module 602 is also used to filter out the input requests that trigger communication interactions and the response data of each input request from the historical communication logs; the processing module 602 is also used to pair the input requests and response data according to semantic association to construct at least one sample pair in the support set.
[0166] In one possible implementation, the acquisition module 604 is further configured to acquire the original message stream uploaded by the first IoT device; the processing module 602 is further configured to aggregate the original message stream into at least one message cluster based on the message length or byte distribution characteristics of the original message stream using an unsupervised clustering algorithm; wherein each message cluster contains a group of messages whose communication semantics belong to the same communication type; the acquisition module 604 is further configured to acquire the semantic annotation information of the user for each message cluster; the processing module 602 is further configured to construct a support set based on the original message stream and the semantic annotation information.
[0167] In one possible implementation, the processing module 602 is further configured to extract features from the support set using a pre-trained feature extraction network to obtain feature vectors and corresponding semantic labels for each sample in the support set; map the feature vectors using the adaptation layer in the meta-learning network to obtain the prediction output; calculate the loss function value between the prediction output and the corresponding semantic labels in the support set; update the parameters of the adaptation layer of the meta-learning network through backpropagation; wherein the parameters in the meta-learning network other than the adaptation layer remain frozen; and construct a semantic adaptation model based on the updated adaptation layer parameters.
[0168] In one possible implementation, the processing module 602 is further configured to perform structural feature analysis on multiple second data units under the same instruction type, identify fixed structure fields and variable structure fields in the message; based on the distribution characteristics and change patterns of variable structure fields in the message, deduce the message structure characteristics and parsing logic of the first communication protocol; and construct a protocol structure template according to the message structure characteristics and parsing logic.
[0169] In one possible implementation, the processing module 602 is further configured to use the parsing unit to perform field segmentation on the communication data of the first IoT device based on the protocol structure template, and extract binary data fragments of the communication data; call the semantic adaptation model to perform semantic parsing on the binary data fragments to obtain parsing results containing semantic tags; the generation module 603 is further configured to generate business data based on the parsing results containing semantic tags.
[0170] In one possible implementation, the processing module 602 is further used to evaluate the effectiveness of the parsing results, obtaining the parsing accuracy and confidence score of the parsing results; if the parsing accuracy does not meet the preset qualification conditions, a rollback mechanism is triggered; if the parsing accuracy meets the preset qualification conditions but the confidence score does not meet the preset credibility conditions, an optimization process is triggered; if the parsing accuracy meets the preset qualification conditions and the confidence score meets the preset credibility conditions, it is determined that the parsing unit and the first communication protocol of the first IoT device are successfully adapted; wherein, the rollback mechanism includes: returning to the step of constructing a support set to supplement training data, and regenerating the parsing unit based on the supplemented support set. In the optimization process: the acquisition module 604 is further used to acquire the semantic annotation information of at least one data sample to be processed with the highest uncertainty; the processing module 602 is further used to use the acquired semantic annotation information as an incremental sample of the support set, and regenerate the parsing unit based on the support set containing the incremental sample.
[0171] It should be noted that, Figure 6 Modules in a given context can also be called units; for example, a defined module can be called a defined unit. Additionally, in... Figure 6 In the embodiments shown, the names of the modules may not be the same as those shown in the figures. For example, the transmission module may also be called the communication module.
[0172] Figure 6If the various units or modules in the present disclosure are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this disclosure, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this disclosure. Storage media for storing computer software products include: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code. In the case where the functions of the integrated modules described above are implemented in hardware, this disclosure provides a possible structural schematic diagram of the access device for the Internet of Things (IoT) devices involved in the above embodiments. For example... Figure 7 As shown, the access device 700 for the Internet of Things (IoT) device includes a processor 702, a communication interface 703, and a bus 704. In some embodiments, the access device 700 for the IoT device may further include a memory 701.
[0173] Processor 702 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 702 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 702 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0174] The communication interface 703 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0175] The memory 701 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0176] As one possible implementation, the memory 701 can exist independently of the processor 702. The memory 701 can be connected to the processor 702 via a bus 704 and is used to store instructions or program code. When the processor 702 calls and executes the instructions or program code stored in the memory 701, it can implement the IoT device access method provided in this disclosure.
[0177] In another possible implementation, the memory 701 can also be integrated with the processor 702.
[0178] The 704 bus can be an extended industry standard architecture (EISA) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0179] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the access device can be divided into different functional modules to complete all or part of the functions described above.
[0180] This disclosure also provides a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer, cause the computer to perform the methods as described in any of the above embodiments.
[0181] Exemplary examples show that the aforementioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical discs (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described herein may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0182] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the Internet of Things (IoT) device access method of any of the above embodiments.
[0183] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0184] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
[0185] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for accessing an Internet of Things (IoT) device, characterized in that, The method includes: In response to the detection of a newly connected first IoT device, the first communication protocol adopted by the first IoT device is determined; If it is determined that the first communication protocol is not included in the preset protocol library, a support set for meta-learning adaptation is constructed; wherein, the support set includes at least one sample pair, the sample pair includes a first data unit and a second data unit with semantic association, the first data unit is used to characterize the input request that triggers the communication interaction, and the second data unit is the response data of the input request; Based on the support set, a parsing unit for the first communication protocol is generated; wherein, the parsing unit includes a semantic adaptation model and a protocol structure template, the semantic adaptation model is used to perform semantic parsing on the communication data of the first IoT device, and the structure template is used to describe the message structure features and parsing logic of the first communication protocol; The parsing unit is used to extract the business data of the first IoT device in order to establish a business communication session with the first IoT device.
2. The method according to claim 1, characterized in that, The construction of the support set for meta-learning adaptation includes: Obtain historical communication logs under the first communication protocol; Filter out the input requests that triggered the communication interaction and the response data of each input request from the historical communication logs; The input request and the response data are paired according to semantic association to construct at least one sample pair in the support set.
3. The method according to claim 1, characterized in that, The construction of the support set for meta-learning adaptation includes: Obtain the original message stream uploaded by the first IoT device; Based on the message length or byte distribution characteristics of the original message stream, an unsupervised clustering algorithm is used to aggregate the original message stream into at least one message cluster; wherein, each message cluster contains a group of messages whose communication semantics belong to the same communication type; Obtain the semantic annotation information of the user for each of the aforementioned message clusters; The support set is constructed based on the original message stream and the semantic annotation information.
4. The method according to any one of claims 1-3, characterized in that, The semantic adaptation model is determined based on the following methods: The support set is used to extract features using a pre-trained feature extraction network to obtain the feature vector and corresponding semantic label for each sample in the support set. The feature vector is mapped using the adaptation layer in the meta-learning network to obtain the prediction output. Calculate the loss function value between the predicted output and the corresponding semantic label in the support set; The parameters of the adaptation layer of the meta-learning network are updated by gradient through backpropagation; wherein, the parameters of the meta-learning network other than the adaptation layer are kept frozen. The semantic adaptation model is constructed based on the updated adaptation layer parameters.
5. The method according to claim 4, characterized in that, The protocol structure template is determined based on the following method: Structural feature analysis is performed on multiple second data units under the same instruction type to identify fixed structure fields and variable structure fields in the message; Based on the distribution characteristics and change patterns of the variable structure fields in the message, the message structure characteristics and parsing logic of the first communication protocol are derived. Based on the message structure characteristics and parsing logic, the protocol structure template is constructed.
6. The method according to claim 1, characterized in that, The step of extracting the business data of the first IoT device using the parsing unit includes: The parsing unit uses the protocol structure template to perform field segmentation on the communication data of the first IoT device and extracts binary data fragments from the communication data. The semantic adaptation model is invoked to perform semantic parsing on the binary data fragment, and a parsing result containing semantic tags is obtained; The business data is generated based on the parsing results containing semantic tags.
7. The method according to claim 6, characterized in that, The method further includes: The validity of the analysis results is evaluated to obtain the analysis accuracy and confidence score of the analysis results; If the parsing accuracy does not meet the preset qualification conditions, a rollback mechanism is triggered; If the parsing accuracy meets the preset qualification condition and the confidence score does not meet the preset credibility condition, then the optimization process is triggered. If the parsing accuracy meets the preset qualification condition and the confidence score meets the preset credibility condition, then it is determined that the parsing unit is successfully adapted to the first communication protocol of the first IoT device. The fallback mechanism includes: returning to the step of constructing the support set to supplement the training data, and regenerating the parsing unit based on the supplemented support set; The optimization process includes: obtaining semantic annotation information of at least one data sample to be processed with the highest uncertainty; using the obtained semantic annotation information as an incremental sample of the support set; and regenerating the parsing unit based on the support set containing the incremental sample.
8. An access device for an Internet of Things (IoT) device, characterized in that, The device includes: The determination module is used to determine the first communication protocol adopted by the first IoT device; The processing module is configured to construct a support set for meta-learning adaptation when it is determined that the first communication protocol is not included in a preset protocol library; wherein the support set includes at least one sample pair, the sample pair includes a first data unit and a second data unit with semantic association, the first data unit is used to characterize an input request that triggers communication interaction, and the second data unit is the response data of the input request; A generation module is used to generate a parsing unit for the first communication protocol based on the support set; wherein, the parsing unit includes a semantic adaptation model and a protocol structured template, the semantic adaptation model is used to perform semantic parsing on the communication data of the first IoT device, and the structured template is used to describe the message structure features and parsing logic of the first communication protocol; The processing module is further configured to use the parsing unit to extract the business data of the first IoT device in order to establish a business communication session with the first IoT device.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a processor, cause the processor to perform the method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program; when the computer program is executed, it is capable of implementing the method as described in any one of claims 1 to 7.
