Message processing method and device, electronic equipment and storage medium

By deploying a protocol template library in the IoT gateway system, the air conditioner control messages can be identified and converted, solving the communication problem of the IoT gateway being incompatible with different home appliances. This enables automatic compatibility and control of air conditioners, improving the system's real-time performance and stability.

CN121907935APending Publication Date: 2026-04-21GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GREE ELECTRIC APPLIANCE INC OF ZHUHAI
Filing Date
2025-12-09
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing IoT gateways are incompatible with the differences in communication interfaces, protocol definitions, and message versions of different home appliances, resulting in the inability to correctly identify messages and preventing users from controlling the corresponding devices through the gateway.

Method used

A protocol template library is deployed in the wireless communication gateway system. By determining the matching degree between the air conditioning control message and the candidate communication protocol template, message difference data is generated. Combined with clustering, the protocol conversion rules are determined, the air conditioning control message is converted into the target protocol message, and then sent to the device.

Benefits of technology

It achieves automatic compatibility with different protocols, improving the system's real-time performance and stability. Users can control air conditioning equipment through the IoT gateway without having to worry about interface, protocol format, and version issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907935A_ABST
    Figure CN121907935A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message processing method and device, electronic equipment and a storage medium, and the method comprises the steps: determining the target matching degree of an air conditioner control message and a candidate communication protocol template when the air conditioner control message is received; under the condition that the target matching degree is lower than a preset threshold value, message difference data are generated based on the air conditioner control message; clustering is carried out in combination with the air conditioner control message and the message difference data, and a protocol conversion rule is determined; based on the protocol conversion rule, converting the air conditioner control message into a target protocol message; and issuing the target protocol message. According to the embodiment of the invention, the gateway of the internet of things can be compatible with equipment of different versions of protocols, the air conditioner control message is accurately analyzed, and a user can control the equipment based on the gateway of the internet of things.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) device technology, and in particular to a message processing method, a message processing apparatus, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the development of IoT and smart home technologies, traditional home appliances such as air conditioners are gradually being included in the scope of remote control and data interconnection. However, due to differences in communication interfaces, protocol definitions, and message versions, existing home appliances such as air conditioners are difficult for IoT gateways to be compatible with, resulting in the inability to correctly identify messages and preventing users from controlling the corresponding devices through the gateway. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a message processing method, a message processing apparatus, an electronic device, and a computer-readable storage medium that overcome or at least partially solve the above problems.

[0004] To address the aforementioned problems, this invention discloses a message processing method applied to a wireless communication gateway system. The wireless communication gateway system deploys a protocol template library containing candidate communication protocol templates. The method includes: Upon receiving an air conditioning control message, determine the target matching degree between the air conditioning control message and the candidate communication protocol template; If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message; Clustering is performed on the air conditioning control messages and the message difference data to determine the protocol conversion rules; Based on the aforementioned protocol conversion rules, the air conditioning control message is converted into the target protocol message; Send the target protocol message.

[0005] Optionally, the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template includes: Parse the air conditioning control message to determine the type field to be compared; In the candidate communication protocol template, a reference type field corresponding to the type field to be compared is determined; The initial matching degree is determined by comparing the field to be compared with the reference field. Obtain the weight value corresponding to the field to be compared; The target matching degree is determined by combining the weight value and the initial matching degree.

[0006] Optionally, the air conditioning control message includes multiple fields, and the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template further includes: Calculate the average of the target matching degree; The target matching degree is updated based on the average.

[0007] Optionally, the step of clustering the air conditioning control message and the message difference data to determine the protocol conversion rules includes: Cluster each field in the air conditioning control message to determine the field type; Determine the single-field conversion rule based on the field type; Combine the single-field conversion rules to generate protocol conversion rules.

[0008] Optionally, the step of clustering each field in the air conditioning control message to determine the field type includes: Determine the initial type corresponding to the candidate communication protocol template; Each field in the air conditioning control message is clustered based on the initial type to determine the field type.

[0009] Optionally, the method further includes: By combining the protocol conversion rules and the message difference data, a difference patch template file is generated; Incremental updates are performed based on the aforementioned difference patch template file.

[0010] Optionally, the method further includes: The target protocol message is converted into an interface data exchange file.

[0011] In a second aspect, embodiments of the present invention disclose a message processing apparatus applied to a wireless communication gateway system, wherein the wireless communication gateway system is equipped with a protocol template library containing candidate communication protocol templates, and the apparatus includes: The receiving module is used to determine the target matching degree between the air conditioning control message and the candidate communication protocol template when the air conditioning control message is received; The difference module is used to generate message difference data based on the air conditioning control message when the target matching degree is lower than a preset threshold. The clustering module is used to perform clustering based on the air conditioning control message and the message difference data to determine the protocol conversion rules; The conversion module is used to convert the air conditioning control message into a target protocol message based on the protocol conversion rules. The transmission module is used to send the target protocol message.

[0012] In a third aspect, an embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the message processing method as described above.

[0013] In a fourth aspect, embodiments of the present invention disclose a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the message processing method described above.

[0014] The embodiments of the present invention have the following advantages: This invention, upon receiving an air conditioning control message, determines the target matching degree between the message and a candidate communication protocol template. If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control message and the message difference data to determine protocol conversion rules. Based on the protocol conversion rules, the air conditioning control message is converted into a target protocol message. The target protocol message is then sent. By comparing the air conditioning control message with candidate communication protocol templates in a protocol template library, message difference data is determined from air conditioning control messages with unrecorded communication protocols. The original air conditioning control message is clustered to determine the conversion rules corresponding to the differences, thereby converting the original air conditioning control message into a target protocol message for controlling the device. Without considering interface, protocol format, or version issues, the differences can be directly extracted and parsing logic generated, automatically completing protocol self-adaptation. This automatically ensures compatibility with control messages of various protocols, allowing users to control air conditioning devices based on an IoT gateway, improving the system's real-time performance and stability. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the steps of an embodiment of the message processing method of the present invention; Figure 2 This is a flowchart illustrating the steps of another embodiment of the message processing method of the present invention; Figure 3 This is a flowchart illustrating an example of a message processing method according to the present invention; Figure 4 This is a structural block diagram of an embodiment of a message processing device according to the present invention; Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention; Figure 6 This is a structural block diagram of a storage medium provided in an embodiment of the present invention. Detailed Implementation

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0017] Reference Figure 1 This diagram illustrates a flowchart of an embodiment of a message processing method according to the present invention. The message processing method is applied to a wireless communication gateway system, which has a protocol template library containing candidate communication protocol templates. The wireless communication gateway system may include an Internet of Things (IoT) gateway module and a cloud server connected to the IoT gateway module. The IoT gateway module can receive control commands from clients, such as remote controls and mobile control terminals. The wireless communication gateway system may have a protocol template library. The protocol template library contains at least one candidate communication protocol template. Each candidate communication protocol template corresponds to a message format of a different type or version of a communication protocol.

[0018] The message processing method may specifically include the following steps: Step 101: Upon receiving an air conditioning control message, determine the target matching degree between the air conditioning control message and the candidate communication protocol template; After the client sends a control command for the air conditioner, it can receive the air conditioner control message carried by that command. Upon receiving the air conditioner control message, it can compare it with a candidate communication protocol template to determine the target matching degree between the two. The target matching degree characterizes the similarity between the air conditioner control message and the candidate communication protocol template. The higher the target matching degree, the higher the similarity between the air conditioner control message and the candidate communication protocol template; conversely, the lower the target matching degree, the lower the similarity between the air conditioner control message and the candidate communication protocol template.

[0019] Step 102: If the target matching degree is lower than a preset threshold, generate message difference data based on the air conditioning control message; If the target matching degree is lower than a preset threshold, meaning the current air conditioning control message has a very low similarity to the candidate communication protocol template, or even no similarity, it can be determined that the air conditioning control message is not a message that can be directly converted at present. Message difference data can be generated based on the differences between the air conditioning control message and the candidate communication protocol template. Message difference data represents the differences between the air conditioning control message and the candidate communication protocol template. The preset threshold can be determined according to actual conditions, and this embodiment of the invention does not impose specific limitations.

[0020] Step 103: Combine the air conditioning control message and the message difference data to perform clustering and determine the protocol conversion rules; The various parts of the air conditioning control message can be clustered, and the parts with differences in the message data can also be clustered to determine the message content corresponding to the parts with differences, thereby determining the corresponding protocol conversion rules when converting the parts with differences.

[0021] Step 104: Based on the protocol conversion rules, convert the air conditioning control message into a target protocol message; Based on the protocol conversion rules, the fields in the air conditioning control message are converted by content recognition to obtain the target protocol message.

[0022] Step 105: Send the target protocol message.

[0023] The target protocol message can be sent to the air conditioner, and the air conditioner can execute the content of the target protocol message to realize the corresponding function.

[0024] This invention, upon receiving an air conditioning control message, determines the target matching degree between the message and a candidate communication protocol template. If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control message and the message difference data to determine protocol conversion rules. Based on the protocol conversion rules, the air conditioning control message is converted into a target protocol message. The target protocol message is then sent. By comparing the air conditioning control message with candidate communication protocol templates in a protocol template library, message difference data is determined from air conditioning control messages with unrecorded communication protocols. The original air conditioning control message is clustered to determine the conversion rules corresponding to the differences, thereby converting the original air conditioning control message into a target protocol message for controlling the device. Without considering interface, protocol format, or version issues, the differences can be directly extracted and parsing logic generated, automatically completing protocol self-adaptation. This automatically ensures compatibility with control messages of various protocols, allowing users to control air conditioning devices based on an IoT gateway, improving the system's real-time performance and stability.

[0025] Reference Figure 2This diagram illustrates a flowchart of another embodiment of the message processing method of the present invention. The message processing method is applied to a wireless communication gateway system, which deploys a protocol template library containing candidate communication protocol templates. The wireless communication gateway system may include an IoT gateway module and a cloud server connected to the IoT gateway module. The protocol template library can store each candidate communication protocol template in a structured database format. Candidate communication protocol templates may include parameters such as device and communication protocol. For example, they may include field information, frame type, verification method, command encoding, version number, and vendor identifier. The field information includes field name, length, data type, and unit. For variable-length fields and extended commands, the template supports optional field marking and priority sorting to prioritize matching core fields during dynamic parsing. The protocol template library can be deployed in the local flash memory of the gateway module, enabling the module to parse known protocols even without a network environment. It also supports synchronization with the cloud server, facilitating centralized management and updating of candidate communication protocol templates. To improve retrieval efficiency, the system employs a multi-dimensional indexing mechanism for acceleration. For example, it uses a combined index of manufacturer identification, model number, and protocol version number to quickly locate matching templates and reduce matching latency. The template library's update mechanism supports OTA (Over-The-Air) incremental updates. When a manufacturer or cloud service adds new candidate communication protocol templates, the module can receive incremental data packets and update the local library incrementally, avoiding overwriting existing templates. Each candidate communication protocol template includes a version number and timestamp information, allowing the system to determine whether an update is needed based on the differences between the local and cloud versions, thus enabling dynamic maintenance and expansion of the protocol template library.

[0026] The message processing method may specifically include the following steps: Step 201: Upon receiving an air conditioning control message, determine the target matching degree between the air conditioning control message and the candidate communication protocol template; When an air conditioning control message is received, it can be compared with a candidate communication protocol template to determine the target matching degree.

[0027] In an optional embodiment of the present invention, the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template includes: Sub-step S2011: Parse the air conditioning control message and determine the type field to be compared; It can parse the fields in the air conditioning control message that need to be compared, that is, determine the fields to be compared. The fields to be compared include, but are not limited to, type fields, length, offset parameters, and check fields.

[0028] Sub-step S2012: In the candidate communication protocol template, determine the reference type field corresponding to the type field to be compared; Candidate communication protocol templates for comparison can be retrieved from the protocol template library based on core fields such as frame type and command code of the air conditioning control message. From these candidate templates, a reference type field corresponding to the same type as the field to be compared is identified. That is, the field to be compared and the reference type field are of the same type, such as both being type fields, lengths, offset parameters, and check fields. The comparison is also based on the same type.

[0029] Sub-step S2013: Compare the type field to be compared with the reference type field to determine the initial matching degree; The fields to be compared and the reference fields are compared one by one according to their field types to determine the initial matching degree under that field type. By comparing multiple different field types, the initial matching degree corresponding to multiple different field types is determined.

[0030] Sub-step S2014: Obtain the weight value corresponding to the field to be compared; The weight values ​​corresponding to the fields to be compared can be determined. These weight values ​​can be preset according to requirements and retrieved directly when needed. Weight values ​​can also be determined adaptively, such as recording the "error frequency" of each field type during actual parsing, including types mismatch, length anomalies, and offset errors. If a certain field repeatedly causes matching failures over a period of time, the system automatically reduces its weight in the matching calculation; conversely, if a certain field remains stable and almost never makes errors, its weight will increase accordingly, making the matching process more reliant on stable features. Simultaneously, whenever a patch template is distributed from the cloud, the patch carries field stability information (e.g., "field offset has changed frequently recently" or "validation method version is fixed"), and the module makes minor adjustments to the local weights based on this information. Updates typically use simple proportional adjustments, such as adjusting weights according to the "recent success rate percentage," but maintaining an overall weight sum of 1.

[0031] Sub-step S2015: Combine the weight value and the initial matching degree to determine the target matching degree.

[0032] Based on field type, the weight values ​​and initial matching scores under the same field type are combined, and then combined with all field types to obtain the target matching score.

[0033] For example, it can be expressed using a formula:

[0034] in, For the first part of the air conditioning control message One field, For the corresponding field in the candidate communication protocol template. These are the initial matching scores for the type field, length field, offset field, and validation field, respectively, and can be either 0 or 1. The weight value of the corresponding field satisfies ; The target match degree.

[0035] In an optional embodiment of the present invention, the air conditioning control message includes multiple fields, and the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template further includes: Sub-step S2016: Calculate the average of the target matching degree; When a message contains multiple fields, the target matching degree mentioned above can represent the matching degree of a single field. To accurately represent the matching situation of the entire message, the average target matching degree of multiple fields can be calculated. This can be expressed using a formula:

[0036] in, The average; denoted as the target matching degree; n represents the number of targets.

[0037] Sub-step S2017: Update the target matching degree based on the average.

[0038] The calculated average can be used to update the target matching degree, which can characterize the degree of matching between the entire air conditioning control message and the candidate communication protocol template.

[0039] Step 202: If the target matching degree is lower than a preset threshold, generate message difference data based on the air conditioning control message; If the target matching degree is lower than a preset threshold, meaning the air conditioning control message does not match the candidate communication protocol template, message difference data can be generated based on the differences between the air conditioning control message and the candidate communication protocol template, such as added fields, missing fields, changes in field type or length, and different verification algorithms. This message difference data can store the parsing rules using an intermediate abstract syntax tree (AST). Subsequently, the logic generator within the gateway parses this description file, generates corresponding parsing functions or byte mapping tables, and dynamically loads them into the parsing engine. New parsing logic is loaded on-the-fly at runtime, enabling seamless hot updates without requiring a firmware restart. Simultaneously, the parsing results are output as a standardized data structure for direct use by upper-layer applications.

[0040] Step 203: Combine the air conditioning control message and the message difference data to perform clustering and determine the protocol conversion rules; Based on the structure and patterns of the original air conditioning control message, the parts with differences recorded in the message difference data can be clustered together based on the message field type to determine the parsing and conversion method of the difference parts and generate protocol conversion rules.

[0041] In an optional embodiment of the present invention, the step of clustering the air conditioning control message and the message difference data to determine the protocol conversion rules includes: Sub-step S2031: Cluster each field in the air conditioning control message to determine the field type; First, clustering can be performed on each field in the air conditioning control message to determine the field types present in the air conditioning control message.

[0042] Sub-step S2032: Determine the single-field conversion rule based on the field type; Based on the defined field type, the conversion methods of the field type in the air conditioning control message are mapped to the conversion methods of the same field type in the candidate communication protocol template, thus determining the single-field conversion rule for a single field type. The single-field conversion rule characterizes the conversion method of a single field.

[0043] Sub-step S2033: Combine the single-field conversion rules to generate protocol conversion rules.

[0044] Combine the single-field conversion rules of all fields to generate protocol conversion rules.

[0045] For example, a cloud server can be used to process air conditioner control messages and related metadata (including device model, firmware version, timestamp, etc.). The cloud server can use machine learning algorithms to analyze the structure of the air conditioner control messages. Sequence classification models (RNN / LSTM) or decision tree classifiers can be used to identify patterns in the message fields, deriving new field parsing rules from the different parts of the message data. This can be formally represented as: Let the set of uploaded messages be... cloud model Learning Mapping ,in For parsing the set of rules, The model parameters are optimized by minimizing the loss function until the training iterations reach the required number or the loss function meets the requirements. Loss function as follows:

[0046] Training yields the optimal parsing rules This includes updating the offset, length, data type, and verification algorithm of newly added fields. By discovering the structural patterns and field regularities of the messages through the cloud server, new protocol parsing rules are derived. Since air conditioner messages from different manufacturers and firmware versions may exhibit changes in field arrangement, additions, deletions, or updates to verification methods, a machine learning model is introduced. The cloud server can perform structured clustering and pattern recognition on the message data, automatically determining which fields share the same meaning, which changes are due to protocol upgrades, and which anomalies are special cases rather than structural changes. This forms a stable field parsing logic, generates protocol conversion rules, and improves the accuracy of the conversion.

[0047] Step 204: Based on the protocol conversion rules, convert the air conditioning control message into a target protocol message; After obtaining the protocol conversion rules, the differences and the already determined parts can be parsed together. According to the mapping relationship in the protocol conversion rules, the fields in the air conditioning control message are converted to generate the target protocol message.

[0048] Step 205: Send the target protocol message; The target protocol message is sent to the air conditioning equipment to control the air conditioning equipment.

[0049] Step 206: Combine the protocol conversion rules and the message difference data to generate a difference patch template file; It also allows mapping protocol conversion rules to message difference data, associating the differing parts with the corresponding conversion methods, and generating difference patch template files based on these associations. Step 207: Perform incremental updates based on the difference patch template file; These difference patch template files are used as data for rule updates, enabling incremental updates to supplement the candidate communication protocol templates in the protocol template library. For example, the cloud server generates difference patch template files from these parsing rules and distributes them to the gateway module using an incremental update method. The gateway module applies the patches to its local protocol template library and parsing engine, while simultaneously updating the template version number, allowing both new and old protocols to be parsed. Modules of the same model or version can share the same patch template, achieving rapid network-wide adaptation. For older modules with limited computing resources, lightweight patches can be distributed, containing only the core field parsing logic, while complex calculations are still performed on the cloud server. Compatibility and real-time performance are achieved through template mapping and dynamic loading, ensuring automated and efficient protocol updates.

[0050] Furthermore, protocol conversion rules can be upgraded via OTA (Over-The-Air) updates, enabling the gateway to acquire a protocol template library and difference recognition capabilities, thus supporting new protocol parsing capabilities. For older modules with limited computing resources or low computing power, an intermediate protocol mapping layer can be introduced within the module to first convert the received raw messages into a standardized intermediate protocol format, and then the cloud or gateway can perform dynamic parsing and logic generation. For messages that still cannot be parsed or have low matching accuracy, the module can continuously upload them to the cloud, utilize the cloud server's learning and difference patching mechanisms to generate parsing rules, and then distribute them to achieve adaptive upgrades.

[0051] Step 208: Convert the target protocol message into an interface data exchange file.

[0052] The system can also convert target protocol messages into interface data exchange files according to interface rules. Users or administrators can quickly adjust specific data through these files, improving control efficiency. For example, parsed target protocol messages can be uniformly converted into standardized JSON data format, ensuring consistent field names and meanings, thus facilitating direct calls from upper-layer applications. The system provides unified data interfaces, including APIs (Application Programming Interfaces) or data bus interfaces, for upper-layer applications to perform functions such as status queries, control command issuance, and event callbacks. The gateway module can simultaneously manage and parse multiple versions of protocol messages, ensuring compatibility between older and newer devices coexisting within the same gateway module.

[0053] This invention, in its embodiments, involves the following steps: upon receiving an air conditioning control message, determining the target matching degree between the air conditioning control message and a candidate communication protocol template; if the target matching degree is lower than a preset threshold, generating message difference data based on the air conditioning control message; performing clustering based on the air conditioning control message and the message difference data to determine protocol conversion rules; converting the air conditioning control message into a target protocol message based on the protocol conversion rules; sending the target protocol message; generating a difference patch template file based on the protocol conversion rules and the message difference data; performing incremental updates based on the difference patch template file; and converting the target protocol message into an interface data exchange file. By identifying the differences between candidate communication protocol templates in the protocol template library and air conditioner control messages, it can compare and extract differences between protocols from different eras and manufacturers, analyze the framework and difference adaptive logic, determine the corresponding parsing logic, generate protocol conversion rules, and achieve seamless access for older air conditioners, extending the device's lifespan. Users can achieve intelligent upgrades without replacing hardware. Furthermore, by introducing dynamic logic generation and cloud-based collaborative learning mechanisms, when encountering unidentified messages, it can generate message difference data, combine it with protocol conversion rules to form a difference patch template file, and then send it to the gateway module for update. Users do not need to wait for manual firmware updates; the gateway module can complete protocol self-adaptation in a short time, improving the system's real-time performance and stability.

[0054] To enable those skilled in the art to clearly understand the implementation process of the embodiments of the present invention, the following examples are used for illustration: You can refer to Figure 3 The process is as follows: 1. Receive air conditioning messages; 2. Search the protocol template library to determine the corresponding template; 3. Determine if the matching degree meets the threshold; 4. If the threshold is met, i.e., it matches the template, it can be directly parsed and standardized data output; 5. If the threshold is met, generate a difference description file; 6. Generate the difference description file; 7. Upload the message and metadata to the cloud; 8. Cloud learning and parsing rule generation; 9. Generate difference patch templates; 10. Distribute to the module and update the template library; 11. Generate dynamic parsing logic and load it into the module; 12. Output standardized data; 13. Upgrade old modules and handle intermediate protocol mapping; 14. Standardized data interaction interface; 15. Upper-layer application call; 16. End.

[0055] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0056] Reference Figure 4 The diagram illustrates a structural block diagram of an embodiment of a message processing device according to the present invention. The message processing device is applied to a wireless communication gateway system, which deploys a protocol template library containing candidate communication protocol templates. Specifically, the message processing device may include the following modules: The receiving module 401 is used to determine the target matching degree between the air conditioning control message and the candidate communication protocol template when it receives the air conditioning control message; The difference module 402 is used to generate message difference data based on the air conditioning control message when the target matching degree is lower than a preset threshold. Clustering module 403 is used to perform clustering by combining the air conditioning control message and the message difference data to determine the protocol conversion rules; The conversion module 404 is used to convert the air conditioning control message into a target protocol message based on the protocol conversion rules. The transmission module 405 is used to send the target protocol message.

[0057] In an optional embodiment of the present invention, the difference module 402 includes: The parsing submodule is used to parse the air conditioning control message and determine the type field to be compared. The reference submodule is used to determine the reference type field corresponding to the type field to be compared in the candidate communication protocol template; The comparison submodule is used to compare the field to be compared with the reference field to determine the initial matching degree. The weighting submodule is used to obtain the weight value corresponding to the field to be compared. The first matching submodule is used to determine the target matching degree by combining the weight value and the initial matching degree.

[0058] In an optional embodiment of the present invention, the air conditioning control message includes multiple fields, and the difference module 402 further includes: The averaging submodule is used to calculate the average of the target matching degree; The second matching submodule is used to update the target matching degree based on the average.

[0059] In an optional embodiment of the present invention, the clustering module 403 includes: The clustering submodule is used to cluster each field in the air conditioning control message and determine the field type; The conversion submodule is used to determine single-field conversion rules based on the field type. The combination submodule is used to combine the single-field conversion rules to generate protocol conversion rules.

[0060] In an optional embodiment of the present invention, the clustering submodule includes: An initial type unit is used to determine the initial type corresponding to the candidate communication protocol template; The clustering unit is used to cluster each field in the air conditioning control message based on the initial type to determine the field type.

[0061] In an optional embodiment of the present invention, the device further includes: The patch module is used to generate a difference patch template file by combining the protocol conversion rules and the message difference data; The update module is used to perform incremental updates based on the difference patch template file.

[0062] In an optional embodiment of the present invention, the device further includes: The interface module is used to convert the target protocol message into an interface data exchange file.

[0063] This invention, upon receiving an air conditioning control message, determines the target matching degree between the message and a candidate communication protocol template. If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control message and the message difference data to determine protocol conversion rules. Based on the protocol conversion rules, the air conditioning control message is converted into a target protocol message. The target protocol message is then sent. By comparing the air conditioning control message with candidate communication protocol templates in a protocol template library, message difference data is determined from air conditioning control messages with unrecorded communication protocols. The original air conditioning control message is clustered to determine the conversion rules corresponding to the differences, thereby converting the original air conditioning control message into a target protocol message for controlling the device. Without considering interface, protocol format, or version issues, the differences can be directly extracted and parsing logic generated, automatically completing protocol self-adaptation. This automatically ensures compatibility with control messages of various protocols, allowing users to control air conditioning devices based on an IoT gateway, improving the system's real-time performance and stability.

[0064] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0065] Reference Figure 5 The present invention also provides an electronic device, comprising: A processor 501 and a memory 502 are provided. The memory 502 stores a computer program executable by the processor 501. When the electronic device is controlled to run, the processor 501 executes the computer program to implement the message processing method as described in any embodiment of the present invention. The message processing method is applied to a wireless communication gateway system. The wireless communication gateway system is equipped with a protocol template library containing candidate communication protocol templates. In the case of message processing, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control messages and the message difference data to determine the protocol conversion rules; Based on the aforementioned protocol conversion rules, the air conditioning control message is converted into the target protocol message; Send the target protocol message.

[0066] Optionally, the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template includes: Parse the air conditioning control message to determine the type field to be compared; In the candidate communication protocol template, a reference type field corresponding to the type field to be compared is determined; The initial matching degree is determined by comparing the field to be compared with the reference field. Obtain the weight value corresponding to the field to be compared; The target matching degree is determined by combining the weight value and the initial matching degree.

[0067] Optionally, the air conditioning control message includes multiple fields, and the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template further includes: Calculate the average of the target matching degree; The target matching degree is updated based on the average.

[0068] Optionally, the step of clustering the air conditioning control message and the message difference data to determine the protocol conversion rules includes: Cluster each field in the air conditioning control message to determine the field type; Determine the single-field conversion rule based on the field type; Combine the single-field conversion rules to generate protocol conversion rules.

[0069] Optionally, the step of clustering each field in the air conditioning control message to determine the field type includes: Determine the initial type corresponding to the candidate communication protocol template; Each field in the air conditioning control message is clustered based on the initial type to determine the field type.

[0070] Optionally, the method further includes: By combining the protocol conversion rules and the message difference data, a difference patch template file is generated; Incremental updates are performed based on the aforementioned difference patch template file.

[0071] Optionally, the method further includes: The target protocol message is converted into an interface data exchange file.

[0072] This invention, upon receiving an air conditioning control message, determines the target matching degree between the message and a candidate communication protocol template. If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control message and the message difference data to determine protocol conversion rules. Based on the protocol conversion rules, the air conditioning control message is converted into a target protocol message. The target protocol message is then sent. By comparing the air conditioning control message with candidate communication protocol templates in a protocol template library, message difference data is determined from air conditioning control messages with unrecorded communication protocols. The original air conditioning control message is clustered to determine the conversion rules corresponding to the differences, thereby converting the original air conditioning control message into a target protocol message for controlling the device. Without considering interface, protocol format, or version issues, the differences can be directly extracted and parsing logic generated, automatically completing protocol self-adaptation. This automatically ensures compatibility with control messages of various protocols, allowing users to control air conditioning devices based on an IoT gateway, improving the system's real-time performance and stability.

[0073] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0074] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0075] Reference Figure 6 This invention also provides a computer-readable storage medium 601, on which a computer program is stored. When the computer program is run by a processor, it executes the message processing method as described in any one of the embodiments of this invention. The message processing method is applied to a wireless communication gateway system, which has a protocol template library containing candidate communication protocol templates. In the case of message processing, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control messages and the message difference data to determine the protocol conversion rules; Based on the aforementioned protocol conversion rules, the air conditioning control message is converted into the target protocol message; Send the target protocol message.

[0076] Optionally, the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template includes: Parse the air conditioning control message to determine the type field to be compared; In the candidate communication protocol template, a reference type field corresponding to the type field to be compared is determined; The initial matching degree is determined by comparing the field to be compared with the reference field. Obtain the weight value corresponding to the field to be compared; The target matching degree is determined by combining the weight value and the initial matching degree.

[0077] Optionally, the air conditioning control message includes multiple fields, and the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template further includes: Calculate the average of the target matching degree; The target matching degree is updated based on the average.

[0078] Optionally, the step of clustering the air conditioning control message and the message difference data to determine the protocol conversion rules includes: Cluster each field in the air conditioning control message to determine the field type; Determine the single-field conversion rule based on the field type; Combine the single-field conversion rules to generate protocol conversion rules.

[0079] Optionally, the step of clustering each field in the air conditioning control message to determine the field type includes: Determine the initial type corresponding to the candidate communication protocol template; Each field in the air conditioning control message is clustered based on the initial type to determine the field type.

[0080] Optionally, the method further includes: By combining the protocol conversion rules and the message difference data, a difference patch template file is generated; Incremental updates are performed based on the aforementioned difference patch template file.

[0081] Optionally, the method further includes: The target protocol message is converted into an interface data exchange file.

[0082] This invention, upon receiving an air conditioning control message, determines the target matching degree between the message and a candidate communication protocol template. If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message. Clustering is performed on the air conditioning control message and the message difference data to determine protocol conversion rules. Based on the protocol conversion rules, the air conditioning control message is converted into a target protocol message. The target protocol message is then sent. By comparing the air conditioning control message with candidate communication protocol templates in a protocol template library, message difference data is determined from air conditioning control messages with unrecorded communication protocols. The original air conditioning control message is clustered to determine the conversion rules corresponding to the differences, thereby converting the original air conditioning control message into a target protocol message for controlling the device. Without considering interface, protocol format, or version issues, the differences can be directly extracted and parsing logic generated, automatically completing protocol self-adaptation. This automatically ensures compatibility with control messages of various protocols, allowing users to control air conditioning devices based on an IoT gateway, improving the system's real-time performance and stability.

[0083] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0084] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0085] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0086] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0088] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.

[0089] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0090] The foregoing has provided a detailed description of a message processing method, a message processing apparatus, an electronic device, and a computer-readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A message processing method, characterized in that, The method, applied to a wireless communication gateway system, wherein the wireless communication gateway system is equipped with a protocol template library containing candidate communication protocol templates, includes: Upon receiving an air conditioning control message, determine the target matching degree between the air conditioning control message and the candidate communication protocol template; If the target matching degree is lower than a preset threshold, message difference data is generated based on the air conditioning control message; Clustering is performed on the air conditioning control messages and the message difference data to determine the protocol conversion rules; Based on the aforementioned protocol conversion rules, the air conditioning control message is converted into the target protocol message; Send the target protocol message.

2. The method according to claim 1, characterized in that, The step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template includes: Parse the air conditioning control message to determine the type field to be compared; In the candidate communication protocol template, a reference type field corresponding to the type field to be compared is determined; The initial matching degree is determined by comparing the field to be compared with the reference field. Obtain the weight value corresponding to the field to be compared; The target matching degree is determined by combining the weight value and the initial matching degree.

3. The method according to claim 2, characterized in that, The air conditioning control message includes multiple fields, and the step of determining the target matching degree between the air conditioning control message and the candidate communication protocol template further includes: Calculate the average of the target matching degree; The target matching degree is updated based on the average.

4. The method according to claim 1, characterized in that, The step of clustering the air conditioning control messages and the message difference data to determine the protocol conversion rules includes: Cluster each field in the air conditioning control message to determine the field type; Determine the single-field conversion rule based on the field type; Combine the single-field conversion rules to generate protocol conversion rules.

5. The method according to claim 4, characterized in that, The step of clustering each field in the air conditioning control message to determine the field type includes: Determine the initial type corresponding to the candidate communication protocol template; Each field in the air conditioning control message is clustered based on the initial type to determine the field type.

6. The method according to claim 1, characterized in that, The method further includes: By combining the protocol conversion rules and the message difference data, a difference patch template file is generated; Incremental updates are performed based on the aforementioned difference patch template file.

7. The method according to claim 1, characterized in that, The method further includes: The target protocol message is converted into an interface data exchange file.

8. A message processing apparatus, characterized in that, An apparatus for use in a wireless communication gateway system, wherein the wireless communication gateway system is equipped with a protocol template library containing candidate communication protocol templates, the apparatus comprising: The receiving module is used to determine the target matching degree between the air conditioning control message and the candidate communication protocol template when the air conditioning control message is received; The difference module is used to generate message difference data based on the air conditioning control message when the target matching degree is lower than a preset threshold. The clustering module is used to perform clustering based on the air conditioning control message and the message difference data to determine the protocol conversion rules; The conversion module is used to convert the air conditioning control message into a target protocol message based on the protocol conversion rules. The transmission module is used to send the target protocol message.

9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the message processing method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the message processing method as described in any one of claims 1-7.