Edge gateway communication method, device, computer equipment and storage medium

The edge gateway obtains and uses the protocol configuration data provided by the protocol configuration end, and realizes communication with multiple devices, solving the problem of insufficient applicability of existing gateways and improving the protocol conversion capability between devices.

CN112399446BActive Publication Date: 2024-12-24YUNDI SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011109357.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-16
Publication Date
2024-12-24
Estimated Expiration
2040-10-16

AI Technical Summary

Technical Problem

Existing IoT gateway products usually only support one to two communication protocol conversions, resulting in insufficient applicability and inability to meet the flexible communication needs between multiple devices.

Method used

The edge gateway obtains the protocol configuration data corresponding to the target device type provided by the protocol configuration end, reads the communication process, and performs data packets and unpacks according to the protocol data structure to realize communication with the target device, and supports multiple protocol conversions.

Benefits of technology

It improves the applicability of edge gateways, can flexibly adapt to multiple device protocols, realizes communication with devices that support various protocols, and solves the problem of insufficient conversion capabilities of traditional gateway protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112399446B_ABST
    Figure CN112399446B_ABST
Patent Text Reader

Abstract

The present application relates to an edge gateway communication method, device, computer equipment and storage medium. The method includes: the edge gateway obtains the target protocol configuration data configured by the protocol configuration end; reads the communication process configured in the target protocol configuration data; for the current to-be-executed process in the communication process, performs data protocol packaging according to the protocol data structure configured in the target protocol configuration data, and obtains the communication data packet corresponding to the current to-be-executed process; the edge gateway sends the communication data packet to the target device; the edge gateway receives the reply data packet returned by the target device for the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain the reply data. This method can improve the applicability of the edge gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an edge gateway communication method, device, computer equipment and storage medium. Background Art

[0002] With the development of wireless communication technology, the Internet of Things (IoT) is also developing day by day. Devices with different communication protocol standards can achieve communication after the communication protocol is converted through the IoT gateway.

[0003] At present, equipment manufacturers have their own communication protocol standards. When using equipment from different manufacturers to communicate, it is necessary to convert various communication protocols. However, most IoT gateway products currently only support one or two standard communication protocol conversions. If there are special needs, additional customized development is required. Therefore, traditional methods are too limited and not very applicable. Summary of the invention

[0004] Based on this, it is necessary to provide an edge gateway communication method, device, computer equipment and storage medium that can improve applicability in response to the above technical problems.

[0005] An edge gateway communication method, the method comprising:

[0006] The edge gateway obtains the target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is the protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated;

[0007] Reading the communication process configured in the target protocol configuration data;

[0008] For the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed;

[0009] The edge gateway sends the communication data packet to the target device;

[0010] The edge gateway receives a reply data packet returned by the target device in response to the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain reply data.

[0011] In one embodiment, the edge gateway obtains the target protocol configuration data configured by the protocol configuration terminal, including:

[0012] After being started, the edge gateway detects whether there is target protocol configuration data configured corresponding to the device type of the target device locally;

[0013] When present, the edge gateway reads the target protocol configuration data locally;

[0014] When it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end.

[0015] In one embodiment, when the target protocol configuration data does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end, including:

[0016] When it does not exist, an alarm message is issued; receiving the target protocol configuration data configured and issued by the protocol configuration end in response to the alarm message; or,

[0017] When it does not exist, the edge gateway sends a protocol configuration download request to the protocol configuration end; and receives the target protocol configuration data returned by the protocol configuration end in response to the protocol configuration download request.

[0018] In one of the embodiments, before the edge gateway obtains the target protocol configuration data configured by the protocol configuration terminal, the method further includes:

[0019] When deploying the edge gateway, receiving the target protocol configuration data sent from the protocol configuration terminal and storing it locally;

[0020] The edge gateway obtains target protocol configuration data configured by the protocol configuration end, including:

[0021] The edge gateway obtains the target protocol configuration data stored locally.

[0022] In one embodiment, for the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed, including:

[0023] For the current to-be-executed process in the communication process, according to the protocol data structure configured in the protocol configuration data, for the defined protocol field, fill in the data corresponding to the data source bound to the protocol field, or fill in the data bound to the protocol field;

[0024] The data obtained after filling is converted into a target data format to obtain a communication data packet corresponding to the current process to be executed.

[0025] In one embodiment, the method further comprises:

[0026] After the edge gateway sends the communication data packet to the target device, when the communication with the target device is normal, the step of the edge gateway receiving a reply data packet returned by the target device in response to the communication data packet is performed;

[0027] When communication with the target device is abnormal, the edge gateway is re-executed to send the communication data packet to the target device;

[0028] When the number of re-issuances reaches a preset number threshold and there is still an abnormality in communication with the target device, a protocol configuration error alarm message is issued.

[0029] In one of the embodiments, the target protocol configuration data is obtained by the protocol configuration end by executing a protocol configuration step;

[0030] The protocol configuration step includes:

[0031] Configuring a communication process between the edge gateway and the target device under a target protocol;

[0032] Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field;

[0033] After the integrity check of the configured communication process is passed, the information configured for the target protocol is saved to obtain the target protocol configuration data.

[0034] An edge gateway communication device, the device comprising:

[0035] An acquisition module, used to acquire target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is the protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated;

[0036] A reading module, used to read the communication process configured in the target protocol configuration data;

[0037] A packaging module, used for performing data protocol packaging according to the protocol data structure configured in the target protocol configuration data for the current to-be-executed process in the communication process, to obtain a communication data packet corresponding to the current to-be-executed process;

[0038] A sending module, used for sending the communication data packet to the target device;

[0039] The unpacking module is used to receive a reply data packet returned by the target device in response to the communication data packet, and unpack the reply data packet according to the protocol data structure to obtain reply data.

[0040] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] Acquire target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated;

[0042] Reading the communication process configured in the target protocol configuration data;

[0043] For the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed;

[0044] Sending the communication data packet to the target device;

[0045] A reply data packet returned by the target device in response to the communication data packet is received, and the reply data packet is unpacked according to the protocol data structure to obtain reply data.

[0046] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0047] Acquire target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated;

[0048] Reading the communication process configured in the target protocol configuration data;

[0049] For the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed;

[0050] Sending the communication data packet to the target device;

[0051] A reply data packet returned by the target device in response to the communication data packet is received, and the reply data packet is unpacked according to the protocol data structure to obtain reply data.

[0052] In the above-mentioned edge gateway communication method, device, computer equipment and storage medium, the edge gateway directly obtains the target protocol configuration data corresponding to the device type of the target device to be communicated from the protocol configuration end, without the need to fix the development protocol to the edge gateway. Based on the communication process configured in the target protocol configuration data, the edge gateway can know the current process to be executed, and perform data protocol packaging according to the protocol data structure configured in the target protocol configuration data to obtain the communication data packet corresponding to the current process to be executed. The edge gateway sends the communication data packet to the target device. Since the packet is based on the protocol data structure configured corresponding to the device type of the target device, the communication data packet sent can be recognized by the target device, and then the edge gateway receives the reply data packet returned by the target device for the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain the reply data. Thus, the communication between the edge gateway and the devices supporting various protocols can be realized through flexible protocol configuration, which solves the problem of edge gateway protocol conversion, and then effectively improves the applicability of the edge gateway.

[0053] An edge gateway communication method, the method comprising:

[0054] Configuring a communication process between the edge gateway and the target device under a target protocol;

[0055] Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field to obtain a protocol data structure;

[0056] After the integrity check of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device;

[0057] Send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0058] An edge gateway communication device, the device comprising:

[0059] A configuration module is used to configure the communication process between the edge gateway and the target device under the target protocol; configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to obtain a protocol data structure; after the integrity test of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device;

[0060] The sending module is used to send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0061] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0062] Configuring a communication process between the edge gateway and the target device under a target protocol;

[0063] Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field to obtain a protocol data structure;

[0064] After the integrity check of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device;

[0065] Send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0066] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0067] Configuring a communication process between the edge gateway and the target device under a target protocol;

[0068] Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field to obtain a protocol data structure;

[0069] After the integrity check of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device;

[0070] Send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0071] The above-mentioned edge gateway communication method, device, computer equipment and storage medium, first, configure the communication process between the edge gateway and the target device under the target protocol. Then, configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to obtain a protocol data structure. Further, after the integrity detection of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device. After the previous three steps, the target protocol configuration data obtained at this time is the target protocol configuration data that has a complete communication process detected by the protocol configuration end and can be adapted to the target device. The edge gateway can directly communicate with the target device according to the target protocol configuration data adapted to the target device. That is, through flexible protocol configuration, it is possible to realize communication between the edge gateway and devices supporting various protocols, solve the problem of edge gateway protocol conversion, and thus effectively improve the applicability of the edge gateway. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 An application environment diagram of an edge gateway communication method in an embodiment;

[0073] Figure 2 A schematic diagram of a flow chart of an edge gateway communication method in one embodiment;

[0074] Figure 3 A system architecture diagram of an edge gateway communication method in an embodiment;

[0075] Figure 4 A schematic flow chart of the steps of an edge gateway communication method in another embodiment;

[0076] Figure 5 A schematic diagram of a flow chart of an edge gateway communication method in another embodiment;

[0077] Figure 6 is a structural block diagram of an edge gateway communication device in one embodiment;

[0078] Figure 7 is a structural block diagram of an edge gateway communication device in one embodiment;

[0079] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0081] The edge gateway communication method provided in this application can be applied to Figure 1 In the application environment shown in the figure, the edge gateway 104 communicates with the protocol configuration terminal 102 and the device 106 through the network.

[0082] The edge gateway 104 can be implemented by an intelligent router with a gateway function or by a dedicated gateway product. The protocol configuration terminal 102 can be a cloud platform or a protocol configuration software. The device 106 can be an intelligent device with computing capabilities. The device 106 can be an Internet of Things device. The device 106 includes, but is not limited to, various personal computers, laptops, smart phones, tablet computers, portable wearable devices, smart TVs, smart speakers, smart air conditioners, and smart printers.

[0083] In one embodiment, Figure 2 As shown, an edge gateway communication method is provided, which can be implemented by an edge gateway or by interaction between an edge gateway and a protocol configuration terminal. Figure 1 The following steps are used as an example to illustrate the edge gateway in the example:

[0084] In step 202, the edge gateway obtains the target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is the protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated.

[0085] Among them, the edge gateway is a gateway deployed at the edge of the network and has edge computing capabilities. The edge gateway can connect to the protocol configuration end through the network, and connect to the device end through the network and protocol conversion function. It can be understood that the edge gateway can obtain the target protocol configuration data configured by the protocol configuration end through the communication connection with the protocol configuration end. It can be understood that the edge computing capability of the edge gateway can be used to analyze data related to the device in real time and provide lightweight connection management.

[0086] Protocol, short for network protocol, is the pre-agreed rules that both parties must follow when the edge gateway and the device communicate. It can be understood that the two parties must perform data encapsulation or decapsulation according to the agreed protocol rules in order to achieve mutual communication.

[0087] The protocol configuration terminal is used to configure the corresponding protocol configuration data according to the device type.

[0088] In one embodiment, the protocol configuration end may be a device installed with protocol configuration software, or a cloud platform, etc. The protocol configuration software is software for performing protocol configuration (ie, software with a protocol configuration function).

[0089] The target device refers to the device to be communicated by the edge gateway, that is, the device with which the edge gateway is going to communicate.

[0090] The target protocol configuration data is the protocol configuration data configured in advance by the protocol configuration end for the device type of the target device to be communicated. The protocol configuration data is the configured protocol data. That is, the protocol data to be used between the target device and the edge gateway is configured in advance in the protocol configuration end, and the target protocol configuration data is obtained.

[0091] In one embodiment, the target protocol configuration data includes a configured communication process and a configured protocol data structure.

[0092] Specifically, the technician can configure the protocol configuration data in advance on the protocol configuration end for the device type of the target device. When the edge gateway needs to communicate with the target device, it can obtain the target protocol configuration data configured by the protocol configuration end to prepare for communication with the target device.

[0093] It can be understood that when the edge gateway wants to communicate with the target device, the edge gateway can request to download the configured target protocol configuration data from the protocol configuration end, or directly obtain the target protocol configuration data configured by the protocol configuration end that has been stored locally in the edge gateway.

[0094] Step 204: read the communication process configured in the target protocol configuration data.

[0095] The communication process refers to the process agreed upon by the edge gateway and the user equipment for communication. It can be understood that when the edge gateway communicates with the user equipment, it is necessary to communicate according to the communication process configured in the target protocol configuration data.

[0096] It can be understood that the communication process may include information such as the agreed communication method, the total communication steps required, the meaning represented by each communication step, and the order between the communication steps.

[0097] It should be noted that the communication processes defined by different protocols are different, that is, the devices using different protocols have different corresponding communication processes. Therefore, the edge gateway can obtain the protocol configuration data of the devices using different protocols from the protocol configuration terminal, and communicate with each device according to the communication process configured in the protocol configuration data.

[0098] For example, the communication process for Mitsubishi series devices (i.e. devices using the Mitsubishi communication protocol) is "gateway reads, device replies data, gateway replies confirmation information", but for Modbus-RTU devices (i.e. devices using the modbus communication protocol), the communication process only requires "gateway reads, device replies data".

[0099] Specifically, the edge gateway reads the acquired target protocol configuration data to obtain the communication process defined for the target device configured in the target protocol configuration data.

[0100] Step 206, for the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed.

[0101] The currently executed process refers to the process that the edge gateway in the communication process is currently going to execute.

[0102] The protocol data structure is a defined data communication format.

[0103] In one embodiment, the configured protocol data structure may include the meaning and length of each defined field, as well as the data source bound to the field, or the data directly bound to the field.

[0104] For example: the first byte of the Mitsubishi series protocol is the start character, the second byte is the device station number, the start character is fixed to the specified character, the device station number is bound to the device unit number mounted in the gateway configuration, and so on.

[0105] Data protocol packetization is the process of filling the data to be sent according to the protocol data structure and converting it into the target data format.

[0106] Communication data packets are data packets obtained after data protocol encapsulation and used to send to devices.

[0107] Specifically, the edge gateway further learns the current process to be executed from the communication process defined by the device manufacturer configured in the read target protocol configuration data. The edge gateway can perform data protocol packaging according to the protocol data structure configured in the target protocol configuration data to obtain the communication data packet corresponding to the current process to be executed.

[0108] Step 208: The edge gateway sends a communication data packet to the target device.

[0109] Among them, sending refers to the action of sending communication data packets to the device from the edge gateway side.

[0110] Specifically, the edge gateway confirms that the network connection to the device is normal and there is no network disconnection, and then sends the communication data packet corresponding to the current process to be executed to the device.

[0111] In step 210, the edge gateway receives a reply data packet returned by the target device in response to the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain reply data.

[0112] Among them, the reply data packet is a data packet returned to the edge gateway after the device side performs data protocol packaging for the data returned by the edge gateway request according to the protocol data structure pre-configured by the manufacturer, and contains real-time information on the device side.

[0113] Unpacking is the process by which the edge gateway or device side extracts useful data from the reply data packet in turn according to the data structure of the protocol configured by the protocol.

[0114] Response data refers to the data replied by the device, which represents the real-time information on the device side.

[0115] Specifically, after receiving the communication data packet sent by the edge gateway, the device communicating with the edge gateway unpacks and extracts the actual data, obtains the data required by the edge gateway, and then, according to the protocol data structure pre-configured by the manufacturer, performs data protocol packaging for the data requested to be returned by the edge gateway, and returns it to the edge gateway. After the edge gateway receives the reply data packet returned by the target device for the communication data packet, it unpacks the reply data packet according to the protocol data structure to obtain the reply data, thereby realizing the communication between the edge gateway and the device.

[0116] In one embodiment, in a specific embodiment, reference Figure 3 System architecture diagram of the edge gateway communication method. The protocol configuration end, i.e., the "protocol configuration software" or "cloud platform", issues the protocol. The edge gateway receives the target protocol configuration data issued by the protocol configuration end, performs data protocol packaging / protocol unpacking according to the target protocol configuration data, and realizes communication with the target device.

[0117] In the above-mentioned edge gateway communication method, device, computer equipment and storage medium, the edge gateway directly obtains the target protocol configuration data configured for the device type of the target device to be communicated from the protocol configuration end, without the need to fix the development protocol to the edge gateway. Based on the communication process configured in the target protocol configuration data, the edge gateway can know the current process to be executed, and perform data protocol packaging according to the protocol data structure configured in the target protocol configuration data to obtain the communication data packet corresponding to the current process to be executed. The edge gateway sends a communication data packet to the target device. Since the packet is based on the protocol data structure configured corresponding to the device type of the target device, the communication data packet sent can be recognized by the target device, and then the edge gateway receives the reply data packet returned by the target device for the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain the reply data. Thus, through flexible protocol configuration, it is possible to realize the communication between the edge gateway and devices supporting various protocols, solve the problem of edge gateway protocol conversion, and then effectively improve the applicability of the edge gateway.

[0118] In one embodiment, the edge gateway obtains the target protocol configuration data configured by the protocol configuration end, including: after the edge gateway is started, it detects whether there is target protocol configuration data configured corresponding to the device type of the target device locally; when it exists, the edge gateway reads the target protocol configuration data from the local; when it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end.

[0119] Specifically, after the edge gateway is started, it will first detect whether there is target protocol configuration data configured corresponding to the device type of the target device in its local storage folder. If the local storage folder stores the target protocol configuration data, the edge gateway directly reads the target protocol configuration data from the local folder. If the local storage folder does not store the target protocol configuration data, the edge gateway needs to obtain the target protocol configuration data from the protocol configuration end.

[0120] In a specific embodiment, reference Figure 4 The flow diagram of the edge gateway communication method steps shows that after the edge gateway is started, it will detect whether there is a target protocol configuration data corresponding to the device type of the target device locally, that is, "check whether there is corresponding protocol configuration data". When the target protocol configuration data exists, the edge gateway reads the target protocol configuration data from the local, that is, "read configuration".

[0121] In this embodiment, the edge gateway detects whether the local storage folder stores target protocol configuration data corresponding to the device type of the target device, which can reduce the workload of backstage staff for self-detection.

[0122] In one embodiment, when it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end, including: when it does not exist, issuing an alarm message; receiving the target protocol configuration data configured and issued by the protocol configuration end in response to the alarm message.

[0123] Among them, the alarm information is issued by the edge gateway to inform the staff that the target protocol configuration data is not stored in the local storage folder of the edge gateway.

[0124] Specifically, when the edge gateway detects that the local storage folder does not store the target protocol configuration data, it issues an alarm message to inform the staff that the edge gateway cannot be used normally and lacks the required protocol configuration data. The staff goes to the protocol configuration end to configure the target protocol configuration data based on the alarm message. The protocol configuration end then sends the target protocol configuration data to the edge gateway.

[0125] In one embodiment, when it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end, including: when it does not exist, the edge gateway sends a protocol configuration download request to the protocol configuration end; and receives the target protocol configuration data returned by the protocol configuration end in response to the protocol configuration download request.

[0126] In a specific embodiment, when the edge gateway detects that the local storage folder does not store the target protocol configuration data, it sends a protocol configuration download request to the protocol configuration end. If the target protocol configuration data returned by the protocol configuration end for the protocol configuration download request can be successfully received, there is no need to send an alarm message to the staff.

[0127] In this embodiment, the edge gateway automatically checks the local storage folder and finds that the target protocol configuration data is not stored, and then automatically requests the protocol configuration end to send it. If the target protocol configuration data can be received, it will no longer send an alarm to the relevant staff. If the protocol configuration end cannot send the target protocol configuration data, it will send an alarm message to inform the staff to go to the protocol configuration end to configure the target protocol configuration data. In this way, it can help the staff to determine that the alarm message is sent because the protocol configuration end has not configured the target protocol configuration data.

[0128] In one embodiment, before the edge gateway obtains the target protocol configuration data configured by the protocol configuration end, the method also includes: when deploying the edge gateway, receiving the target protocol configuration data issued from the protocol configuration end and storing it locally; the edge gateway obtains the target protocol configuration data configured by the protocol configuration end, including: the edge gateway obtains the locally stored target protocol configuration data.

[0129] Specifically, before the edge gateway obtains the target protocol configuration data configured by the protocol configuration end, the edge gateway will be deployed first. When deploying the edge gateway, the technician can first edit the protocol data structure definition on the protocol configuration end to adapt to the protocol used by the target device. After the editing is completed, the target protocol configuration data is obtained and sent to the edge gateway via wired / wireless. The edge gateway can then store the target protocol configuration data sent from the protocol configuration end locally. When the edge gateway is deployed and started, the stored target protocol configuration data can be obtained locally.

[0130] In this embodiment, the target protocol configuration data is received and stored locally when the edge gateway is deployed. The staff does not need to trigger the deployment completion control after completing the edge gateway deployment. The edge gateway then receives the target protocol configuration data, which can reduce the waiting time of the staff. If the download is successful, it can also further reduce the subsequent staff's inspection of the edge gateway deployment work, thereby reducing the workload of the staff and speeding up the progress of the project.

[0131] In one embodiment, for the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the protocol configuration data to obtain a communication data packet corresponding to the current process to be executed, including: for the current process to be executed in the communication process, according to the protocol data structure configured in the protocol configuration data, for the defined protocol field, filling in the data corresponding to the data source bound to the protocol field, or filling in the data bound to the protocol field; converting the data obtained after filling into the target data format to obtain a communication data packet corresponding to the current process to be executed.

[0132] Among them, the device protocol is essentially a string of data. To achieve communication with the device, we need to write the corresponding data in the corresponding protocol field according to the protocol data structure formulated by the device manufacturer to achieve communication.

[0133] It can be understood that for different protocols, the data type of the data written in the protocol field is different. For example, the data type of the Mitsubishi series protocol is ASCII code stream, and the data type of the Modbus-RTU protocol is hexadecimal.

[0134] Data source refers to the source of substantial data.

[0135] It can be understood that when the protocol field is bound to data rather than a data source, there is no need to retrieve the corresponding data through the data source, but the bound corresponding data is directly filled into the protocol field.

[0136] Specifically, the edge gateway, for the current process to be executed in the communication process, takes out substantial data to fill in the protocol field according to the protocol data structure configured in the protocol configuration data and the data source bound to the protocol field for the defined protocol field, converts the filled data into the target data format, and obtains the communication data packet corresponding to the current process to be executed.

[0137] In a specific embodiment, when the protocol field is bound to data rather than a data source, the data bound to the protocol field is directly filled in, and the filled data is converted into a target data format to obtain a communication data packet corresponding to the current process to be executed.

[0138] In a specific embodiment, reference Figure 4 The schematic diagram of the process of edge gateway communication method steps shows the process of edge gateway performing data protocol packet encapsulation. For the current process to be executed in the communication process, data protocol packet encapsulation is performed according to the protocol data structure configured in the protocol configuration data, that is, corresponding to Figure 4 Follow the steps of "Execute the communication process according to the protocol configuration" and "Fill in data according to the protocol field information" in the configuration.

[0139] In this embodiment, the edge gateway obtains the target protocol configuration data configured by the protocol configuration terminal, and fills the data corresponding to the protocol field for the defined protocol field according to the protocol data structure configured in the target protocol configuration data, or fills the data bound to the protocol field. Then, the data obtained after filling is converted into the target data format to obtain the communication data packet corresponding to the current process to be executed. The entire protocol configuration process does not require manual pre-setting of the protocol configuration of the edge gateway, but is obtained through the protocol configuration terminal. It does not require manual filling of the protocol data but is filled in by itself, so that the edge gateway can adapt to equipment from different manufacturers, thereby improving the adaptability of the edge gateway.

[0140] In one embodiment, the method also includes: after the edge gateway sends a communication data packet to the target device, when communication with the target device is normal, executing the step of the edge gateway receiving a reply data packet returned by the target device for the communication data packet; when communication with the target device is abnormal, re-executing the edge gateway to send the communication data packet to the target device; when the number of re-sending reaches a preset number threshold and communication with the target device is still abnormal, issuing a protocol configuration error alarm message.

[0141] Specifically, after the edge gateway sends a communication data packet to the target device, if the communication with the target device is normal, the device can receive the communication data packet sent by the edge gateway. The device unpacks the communication data packet sent by the edge gateway according to the protocol data structure, extracts the required substantial data, and obtains the substantial data that the edge gateway needs to reply. The device encapsulates the substantial data that the edge gateway needs to reply according to the data protocol structure and sends the reply data packet to the edge gateway.

[0142] When the edge gateway does not obtain the reply data packet uploaded by the device and exceeds the preset time threshold, it is determined that the communication with the target device is abnormal, and the edge gateway re-executes the communication data packet to the target device.

[0143] When the number of re-issuances reaches a preset threshold and there is still an abnormality in communication with the target device, a protocol configuration error alarm message is issued.

[0144] In a specific embodiment, reference Figure 4 The flow chart of the edge gateway communication method shows that when the edge gateway communicates with the device, it will "determine whether the device is communicating normally". When the device receives the communication data packet sent by the gateway, that is, "receive data", it will determine whether the protocol is correct. If the protocol is correct, it will perform data protocol packaging according to the protocol data structure and upload the reply data packet to the edge gateway. If the reply data packet uploaded by the device can be received, it is normal communication, and the reply data packet uploaded by the device will be unpacked, that is, "extract data according to the protocol configuration". If the reply data packet uploaded by the device has not been received after the preset time threshold, it will first determine whether there is a problem in the process of sending the communication data packet, that is, the edge gateway will send the communication data packet again. In this real-time example, the preset threshold for the number of re-sending is 3 times. After the communication data packet is re-sent three times, if the reply data packet uploaded by the device has not been received after the preset time threshold, a protocol configuration error alarm message is issued.

[0145] In this embodiment, by obtaining the reply data packet uploaded by the device, the edge gateway unpacks the reply data packet to extract the actual data and uploads it to the cloud platform. The operation and maintenance personnel can monitor the status of the device in real time by viewing the real-time data uploaded by the edge gateway on the cloud platform.

[0146] In one embodiment, the target protocol configuration data is obtained by configuring the protocol configuration end by executing the protocol configuration steps; the protocol configuration steps include: configuring the communication process between the edge gateway and the target device under the target protocol; configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding data or data source filled in each protocol field; after the integrity check of the configured communication process is passed, the information configured for the target protocol is saved to obtain the target protocol configuration data.

[0147] The information configured for the target protocol includes the configured communication process and the relevant information of the protocol data structure of the configured target protocol. The relevant information of the protocol data structure of the target protocol includes the meaning and field length of each protocol field in the target protocol, and binds the data or data source filled in each protocol field accordingly.

[0148] Specifically, on the protocol configuration side, configure the communication process between the edge gateway and the target device under the target protocol, then configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to complete the configuration process for the target protocol.

[0149] Before sending the protocol configuration data to the edge gateway, the integrity of the configured communication process is first tested. After the test is successful, the target protocol configuration data is sent to the edge gateway. If there is a problem, the target protocol is reconfigured until it is configured properly and then the target protocol configuration data is sent to the edge gateway. The edge gateway saves the target protocol configuration data to a local storage folder.

[0150] In a specific embodiment, reference Figure 4 The flow diagram of the edge gateway communication method steps shows the process of the protocol configuration end configuring the protocol flow. Configure the communication flow between the edge gateway and the target device under the target protocol, that is, "Configure the communication flow of the device". Configure the meaning and field length of each protocol field in the target protocol, that is, "Define the meaning and byte length of each protocol field".

[0151] In this embodiment, in different projects, for different manufacturers' equipment, the protocol configuration data corresponding to the equipment is downloaded specifically. What kind of protocol configuration data is needed is downloaded, and there is no need to store one or two protocol configuration data in the edge gateway. This solves the problem that traditional gateways cannot communicate with many devices and have poor applicability, thereby improving the applicability of edge gateways.

[0152] In one embodiment, Figure 5 As shown, an edge gateway communication method is provided, which can be implemented through a protocol configuration terminal. Figure 1 The protocol configuration end in the example is used to illustrate, including the following steps:

[0153] Step 502, configuring the communication process between the edge gateway and the target device under the target protocol.

[0154] Step 504: configure the meaning and field length of each protocol field in the target protocol, and bind the corresponding filled data or data source of each protocol field to obtain a protocol data structure.

[0155] Step 506: After the integrity check of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device.

[0156] Step 508: Send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0157] The above-mentioned edge gateway communication method, first, configures the communication process between the edge gateway and the target device under the target protocol. Then, configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to obtain a protocol data structure. Further, after the integrity detection of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device. After the previous three steps, the target protocol configuration data obtained at this time is the target protocol configuration data that has a complete communication process detected by the protocol configuration end and can be adapted to the target device. The edge gateway can directly communicate with the target device according to the target protocol configuration data adapted to the target device. That is, through flexible protocol configuration, it is possible to realize communication between the edge gateway and devices supporting various protocols, solve the problem of edge gateway protocol conversion, and thus effectively improve the applicability of the edge gateway.

[0158] It should be understood that, although each step in the flow chart in each embodiment of the present application is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart in each embodiment of the present application may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.

[0159] In one embodiment, Figure 6 As shown, an edge gateway communication device 500 is provided, which is arranged in an edge gateway. The device 600 includes: an acquisition module 602, a reading module 604, a packaging module 606, a sending module 608 and an unpacking module 610, wherein:

[0160] The acquisition module 602 is used to acquire the target protocol configuration data configured by the protocol configuration end; the target protocol configuration data is the protocol configuration data configured in advance by the protocol configuration end corresponding to the device type of the target device to be communicated.

[0161] The reading module 604 is used to read the communication process configured in the target protocol configuration data.

[0162] The packaging module 606 is used to perform data protocol packaging according to the protocol data structure configured in the target protocol configuration data for the current to-be-executed process in the communication process, so as to obtain a communication data packet corresponding to the current to-be-executed process.

[0163] The sending module 608 is used to send the communication data packet to the target device.

[0164] The unpacking module 610 is used to receive a reply data packet returned by the target device in response to the communication data packet, and unpack the reply data packet according to the protocol data structure to obtain reply data.

[0165] In one embodiment, the acquisition module 602 is also used to detect whether there is target protocol configuration data configured corresponding to the device type of the target device locally after the edge gateway is started; if it exists, the target protocol configuration data is read locally; if it does not exist, the target protocol configuration data is obtained from the protocol configuration end.

[0166] In one embodiment, the acquisition module 602 is further used to issue an alarm message when it does not exist; and receive the target protocol configuration data configured and issued by the protocol configuration end in response to the alarm message.

[0167] In one embodiment, the acquisition module 602 is further configured to send a protocol configuration download request to the protocol configuration end when the protocol configuration does not exist; and receive the target protocol configuration data returned by the protocol configuration end in response to the protocol configuration download request.

[0168] In one embodiment, the acquisition module 602 is further used to receive the target protocol configuration data sent from the protocol configuration terminal and store it locally when the edge gateway is deployed; and acquire the locally stored target protocol configuration data.

[0169] In one embodiment, the packaging module 606 is also used to fill in the data corresponding to the data source bound to the protocol field for the current process to be executed in the communication process according to the protocol data structure configured in the protocol configuration data, or fill in the data bound to the protocol field; convert the data obtained after filling into the target data format to obtain a communication data packet corresponding to the current process to be executed.

[0170] In one embodiment, after sending a communication data packet to the target device, when communication with the target device is normal, the sending module 608 is also used to notify the unpacking module 610 to execute the step of receiving a reply data packet returned by the target device for the communication data packet; when communication with the target device is abnormal, the communication data packet is re-sent to the target device; when the number of re-sending reaches a preset number threshold and communication with the target device is still abnormal, a protocol configuration error alarm message is issued.

[0171] In one embodiment, the apparatus further comprises:

[0172] The configuration module (not shown in the figure) is used to configure the communication process between the edge gateway and the target device under the target protocol; configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly; after the integrity check of the configured communication process is passed, the information configured for the target protocol is saved to obtain the target protocol configuration data. It can be understood that the configuration module can be a module set in the protocol configuration end. In this embodiment, the edge gateway communication device is a device composed of the modules in the edge gateway and the protocol configuration end.

[0173] In one embodiment, Figure 7 As shown, an edge gateway communication device 700 is provided, which is arranged in a protocol configuration terminal. The device 700 includes: a configuration module 702 and a sending module 704, wherein:

[0174] Configuration module 702, used to configure the communication process between the edge gateway and the target device under the target protocol; also used to configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to obtain a protocol data structure; also used to save the communication process and the protocol data structure configured for the target protocol after the integrity test of the configured communication process passes, and obtain the target protocol configuration data configured corresponding to the device type of the target device;

[0175] The sending module 704 is used to send the target protocol configuration data to the edge gateway; wherein the target protocol configuration data is used to instruct the edge gateway to communicate with the target device according to the target protocol configuration data.

[0176] For the specific definition of the edge gateway communication device, please refer to the definition of the edge gateway communication method above, which will not be repeated here. Each module in the above-mentioned edge gateway communication device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0177] In one embodiment, a computer device is provided. The computer device may be a protocol configuration terminal or an edge gateway. The internal structure diagram thereof may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an edge gateway communication method is implemented.

[0178] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0179] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the edge gateway communication method of the above-mentioned various embodiments is implemented.

[0180] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the edge gateway communication method of the various embodiments described above is implemented.

[0181] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0183] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An edge gateway communication method, characterized in that: The method comprises: After the edge gateway is started, it detects whether there is target protocol configuration data configured corresponding to the device type of the target device locally; When present, the edge gateway reads the target protocol configuration data locally; When it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end; the target protocol configuration data is the protocol configuration data obtained by the protocol configuration end performing the protocol configuration steps in advance for the device type of the target device to be communicated; Reading the communication process configured in the target protocol configuration data; For the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed; The edge gateway sends the communication data packet to the target device; The edge gateway receives a reply data packet returned by the target device in response to the communication data packet, and unpacks the reply data packet according to the protocol data structure to obtain reply data; The protocol configuration step includes: Configuring a communication process between the edge gateway and the target device under a target protocol; Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field; After the integrity check of the configured communication process is passed, the information configured for the target protocol is saved to obtain the target protocol configuration data.

