CN114172974A - Protocol conversion method, device and system - Google Patents

Protocol conversion method, device and system Download PDF

Info

Publication number
CN114172974A
CN114172974A CN202111485890.6A CN202111485890A CN114172974A CN 114172974 A CN114172974 A CN 114172974A CN 202111485890 A CN202111485890 A CN 202111485890A CN 114172974 A CN114172974 A CN 114172974A
Authority
CN
China
Prior art keywords
script
target
equipment
conversion
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111485890.6A
Other languages
Chinese (zh)
Other versions
CN114172974B (en
Inventor
林业
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202111485890.6A priority Critical patent/CN114172974B/en
Publication of CN114172974A publication Critical patent/CN114172974A/en
Application granted granted Critical
Publication of CN114172974B publication Critical patent/CN114172974B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a protocol conversion method, a device and a system, wherein the system comprises the following steps: the gateway equipment sends a request for acquiring a conversion protocol script of the target intelligent equipment to the server; the server receives the request and extracts a target conversion protocol script corresponding to the target intelligent device, wherein the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relationship according to the type of the intelligent device, the intelligent devices of the same type commonly correspond to one parent script, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device; the server sends the target conversion protocol script to the gateway equipment; the gateway equipment converts the interactive information between the target intelligent equipment and the server through the sub-script; if the conversion of the sub script fails, the gateway device uses the parent script to perform the conversion. The technical scheme provided by the invention reduces the number of conversion protocols and the data volume.

Description

Protocol conversion method, device and system
Technical Field
The invention relates to the field of intelligent equipment control, in particular to a protocol conversion method, a device and a system.
Background
With the continuous development of smart homes, smart home products are applied more and more, a platform dealer generally sends control instruction information to a gateway device through a server, the gateway device forwards the received control instruction information to the smart home products connected to the gateway device to control the smart home products to act, and then sends information fed back by the smart home products to the server through the gateway device. The platform merchant is the system that collects APP, server and gateway equipment in an organic whole, but the brand of intelligent house product, model are various, when docking with different platform merchant and equipment merchant's equipment, all need gateway equipment to do the work of protocol conversion, carry out interconversion with equipment merchant's agreement and platform merchant's own agreement, could control. For example, an air conditioner status reporting process: the temperature state information reported by the air conditioner of the manufacturer A is { "temp": 26}, the temperature state information reported by the air conditioner of the manufacturer B is { "temperature": 26}, but when the server of the platform manufacturer can only identify { "air _ temperature": 26}, the gateway device converts the temperature state information reported by the air conditioners of the manufacturers A and B into the temperature state information { "air _ temperature": 26} which can be identified by the server of the platform manufacturer A and B respectively, and forwards the temperature state information to the server. In the prior art, a server provides protocol conversion scripts of each type of equipment model, a local gateway performs protocol conversion through the protocol conversion scripts after acquiring all the protocol conversion scripts, and only the protocol conversion scripts need to be updated online in the later stage. However, in the prior art, a server needs to provide one protocol conversion script for each equipment model, and with the increase of the models of the platform business access equipment, hundreds of models exist, and at this time, a server needs to maintain hundreds of protocol conversion scripts, so that the amount of the scripts is large and the scripts are inconvenient to maintain. In addition, there is a lot of redundant data in a large number of protocol conversion scripts, for example, there are 20 types of air conditioner models, and although the device models are different, the protocols are the same for more than 95%, and at this time, it is necessary to download the protocol conversion scripts of 20 air conditioner models. The large amount of protocol scripts makes the maintenance work of the server and the gateway device very difficult, so that how to reduce the amount of the conversion protocol is a problem to be solved urgently on the premise of not influencing the protocol conversion function.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a system for protocol conversion, so that the amount of converted protocols is reduced without affecting the protocol conversion function.
According to a first aspect, the present invention provides a protocol conversion method applied to a gateway device, the method including: sending a request for acquiring a conversion protocol script of the target intelligent equipment to a server; receiving a target conversion protocol script which is sent by the server and corresponds to the target intelligent device, wherein the target conversion protocol script is extracted by the server according to the request of the conversion protocol script, the target conversion protocol script comprises a parent script and a child script, and the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type jointly correspond to one parent script, and a difference part between a conversion protocol corresponding to each intelligent device and a conversion protocol in the parent script to which the intelligent device belongs forms a child script of each intelligent device; converting the interactive information between the target intelligent equipment and the server through the sub-script; and if the conversion of the interactive information by the sub script fails, converting the interactive information between the target intelligent equipment and the server by using the parent script corresponding to the sub script.
Optionally, the sending a request for obtaining a protocol conversion script of the target smart device to the server includes: acquiring the equipment model of the target intelligent equipment; generating a conversion protocol script request carrying the equipment model based on the equipment model, sending the conversion protocol script request carrying the equipment model to the server so that the server analyzes the equipment model of the target intelligent equipment in the conversion protocol script request, determining the equipment type based on the equipment model, and searching a father script matched with the equipment type and a son script matched with the equipment model from a preset conversion protocol script database, wherein the preset conversion protocol script database stores father scripts corresponding to different intelligent equipment types and son scripts corresponding to different intelligent equipment models.
Optionally, the converting, by the sub-script, interaction information between the smart device and the server includes: receiving control instruction information which is sent by the server and used for controlling the target intelligent equipment; judging whether the information type of the control instruction information is the information type supported by a conversion protocol in the sub-script corresponding to the target intelligent equipment; if the information type of the control instruction information is the information type supported by the conversion protocol in the sub-script, converting the control instruction information into target control information based on the sub-script; sending the target control information to the target intelligent equipment; receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information; converting the state information into target state information based on the sub-script; and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
Optionally, if the conversion of the interaction information by the sub-script fails, the conversion of the interaction information between the intelligent device and the server is performed by using a parent script corresponding to the sub-script, including: receiving control instruction information which is sent by the server and used for controlling target intelligent equipment, and judging whether the information type of the control instruction information is the information type supported by a conversion protocol in a sub-script of the target intelligent equipment; if the information type of the control instruction information is not the information type supported by the conversion protocol in the sub script, converting the control instruction information into target control information based on the parent script; sending the target control information to the target intelligent equipment; receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information; converting the state information into target state information based on the parent script; and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
According to a second aspect, the present invention provides a protocol conversion method applied to a server, the method comprising: receiving a conversion protocol script request for acquiring target intelligent equipment, which is sent by gateway equipment; extracting a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, and the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type correspond to one parent script together, and the conversion protocol corresponding to each intelligent device and the difference part between the conversion protocols in the parent script to which the intelligent device belongs form the child script of each intelligent device; and sending the target conversion protocol script to the gateway equipment so that the gateway equipment converts the interactive information between the target intelligent equipment and the server through the sub-script, and when the sub-script fails to convert the interactive information, converting the interactive information between the target intelligent equipment and the server by using the parent script corresponding to the sub-script.
Optionally, the extracting, according to the request for the conversion protocol script, a target conversion protocol script corresponding to the target intelligent device includes: analyzing the equipment model of the target intelligent equipment in the conversion protocol script request, wherein the conversion protocol script request carries the equipment model of the target intelligent equipment; determining the type of the equipment based on the type of the equipment, and searching out a parent script matched with the type of the equipment and a child script matched with the type of the equipment from a preset conversion protocol script database, wherein the parent script corresponding to different intelligent equipment types and the child script corresponding to different intelligent equipment types are stored in the preset conversion protocol script database.
According to a third aspect, the present invention provides a protocol conversion apparatus applied to a gateway device, the apparatus comprising: the request sending module is used for sending a protocol conversion script request for acquiring the target intelligent equipment to the server; the protocol acquisition module is used for receiving a target conversion protocol script which is sent by the server and corresponds to the target intelligent device, the target conversion protocol script is extracted by the server according to the request of the conversion protocol script, the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relationship according to the type of the intelligent device, wherein the intelligent devices of the same type correspond to one parent script together, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device; the first conversion module is used for converting the interactive information between the target intelligent equipment and the server through the sub-script; and the second conversion module is used for converting the interactive information between the target intelligent device and the server by using the parent script corresponding to the sub-script if the conversion of the interactive information by the sub-script fails.
According to a fourth aspect, the present invention provides a protocol conversion apparatus applied to a server, the apparatus comprising: the request receiving module is used for receiving a conversion protocol script request for acquiring the target intelligent equipment, which is sent by the gateway equipment; the protocol extraction module is used for extracting a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type jointly correspond to one parent script, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device; and the protocol sending module is used for sending the target conversion protocol script to the gateway equipment so as to enable the gateway equipment to convert the interactive information between the target intelligent equipment and the server through the sub-script, and when the sub-script fails to convert the interactive information, the parent script corresponding to the sub-script is used for converting the interactive information between the target intelligent equipment and the server.
According to a fifth aspect, the present invention provides a protocol conversion system comprising a server and a gateway device, wherein: the gateway equipment sends a request for acquiring a conversion protocol script of target intelligent equipment to the server; the server receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, the intelligent devices of the same type correspond to one parent script together, and the conversion protocol corresponding to each intelligent device and the difference part between the conversion protocols in the parent script to which the intelligent device belongs form the child script of each intelligent device; the server sends the target conversion protocol script to the gateway equipment; the gateway equipment receives the target conversion protocol script; the gateway equipment converts the interactive information between the target intelligent equipment and the server through the sub-script; and if the conversion of the interactive information by the sub script fails, the gateway device converts the interactive information between the target intelligent device and the server by using the parent script corresponding to the sub script.
Optionally, the gateway device sends a request for acquiring a conversion protocol script of the target intelligent device to the server; the server receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, and the method comprises the following steps: the gateway equipment acquires the equipment model of the target intelligent equipment; the gateway equipment generates a conversion protocol script request carrying the equipment model based on the equipment model, and sends the conversion protocol script request carrying the equipment model to the server; the server receives the protocol conversion script request; the server analyzes the equipment model of the target intelligent equipment in the protocol conversion script request; and the server determines the type of the equipment based on the type of the equipment, and searches out a parent script matched with the type of the equipment and a child script matched with the type of the equipment from a preset conversion protocol script database.
The technical scheme provided by the application has the following advantages:
according to the technical scheme, a unified conversion protocol script is configured for the intelligent devices of the same type to serve as a parent script, and then for the intelligent devices of the same type and different types, if a difference part exists between the conversion protocol of the type and the conversion protocol in the parent script, the difference part is independently written into a sub script of the intelligent device of the corresponding type. Therefore, when the gateway equipment manages the intelligent equipment, the corresponding father script and the corresponding son script are obtained from the server only according to the currently configured intelligent equipment model, and the intelligent equipment with the same equipment type only needs to obtain one father script and a plurality of son scripts with very small data volume, so that the data volume of the conversion protocol script is greatly reduced, and the management and maintenance difficulty of the gateway equipment management on the conversion protocol script is greatly reduced. When the gateway equipment converts the interactive information between the server and the intelligent equipment, the sub-script is firstly used for conversion, if the interactive information needing to be converted is found not to belong to the range limited by the conversion protocol in the sub-script, the parent script is used for converting the interactive information when the conversion fails, and therefore the interactive information can be accurately converted.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
FIG. 1 is a diagram illustrating a protocol conversion system according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the steps of a protocol conversion method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating another step of a protocol conversion method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a protocol conversion apparatus according to an embodiment of the present invention;
fig. 5 is another schematic diagram of a protocol conversion apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, in one embodiment, a protocol conversion system includes a server 2 and a gateway device 1, and the operation of the system is as follows:
the gateway device 1 sends a request to the server 2 to obtain the conversion protocol script of the target smart device. Specifically, the gateway device 1 acquires the conversion protocol script supported by the target intelligent device from the server 2 before converting the interaction information between the target intelligent device and the server 2, so that the gateway device 1 first sends an acquisition request to the server 2, and the server 2 sends the required script to the gateway device 1.
The server 2 receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, the intelligent devices of the same type correspond to one parent script together, and the conversion protocol corresponding to each intelligent device and the difference part between the conversion protocols in the parent script to which the intelligent device belongs form the child script of each intelligent device. Specifically, since more than 95% of the conversion protocol codes of the intelligent devices of the same type are the same (for example, the conversion protocols of all air conditioners are substantially the same, and the conversion protocols of all washing machines are substantially the same), in the embodiment of the present invention, in order to reduce the number of the conversion protocol scripts and the file size, a standard conversion protocol parent script is configured in advance for the intelligent devices of the same type, so that the conversion protocol parent script can meet most control functions of most devices. And then, aiming at the intelligent equipment of the same type, sequentially aiming at the equipment model of each equipment, analyzing the difference between the corresponding actual conversion protocol and the conversion protocol in the parent script, if no difference exists, the child script is empty, and if the difference exists, the corresponding difference code is configured into the child script corresponding to the equipment model. Therefore, the data volume in the sub scripts is very small, the same type of intelligent equipment only needs one father script, then the father script and each sub script in the same equipment type are associated, the attribution of the father script and the sub script is determined, and therefore flexible calling can be achieved. For example: the temperature range of common air conditioners is 16-30 degrees, a special air conditioner a2_ conditionioner only supports 20-28 degrees, conditions are added into a sub script of a2_ conditionioner, and the other is based on a parent script.
The server 2 transmits the target conversion protocol script to the gateway apparatus 1.
The gateway apparatus 1 receives the target conversion protocol script.
The gateway device 1 converts the interaction information between the target intelligent device and the server 2 through the sub-script.
If the conversion of the interaction information by the sub-script fails, the gateway device 1 converts the interaction information between the target intelligent device and the server 2 by using the parent script corresponding to the sub-script.
Specifically, after receiving the conversion protocol script supporting the target intelligent device, the gateway device 1 first tries to convert the interaction information between the target intelligent device and the server 2 by using the sub-script, and if the converted interaction information is just the interaction function supported by the code in the sub-script, the conversion is directly performed. And if the converted interactive information does not correspond to the codes in the sub-script, switching to the parent script to convert the interactive information. For example: if the set is the air-conditioning mode, the sub script only contains the air-conditioning temperature of the difference part, and no air-conditioning mode exists, so that the sub script can fail to be converted, and the parent script is switched to convert the interactive information of the air-conditioning mode.
Specifically, in an embodiment, in the system, the gateway device 1 sends a request for acquiring a conversion protocol script of the target intelligent device to the server 2; the server 2 receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, and the specific working process is as follows:
the gateway apparatus 1 acquires the apparatus model of the target intelligent apparatus.
The gateway device 1 generates a conversion protocol script request carrying the device model based on the device model, and sends the conversion protocol script request carrying the device model to the server 2.
The server 2 receives a protocol conversion script request;
the server 2 analyzes the equipment model of the target intelligent equipment in the conversion protocol script request;
the server 2 determines the device type based on the device model, and searches out a parent script matching the device type and a child script matching the device model from a preset conversion protocol script database.
Specifically, when the gateway device 1 downloads the conversion protocol scripts from the server 2, it is practically impossible to download all the conversion protocol scripts stored in the server 2, and the gateway device 1 has no large storage space and does not need to download most of the scripts because they are not used. Therefore, before the conversion protocol script is obtained from the server 2, the device model of the target smart device is first obtained, for example: the intelligent equipment which is distributed with the network through the gateway equipment 1 at present comprises a washing machine, an air conditioner, a sound box and a curtain, the gateway equipment 1 obtains the equipment models of the four intelligent equipment, then generates a conversion protocol script obtaining request carrying models aiming at the four equipment, and sends the request to the server 2, so that the server 2 analyzes the four equipment models in the request, and then sends a sub script and a father script corresponding to the equipment models to the gateway equipment 1, thereby avoiding the storage of redundant information in the gateway equipment 1.
Through the components, according to the technical scheme provided by the application, a unified conversion protocol script is configured for the intelligent devices of the same type to serve as a parent script, and then for the intelligent devices of the same type and different types, if the conversion protocol of the type is different from the conversion protocol in the parent script, the different part is independently written into the sub script of the intelligent device of the corresponding type. Therefore, when the gateway equipment manages the intelligent equipment, the corresponding father script and the corresponding son script are obtained from the server only according to the currently configured intelligent equipment model, and the intelligent equipment with the same equipment type only needs to obtain one father script and a plurality of son scripts with very small data volume, so that the data volume of the conversion protocol script is greatly reduced, and the management and maintenance difficulty of the gateway equipment management on the conversion protocol script is greatly reduced. When the gateway equipment converts the interactive information between the server and the intelligent equipment, the sub-script is firstly used for conversion, if the interactive information needing to be converted is found not to belong to the range limited by the conversion protocol in the sub-script, the parent script is used for converting the interactive information when the conversion fails, and therefore the interactive information can be accurately converted.
Referring to fig. 2, in an embodiment, a protocol conversion method is further provided, where the method is applied to the gateway device 1 and the server 2 shown in fig. 1, where the gateway device 1 is configured to perform steps S101 to S104, and the server 2 is configured to perform steps S201 to S203.
Step S101: and sending a request for acquiring the conversion protocol script of the target intelligent equipment to the server.
Step S201: and receiving a protocol conversion script request for acquiring the target intelligent equipment, which is sent by the gateway equipment.
Step S202: and extracting a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, the intelligent devices of the same type commonly correspond to one parent script, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device.
Step S203: and sending the target conversion protocol script to the gateway equipment.
Step S102: and receiving a target conversion protocol script corresponding to the target intelligent equipment sent by the server.
Step S103: and converting the interactive information between the target intelligent equipment and the server through the sub-script.
Step S104: and if the conversion of the interaction information by the sub script fails, converting the interaction information between the target intelligent equipment and the server by using the parent script corresponding to the sub script.
Specifically, the execution steps of S101 to S104 and S201 to S203 are the same as the implementation manner and principle of the system embodiment, and for details, reference is made to the related description of the system embodiment, and no further description is given.
Specifically, in an embodiment, the step S103 specifically includes the following steps:
the method comprises the following steps: and receiving control instruction information which is sent by the server and used for controlling the target intelligent equipment.
Step two: and judging whether the information type of the control instruction information is the information type supported by the conversion protocol in the sub-script corresponding to the target intelligent equipment.
Step three: and if the information type of the control instruction information is the information type supported by the conversion protocol in the sub-script, converting the control instruction information into target control information based on the sub-script.
Step four: and sending the target control information to the target intelligent equipment.
Step five: and receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information.
Step six: and converting the state information into target state information based on the sub-script.
Step seven: and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
Specifically, the principle of the step one to the step seven refers to the related description of the above system embodiment, and is not repeated herein. For example: in this embodiment, the server transmits control instruction information for adjusting the temperature up to the air conditioner, and the gateway device performs protocol conversion on the information into a format that can be recognized by the air conditioner, i.e., target control information. And then the air conditioner responds to the target control information to adjust the temperature by one degree, the current air conditioner temperature is fed back to the gateway equipment as state information, and then the gateway equipment converts the state information into target state information which can be identified by the server so as to inform the server of the temperature value of the current air conditioner.
Specifically, in an embodiment, the step S104 specifically includes the following steps:
step eight: and receiving control instruction information which is sent by the server and used for controlling the target intelligent equipment, and judging whether the information type of the control instruction information is the information type supported by the conversion protocol in the sub-script of the target intelligent equipment.
Step nine: and if the information type of the control instruction information is not the information type supported by the conversion protocol in the sub script, converting the control instruction information into target control information based on the parent script.
Step ten: and sending the target control information to the target intelligent equipment.
Step eleven: and receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information.
Step twelve: converting the state information into target state information based on the parent script.
Step thirteen: and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
Specifically, the principle of step eight to step thirteen refers to the related description of the above system embodiment, and is not repeated herein. For example: and when the control instruction information sent by the server is in an air conditioner mode, adjusting the air conditioner to be in a hot air mode, wherein the conversion protocol in the sub-script only has the air conditioner temperature and cannot convert the current control instruction information, and then converting the current control instruction information by using the parent script corresponding to the sub-script. For the following principle, reference may be made to the description of the above steps one to seven, which are not described herein again.
Referring to fig. 3, in an embodiment, step S101 executed by the gateway device 1 specifically includes step S105 to step S106, and step S202 executed by the server 2 specifically includes step S204 to step S205.
Step S105: and acquiring the equipment model of the target intelligent equipment.
Step S106: and generating a conversion protocol script request carrying the equipment model based on the equipment model, and sending the conversion protocol script request carrying the equipment model to the server.
Step S201: and receiving a protocol conversion script request for acquiring the target intelligent equipment, which is sent by the gateway equipment.
Step S204: and analyzing the equipment model of the target intelligent equipment in the conversion protocol script request.
Step S205: the method comprises the steps of determining the type of equipment based on the type of the equipment, searching a parent script matched with the type of the equipment and a child script matched with the type of the equipment from a preset conversion protocol script database, wherein the parent script corresponding to different intelligent equipment types and the child script corresponding to different intelligent equipment types are stored in the preset conversion protocol script database.
Specifically, the execution steps of S105 to S106 and S204 to S205 are the same as the implementation and principle of the system embodiment, and for details, reference is made to the related description of the system embodiment, and no further description is given.
Through the steps, according to the technical scheme provided by the application, a unified conversion protocol script is configured for the intelligent devices of the same type to serve as a parent script, and then for the intelligent devices of the same type and different types, if the conversion protocol of the type is different from the conversion protocol in the parent script, the different part is independently written into the sub script of the intelligent device of the corresponding type. Therefore, when the gateway equipment manages the intelligent equipment, the corresponding father script and the corresponding son script are obtained from the server only according to the currently configured intelligent equipment model, and the intelligent equipment with the same equipment type only needs to obtain one father script and a plurality of son scripts with very small data volume, so that the data volume of the conversion protocol script is greatly reduced, and the management and maintenance difficulty of the gateway equipment management on the conversion protocol script is greatly reduced. When the gateway equipment converts the interactive information between the server and the intelligent equipment, the sub-script is firstly used for conversion, if the interactive information needing to be converted is found not to belong to the range limited by the conversion protocol in the sub-script, the parent script is used for converting the interactive information when the conversion fails, and therefore the interactive information can be accurately converted.
As shown in fig. 4, this embodiment further provides a protocol conversion apparatus, which includes:
the request sending module 101 is configured to send a request for obtaining a protocol conversion script of a target intelligent device to a server. For details, refer to the related description of step S101 in the above method embodiment, and no further description is provided here.
The protocol obtaining module 102 is configured to receive a target conversion protocol script corresponding to a target intelligent device and sent by a server, where the target conversion protocol script is extracted by the server according to a request of converting the protocol script, the target conversion protocol script includes a parent script and a child script, and the parent script and the child script establish an attribution relationship according to types of the intelligent devices, where intelligent devices of the same type correspond to one parent script together, and a difference portion between a conversion protocol corresponding to each intelligent device and a conversion protocol in the parent script to which the intelligent device belongs forms a child script of each intelligent device. For details, refer to the related description of step S102 in the above method embodiment, and no further description is provided here.
And the first conversion module 103 is configured to convert the interaction information between the target intelligent device and the server through the sub-script. For details, refer to the related description of step S103 in the above method embodiment, and no further description is provided here.
And a second conversion module 104, configured to, if the conversion of the interaction information by the sub-script fails, convert the interaction information between the target intelligent device and the server by using a parent script corresponding to the sub-script. For details, refer to the related description of step S104 in the above method embodiment, and no further description is provided here.
As shown in fig. 5, this embodiment further provides a protocol conversion apparatus, which includes:
a request receiving module 201, configured to receive a request for obtaining a conversion protocol script of a target intelligent device, where the request is sent by a gateway device. For details, refer to the related description of step S201 in the above method embodiment, and no further description is provided here.
The protocol extraction module 202 is configured to extract a target conversion protocol script corresponding to a target intelligent device according to a conversion protocol script request, where the target conversion protocol script includes a parent script and a child script, and the parent script and the child script establish an attribution relationship according to types of the intelligent devices, where the intelligent devices of the same type correspond to one parent script together, and a difference portion between a conversion protocol corresponding to each intelligent device and a conversion protocol in the parent script to which the intelligent device belongs constitutes a child script of each intelligent device. For details, refer to the related description of step S202 in the above method embodiment, and no further description is provided herein.
The protocol sending module 203 is configured to send the target conversion protocol script to the gateway device, so that the gateway device converts the interaction information between the target intelligent device and the server through the sub-script, and when the conversion of the interaction information by the sub-script fails, converts the interaction information between the target intelligent device and the server by using the parent script corresponding to the sub-script. For details, refer to the related description of step S203 in the above method embodiment, and no further description is provided here.
The protocol conversion apparatus provided in the embodiment of the present invention is configured to execute a protocol conversion method provided in the above embodiment, and the implementation manner and the principle of the protocol conversion apparatus are the same, and details of the protocol conversion apparatus refer to the related description of the above method embodiment and are not described again.
Through the cooperative cooperation of the above components, according to the technical scheme provided by the application, a unified conversion protocol script is configured for the intelligent devices of the same type as a parent script, and then for the intelligent devices of the same type and different types, if a difference part exists between the conversion protocol of the type and the conversion protocol in the parent script, the difference part is independently written into a sub-script of the intelligent device of the corresponding type. Therefore, when the gateway equipment manages the intelligent equipment, the corresponding father script and the corresponding son script are obtained from the server only according to the currently configured intelligent equipment model, and the intelligent equipment with the same equipment type only needs to obtain one father script and a plurality of son scripts with very small data volume, so that the data volume of the conversion protocol script is greatly reduced, and the management and maintenance difficulty of the gateway equipment management on the conversion protocol script is greatly reduced. When the gateway equipment converts the interactive information between the server and the intelligent equipment, the sub-script is firstly used for conversion, if the interactive information needing to be converted is found not to belong to the range limited by the conversion protocol in the sub-script, the parent script is used for converting the interactive information when the conversion fails, and therefore the interactive information can be accurately converted.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A protocol conversion method applied to a gateway device is characterized by comprising the following steps:
sending a request for acquiring a conversion protocol script of the target intelligent equipment to a server;
receiving a target conversion protocol script which is sent by the server and corresponds to the target intelligent device, wherein the target conversion protocol script is extracted by the server according to the request of the conversion protocol script, the target conversion protocol script comprises a parent script and a child script, and the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type jointly correspond to one parent script, and a difference part between a conversion protocol corresponding to each intelligent device and a conversion protocol in the parent script to which the intelligent device belongs forms a child script of each intelligent device;
converting the interactive information between the target intelligent equipment and the server through the sub-script;
and if the conversion of the interactive information by the sub script fails, converting the interactive information between the target intelligent equipment and the server by using the parent script corresponding to the sub script.
2. The method of claim 1, wherein sending a request to a server to obtain a translated protocol script for a target smart device comprises:
acquiring the equipment model of the target intelligent equipment;
generating a conversion protocol script request carrying the equipment model based on the equipment model, sending the conversion protocol script request carrying the equipment model to the server so that the server analyzes the equipment model of the target intelligent equipment in the conversion protocol script request, determining the equipment type based on the equipment model, and searching a father script matched with the equipment type and a son script matched with the equipment model from a preset conversion protocol script database, wherein the preset conversion protocol script database stores father scripts corresponding to different intelligent equipment types and son scripts corresponding to different intelligent equipment models.
3. The method according to claim 1, wherein the converting the interaction information between the smart device and the server through the sub-script comprises:
receiving control instruction information which is sent by the server and used for controlling the target intelligent equipment;
judging whether the information type of the control instruction information is the information type supported by a conversion protocol in the sub-script corresponding to the target intelligent equipment;
if the information type of the control instruction information is the information type supported by the conversion protocol in the sub-script, converting the control instruction information into target control information based on the sub-script;
sending the target control information to the target intelligent equipment;
receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information;
converting the state information into target state information based on the sub-script;
and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
4. The method according to claim 1, wherein if the child script fails to convert the interaction information, the converting the interaction information between the smart device and the server using a parent script corresponding to the child script comprises:
receiving control instruction information which is sent by the server and used for controlling target intelligent equipment, and judging whether the information type of the control instruction information is the information type supported by a conversion protocol in a sub-script of the target intelligent equipment;
if the information type of the control instruction information is not the information type supported by the conversion protocol in the sub script, converting the control instruction information into target control information based on the parent script;
sending the target control information to the target intelligent equipment;
receiving state information sent by the target intelligent equipment, wherein the state information is fed back by the target intelligent equipment according to the target control information;
converting the state information into target state information based on the parent script;
and sending the target state information to the server so that the server determines the current state of the target intelligent equipment according to the target state information.
5. A protocol conversion method is applied to a server, and the method comprises the following steps:
receiving a conversion protocol script request for acquiring target intelligent equipment, which is sent by gateway equipment;
extracting a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, and the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type correspond to one parent script together, and the conversion protocol corresponding to each intelligent device and the difference part between the conversion protocols in the parent script to which the intelligent device belongs form the child script of each intelligent device;
and sending the target conversion protocol script to the gateway equipment so that the gateway equipment converts the interactive information between the target intelligent equipment and the server through the sub-script, and when the sub-script fails to convert the interactive information, converting the interactive information between the target intelligent equipment and the server by using the parent script corresponding to the sub-script.
6. The method according to claim 5, wherein the extracting a target conversion protocol script corresponding to the target smart device according to the conversion protocol script request comprises:
analyzing the equipment model of the target intelligent equipment in the conversion protocol script request, wherein the conversion protocol script request carries the equipment model of the target intelligent equipment;
determining the type of the equipment based on the type of the equipment, and searching out a parent script matched with the type of the equipment and a child script matched with the type of the equipment from a preset conversion protocol script database, wherein the parent script corresponding to different intelligent equipment types and the child script corresponding to different intelligent equipment types are stored in the preset conversion protocol script database.
7. A protocol conversion apparatus, applied to a gateway device, the apparatus comprising:
the request sending module is used for sending a protocol conversion script request for acquiring the target intelligent equipment to the server;
the protocol acquisition module is used for receiving a target conversion protocol script which is sent by the server and corresponds to the target intelligent device, the target conversion protocol script is extracted by the server according to the request of the conversion protocol script, the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relationship according to the type of the intelligent device, wherein the intelligent devices of the same type correspond to one parent script together, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device;
the first conversion module is used for converting the interactive information between the target intelligent equipment and the server through the sub-script;
and the second conversion module is used for converting the interactive information between the target intelligent device and the server by using the parent script corresponding to the sub-script if the conversion of the interactive information by the sub-script fails.
8. A protocol conversion apparatus, applied to a server, the apparatus comprising:
the request receiving module is used for receiving a conversion protocol script request for acquiring the target intelligent equipment, which is sent by the gateway equipment;
the protocol extraction module is used for extracting a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, wherein the intelligent devices of the same type jointly correspond to one parent script, and the difference part between the conversion protocol corresponding to each intelligent device and the conversion protocol in the parent script to which the intelligent device belongs forms the child script of each intelligent device;
and the protocol sending module is used for sending the target conversion protocol script to the gateway equipment so as to enable the gateway equipment to convert the interactive information between the target intelligent equipment and the server through the sub-script, and when the sub-script fails to convert the interactive information, the parent script corresponding to the sub-script is used for converting the interactive information between the target intelligent equipment and the server.
9. A protocol conversion system comprising a server and a gateway device, wherein:
the gateway equipment sends a request for acquiring a conversion protocol script of target intelligent equipment to the server;
the server receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, wherein the target conversion protocol script comprises a parent script and a child script, the parent script and the child script establish an attribution relation according to the type of the intelligent device, the intelligent devices of the same type correspond to one parent script together, and the conversion protocol corresponding to each intelligent device and the difference part between the conversion protocols in the parent script to which the intelligent device belongs form the child script of each intelligent device;
the server sends the target conversion protocol script to the gateway equipment;
the gateway equipment receives the target conversion protocol script;
the gateway equipment converts the interactive information between the target intelligent equipment and the server through the sub-script;
and if the conversion of the interactive information by the sub script fails, the gateway device converts the interactive information between the target intelligent device and the server by using the parent script corresponding to the sub script.
10. The system of claim 9, wherein the gateway device sends a request to the server to obtain a translation protocol script for a target smart device; the server receives the request and extracts a target conversion protocol script corresponding to the target intelligent device according to the conversion protocol script request, and the method comprises the following steps:
the gateway equipment acquires the equipment model of the target intelligent equipment;
the gateway equipment generates a conversion protocol script request carrying the equipment model based on the equipment model, and sends the conversion protocol script request carrying the equipment model to the server;
the server receives the protocol conversion script request;
the server analyzes the equipment model of the target intelligent equipment in the protocol conversion script request;
and the server determines the type of the equipment based on the type of the equipment, and searches out a parent script matched with the type of the equipment and a child script matched with the type of the equipment from a preset conversion protocol script database.
CN202111485890.6A 2021-12-07 2021-12-07 Protocol conversion method, device and system Active CN114172974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111485890.6A CN114172974B (en) 2021-12-07 2021-12-07 Protocol conversion method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111485890.6A CN114172974B (en) 2021-12-07 2021-12-07 Protocol conversion method, device and system

Publications (2)

Publication Number Publication Date
CN114172974A true CN114172974A (en) 2022-03-11
CN114172974B CN114172974B (en) 2024-02-09

Family

ID=80484012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111485890.6A Active CN114172974B (en) 2021-12-07 2021-12-07 Protocol conversion method, device and system

Country Status (1)

Country Link
CN (1) CN114172974B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040076281A1 (en) * 2002-10-18 2004-04-22 Aviram Dahari Method and system for integrating multi services for intelligent networks
WO2012168263A1 (en) * 2011-06-06 2012-12-13 S. Siedle & Söhne Telefon- und Telegrafenwerke OHG Device and method for the script-controlled data processing of data for a home communication system or home automation system
KR20190143504A (en) * 2018-05-30 2019-12-31 주식회사 유비벨록스모바일 Cloud-AI server for generating function control protocols of IOT devices
CN111447227A (en) * 2020-03-27 2020-07-24 四川虹美智能科技有限公司 Protocol analysis method and device of Internet of things equipment
CN112688967A (en) * 2021-03-11 2021-04-20 武汉慧联无限科技有限公司 Internet of things data processing method, device, equipment and storage medium
CN113067811A (en) * 2021-03-17 2021-07-02 北京自如信息科技有限公司 Protocol conversion method, device, system, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040076281A1 (en) * 2002-10-18 2004-04-22 Aviram Dahari Method and system for integrating multi services for intelligent networks
WO2012168263A1 (en) * 2011-06-06 2012-12-13 S. Siedle & Söhne Telefon- und Telegrafenwerke OHG Device and method for the script-controlled data processing of data for a home communication system or home automation system
KR20190143504A (en) * 2018-05-30 2019-12-31 주식회사 유비벨록스모바일 Cloud-AI server for generating function control protocols of IOT devices
CN111447227A (en) * 2020-03-27 2020-07-24 四川虹美智能科技有限公司 Protocol analysis method and device of Internet of things equipment
CN112688967A (en) * 2021-03-11 2021-04-20 武汉慧联无限科技有限公司 Internet of things data processing method, device, equipment and storage medium
CN113067811A (en) * 2021-03-17 2021-07-02 北京自如信息科技有限公司 Protocol conversion method, device, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114172974B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN109327551B (en) Method and device for accessing Internet of things equipment into Internet of things platform and server
CN100385855C (en) System and its method for central remote automatic upgrading software
EP3185482A1 (en) Intelligent home controller and communication method thereof
CN103488696A (en) Business query method, device and system of CPE (customer premises equipment), ACS (auto-configuration server) and CPE
CN114328256A (en) Test method, test device, computer-readable storage medium and electronic equipment
CN111079383A (en) Data interaction method, device and system for cloud platform and equipment of Internet of things
CN104866650A (en) Abstract equipment creating method and device
CN114282343A (en) Equipment modeling method and system suitable for power Internet of things
CN114172974A (en) Protocol conversion method, device and system
CN112735112A (en) Infrared code learning method, device, system, equipment and medium
CN105744556A (en) Method and system for base station fault acquisition
CN115981170A (en) Intelligent household management method, device, equipment and storage medium
CN114124952B (en) Cloud platform access system and method of data acquisition equipment
CN113839992B (en) Equipment control method and device
CN109991860A (en) A kind of method and device by scanning the two-dimensional code replacement smart home device
CN115062051A (en) Universal assembly cross-database language query method and system
CN113869536A (en) Automatic switch setting method suitable for remote operation and maintenance and related device
CN113645131A (en) Data processing method and device, electronic equipment and storage medium
CN108769087B (en) Development method of interactive system and server
WO2015125483A1 (en) Telegraphic message conversion system and telegraphic message conversion method for use in m2m
CN107453903B (en) Method and system for identifying communication slave station and storage device
CN101336425A (en) Method and apparatus for generating task in network and recording medium storing program for executing the method
CN104486449A (en) Calculation device controlling method and device
CN105893047B (en) A kind of bilingual moonlet test macro
CN115002014B (en) Method and device for determining test result, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant