CN115834726B - Protocol conversion method, data transmission method, device, gateway and storage medium - Google Patents

Protocol conversion method, data transmission method, device, gateway and storage medium Download PDF

Info

Publication number
CN115834726B
CN115834726B CN202310134512.6A CN202310134512A CN115834726B CN 115834726 B CN115834726 B CN 115834726B CN 202310134512 A CN202310134512 A CN 202310134512A CN 115834726 B CN115834726 B CN 115834726B
Authority
CN
China
Prior art keywords
internet
configuration
data
cloud platform
data format
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.)
Active
Application number
CN202310134512.6A
Other languages
Chinese (zh)
Other versions
CN115834726A (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.)
Guangzhou Huitong Guoxin Technology Co ltd
Original Assignee
Guangzhou Huitong Guoxin 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 Guangzhou Huitong Guoxin Technology Co ltd filed Critical Guangzhou Huitong Guoxin Technology Co ltd
Priority to CN202310134512.6A priority Critical patent/CN115834726B/en
Publication of CN115834726A publication Critical patent/CN115834726A/en
Application granted granted Critical
Publication of CN115834726B publication Critical patent/CN115834726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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]

Abstract

The invention relates to the technical field of the Internet of things and discloses a protocol conversion method, a data transmission method, a device, a gateway and a storage medium. The protocol conversion method comprises the following steps: acquiring a configuration page of an Internet of things gateway; responding to a first configuration operation of the configuration page of the Internet of things device, and determining a first data format of the Internet of things device based on the first configuration operation; responsive to a second configuration operation on the cloud platform configuration page, determining a second data format of the cloud platform based on the second configuration operation; responding to a third configuration operation of the protocol conversion configuration page, and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation; and converting the first data format and the second data format based on the target conversion rule. By implementing the technical scheme of the invention, the page configuration mode is used for replacing code writing, so that the access difficulty and workload are reduced, the access efficiency is improved, and the access safety and standardization are ensured.

Description

Protocol conversion method, data transmission method, device, gateway and storage medium
Technical Field
The invention relates to the technical field of the internet of things, in particular to a protocol conversion method, a data transmission method, a device, a gateway and a storage medium.
Background
Sensing equipment involved in the internet of things project is typically from numerous developers and brands; cloud platforms related to the Internet of things project generally have an Internet of things device access protocol customized by the cloud platform. Because most of internet of things devices do not have industry unified standards at present, devices to be accessed in the internet of things project are usually non-standard devices, and the functional models and the access protocols of cloud platforms to be accessed are different. By using the Internet of things gateway as an intermediary, the Internet of things sub-equipment can be accessed in the south direction, the cloud platform can be accessed in the north direction, and protocol conversion between the Internet of things sub-equipment and the cloud platform can be realized. The internet of things gateway needs to support multiple sub-devices with different protocols to access, and multiple cloud platforms with different protocols are accessed to realize bidirectional communication between the internet of things gateway and the sub-devices and the cloud platforms.
However, in the current internet of things gateway, for implementing protocol conversion between the sub-device and the cloud platform, different embedded codes are written and burned into the internet of things gateway according to different protocols of the accessed sub-device and the cloud platform, or different protocol conversion and encoding and decoding code packets are uploaded. When various types of internet of things equipment or a plurality of different cloud platforms are accessed, a large amount of embedded codes or encoding and decoding plug-ins are required to be developed, and operations such as hardware burning or plug-in package uploading, synchronization and the like are repeated, so that development cost is increased, access efficiency is low, protocol modification is difficult, and software and hardware code writing levels of equipment access personnel are relied on. Even if the software and hardware code writing level of equipment access personnel is higher, the problems of uneven quality, standardability, difficult guarantee of safety and the like of protocol conversion and encoding and decoding codes exist.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a protocol conversion method, a data transmission method, a device, a gateway, and a storage medium, so as to solve the problem of poor object connection effect caused by the problem of embedded code development in the protocol conversion process.
According to a first aspect, an embodiment of the present invention provides a protocol conversion method, including: acquiring a configuration page of an Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page; responding to a first configuration operation of the configuration page of the Internet of things equipment, and determining a first data format of the Internet of things equipment based on the first configuration operation; responding to a second configuration operation of the cloud platform configuration page, and determining a second data format of the cloud platform based on the second configuration operation; responding to a third configuration operation of the protocol conversion configuration page, and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation; and converting the first data format and the second data format based on the target conversion rule.
According to the protocol conversion method provided by the embodiment of the invention, the configuration of the Internet of things equipment is carried out through the Internet of things equipment configuration page to determine the data format of the Internet of things equipment, the cloud platform configuration is carried out through the cloud platform configuration page to generate the data format of the cloud platform, and the conversion rule is configured through the protocol conversion configuration page to realize the conversion among different data formats. According to the method, the code writing is replaced in a page configuration mode, the access of the Internet of things equipment and the cloud platform can be realized without writing software and hardware codes, the workload is increased due to the fact that a large amount of embedded codes are written, the access difficulty and workload of various Internet of things equipment or a plurality of cloud platforms are reduced, the access efficiency is improved, the access safety and standardization of the Internet of things equipment and the cloud platforms are ensured, and the access effect of the Internet of things is improved.
With reference to the first aspect, in a first implementation manner of the first aspect, the performing, based on the target conversion rule, conversion of the first data format and conversion of the second data format includes: determining a source data format and a target data format from the first data format and the second data format; respectively extracting a first data element in the source data format and a second data element in the target data format based on the target conversion rule; determining a mapping relationship between the first data element and the second data element; and converting the source data format into the target data format based on the mapping relation.
According to the protocol conversion method provided by the embodiment of the invention, the mapping relation between the data elements is determined by extracting the data elements in the source data format and the target data format, and then the conversion from the source data format to the target data format is completed according to the mapping relation. Therefore, the conversion of the data format can be realized through the target conversion rule of the visual page configuration, and the data conversion can be realized without encoding.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the determining a mapping relationship between the first data element and the second data element includes: responsive to a join operation on the first data element and the second data element, determining a join relationship between the first data element and the second data element based on the join operation; and determining a mapping relation between the first data element and the second data element based on the connection relation.
According to the protocol conversion method provided by the embodiment of the invention, the connection is carried out between the first data element and the second data element, and the mapping relation between the first data element and the second data element can be determined according to the connection relation, so that the data element to be converted automatically generates the data mapping relation in a connection form, and the protocol conversion code is not required to be written by a user.
With reference to the first aspect, in a third implementation manner of the first aspect, the determining, in response to a first configuration operation on the configuration page of the internet of things device, a first data format corresponding to the internet of things device based on the first configuration operation includes: determining measurement point information and a first communication connection protocol of the Internet of things equipment based on the first configuration operation; and generating a first data format of the Internet of things equipment according to the first communication connection protocol and the measuring point information.
According to the protocol conversion method provided by the embodiment of the invention, the measurement point information and the communication connection protocol of the Internet of things equipment are configured in a visual page configuration mode, so that the automatic generation of the data format of the Internet of things equipment is realized in a page configuration mode, the real-time adjustment according to actual needs is facilitated, a code is not required to be written or a coding and decoding component is not required to be uploaded, and the code writing requirement for technicians is reduced.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the determining, in response to a second configuration operation on the cloud platform configuration page, a second data format corresponding to the cloud platform based on the second configuration operation includes: acquiring preset model information of the cloud platform aiming at the internet of things equipment; extracting preset measuring point information of the Internet of things equipment from the preset model information; determining a second communication connection protocol of the cloud platform based on the second configuration operation; and generating a second data format of the cloud platform according to the second communication connection protocol and the preset measuring point information.
According to the protocol conversion method provided by the embodiment of the invention, the cloud platform communication connection protocol is configured in a visual configuration page mode, so that the cloud platform can automatically generate the data format of the internet of things device in a page configuration mode, the real-time adjustment is convenient according to actual needs, a code is not required to be written or a coding and decoding component is not required to be uploaded, and the code writing requirement for technicians is reduced.
With reference to the first aspect, in a fifth implementation manner of the first aspect, the determining, in response to a third configuration operation on the protocol conversion configuration page, a target conversion rule between the internet of things device and the cloud platform based on the third configuration operation includes: generating at least one protocol conversion rule based on an editing operation of protocol conversion in response to the editing operation; in response to a selection operation of at least one of the protocol conversion rules, the target conversion rule is determined based on the selection operation.
According to the protocol conversion method provided by the embodiment of the invention, the protocol conversion between the Internet of things equipment and the cloud platform is configured in a visual configuration page mode, and then the corresponding target conversion rule is determined from the configured protocol conversion rule, so that the flexible configuration and flexible use of the conversion rule are realized.
With reference to the first aspect or any implementation manner of the first to fifth implementation manners of the first aspect, in a sixth implementation manner of the first aspect, the method further includes: and responding to the export operation of the configuration information, and exporting the configuration information of the Internet of things device corresponding to the first configuration operation, the configuration information of the cloud platform corresponding to the second configuration operation and the protocol conversion configuration information corresponding to the third configuration operation based on the export operation.
The protocol conversion method provided by the embodiment of the invention supports the export of the configuration information, is convenient for multiplexing the configuration information in other gateways, does not need repeated configuration, and saves configuration time.
According to a second aspect, an embodiment of the present invention provides a data transmission method, including: obtaining data to be transmitted, wherein the data to be transmitted comprises: the data uploaded to the cloud platform by the internet of things device and/or the data issued to the internet of things device by the cloud platform; based on the first aspect or the protocol conversion method of any implementation manner of the first aspect, performing protocol conversion on the data to be transmitted, and converting the data to be transmitted into a target data format identifiable by target equipment, where the target equipment is the internet of things equipment or the cloud platform; and sending the data to be transmitted in the target data format to the target equipment.
According to the data transmission method provided by the embodiment of the invention, the data to be transmitted is converted into the target data format which can be identified by the target equipment by carrying out protocol conversion, so that the target equipment can accurately receive the data, and the data transmission efficiency is improved.
According to a third aspect, an embodiment of the present invention provides a protocol conversion apparatus, including: the configuration acquisition module is used for acquiring a configuration page of the Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page; the first response module is used for responding to a first configuration operation of the configuration page of the Internet of things equipment and determining a first data format of the Internet of things equipment based on the first configuration operation; the second response module is used for responding to a second configuration operation of the cloud platform configuration page and determining a second data format of the cloud platform based on the second configuration operation; the third response module is used for responding to a third configuration operation of the protocol conversion configuration page and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation; and the conversion module is used for converting the first data format and the second data format based on the target conversion rule.
According to a fourth aspect, an embodiment of the present invention provides a data transmission apparatus, including: the data acquisition module is used for acquiring data to be transmitted, and the data to be transmitted comprises: the data uploaded to the cloud platform by the internet of things device and/or the data issued to the internet of things device by the cloud platform; a data conversion module, configured to perform protocol conversion on the data to be transmitted based on the protocol conversion method of the first aspect or any implementation manner of the first aspect, and convert the data to be transmitted into a target data format that can be identified by a target device; the target equipment is the Internet of things equipment or the cloud platform; and the sending module is used for sending the data to be transmitted in the target data format to the target equipment.
According to a fifth aspect, an embodiment of the present invention provides a gateway, including: the device comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so as to execute the protocol conversion method according to the first aspect or any implementation manner of the first aspect or execute the data transmission method according to the second aspect.
According to a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the protocol conversion method according to the first aspect or any implementation manner of the first aspect, or the data transmission method according to the second aspect.
It should be noted that, the protocol conversion device, the data transmission device, the gateway and the computer readable storage medium provided in the embodiments of the present invention have corresponding beneficial effects, please refer to the description of corresponding contents in the protocol conversion and data transmission methods, and are not repeated here.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a protocol conversion method according to an embodiment of the present invention;
FIG. 2 is another flow chart of a protocol conversion method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the configuration of a source message protocol and a target message protocol in an embodiment of the invention;
FIG. 4 is a schematic diagram of different data formats in an embodiment of the invention;
FIG. 5 shows a schematic diagram of the connection of different data elements in an embodiment of the invention;
FIG. 6 is a schematic diagram of a data mapping relationship in an embodiment of the present invention;
FIG. 7 is a further flowchart of a protocol conversion method according to an embodiment of the present invention;
FIG. 8 shows a schematic diagram of a measurement point configuration of an Internet of things device in an embodiment of the present invention;
fig. 9 is a schematic diagram illustrating a communication protocol configuration of an internet of things device according to an embodiment of the present invention;
fig. 10 is a schematic diagram illustrating a connection protocol configuration of an internet of things device according to an embodiment of the present invention;
fig. 11 is a schematic diagram illustrating generation of a communication theme data format of an internet of things device according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a connection configuration of a cloud platform in an embodiment of the present invention;
fig. 13 is a schematic diagram of a communication protocol configuration of a cloud platform according to an embodiment of the present invention;
fig. 14 is a schematic diagram illustrating generation of a communication theme data format of a cloud platform according to an embodiment of the present invention;
FIG. 15 is a schematic diagram showing the configuration of conversion rules in the embodiment of the present invention;
fig. 16 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 17 is a block diagram of a protocol conversion apparatus according to an embodiment of the present invention;
fig. 18 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 19 is a schematic hardware structure of a gateway according to an embodiment of the present invention.
Detailed Description
For the purpose of making 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 clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, if protocol conversion between the sub-device and the cloud platform is to be realized, different embedded codes are written and burnt into the internet of things gateway according to different protocols of the accessed sub-device and the cloud platform, or different protocol conversion and encoding and decoding code packages are uploaded. When various types of internet of things equipment or a plurality of different cloud platforms are accessed, a large amount of embedded codes or encoding and decoding plug-ins are required to be developed, and operations such as hardware burning or plug-in package uploading, synchronization and the like are repeated, so that development cost is increased, access efficiency is low, protocol modification is difficult, and software and hardware code writing levels of equipment access personnel are relied on.
Based on the method, the technical scheme of the invention configures the connection configuration of the internet of things equipment to be accessed and the cloud platform to be docked in the internet of things gateway in a page configuration mode, thereby realizing the data format generation and protocol conversion of the internet of things equipment and the cloud platform, avoiding writing a large amount of embedded codes, reducing the access difficulty and workload of various internet of things equipment or a plurality of cloud platforms, improving the access efficiency and simultaneously ensuring the access safety and standardization of the internet of things equipment and the cloud platform.
According to an embodiment of the present invention, there is provided an embodiment of a protocol conversion method, it should be noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
In this embodiment, a protocol conversion method is provided, which may be used in a gateway, such as an internet of things gateway, and fig. 1 is a flowchart of the protocol conversion method according to an embodiment of the present invention, as shown in fig. 1, where the flowchart includes the following steps:
s11, acquiring a configuration page of the Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page.
When the Internet of things equipment and the cloud platform which are connected to the Internet of things gateway are required to be configured, a user can input a login address of the Internet of things gateway through a browser of electronic equipment (such as a computer, a tablet personal computer and the like) and then input a login user name and a password, so that the configuration page of the Internet of things gateway can be obtained.
Specifically, the configuration page comprises an internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page. The Internet of things equipment configuration page is used for configuring information such as an information model, connection setting and connection protocol of the Internet of things equipment; the cloud platform configuration page is used for configuring information such as connection settings and connection protocols of the cloud platform; the protocol conversion configuration page is used for configuring a data conversion protocol between the Internet of things device and the cloud platform.
S12, responding to a first configuration operation of the configuration page of the Internet of things device, and determining a first data format of the Internet of things device based on the first configuration operation.
The first configuration operation is related operation of the user for configuring the Internet of things gateway accessed to the Internet of things device through the Internet of things device configuration page. The first data format is used for characterizing a communication theme data format required by the Internet of things equipment.
The user configures information such as an information model, connection setting, connection protocol and the like of the Internet of things device through the Internet of things device configuration page, and accordingly, the Internet of things gateway can respond to first configuration operation of the user on the Internet of things device configuration page and automatically generate a communication theme data format of the Internet of things device according to configuration data generated by the first configuration operation.
S13, responding to a second configuration operation of the cloud platform configuration page, and determining a second data format of the cloud platform based on the second configuration operation.
The second configuration operation is an operation of the user to perform cloud platform configuration through the cloud platform configuration page. The second data format is a communication theme data format required by the cloud platform.
The user configures information such as connection setting and connection protocol of the internet of things to the cloud platform through the cloud platform configuration page, and accordingly, the internet of things gateway can respond to second configuration operation of the user on the cloud platform configuration page and automatically generate a communication theme data format of the cloud platform according to configuration data generated by the second configuration operation.
It should be noted that, the information model of the cloud platform for the internet of things device is preconfigured in the cloud platform configuration page, and the internet of things gateway can automatically generate the communication theme data format of the cloud platform for the internet of things device by combining the preconfigured information model of the internet of things device.
S14, responding to a third configuration operation of the protocol conversion configuration page, and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation.
The third configuration operation is an operation in which the user performs protocol conversion configuration through the protocol conversion configuration page. The target conversion rule is used to determine a source data format before conversion and a target data format after conversion.
The user configures the protocol conversion information through the protocol conversion configuration page, for example, adds a protocol conversion rule, selects the protocol conversion rule and the like, and accordingly, the internet of things gateway can respond to a third configuration operation of the user on the protocol conversion configuration page, determine a source protocol theme before conversion and a target protocol theme to be converted according to the third configuration operation, then determine a source data format according to the source protocol, and determine a target data format according to the target protocol theme.
S15, converting the first data format and the second data format based on the target conversion rule.
The internet of things determines a source data format and a target data format in the first data format and the second data format according to a target conversion rule, and performs data conversion by combining the mapping relation of the data elements in the first data format and the second data format. Taking the first data format as a source data format and the second data format as a target data format as an example, the internet of things gateway can convert the first data format into the second data format according to a target conversion rule by combining the mapping relation of the data elements in the first data format and the second data format.
According to the protocol conversion method provided by the embodiment, the configuration of the Internet of things equipment is carried out through the Internet of things equipment configuration page to determine the data format of the Internet of things equipment, the cloud platform configuration is carried out through the cloud platform configuration page to generate the data format of the cloud platform, and the conversion rule is configured through the protocol conversion configuration page to realize conversion among different data formats. According to the method, the code writing is replaced in a page configuration mode, the access of the Internet of things equipment and the cloud platform can be realized without writing software and hardware codes, the workload is increased due to the fact that a large amount of embedded codes are written, the access difficulty and workload of various Internet of things equipment or a plurality of cloud platforms are reduced, the access efficiency is improved, the access safety and standardization of the Internet of things equipment and the cloud platforms are ensured, and the access effect of the Internet of things is improved.
In this embodiment, a protocol conversion method is provided, which may be used in a gateway, such as an internet of things gateway, and fig. 2 is a flowchart of the protocol conversion method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
s21, acquiring a configuration page of the Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S22, responding to a first configuration operation of the configuration page of the Internet of things device, and determining a first data format of the Internet of things device based on the first configuration operation.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S23, responding to a second configuration operation of the cloud platform configuration page, and determining a second data format of the cloud platform based on the second configuration operation.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
And S24, responding to a third configuration operation of the protocol conversion configuration page, and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S25, converting the first data format and the second data format based on the target conversion rule.
Specifically, the step S25 may include:
s251, determining a source data format and a target data format from the first data format and the second data format based on the target conversion rule.
The source data format is the data format before conversion and the target data format is the data format after conversion. The internet of things gateway can determine whether the internet of things device sends data to the cloud platform or whether the cloud platform sends data to the internet of things device currently according to the target conversion rule.
For example, when the internet of things device sends data to the cloud platform, the first data format determined by the internet of things device based on the message protocol theme is used as a source data format, and the second data format determined by the cloud platform based on the message protocol theme is used as a target data format. Taking fig. 3 as an example, the source message protocol is a modbus protocol, the source message topic is attribute reporting, the target message protocol is a platform protocol, and the target message topic is equipment reporting attribute. For the source message protocol and the target message protocol, corresponding protocol information is respectively corresponding, and for different protocol information, corresponding data formats are corresponding, as shown in fig. 4.
S252, respectively extracting a first data element in the source data format and a second data element in the target data format.
The first data element is all leaf nodes contained in the source data format. The second data element is all leaf nodes contained in the target data format. The internet of things gateway can analyze the data elements contained in the source data format according to the message protocol for generating the source data format, and similarly, can analyze the data elements contained in the target data format according to the message protocol for generating the target data format.
Taking the human body sensor as an example, the first data element and the second data element may include elements such as human body existence signal, delay, sensitivity, and the like, and the first data element and the second data element obtained by analyzing the elements are displayed in a protocol conversion configuration page by the internet of things gateway, as shown in fig. 5.
S253, determining a mapping relationship between the first data element and the second data element.
And constructing a mapping relation between the first data element and the second data element according to the association degree between the first data element and the second data element. The association degree can be determined by a connection method, can also be determined by comparing semantic information, can be determined by comparing keywords, is not particularly limited herein, and can be determined by a person skilled in the art according to actual needs.
As an alternative embodiment, the mapping relationship between the data elements may be determined here by means of a wire, in particular:
(1) In response to a join operation on the first data element and the second data element, a join relationship between the first data element and the second data element is determined based on the join operation.
(2) A mapping relationship between the first data element and the second data element is determined based on the connection relationship.
The user connects the first data element and the second data element correspondingly on the protocol conversion configuration page through the input device such as the keyboard or the mouse, and correspondingly, the internet of things gateway can respond to the connection operation of the user on the first data element and the second data element on the protocol conversion configuration page to obtain the connection relation between the first data element and the second data element, and a corresponding connection line is generated between the first data element and the second data element, as shown in fig. 5.
The internet of things automatically generates a corresponding data mapping relation according to the connection line between the first data element and the second data element, as shown in fig. 6.
Through connecting lines between the first data elements and the second data elements, the mapping relation between the first data elements and the second data elements can be determined according to the connection relation, so that the data elements to be converted automatically generate the data mapping relation in a connection mode, and a user does not need to write protocol conversion codes.
And S254, converting the source data format into a target data format based on the mapping relation.
The mapping relationship can characterize differences between the source data format and the target data format, such as element identification, differences between element types. The internet of things gateway can map the data elements in the source data format to the target data format according to the mapping relation.
As shown in fig. 6, the source data format and the target data format are different in element identifiers and correspond to corresponding aliases, and at this time, the internet of things gateway can map the data elements in the source data format to the target data format according to the alias mapping relationship.
According to the protocol conversion method provided by the embodiment, the mapping relation between the data elements is determined by extracting the data elements in the source data format and the target data format, and then the conversion from the source data format to the target data format is completed according to the mapping relation. Therefore, the conversion of the data format can be realized through the target conversion rule of the visual page configuration, and the data conversion can be realized without encoding.
In this embodiment, a protocol conversion method is provided, which may be used in a gateway, such as an internet of things gateway, and fig. 7 is a flowchart of the protocol conversion method according to an embodiment of the present invention, as shown in fig. 7, where the flowchart includes the following steps:
s31, acquiring a configuration page of the Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S32, responding to a first configuration operation of the configuration page of the Internet of things device, and determining a first data format of the Internet of things device based on the first configuration operation.
Specifically, the step S32 may include:
s321, determining measurement point information of the Internet of things device and a first communication connection protocol based on the first configuration operation.
The measuring point information is used for characterizing a target point when the Internet of things equipment is observed. The first communication connection protocol is a communication protocol and a connection protocol when the Internet of things equipment is accessed to the Internet of things gateway.
The communication protocols of different Internet of things equipment when being accessed to the Internet of things gateway are different, and corresponding setting contents are different. Specifically, the setting content of the communication protocol includes: serial port/network port information, equipment addresses, data acquisition modes and the like.
For the internet of things device, the connection protocol is configured as a southbound connection protocol, and the configuration content of the connection protocol includes: connection protocol basic information, communication subject data format, and the like.
Taking the internet of things equipment as a human body sensor, and configuring the human body sensor in the internet of things gateway as an example, the specific configuration implementation mode is as follows:
the user can configure basic attributes (such as equipment names, equipment identifiers and the like), inherent attributes (such as models, brands and the like) and measurement point information (such as human body presence signals, time delay, sensitivity and the like) of the human body sensor in the Internet of things equipment configuration page.
Correspondingly, the internet of things gateway can respond to the configuration operation of the user on the internet of things device configuration page, generate measurement point configuration data corresponding to the configuration operation, and display the basic attribute, the inherent attribute, the measurement point information and the like of the completion of the configuration on the internet of things device configuration page, as shown in fig. 8.
The user can configure the communication protocol of the human body sensor in the configuration page of the internet of things equipment, and set the connection content of the communication protocol. The specific connection setting content comprises equipment addresses, communication protocols, serial numbers, baud rates, acquisition rules and the like.
Accordingly, the internet of things gateway can respond to the configuration operation of the user on the internet of things device configuration page, generate the communication protocol configuration data corresponding to the configuration operation, and display the communication protocol content after the configuration on the internet of things device configuration page, as shown in fig. 9.
The user can configure the connection protocol of the human body sensor in the configuration page of the internet of things device, set the basic information of the connection protocol, the data format of the communication theme (such as theme name, communication protocol and data format) and the like in the connection protocol in combination with the communication protocol (such as modbus protocol), and configure the connection protocol as a southbound connection protocol.
Correspondingly, the internet of things gateway can respond to the configuration operation of the user on the internet of things device configuration page, generate connection protocol configuration data corresponding to the configuration operation, and display connection protocol content with completed configuration on the internet of things device configuration page, as shown in fig. 10.
S322, according to the first communication connection protocol and the measuring point information, a first data format of the Internet of things equipment is generated.
After the internet of things gateway completes configuration of the connection protocol according to configuration operation, a communication theme data format is automatically generated based on the connection protocol, the communication protocol of the internet of things device and the configured measurement point information of the internet of things device, and all leaf nodes contained in the communication theme data format are automatically analyzed to serve as data elements.
Taking the internet of things equipment as a human body sensor, for example, the human body sensor is configured in the gateway of the internet of things, and the gateway of the internet of things automatically generates a communication subject data format based on a connection protocol, a communication protocol (such as a modbus protocol) of the human body sensor, and configured measurement point information such as human body presence signals, time delay, sensitivity and the like, as shown in fig. 11.
S33, responding to a second configuration operation of the cloud platform configuration page, and determining a second data format of the cloud platform based on the second configuration operation.
Specifically, the step S33 may include:
s331, obtaining preset model information of the cloud platform aiming at the Internet of things equipment.
The preset model information is an information model which is preset in the cloud platform and aims at each piece of internet of things equipment, and is generated in the form of JSON files. When the cloud platform is configured in the internet of things gateway, the cloud platform is accessed through a preset communication protocol (such as an MQTT protocol), and after the cloud platform is accessed, an information model configured in the cloud platform can be searched to determine preset model information corresponding to the internet of things device.
It should be noted that, if the search mode of the information model of the internet of things device of the accessed internet of things gateway is not currently provided in the cloud platform, the user may obtain the model information of the internet of things device through other ways (for example, modes of HTTP or manual derivation, etc.), and create the information model of the internet of things device in the cloud platform configuration page.
S332, extracting preset measuring point information of the Internet of things equipment from the preset model information.
The preset measuring point information is an observed target point which is preconfigured by the cloud platform and aims at the internet of things equipment. The preset model information comprises equipment basic information, inherent attributes, measuring point information and the like corresponding to the internet of things equipment, and the internet of things gateway can analyze the acquired preset model information and extract preset measuring point information aiming at the internet of things equipment.
S333, determining a second communication connection protocol of the cloud platform based on the second configuration operation.
The second communication connection protocol is a communication protocol and a connection protocol when the Internet of things is connected with the cloud platform. The communication protocols of the internet of things-based access cloud platform are different, and different setting contents exist. Taking the MQTT protocol as an example, the connection setting contents of the communication protocol include: host address Host, port, client ID, etc.
For the cloud platform, the connection protocol of the internet of things access to the cloud platform is configured as a northbound connection protocol, and the configuration content of the connection protocol comprises: connection protocol basic information, communication theme message routing, communication theme data format and the like.
Specifically, the user can perform relevant configuration on the connection setting of the access cloud platform in the cloud platform configuration page. Correspondingly, the internet of things gateway can respond to the configuration operation of the user on the cloud platform configuration page, generate configuration data corresponding to the configuration operation, and display connection setting content and the like after the configuration is completed on the cloud platform configuration page, as shown in fig. 12.
The user can configure a connection protocol of the internet of things for accessing the cloud platform in the cloud platform configuration page, set the basic information of the connection protocol required by the cloud platform, the communication subject message route (such as a subject path), the communication subject data format and the like, and configure the connection protocol as a northbound connection protocol.
Correspondingly, the internet of things gateway can respond to the configuration operation of the user on the cloud platform configuration page, generate connection protocol configuration data corresponding to the configuration operation, and display connection protocol contents such as a communication theme list, a communication theme path and the like after the configuration is completed on the cloud platform configuration page, as shown in fig. 13.
And S334, generating a second data format of the cloud platform according to the second communication connection protocol and the preset measurement point information.
After the internet of things gateway completes the configuration of the connection protocol for the cloud platform according to the configuration operation, a required communication theme data format is automatically generated based on the connection protocol and preset measurement point information of the internet of things device, and all leaf nodes contained in the communication theme data format are automatically analyzed to serve as data elements.
Taking the internet of things device as a human body sensor as an example, when the cloud platform is configured in the internet of things gateway, the internet of things gateway automatically generates a communication theme data format based on a connection protocol and preset point information which is configured in advance and aims at the human body sensor, as shown in fig. 14.
And S34, responding to a third configuration operation of the protocol conversion configuration page, and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation.
Specifically, the step S34 may include:
s341, responding to the editing operation of the conversion rules, and generating at least one conversion rule based on the editing operation.
The conversion rule is a rule for converting a data format between the internet of things device and the cloud platform, and specifically comprises the following steps: the internet of things device sends data to the cloud platform to perform data format conversion rules, and the cloud platform sends data to the internet of things device to perform data format conversion rules, such as conversion rules between a platform protocol of the cloud platform and a modbus protocol of the internet of things device shown in fig. 15.
Specifically, the user edits the theme conversion rules at the protocol conversion configuration page to determine the operation of the source protocol theme and the target protocol theme of the conversion rules. Accordingly, the Internet of things gateway can respond to editing operation of a user on the protocol conversion configuration page, and one or more conversion rules are generated according to the editing operation.
S342, in response to a selection operation of at least one conversion rule, determining a target conversion rule based on the selection operation.
The user selects the currently required data conversion rule from the conversion rules through the input device such as a keyboard or a mouse, and correspondingly, the internet of things gateway can respond to the selection operation of the user, determine the conversion rule selected by the user as the target conversion rule, and determine the source protocol theme before conversion and the target protocol theme after conversion based on the target conversion rule, as shown in fig. 3.
S35, converting the first data format and the second data format based on the target conversion rule.
The detailed description refers to the corresponding related descriptions of the above embodiments, and will not be repeated here.
S36, in response to the export operation of the configuration information, exporting the configuration information of the Internet of things device corresponding to the first configuration operation, the configuration information of the cloud platform corresponding to the second configuration operation and the protocol conversion configuration information corresponding to the third configuration operation based on the export operation.
When the same Internet of things equipment is accessed in other Internet of things, the current configuration information can be multiplexed into other gateways at the moment, so that repeated configuration for the same Internet of things equipment can be avoided. When the current or other Internet of things are connected with the same type of Internet of things equipment, the current configuration information can be copied into new configuration information for use, and the new same type of Internet of things equipment can be quickly connected only by modifying different few configurations among the Internet of things equipment, so that repeated configuration of the same type of Internet of things equipment can be avoided. Specifically, a configuration page of the internet of things gateway is provided with a export tag, and after the configuration of the internet of things device, the cloud platform and the protocol conversion is completed, a user can export the configuration information of the internet of things device, the configuration information of the cloud platform and the configuration information of the protocol conversion through the export tag. Correspondingly, the Internet of things gateway can respond to the export operation to obtain Internet of things equipment configuration information, cloud platform configuration information and protocol conversion configuration information.
It should be noted that, corresponding export tags may be respectively set on the configuration page of the internet of things device, the configuration page of the cloud platform, and the configuration page of the protocol conversion, and if a user wants to export certain configuration information, the user may perform export operation of the configuration information through the export tag on the corresponding configuration page. Correspondingly, the internet of things gateway can respond to the export operation to export the configuration information of the internet of things device, or the configuration information of the cloud platform, or the configuration information of the protocol conversion.
According to the protocol conversion method provided by the embodiment, the measurement point information and the communication connection protocol of the Internet of things device are configured in a visual configuration page mode, and the cloud platform communication connection protocol is configured in a visual configuration page mode, so that the automatic generation of the data format of the Internet of things device and the automatic generation of the data format of the cloud platform aiming at the Internet of things device are realized in a page configuration mode, real-time adjustment according to actual needs is facilitated, code writing or uploading of a coding and decoding component is not needed, and the code writing requirements for technicians are greatly reduced. The protocol conversion between the Internet of things equipment and the cloud platform is configured in a visual configuration page mode, and then a corresponding target conversion rule is determined from the configured protocol conversion rule, so that flexible configuration and flexible use of the conversion rule are realized. Meanwhile, the configuration information can be exported in a supported manner, so that the configuration information can be conveniently multiplexed in other gateways, repeated configuration is not needed, and configuration time is saved.
In this embodiment, a data transmission method is provided, which may be used in a gateway, such as an internet of things gateway, and fig. 16 is a flowchart of a data transmission method according to an embodiment of the present invention, as shown in fig. 16, where the flowchart includes the following steps:
s41, acquiring data to be transmitted.
The data to be transmitted comprises data uploaded to the cloud platform by the internet of things device and/or data issued to the internet of things device by the cloud platform.
When the data to be transmitted is the data uploaded to the cloud platform by the internet of things equipment, the data to be transmitted is the data acquired by the internet of things from the internet of things equipment. Taking a human body sensor as an example, the data to be transmitted is data collected from the human body sensor at regular intervals by the internet of things, for example, the data collected at a certain moment is: the human body has the functions of signal, time delay and sensitivity.
When the data to be transmitted is the data issued by the cloud platform to the Internet of things equipment, the data to be transmitted is the data issued by the cloud platform monitored by the Internet of things gateway. Taking a human body sensor as an example, the data to be transmitted are delay data, sensitivity data and the like which are required to be issued to the human body sensor and are monitored by the internet of things gateway from the cloud platform.
S42, carrying out protocol conversion on the data to be transmitted based on a protocol conversion method, and converting the data to be transmitted into a target data format which can be identified by target equipment.
The target equipment is Internet of things equipment or a cloud platform.
The protocol conversion method according to the above embodiment performs protocol conversion on the data to be transmitted, so as to convert the data format of the data to be transmitted into a target data format that can be identified by the target device. Specifically, the protocol conversion includes conversion from the internet of things device to the cloud platform and conversion from the cloud platform to the internet of things device. These two conversion modes will be described below, respectively.
(1) And converting the Internet of things equipment into a cloud platform.
The internet of things automatically codes and decodes the data of the internet of things according to the information model and the connection protocol of the configured internet of things equipment, generates a corresponding data format of the internet of things equipment, and converts the data format of the internet of things equipment into a data format recognized by the cloud platform according to the protocol conversion rule between the configured internet of things equipment and the cloud platform.
Taking the internet of things equipment as a human body sensor, the data to be transmitted is measurement point information such as human body existence signal, time delay, sensitivity and the like, and the communication protocol is modbus as an example, the internet of things gateway can generate a data format of a corresponding communication theme from the data acquired by the internet of things gateway from the human body sensor according to configuration information:
{
"bodySignal": 1,
"delayTime": 25,
"sensitivity": 5
};
Then, according to the configured protocol conversion rule, converting the communication theme data of the human body sensor into a data format required by the cloud platform:
{
"id": "0000001",
"time": "2022-10-2810:10:10",
"type": "info",
"data": {
"body_signal": 1,
"delay_time": 25,
"sensitivity": 5
}
}。
(2) And converting the cloud platform into the Internet of things equipment.
The internet of things is connected to the cloud platform according to the connection setting of the configured cloud platform, monitors and receives data sent by the cloud platform to the internet of things device according to the connection protocol of the configured cloud platform, and then converts a data format of the data sent by the cloud platform to the internet of things device into a data format recognized by the internet of things device according to a protocol conversion rule between the configured internet of things device and the cloud platform.
Taking the connection protocol of the internet of things to the cloud platform as an MQTT protocol as an example, the internet of things gateway can monitor and receive data sent by the cloud platform to the internet of things device according to the configured cloud platform connection protocol, for example, the monitored MQTT path is: the data format of the corresponding communication theme is generated by the data sent to the internet of things device from the cloud platform acquired from the path:
{
"id": "0000002",
"time": "2022-10-2811:11:11",
"mode": "sync",
"data": {
"delay_time": 30,
"sensitivity": 3
}
};
then, according to the configured protocol conversion rule, converting the communication theme data of the cloud platform into a data format recognized by the internet of things device:
{
"delayTime": 30,
"sensitivity": 3
}。
S43, sending the data to be transmitted in the target data format to the target equipment.
If the data to be transmitted is the data uploaded to the cloud platform by the Internet of things device, the Internet of things device accesses the cloud platform according to the connection configuration of the configured cloud platform, and sends the data to be transmitted in the target data format obtained after conversion to the cloud platform. For example, according to the configured communication connection protocol of the cloud platform, the internet of things sends the data to be transmitted in the target data format obtained after conversion to the MQTT path corresponding to the cloud platform: sys/body_sensor/device_001/ting/event/property/post.
If the data to be transmitted is the data issued to the Internet of things equipment by the cloud platform, the Internet of things gateway connects the Internet of things equipment according to the connection configuration of the configured Internet of things equipment, and the data to be transmitted in the target data format obtained after conversion is sent to the Internet of things equipment. For example, the internet of things sends the data to be transmitted in the target data format obtained after conversion to the human body sensor according to the communication connection protocol of the human body sensor which is configured.
According to the data transmission method, the data to be transmitted is subjected to protocol conversion to be converted into the target data format which can be identified by the target equipment, so that the target equipment can accurately receive the data, and the data transmission efficiency is improved.
The embodiment also provides a protocol conversion device, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a protocol conversion device, as shown in fig. 17, including:
the configuration obtaining module 51 is configured to obtain a configuration page of the internet of things gateway, where the configuration page of the internet of things gateway includes an internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page.
The first response module 52 is configured to determine, in response to a first configuration operation on the configuration page of the internet of things device, a first data format of the internet of things device based on the first configuration operation.
The second response module 53 is configured to determine, in response to a second configuration operation on the cloud platform configuration page, a second data format of the cloud platform based on the second configuration operation.
And a third response module 54, configured to determine, in response to a third configuration operation on the protocol conversion configuration page, a target conversion rule between the internet of things device and the cloud platform based on the third configuration operation.
The conversion module 55 is configured to perform conversion between the first data format and the second data format based on the target conversion rule.
Alternatively, the conversion module 55 may include:
and the format determination submodule is used for determining a source data format and a target data format from the first data format and the second data format based on the target conversion rule.
The element extraction sub-module is used for respectively extracting a first data element in the source data format and a second data element in the target data format.
And the mapping determination submodule is used for determining the mapping relation between the first data element and the second data element.
And the data conversion sub-module is used for converting the source data format into the target data format based on the mapping relation.
Optionally, the element extraction submodule is specifically configured to: responsive to a join operation on the first data element and the second data element, determining a join relationship between the first data element and the second data element based on the join operation; a mapping relationship between the first data element and the second data element is determined based on the connection relationship.
Alternatively, the first response module 52 may include:
and the first determining submodule is used for determining the measuring point information of the internet of things equipment and the first communication connection protocol based on the first configuration operation.
The first generation sub-module is used for generating a first data format of the Internet of things equipment according to the first communication connection protocol and the measurement point information.
Alternatively, the second response module 53 may include:
the model acquisition sub-module is used for acquiring preset model information of the cloud platform aiming at the internet of things equipment.
And the measuring point extraction sub-module is used for extracting preset measuring point information of the tandem equipment from the preset model information.
And the second determining submodule is used for determining a second communication connection protocol of the cloud platform based on a second configuration operation.
The second generation sub-module is used for generating a second data format of the cloud platform according to a second communication connection protocol and preset measurement point information.
Alternatively, the third response module 54 may include:
and the editing sub-module is used for responding to the editing operation on the conversion rules and generating at least one conversion rule based on the editing operation.
And a selection sub-module for determining a target conversion rule based on the selection operation in response to the selection operation of the at least one conversion rule.
Optionally, the protocol conversion device may further include:
and the export module is used for exporting the configuration information of the Internet of things device corresponding to the first configuration operation, the configuration information of the cloud platform corresponding to the second configuration operation and the protocol conversion configuration information corresponding to the third configuration operation based on the export operation in response to the export operation of the configuration information.
The protocol conversion means in this embodiment are presented in the form of functional units, here referred to as ASIC circuits, processors and memories executing one or more software or firmware programs, and/or other devices that can provide the above described functionality.
Further functional descriptions of the above modules and sub-modules are the same as those of the above corresponding embodiments, and are not repeated here.
According to the protocol conversion device provided by the embodiment, the configuration of the Internet of things equipment is carried out through the Internet of things equipment configuration page to determine the data format of the Internet of things equipment, the cloud platform configuration is carried out through the cloud platform configuration page to generate the data format of the cloud platform, and the configuration of the conversion rule is carried out through the protocol conversion configuration page to realize conversion among different data formats. The device replaces code writing in a page configuration mode, can realize the access of the internet of things device and the cloud platform without writing software and hardware codes, avoids increasing the workload by writing a large amount of embedded codes, reduces the access difficulty and workload of various internet of things devices or a plurality of cloud platforms, improves the access efficiency, ensures the access safety and standardization of the internet of things devices and the cloud platforms, and improves the access effect of the internet of things devices and the cloud platforms.
The present embodiment provides a data transmission apparatus, as shown in fig. 18, including:
the data obtaining module 61 is configured to obtain data to be transmitted, where the data to be transmitted includes data uploaded to the cloud platform by the internet of things device and/or data issued to the internet of things device by the cloud platform.
The data conversion module 62 is configured to perform protocol conversion on data to be transmitted based on a protocol conversion method, and convert the data to be transmitted into a target data format that can be identified by a target device, where the target device is an internet of things device or a cloud platform.
A sending module 63, configured to send the data to be transmitted in the target data format to the target device.
The data transmission means in this embodiment are presented in the form of functional units, where the units refer to ASIC circuits, processors and memories executing one or more software or firmware programs, and/or other devices that can provide the functionality described above.
Further functional descriptions of the above modules are the same as those of the above corresponding embodiments, and are not repeated here.
According to the data transmission device, the data to be transmitted is subjected to protocol conversion to be converted into the target data format which can be identified by the target equipment, so that the target equipment can accurately receive the data, and the data transmission efficiency is improved.
The embodiment of the invention also provides a gateway which is provided with the protocol conversion device shown in the figure 17 and the data transmission device shown in the figure 18.
Referring to fig. 19, fig. 19 is a schematic structural diagram of a gateway according to an alternative embodiment of the present invention, as shown in fig. 19, the gateway may include: at least one processor 701, such as a central processing unit (Central Processing Unit, CPU), at least one communication interface 703, a memory 704, at least one communication bus 702. Wherein the communication bus 702 is used to enable connected communications between these components. The communication interface 703 may include a Display screen (Display), a Keyboard (Keyboard), and the optional communication interface 703 may further include a standard wired interface, and a wireless interface. The memory 704 may be a high-speed volatile random access memory (Random Access Memory, RAM) or may be a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 704 may also optionally be at least one storage device located remotely from the processor 701. Wherein the processor 701 may be in conjunction with the apparatus described in fig. 5, the memory 704 stores an application program, and the processor 701 invokes the program code stored in the memory 704 for performing any of the method steps described above.
The communication bus 702 may be, among other things, a peripheral component interconnect standard (peripheralcomponent interconnect, PCI) bus or an extended industry standard architecture (extendedindustry standard architecture, EISA) bus, etc. Communication bus 702 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 19, but not only one bus or one type of bus.
Wherein the memory 704 may include volatile memory (RAM), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); memory 704 may also include combinations of the above types of memory.
The processor 701 may be a central processing unit (centralprocessing unit, CPU), a Network Processor (NP), or a combination of CPU and NP, among others.
The processor 701 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmablelogic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmablegate array, FPGA), general-purpose array logic (genericarray logic, GAL), or any combination thereof.
Optionally, the memory 704 is also used for storing program instructions. The processor 701 may invoke program instructions to implement the protocol conversion method or the data transmission method as shown in the above-described embodiments of the present application.
The embodiment of the invention also provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions can execute the protocol conversion method or the data transmission method in any of the above method embodiments. The storage medium may be a magnetic Disk, an optical disc, a Read-Only Memory (ROM), a Random access Memory (Random AccessMemory, RAM), a flash Memory (flash Memory), a Hard Disk (HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (8)

1. A method of protocol conversion, comprising:
Acquiring a configuration page of an Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page;
responding to a first configuration operation of the configuration page of the Internet of things equipment, and determining a first data format of the Internet of things equipment based on the first configuration operation;
responding to a second configuration operation of the cloud platform configuration page, and determining a second data format of the cloud platform based on the second configuration operation;
responding to a third configuration operation of the protocol conversion configuration page, determining a target conversion rule between the internet of things device and the cloud platform based on the third configuration operation, wherein the target conversion rule comprises the following steps: generating at least one protocol conversion rule based on an editing operation of protocol conversion in response to the editing operation; determining the target conversion rule based on a selection operation of at least one protocol conversion rule in response to the selection operation;
converting the first data format and the second data format based on the target conversion rule includes: determining a source data format and a target data format from the first data format and the second data format based on the target conversion rule; respectively extracting a first data element in the source data format and a second data element in the target data format; determining a mapping relationship between the first data element and the second data element; converting the source data format into the target data format based on the mapping relation;
Responding to the export operation of the configuration information, and exporting the configuration information of the Internet of things device corresponding to the first configuration operation, the configuration information of the cloud platform corresponding to the second configuration operation and the protocol conversion configuration information corresponding to the third configuration operation based on the export operation;
multiplexing the configuration information of the Internet of things device, the configuration information of the cloud platform and the configuration information of the protocol conversion;
wherein the determining the mapping relationship between the first data element and the second data element includes: responsive to a join operation on the first data element and the second data element, determining a join relationship between the first data element and the second data element based on the join operation; and determining a mapping relation between the first data element and the second data element based on the connection relation.
2. The method of claim 1, wherein the determining, in response to a first configuration operation on the configuration page of the internet of things device, a first data format corresponding to the internet of things device based on the first configuration operation comprises:
determining measurement point information and a first communication connection protocol of the Internet of things equipment based on the first configuration operation;
And generating a first data format of the Internet of things equipment according to the first communication connection protocol and the measuring point information.
3. The method of claim 1, wherein responsive to a second configuration operation on the cloud platform configuration page, determining a second data format corresponding to the cloud platform based on the second configuration operation comprises:
acquiring preset model information of the cloud platform aiming at the internet of things equipment;
extracting preset measuring point information of the Internet of things equipment from the preset model information;
determining a second communication connection protocol of the cloud platform based on the second configuration operation;
and generating a second data format of the cloud platform according to the second communication connection protocol and the preset measuring point information.
4. A data transmission method, comprising:
acquiring data to be transmitted, wherein the data to be transmitted comprises data uploaded to a cloud platform by an internet of things device and/or data issued to the internet of things device by the cloud platform;
performing protocol conversion on the data to be transmitted based on the protocol conversion method of any one of claims 1-3, and converting the data to be transmitted into a target data format recognizable by target equipment; the target equipment is the Internet of things equipment or the cloud platform;
And sending the data to be transmitted in the target data format to the target equipment.
5. A protocol conversion device, comprising:
the configuration acquisition module is used for acquiring a configuration page of the Internet of things gateway, wherein the configuration page of the Internet of things gateway comprises an Internet of things device configuration page, a cloud platform configuration page and a protocol conversion configuration page;
the first response module is used for responding to a first configuration operation of the configuration page of the Internet of things equipment and determining a first data format of the Internet of things equipment based on the first configuration operation;
the second response module is used for responding to a second configuration operation of the cloud platform configuration page and determining a second data format of the cloud platform based on the second configuration operation;
the third response module is used for responding to a third configuration operation of the protocol conversion configuration page and determining a target conversion rule between the Internet of things device and the cloud platform based on the third configuration operation;
the conversion module is used for converting the first data format and the second data format based on the target conversion rule;
the export module is used for responding to the export operation of the configuration information, exporting the configuration information of the Internet of things device corresponding to the first configuration operation, the configuration information of the cloud platform corresponding to the second configuration operation and the protocol conversion configuration information corresponding to the third configuration operation based on the export operation; multiplexing the configuration information of the Internet of things device, the configuration information of the cloud platform and the configuration information of the protocol conversion;
Wherein the third response module comprises: the editing sub-module is used for responding to editing operation on protocol conversion and generating at least one protocol conversion rule based on the editing operation; a selection sub-module for determining the target conversion rule based on a selection operation of at least one protocol conversion rule in response to the selection operation;
wherein, the conversion module includes:
a format determination submodule, configured to determine a source data format and a target data format from the first data format and the second data format based on the target conversion rule;
an element extraction sub-module, configured to extract a first data element in the source data format and a second data element in the target data format, respectively;
a mapping determination submodule for determining a mapping relation between the first data element and the second data element;
the data conversion sub-module is used for converting the source data format into the target data format based on the mapping relation;
the element extraction sub-module is further used for responding to the connection operation of the first data element and the second data element, and determining the connection relation between the first data element and the second data element based on the connection operation; and determining a mapping relation between the first data element and the second data element based on the connection relation.
6. A data transmission apparatus, comprising:
the data acquisition module is used for acquiring data to be transmitted, and the data to be transmitted comprises: the data uploaded to the cloud platform by the internet of things device and/or the data issued to the internet of things device by the cloud platform;
a data conversion module, configured to perform protocol conversion on the data to be transmitted based on the protocol conversion method according to any one of claims 1 to 3, and convert the data to be transmitted into a target data format that can be identified by a target device; the target equipment is the Internet of things equipment or the cloud platform;
and the sending module is used for sending the data to be transmitted in the target data format to the target equipment.
7. A gateway, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the protocol conversion method of any one of claims 1-3 or the data transmission method of claim 4.
8. A computer-readable storage medium storing computer instructions for causing a computer to perform the protocol conversion method of any one of claims 1 to 3 or the data transmission method of claim 4.
CN202310134512.6A 2023-02-20 2023-02-20 Protocol conversion method, data transmission method, device, gateway and storage medium Active CN115834726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310134512.6A CN115834726B (en) 2023-02-20 2023-02-20 Protocol conversion method, data transmission method, device, gateway and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310134512.6A CN115834726B (en) 2023-02-20 2023-02-20 Protocol conversion method, data transmission method, device, gateway and storage medium

Publications (2)

Publication Number Publication Date
CN115834726A CN115834726A (en) 2023-03-21
CN115834726B true CN115834726B (en) 2023-07-21

Family

ID=85521901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310134512.6A Active CN115834726B (en) 2023-02-20 2023-02-20 Protocol conversion method, data transmission method, device, gateway and storage medium

Country Status (1)

Country Link
CN (1) CN115834726B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111416845A (en) * 2020-03-12 2020-07-14 腾讯云计算(北京)有限责任公司 Method and device for configuring edge device and storage medium
WO2023011274A1 (en) * 2021-08-04 2023-02-09 京东方科技集团股份有限公司 Communication protocol conversion method, and device, system, and gateway device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10425501B2 (en) * 2014-08-05 2019-09-24 Moxie Software, Inc. Element mapping and rule building systems and methods for contextual site visitor engagement
CN111600792A (en) * 2020-04-26 2020-08-28 珠海格力电器股份有限公司 Gateway device, device control system, device control method and device
CN112055062B (en) * 2020-08-21 2024-04-09 深圳市信锐网科技术有限公司 Data communication method, device, equipment and readable storage medium
CN114760368A (en) * 2022-04-28 2022-07-15 京东方科技集团股份有限公司 Data transmission method and related equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111416845A (en) * 2020-03-12 2020-07-14 腾讯云计算(北京)有限责任公司 Method and device for configuring edge device and storage medium
WO2023011274A1 (en) * 2021-08-04 2023-02-09 京东方科技集团股份有限公司 Communication protocol conversion method, and device, system, and gateway device

Also Published As

Publication number Publication date
CN115834726A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
CN110795148A (en) Method and device for generating layout file and electronic equipment
CN108153670A (en) A kind of interface test method, device and electronic equipment
US11509505B2 (en) Method and apparatus for operating smart network interface card
CN106550038B (en) Data configuration diagnosis system and method of digital control system
CN107957940B (en) Test log processing method, system and terminal
CN111556158B (en) Access method, access device, access equipment and storage medium of Internet of things platform
CN110321154A (en) A kind of interface message methods of exhibiting, device and the electronic equipment of micro services
US20140280469A1 (en) Method and apparatus for remote management of computer system using handheld device
WO2019165773A1 (en) Method and system for generating gpu card slot position information
CN111008180A (en) Method and device for collecting log files in container and electronic equipment
JP5975396B2 (en) Device management system, management device and device used therefor
CN115834726B (en) Protocol conversion method, data transmission method, device, gateway and storage medium
CN110489304B (en) Method and device for monitoring resource access state between systems
CN111277569B (en) Network message decoding method and device and electronic equipment
CN110380902B (en) Topological relation generation method and device, electronic equipment and storage medium
CN115695090A (en) Data transmission method, internet of things gateway equipment and computer readable storage medium
CN112527453B (en) Virtualization information simulation system, method and computer-readable storage medium
CN114172978A (en) Multi-protocol equipment access method and related device
CN114554618A (en) Wireless access point device, equipment access method, equipment and storage medium
CN114428747A (en) User interface testing method, device, server and storage medium
US20180268036A1 (en) Communication information generating apparatus, communication information generating method, recording medium, and communication management system
KR102006212B1 (en) Method and apparatus for generating python script used in first simulator by converting xml script used in second simulator
CN111538666A (en) Method and device for collecting test results in batches, computer equipment and storage medium
CN112230891A (en) Interface document integration method and device, server and computer storage medium
CN107870854B (en) Method and device for testing data accuracy of chart library

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