2. The method according to claim 1, characterized in that The communication process includes a communication method, communication steps, the meaning represented by each of the communication steps, and the order between the communication steps.

3. The method according to claim 1, characterized in that When the target protocol configuration data does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end, including: When it does not exist, an alarm message is issued; receiving the target protocol configuration data configured and issued by the protocol configuration end in response to the alarm message; or, When it does not exist, the edge gateway sends a protocol configuration download request to the protocol configuration end; and receives the target protocol configuration data returned by the protocol configuration end in response to the protocol configuration download request.

4. The method according to claim 3, characterized in that The method further comprises: When the protocol configuration end cannot send the target protocol configuration data in response to the protocol configuration download request, an alarm message is issued.

5. The method according to claim 1, characterized in that: Before the edge gateway obtains the target protocol configuration data configured by the protocol configuration terminal, the method further includes: When deploying the edge gateway, receiving the target protocol configuration data sent from the protocol configuration terminal and storing it locally; The edge gateway obtains target protocol configuration data configured by the protocol configuration end, including: The edge gateway obtains the target protocol configuration data stored locally.

6. The method according to claim 1, characterized in that The method of performing data protocol packaging for the current process to be executed in the communication process according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed includes: For the current to-be-executed process in the communication process, according to the protocol data structure configured in the protocol configuration data, for the defined protocol field, fill in the data corresponding to the data source bound to the protocol field, or fill in the data bound to the protocol field; The data obtained after filling is converted into a target data format to obtain a communication data packet corresponding to the current process to be executed.

7. The method according to claim 1, characterized in that The method further comprises: After the edge gateway sends the communication data packet to the target device, when the communication with the target device is normal, the step of the edge gateway receiving a reply data packet returned by the target device in response to the communication data packet is performed; When communication with the target device is abnormal, the edge gateway is re-executed to send the communication data packet to the target device; When the number of re-issuances reaches a preset number threshold and there is still an abnormality in communication with the target device, a protocol configuration error alarm message is issued.

8. An edge gateway communication method, characterized in that: The method comprises: Configure the communication flow between the edge gateway and the target device under the target protocol; Configuring the meaning and field length of each protocol field in the target protocol, and binding the corresponding filled data or data source of each protocol field to obtain a protocol data structure; After the integrity check of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device; When the edge gateway detects that the target protocol configuration data corresponding to the device type of the target device does not exist locally, the target protocol configuration data is sent to the edge gateway; wherein the edge gateway is used to read the communication process configured in the target protocol configuration data; for the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed; the communication data packet is sent to the target device, a reply data packet returned by the target device for the communication data packet is received, and the reply data packet is unpacked according to the protocol data structure to obtain reply data.

9. An edge gateway communication device, characterized in that: The device comprises: An acquisition module is used for detecting whether there is a target protocol configuration data configured corresponding to the device type of the target device locally after the edge gateway is started; when it exists, the edge gateway reads the target protocol configuration data from the local; when it does not exist, the edge gateway obtains the target protocol configuration data from the protocol configuration end; the target protocol configuration data is the protocol configuration data obtained by the protocol configuration end in advance performing the protocol configuration step for the device type of the target device to be communicated; the protocol configuration step includes: configuring the communication process between the edge gateway and the target device under the target protocol; configuring the meaning and field length of each protocol field in the target protocol, and binding the data or data source filled in each protocol field accordingly; after the integrity detection of the configured communication process is passed, the information configured for the target protocol is saved to obtain the target protocol configuration data; a reading module is used to read the communication process configured in the target protocol configuration data; A packaging module, used for performing data protocol packaging according to the protocol data structure configured in the target protocol configuration data for the current to-be-executed process in the communication process, to obtain a communication data packet corresponding to the current to-be-executed process; A sending module, used for sending the communication data packet to the target device; The unpacking module is used to receive a reply data packet returned by the target device in response to the communication data packet, and unpack the reply data packet according to the protocol data structure to obtain reply data.

10. An edge gateway communication device, characterized in that: The device comprises: A configuration module is used to configure the communication process between the edge gateway and the target device under the target protocol; configure the meaning and field length of each protocol field in the target protocol, and bind the data or data source filled in each protocol field accordingly to obtain a protocol data structure; after the integrity test of the configured communication process is passed, the communication process and the protocol data structure configured for the target protocol are saved to obtain the target protocol configuration data configured corresponding to the device type of the target device; A sending module is used to send the target protocol configuration data to the edge gateway when the edge gateway detects that the target protocol configuration data corresponding to the device type of the target device does not exist locally; wherein the edge gateway is used to read the communication process configured in the target protocol configuration data; for the current process to be executed in the communication process, data protocol packaging is performed according to the protocol data structure configured in the target protocol configuration data to obtain a communication data packet corresponding to the current process to be executed; the communication data packet is sent to the target device, a reply data packet returned by the target device for the communication data packet is received, and the reply data packet is unpacked according to the protocol data structure to obtain reply data.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.