Communication method and device, PLC gateway, system and storage medium
The PLC gateway realizes the conversion of communication protocol formats between different PLC devices, which solves the problem that existing PLC devices cannot be integrated and used due to different protocols, improves communication efficiency and reliability, and reduces maintenance costs.
Patent Information
- Application Number
- CN202311354644.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-04-18
AI Technical Summary
Due to inconsistent development platforms, development languages, etc., existing PLC devices have different supported communication protocols and cannot be integrated and used in the same scenario.
A communication method is provided to realize the format conversion of different communication protocols through the PLC gateway, so that PLC devices that support different protocols can be integrated in the same scenario. The PLC gateway receives uplink and downlink messages and converts format according to the communication protocol of the target device.
Improve communication efficiency and reliability, reduce maintenance costs, and realize the integrated use of different types of PLC equipment.
Smart Images

Figure CN119854381A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of power line communication, and in particular to a communication method, device, PLC gateway, system and computer-readable storage medium. Background Art
[0002] Power Line Communication (PLC) is a communication technology that uses power lines to transmit data. It adds modulation and demodulation devices to the existing power lines to transmit the data signals of PLC equipment to each node to achieve information transmission and communication. It can be applied to various scenarios, including homes, commercial buildings, industrial control and other fields, and can be used to realize smart grids, smart homes, remote monitoring and other functions. For example, in a home scene, power line communication technology can be used to remotely control different home appliances in the home scene. For another example in a traffic scene, power line communication technology can be used to achieve full connection of equipment such as traffic intersection display screens, traffic lights, countdown boards, pedestrian crossing buttons, etc.
[0003] Since there is no unified communication protocol standard for power line communication technology in the current environment, the PLC devices produced by various PLC equipment manufacturers have inconsistencies in development platforms, development languages, etc., which makes the communication protocols supported by these different types of PLC devices different, resulting in the inability to use different types of PLC devices supporting different communication protocols in the same scenario. Summary of the invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a communication method, device, PLC gateway, system and computer-readable storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a communication method is provided, which is applied to a PLC gateway, wherein the PLC gateway is used to wirelessly connect to a server and to wiredly connect to a plurality of PLC devices; at least two of the plurality of PLC devices support different communication protocols; the method comprises:
[0006] Receiving an uplink message sent by the PLC device; determining a communication protocol supported by the server, converting a format of the uplink message into a format of a communication protocol supported by the server and sending the format to the server; and / or
[0007] Receive a downlink message sent by the server; determine the communication protocol supported by the target PLC device indicated by the downlink message, convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device.
[0008] In this embodiment, the format conversion is implemented by the PLC gateway, so that PLC devices supporting different communication protocols can be integrated in the same scene. On the one hand, the PLC gateway can flexibly perform format conversion of different communication protocols. Whether it is an uplink message or a downlink message, it will be converted into a format that matches the corresponding device before sending, which can greatly improve communication efficiency. In addition, the PLC gateway can play a buffering and distribution role between the server and the PLC device, thereby improving the reliability of communication. On the other hand, it is only necessary to develop a communication protocol conversion function for the PLC gateway to support multiple different types of PLC devices without adjusting the PLC device, thereby reducing maintenance costs.
[0009] In one implementation, converting the format of the uplink message into the format of the communication protocol supported by the server includes:
[0010] Determine a target communication protocol supported by the PLC device sending the uplink message according to the identification information carried by the uplink message and the identification information of each PLC device pre-stored by the PLC gateway and connected to the PLC gateway by wire;
[0011] Determining a first format conversion file adapted to the target communication protocol from a plurality of pre-stored first format conversion files; any of the first format conversion files includes a conversion rule for converting a format of a message content in a message from a format of a communication protocol supported by a PLC device to a format of a communication protocol supported by the server;
[0012] A first format conversion file adapted to the target communication protocol is called to convert the format of the message content in the uplink message to obtain a converted uplink message.
[0013] In this embodiment, the first format conversion file contains relevant conversion rules, which can help the PLC gateway to correctly convert the format of the uplink message; and using the first format conversion file to convert the format of the uplink message can avoid the workload of separately developing and maintaining a communication protocol adapter for each PLC device. It is only necessary to write the first format conversion file that adapts to different communication protocols to adapt to different types of PLC devices, thereby reducing development and maintenance costs.
[0014] In one implementation, converting the format of the downlink message into the format of the communication protocol supported by the target PLC device includes:
[0015] Determine the communication protocol supported by the target PLC device indicated by the downlink message according to the identification information carried by the downlink message and the identification information of each PLC device pre-stored by the PLC gateway and connected to the PLC gateway by wire;
[0016] Determining a second format conversion file adapted to the communication protocol supported by the target PLC device from a plurality of pre-stored second format conversion files; any of the second format conversion files includes a conversion rule for converting a format of a message content in a message from a format of the communication protocol supported by the server to a format of the communication protocol supported by the PLC device;
[0017] A second format conversion file adapted to the communication protocol supported by the target PLC device is called to convert the format of the message content in the downlink message to obtain a converted downlink message.
[0018] In this embodiment, the second format conversion file contains relevant conversion rules, which can help the PLC gateway to correctly convert the format of the downlink message; and using the second format conversion file to convert the format of the downlink message can avoid the workload of separately developing and maintaining a communication protocol adapter for each PLC device. It is only necessary to write a second format conversion file that adapts to different communication protocols to adapt to different types of PLC devices, thereby reducing development and maintenance costs.
[0019] In one implementation, the identification information includes a protocol identification of a communication protocol supported by the PLC device and / or a device identification of the PLC device.
[0020] In one implementation, the server stores first format conversion files and second format conversion files corresponding to different communication protocols, and the first format conversion files and second format conversion files corresponding to different communication protocols are uploaded to the server by calling a registration interface provided by the server;
[0021] The multiple first format conversion files and multiple second format conversion files pre-stored in the PLC gateway are downloaded from the server.
[0022] In one implementation, the communication method is applied to each of at least two PLC gateways; the at least two PLC gateways are in communication connection; different PLC gateways store first format conversion files adapted to different communication protocols;
[0023] After determining the target communication protocol supported by the PLC device sending the uplink message, the method further includes:
[0024] In the case of determining that the first format conversion file adapted to the target communication protocol is not stored in the PLC gateway, determining a first target PLC gateway that pre-stores the first format conversion file adapted to the target communication protocol from other PLC gateways, forwarding the uplink message to the first target PLC gateway, so that the first target PLC gateway converts the format of the message content in the uplink message, and sends the converted uplink message to the server;
[0025] The receiving an uplink message sent by the PLC device includes:
[0026] Receive an uplink message sent by any one of the multiple PLC devices that are wired to the PLC gateway; and / or receive an uplink message forwarded by other PLC gateways.
[0027] In this embodiment, when at least two PLC gateways are communicatively connected, the function of message format conversion is distributed among at least two PLC gateways, which can effectively share the workload. Each PLC gateway only needs to manage and maintain the part it is responsible for, reducing the pressure on a single PLC gateway, improving the processing power and performance of the power line communication system, and reducing the complexity of management and maintenance, thereby improving the manageability of the system.
[0028] In one implementation, the communication method is applied to each of at least two PLC gateways; the at least two PLC gateways are in communication connection; different PLC gateways store first format conversion files adapted to different communication protocols;
[0029] After determining the communication protocol supported by the target PLC device indicated by the downlink message, the method further includes:
[0030] In the case of determining that the second format conversion file adapted to the communication protocol supported by the target PLC device is not stored in the present PLC gateway, determining a second target PLC gateway pre-stored with the second format conversion file adapted to the communication protocol supported by the target PLC device from other PLC gateways, forwarding the downlink message to the second target PLC gateway, so that the second target PLC gateway converts the format of the message content in the downlink message, and returns the converted downlink message;
[0031] The receiving a downlink message sent by the server includes:
[0032] Receive downlink messages directly sent by the server, and / or receive downlink messages forwarded by other PLC gateways.
[0033] In this embodiment, when at least two PLC gateways are communicatively connected, the function of message format conversion is distributed among at least two PLC gateways, which can effectively share the workload. Each PLC gateway only needs to manage and maintain the part it is responsible for, reducing the pressure on a single PLC gateway, improving the processing power and performance of the power line communication system, and reducing the complexity of management and maintenance, thereby improving the manageability of the system.
[0034] In one implementation, the PLC gateway is deployed with a first format conversion model, and the first format conversion model is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the PLC device to the format indicated by the communication protocol supported by the server;
[0035] The first format conversion model is obtained by supervised training based on a first training sample set, wherein the training samples in the first training sample set include a first message encapsulated based on a communication protocol supported by the PLC device, and a second message encapsulated based on a communication protocol supported by the server;
[0036] The optimization goal of the first format conversion model during the training process includes: minimizing the error between the second message and the first predicted message, the first predicted message being obtained by performing format conversion on the first message by the first format conversion model to be trained;
[0037] The converting the format of the uplink message into the format of the communication protocol supported by the server includes:
[0038] The uplink message is input into the first format conversion model, so that the first format conversion model converts the format of the message content in the uplink message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server, and outputs the converted uplink message.
[0039] This embodiment implements adaptive format conversion based on the first format conversion model, which can improve flexibility and adaptability. It can also realize format conversion when facing new communication protocols. There is no need to set the first format conversion file for each communication protocol, which reduces the need for manual intervention, helps to reduce dimensional costs, and improves the degree of automation of the PLC gateway.
[0040] In one implementation, the PLC gateway is deployed with a second format conversion model, and the second format conversion model is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the server to the format indicated by the communication protocol corresponding to the input protocol identifier;
[0041] The second format conversion model is obtained by supervised training based on a second training sample set, wherein the training samples in the second training sample set include a third message encapsulated based on a communication protocol supported by the server, a fourth message encapsulated based on a communication protocol supported by the PLC device, and a protocol identifier of the communication protocol corresponding to the fourth message;
[0042] The optimization goal of the second format conversion model during the training process includes: minimizing the error between the fourth message and the second predicted message, the second predicted message being obtained by the second format conversion model to be trained by format conversion of the third message according to the protocol identifier of the communication protocol corresponding to the fourth message;
[0043] The converting the format of the downlink message into the format of the communication protocol supported by the target PLC device includes:
[0044] According to the identification information carried by the downlink message, obtaining a protocol identifier of a communication protocol supported by the target PLC device indicated by the identification information;
[0045] The downlink message and the protocol identifier of the communication protocol supported by the target PLC device are input into the second format conversion model, so that the second format conversion model converts the downlink message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the target PLC device according to the protocol identifier of the communication protocol supported by the target PLC device, and outputs the converted downlink message.
[0046] In this embodiment, adaptive format conversion is implemented based on the second format conversion model, which can improve flexibility and adaptability. Format conversion can also be implemented when facing new communication protocols. There is no need to set a second format conversion file for each communication protocol, which reduces the need for manual intervention, helps to reduce dimensional costs, and improves the degree of automation of the PLC gateway.
[0047] According to a second aspect of an embodiment of the present disclosure, a communication device is provided, which is applied to a PLC gateway, wherein the PLC gateway is used to wirelessly connect to a server and to wiredly connect to a plurality of PLC devices; at least two of the plurality of PLC devices support different communication protocols; the device comprises:
[0048] An uplink message forwarding module, used to receive an uplink message sent by the PLC device; obtain a communication protocol supported by the server, convert the format of the uplink message into the format of the communication protocol supported by the server and send it to the server; and / or
[0049] The downlink message forwarding module is used to receive the downlink message sent by the server; obtain the communication protocol supported by the target PLC device indicated by the downlink message, convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device.
[0050] According to a third aspect of an embodiment of the present disclosure, there is provided a communication system, comprising a server, at least one PLC gateway, and a plurality of PLC devices connected to the PLC gateway by wire;
[0051] The PLC device is used to generate an uplink message according to the communication protocol supported by the device and send it to the PLC gateway; and / or receive a downlink message sent by the PLC gateway; wherein at least two of the multiple PLC devices support different communication protocols;
[0052] The PLC gateway is used to perform the steps of any method described in the first aspect;
[0053] The server is used to receive the downlink message sent by the PLC gateway; and / or generate the downlink message according to the communication protocol supported by the server and send it to the PLC gateway.
[0054] According to a fourth aspect of an embodiment of the present disclosure, a PLC gateway is provided, including:
[0055] processor;
[0056] a memory for storing a computer program executable by the processor;
[0057] Wherein, when the processor executes the program, the steps of any method described in the first aspect are implemented.
[0058] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0059] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a structural diagram of a communication system according to an exemplary embodiment of the present disclosure;
[0061] Figure 2 is a structural diagram of another communication system according to an exemplary embodiment of the present disclosure;
[0062] Figure 3is a structural diagram of another communication system shown in the present disclosure according to an exemplary embodiment;
[0063] Figure 4 is a flow chart of a communication method according to an exemplary embodiment of the present disclosure;
[0064] Figure 5 is a schematic diagram of a communication architecture of a PLC gateway according to an exemplary embodiment of the present disclosure;
[0065] Fig. 6A is a timing diagram of a PLC gateway processing a downlink message according to an exemplary embodiment of the present disclosure;
[0066] Figure 6B is a timing diagram of a PLC gateway processing an uplink message according to an exemplary embodiment of the present disclosure;
[0067] Figure 7 is a structural diagram of a communication device according to an exemplary embodiment of the present disclosure;
[0068] Figure 8 It is a structural block diagram of a PLC gateway shown in the present disclosure according to an exemplary embodiment. DETAILED DESCRIPTION
[0069] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0070] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0071] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0072] In view of the problem that different types of PLC devices support different communication protocols in the related art, which leads to the inability to integrate different types of PLC devices into the same scene, the embodiment of the present disclosure provides a communication method, which is applied to a PLC gateway, and the PLC gateway is used to wirelessly connect to a server and to be wired to multiple PLC devices; the communication protocols supported by at least two of the multiple PLC devices are different, so that the formats of the message contents in the uplink messages sent by the at least two PLC devices are different; the PLC gateway can receive an uplink message sent by any one of the multiple PLC devices, and then convert the format of the uplink message into the format of the communication protocol supported by the server according to the communication protocol supported by the server, and send the converted uplink message to the server; and / or, the PLC gateway can receive a downlink message sent by the server, and then determine the communication protocol supported by the target PLC device indicated by the downlink message, so as to convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device. This embodiment realizes format conversion through the PLC gateway, so that PLC devices supporting different communication protocols can be integrated in the same scene.
[0073] On the one hand, the PLC gateway can flexibly convert the formats of different communication protocols. Whether it is an uplink message or a downlink message, it will be converted into a format that matches the corresponding device before sending, which can greatly improve communication efficiency. In addition, the PLC gateway can play a role of buffering and distribution between the server and the PLC device, improving the reliability of communication.
[0074] On the other hand, it is only necessary to develop a communication protocol conversion function for the PLC gateway to support a variety of different types of PLC devices without adjusting the PLC devices, thereby reducing maintenance costs.
[0075] It is understood that PLC devices include but are not limited to: (1) Devices that are plugged into power sockets: such as PLC adapters, smart sockets, etc. These devices can use existing power sockets for data transmission. (2) Devices connected to power: such as webcams, routers, televisions, etc. These devices can transmit data through power lines to achieve network connection and communication functions. (3) Controllers that can be connected to power line devices: such as smart home controllers, industrial controllers, etc. These devices can achieve remote monitoring and control functions through power lines.
[0076] In an exemplary application scenario, see Figure 1, shows a communication system, including a server 10, a PLC gateway 20 wirelessly connected to the server 10, and a plurality of PLC devices 30 wiredly connected to the PLC gateway 20. The PLC gateway 20 has a format conversion function for different communication protocols, which enables the PLC devices 30 supporting different communication protocols to be integrated in the same scene and communicate with the server 10. Figure 1 As shown, the scene can integrate three PLC devices 30 provided by different manufacturers, and the PLC devices 30 provided by the three different manufacturers support different communication protocols, such as manufacturer A supports communication protocol 1, manufacturer B supports communication protocol 2, and manufacturer C supports communication protocol 3; of course, the same manufacturer can also support two or more communication protocols, and this implementation does not impose any restrictions on this. Exemplarily, the PLC devices 30 in the home scene include but are not limited to human body sensors, door locks, switches, spotlights, downlights, or curtain motors.
[0077] In another exemplary application scenario, see Figure 2 , another communication system is shown, including a server 10, at least two PLC gateways 20, and multiple PLC devices 30 connected to the PLC gateways 20 by wire. For example, at least two PLC gateways 20 can be set in a scene with a larger venue (such as a factory, school, or office building, etc.), at least two PLC gateways 20 are connected in communication, and each PLC gateway 20 can be connected to the server 10 wirelessly, and connected to multiple PLC devices 30 through power lines. Each PLC gateway 20 has a format conversion function for different communication protocols.
[0078] In another exemplary application scenario, see Figure 3 , shows another communication system, including a user terminal 40, a server 10, at least one PLC gateway 20, and a plurality of PLC devices 30 connected to the PLC gateway 20 by wire. The user terminal 40 includes but is not limited to a mobile phone, a computer, a tablet, and a wearable device. The user terminal 40 is connected to the server 10 for communication. The server 10 can send a downlink message to the PLC gateway 20 according to the control instruction sent by the user terminal 40, and then the PLC gateway 20 converts the format of the downlink message and forwards the converted downlink message to the corresponding PLC device 30, and the PLC performs a corresponding action according to the converted downlink message.
[0079] For example, in a home scenario, a user can send a control instruction about "opening the curtains" to the server 10 through the user terminal 40. The server 10 can generate a downlink message sent to the PLC gateway 20 based on the control instruction sent by the user terminal 40. The PLC gateway 20 performs format conversion and related steps of message forwarding, and then the related PLC device 30 such as the curtain motor drives the curtain to open.
[0080] like Figure 4 As shown, Figure 4 The present disclosure is a flow chart of a communication method according to an exemplary embodiment. The communication method is applied to a PLC gateway, and the PLC gateway is used to wirelessly connect to a server and to wiredly connect to multiple PLC devices. At least two of the multiple PLC devices support different communication protocols, so that the formats of the message contents in the uplink messages sent by the at least two PLC devices are different. The method includes:
[0081] In S101, an uplink message sent by the PLC device is received; and a communication protocol supported by the server is determined to convert the format of the uplink message into the format of the communication protocol supported by the server and send the format to the server.
[0082] It can be understood that the embodiments of the present disclosure do not impose any restrictions on the specific content of the uplink message, and can be specifically configured according to the actual application scenario. For example, the message content in the uplink message sent by the PLC device includes but is not limited to the data collected by the PLC device, the operating status of the PLC device, or abnormal alarm information of the PLC device, etc.
[0083] In S102, a downlink message sent by the server is received; a communication protocol supported by the target PLC device indicated by the downlink message is determined, so as to convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send the format to the target PLC device.
[0084] It is understandable that the embodiments of the present disclosure do not impose any restrictions on the specific content of the downlink message, and can be specifically configured according to the actual application scenario. For example, the message content in the uplink message includes control instructions for controlling the PLC device to perform related actions, or other information.
[0085] In this embodiment, the format conversion is implemented by the PLC gateway, so that PLC devices supporting different communication protocols can be integrated in the same scene. On the one hand, the PLC gateway can flexibly perform format conversion of different communication protocols. Whether it is an uplink message or a downlink message, it will be converted into a format that matches the corresponding device before sending, which can greatly improve communication efficiency. In addition, the PLC gateway can play a buffering and distribution role between the server and the PLC device, thereby improving the reliability of communication. On the other hand, it is only necessary to develop a communication protocol conversion function for the PLC gateway to support multiple different types of PLC devices without adjusting the PLC device, thereby reducing maintenance costs.
[0086] In some embodiments, the server may provide a relevant registration interface, and the manufacturer of the PLC device or other relevant personnel may call the registration interface provided by the server through an electronic device to upload the first format conversion file and the second format conversion file corresponding to the communication protocol supported by the PLC device to the server. The first format conversion file includes a conversion rule for converting the format of the message content in the message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server. The second format conversion file includes a conversion rule for converting the format of the message content in the message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the PLC device. Through the above registration method, the server may store the first format conversion file and the second format conversion file corresponding to different communication protocols.
[0087] The PLC gateway can then download the corresponding multiple first format conversion files and multiple second format conversion files from the server according to the different communication protocols supported by the multiple PLC devices connected to it, and store them in the local storage space of the PLC gateway for use in the subsequent format conversion process. In other words, when a PLC device supporting a new communication protocol is connected, the PLC gateway only needs to download the relevant first format conversion files and second format conversion files from the server, without making other changes to the PLC gateway, thereby improving the access efficiency of the PLC device and reducing maintenance costs.
[0088] In some embodiments, for S101, after receiving an uplink message sent by any PLC device, the PLC gateway can determine the target communication protocol supported by the PLC device sending the uplink message based on the identification information carried by the uplink message and the identification information of each PLC device that is wired to the PLC gateway and pre-stored in the PLC gateway. For example, the PLC gateway can pre-store the correspondence between the identification information of each PLC device that is wired to the PLC gateway and the communication protocol.
[0089] Exemplarily, the identification information includes the protocol identifier of the communication protocol supported by the PLC device. The PLC gateway may pre-store the correspondence between different protocol identifiers and communication protocols, thereby determining the target communication protocol supported by the PLC device sending the uplink message based on the protocol identifier in the uplink message and the pre-stored correspondence.
[0090] Exemplarily, the identification information includes the device identification of the PLC device. The PLC gateway pre-stores the correspondence between the device identifications of different PLC devices and the communication protocols, thereby determining the target communication protocol supported by the PLC device sending the uplink message based on the device identification in the uplink message and the pre-stored correspondence.
[0091] Of course, the identification information carried by the uplink message may also include both a protocol identification and a device identification. The device identification is used to indicate the PLC device that sends the uplink message, and the protocol identification is used to indicate the communication protocol supported by the PLC device.
[0092] It is understandable that, in the case where there are multiple versions of the same communication protocol, the correspondence between the identification information and the communication protocol and its version number can be pre-stored to achieve correct format conversion.
[0093] The PLC gateway may pre-store multiple first format conversion files corresponding to different communication protocols. After determining the target communication protocol supported by the PLC device that sends the uplink message, the PLC gateway may determine the first format conversion file adapted to the target communication protocol from the pre-stored multiple first format conversion files, and then call the first format conversion file adapted to the target communication protocol to convert the format of the message content in the uplink message to obtain the converted uplink message. In this embodiment, the first format conversion file contains relevant conversion rules, which can help the PLC gateway to correctly convert the format of the uplink message; and using the first format conversion file to convert the format of the uplink message can avoid the workload of developing and maintaining the communication protocol adapter program separately for each PLC device. It only needs to write the first format conversion file adapted to different communication protocols to adapt to different types of PLC devices, reducing development and maintenance costs.
[0094] In some embodiments, for S102, after receiving the downlink message sent by the server, the PLC gateway can determine the communication protocol supported by the target PLC device indicated by the downlink message based on the identification information carried by the downlink message and the identification information of each PLC device that is wired to the PLC gateway and pre-stored in the PLC gateway. For example, the PLC gateway can pre-store the correspondence between the identification information of each PLC device that is wired to the PLC gateway and the communication protocol.
[0095] Exemplarily, the identification information includes the protocol identifier of the communication protocol supported by the PLC device. The PLC gateway may pre-store the correspondence between different protocol identifiers and communication protocols, thereby determining the communication protocol supported by the target PLC device indicated by the downlink message based on the protocol identifier in the downlink message and the pre-stored correspondence.
[0096] Exemplarily, the identification information includes the device identification of the PLC device. The PLC gateway pre-stores the correspondence between the device identifications of different PLC devices and the communication protocols, thereby determining the communication protocol supported by the target PLC device indicated by the device identification based on the device identification in the downlink message and the pre-stored correspondence.
[0097] Of course, the identification information carried by the downlink message may also include both a protocol identifier and a device identifier. The device identifier is used to indicate the recipient of the downlink message (ie, the target PLC device mentioned above), and the protocol identifier is used to indicate the communication protocol supported by the target PLC device.
[0098] It is understandable that, in the case where there are multiple versions of the same communication protocol, the correspondence between the identification information and the communication protocol and its version number can be pre-stored to achieve correct format conversion.
[0099] The PLC gateway may pre-store multiple second format conversion files corresponding to different communication protocols. After determining the communication protocol supported by the target PLC device indicated by the downlink message, the PLC gateway may determine the second format conversion file adapted to the communication protocol supported by the target PLC device from the pre-stored multiple second format conversion files; and then call the second format conversion file adapted to the communication protocol supported by the target PLC device to convert the format of the message content in the downlink message to obtain the converted downlink message. In this embodiment, the second format conversion file contains relevant conversion rules, which can help the PLC gateway to correctly convert the format of the downlink message; and using the second format conversion file to convert the format of the downlink message can avoid the workload of developing and maintaining the communication protocol adapter program for each PLC device separately. It only needs to write the second format conversion file adapted to different communication protocols to adapt to different types of PLC devices, reducing development and maintenance costs.
[0100] In an exemplary embodiment, see Figure 5 ,The PLC gateway abstracts the application layer (business processing), the data conversion layer (involving the format conversion process of ,message content), the communication layer (encryption, decryption, retransmission, etc., involving TCP or UDP transmission) and the physical layer (data transmission).
[0101] (1) Application layer: In the PLC gateway, the application layer is responsible for processing the business logic related to the application program, and performing operations such as processing, filtering, verifying, and distributing data. This layer mainly involves protocols and data formats related to the server, and converts the communication protocols and formats supported by the server into other protocols and formats through the data conversion layer.
[0102] (2) Data conversion layer: The data conversion layer is the core layer of the PLC gateway, which is mainly responsible for converting data of different formats. It mainly involves ① converting the format of the message content in the uplink message from the format indicated by the communication protocol supported by the PLC device to the format indicated by the communication protocol supported by the server; and ② converting the format of the message content in the downlink message from the format indicated by the communication protocol supported by the server to the format indicated by the communication protocol supported by the PLC device. The data conversion layer ensures that the message entry of the application layer and the communication layer remains unchanged, so that multi-protocol conversion can be achieved.
[0103] For example, the format of the communication protocol indication supported by the server is json (JavaScript Object Notation, JS object notation) format, and the format of the communication protocol indication supported by the PLC device includes but is not limited to json format, PB (protocol buffer) format or TLV (Tag-Length-Value) format.
[0104] (3) Communication layer: The communication layer is the basic link for communication between the PLC gateway and other devices, mainly involving various communication protocols and transmission protocols, such as TCP / IP, UDP, HTTP, SNMP, etc. The goal of this layer is to ensure reliable data transmission and communication connections, while supporting encryption, authentication, compression, and retransmission mechanisms to improve the security and reliability of communication.
[0105] (4) Physical layer: The physical layer is the bottom layer of the PLC gateway and is mainly responsible for transmitting data from one physical medium (such as cable, optical fiber) to another physical medium. This layer includes multiple physical transmission methods, such as wired, wireless, optical fiber, etc., and supports standard electrical and mechanical interfaces to ensure interoperability and compatibility of devices.
[0106] See also Fig. 6A The timing diagram shown:
[0107] In 201, the server sends a downlink message to the PLC gateway.
[0108] In 202, the PLC gateway determines the communication protocol supported by the target PLC device indicated by the downlink message through the data conversion layer, so as to convert the format of the message content in the downlink message into the format of the communication protocol supported by the target PLC device, and obtain the converted message content. For the specific conversion process, please refer to the above description, which will not be repeated here.
[0109] In 203, the PLC gateway encrypts and assembles the converted message content through the communication layer to obtain a converted downlink message.
[0110] In 204, the PLC gateway sends the converted downlink message to the target PLC device through the physical layer.
[0111] See also Figure 6B The timing diagram shown:
[0112] In 301, the PLC device sends an uplink message to the PLC gateway, and the PLC gateway receives the uplink message sent by the PLC device through the physical layer.
[0113] In 302, the PLC gateway decrypts and parses the uplink message through the communication layer to obtain the message content in the uplink message.
[0114] In 303, the PLC gateway converts the format of the message content in the uplink message into the format of the communication protocol supported by the server through the data conversion layer to obtain the converted message content. The specific conversion process can be found in the above description and will not be repeated here.
[0115] In 304, the PLC gateway performs message assembly on the converted message content through the application layer to obtain a converted downlink message, and then sends the converted uplink message to the server.
[0116] In some embodiments, considering that at least two PLC gateways can be set up in a larger venue (such as a factory, school, or office building, etc.), the power line communication method provided in this embodiment can be applied to each of the at least two PLC gateways, and at least two PLC gateways are communicatively connected.
[0117] Considering that if each of at least two PLC gateways pre-stores the first format conversion file and the second format conversion file corresponding to different communication protocols to cope with the message format conversion requirements of PLC devices supporting different communication protocols, it is easy to cause storage burden and processing burden when there are many communication protocols. Therefore, in the case of at least two PLC gateways being connected in communication, the function of message format conversion can be distributed between at least two PLC gateways so as to more effectively handle the protocol conversion task. In other words, different PLC gateways store the first format conversion file and the second format conversion file adapted to different communication protocols. For example, there are currently 3 PLC gateways, the first PLC gateway stores the first format conversion file and the second format conversion file adapted to communication protocol A; the second PLC gateway stores the first format conversion file and the second format conversion file adapted to communication protocol B; the third PLC gateway stores the first format conversion file and the second format conversion file adapted to communication protocol C; thereby realizing the format conversion function of different PLC gateways supporting different communication protocols.
[0118] Therefore, each PLC gateway receives an uplink message including: receiving an uplink message sent by any one of a plurality of PLC devices wired to the PLC gateway; and / or receiving an uplink message forwarded by other PLC gateways.
[0119] Each PLC gateway receives a downlink message including: receiving a downlink message directly sent by a server, and / or receiving a downlink message forwarded by other PLC gateways.
[0120] In one possible implementation, for an uplink message, after any PLC gateway determines the target communication protocol supported by the PLC device sending the uplink message based on the identification information carried by the uplink message and the identification information pre-stored in the PLC gateway, the PLC gateway can query whether the PLC gateway stores a first format conversion file adapted to the target communication protocol. When it is determined that the first format conversion file adapted to the target communication protocol is not stored in the PLC gateway, a first target PLC gateway that pre-stores the first format conversion file adapted to the target communication protocol is determined from other PLC gateways, and the uplink message is forwarded to the first target PLC gateway, so that the first target PLC gateway converts the format of the message content in the uplink message, and sends the converted uplink message to the server.
[0121] Exemplarily, a PLC gateway sends a request carrying a protocol identifier of a target communication protocol to other PLC gateways to inquire whether other PLC gateways store a first format conversion file compatible with the target communication protocol, and then determines the first target PLC gateway based on responses sent by other PLC gateways.
[0122] Exemplarily, the PLC gateway may store a table that records relevant information of different PLC gateways and the first format conversion files stored therein. The PLC gateway may then query the table to determine, from other PLC gateways, a first target PLC gateway that pre-stores a first format conversion file that is compatible with the target communication protocol.
[0123] In another possible implementation, for downlink messages, after any PLC gateway determines the communication protocol supported by the target PLC device indicated by the downlink message to be received based on the identification information carried by the downlink message and the identification information pre-stored in the PLC gateway, the PLC gateway can query whether the PLC gateway stores a second format conversion file adapted to the communication protocol supported by the target PLC device. When it is determined that the second format conversion file adapted to the communication protocol supported by the target PLC device is not stored in the PLC gateway, a second target PLC gateway that pre-stores the second format conversion file adapted to the communication protocol supported by the target PLC device is determined from other PLC gateways, and the downlink message is forwarded to the second target PLC gateway, so that the second target PLC gateway converts the format of the message content in the downlink message and returns the converted downlink message; then the PLC gateway can receive the converted downlink message returned by the second target PLC gateway, and send the converted downlink message to the target PLC device through the power line.
[0124] Exemplarily, a PLC gateway may send a request carrying a protocol identifier of a communication protocol supported by a target PLC device to other PLC gateways to inquire whether the other PLC gateways store a second format conversion file compatible with the communication protocol supported by the target PLC device, and then determine the first target PLC gateway based on the responses sent by the other PLC gateways.
[0125] Exemplarily, the table stored in the PLC gateway also records relevant information of different PLC gateways and the second format conversion files stored therein. The PLC gateway can query the table to determine from other PLC gateways a second target PLC gateway that has a pre-stored second format conversion file that is compatible with the communication protocol supported by the target PLC device.
[0126] In this embodiment, when at least two PLC gateways are communicatively connected, the function of message format conversion is dispersed between at least two PLC gateways, which can effectively share the workload. Each PLC gateway only needs to manage and maintain the part it is responsible for, reducing the pressure on a single PLC gateway, improving the processing power and performance of the power line communication system, and reducing the complexity of management and maintenance, thereby improving the manageability of the system.
[0127] In some embodiments, considering that the above-mentioned format conversion process requires pre-configuration of the first format conversion file and the second format conversion file adapted to the communication protocol, this method is not flexible enough to support new and unknown protocol conversion. Therefore, it is possible to consider using machine learning or artificial intelligence technology to train the first format conversion model and the second format conversion model, and deploy the first format conversion model and the second format conversion model in the PLC gateway.
[0128] The first format conversion model is used to convert the format of the message content in the message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server.
[0129] The second format conversion model is used to convert the format of the message content in the message from the format of the communication protocol supported by the server to the format of the communication protocol corresponding to the input protocol identifier.
[0130] The construction process of the first format conversion model and the second format conversion model can be performed by other electronic devices. The model architecture of the first format conversion model and the second format conversion model includes but is not limited to a recurrent neural network (RNN), a convolutional neural network (CNN), or a neural network based on a self-attention mechanism (Transformer), and this embodiment does not impose any restrictions on this.
[0131] The construction process of the first format conversion model is exemplified here: the electronic device can obtain a first training sample set, the training samples in the first training sample set include a first message encapsulated based on a communication protocol supported by the PLC device, and a second message encapsulated based on a communication protocol supported by the server; the first training sample set is input into the first format conversion model to be trained, so that the first format conversion model to be trained extracts features from the first message, the features include but are not limited to message structure, field values, and data distribution, etc., and then performs format conversion processing according to the extracted features to obtain a first predicted message, and trains the first format conversion model with the optimization goal of minimizing the error between the second message and the first predicted message.
[0132] The construction process of the second format conversion model is illustrated here: since the second format conversion model is used to convert the format indicated by a certain communication protocol supported by the server into multiple different communication protocols supported by the PLC device, in order to improve the accuracy of the format conversion, the protocol identifier of the communication protocol to be converted can also be input into the second format conversion model to provide additional information to guide the model for conversion, thereby helping the second format conversion model to make correct decisions when performing format conversion.
[0133] The electronic device may obtain a second training sample set, wherein the training samples in the second training sample set include a third message encapsulated based on a communication protocol supported by the server, a fourth message encapsulated based on a communication protocol supported by the PLC device, and a protocol identifier of a communication protocol corresponding to the fourth message. The second training sample set is then input into a second format conversion model to be trained, so that the second format conversion model performs format conversion processing on the third message according to the protocol identifier of the communication protocol corresponding to the fourth message to obtain a second predicted message, and the second format conversion model is trained with minimizing the error between the fourth message and the second predicted message as an optimization goal.
[0134] It is understandable that in addition to the protocol identifier, other feature information may also be considered, such as the message structure, field values, data distribution, etc. of the communication protocol supported by the PLC device. These features can be used as inputs to the second format conversion model to help the second format conversion model make accurate conversion decisions.
[0135] In actual application, the PLC gateway is deployed with the first format conversion model and the second format conversion model, so as to realize adaptive format conversion based on the first format conversion model and the second format conversion model, thereby improving flexibility and adaptability.
[0136] In one possible implementation, after receiving the uplink message sent by the PLC device, the PLC can input the uplink message into the first format conversion model, so that the first format conversion model converts the format of the message content in the uplink message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server, and outputs the converted uplink message. This embodiment implements adaptive format conversion based on the first format conversion model, which can improve flexibility and adaptability, and can also achieve format conversion when facing new communication protocols. There is no need to set a first format conversion file for each communication protocol, which reduces the need for manual intervention, helps to reduce dimensional costs, and improves the degree of automation of the PLC gateway.
[0137] In another possible implementation, after receiving the downlink message sent by the server, the PLC can obtain the protocol identifier of the communication protocol supported by the target PLC device indicated by the identification information according to the identification information carried by the downlink message; then the downlink message and the protocol identifier of the communication protocol supported by the target PLC device are input into the second format conversion model, so that the second format conversion model can convert the downlink message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the target PLC device according to the protocol identifier of the communication protocol supported by the target PLC device, and output the converted downlink message. This embodiment implements adaptive format conversion based on the second format conversion model, which can improve flexibility and adaptability, and can also achieve format conversion when facing new communication protocols. There is no need to set a second format conversion file for each communication protocol, which reduces the need for manual intervention, helps to reduce dimensionality costs, and improves the automation level of the PLC gateway.
[0138] The various technical features in the above embodiments can be arbitrarily combined as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also falls within the scope of this specification.
[0139] Corresponding to the embodiment of the aforementioned communication processing method, the present disclosure further provides a communication device, which is applied to a PLC gateway, wherein the PLC gateway is used to wirelessly connect to a server and to wiredly connect to a plurality of PLC devices; at least two of the plurality of PLC devices support different communication protocols, so that the formats of the message contents in the uplink messages sent by the at least two PLC devices are different; please refer to Figure 7 , the device 400 comprises:
[0140] An uplink message forwarding module 401 is used to receive an uplink message sent by the PLC device; obtain a communication protocol supported by the server, convert the format of the uplink message into the format of the communication protocol supported by the server and send it to the server; and / or
[0141] The downlink message forwarding module 402 is used to receive the downlink message sent by the server; obtain the communication protocol supported by the target PLC device indicated by the downlink message, convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device.
[0142] In some embodiments, the uplink message forwarding module 401 includes a first conversion unit, which is used to: determine the target communication protocol supported by the PLC device sending the uplink message based on the identification information carried by the uplink message and the identification information of each PLC device pre-stored in the PLC gateway and connected to the PLC gateway by wire; determine a first format conversion file adapted to the target communication protocol from a plurality of pre-stored first format conversion files; any of the first format conversion files includes a conversion rule for converting the format of the message content in the message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server; call the first format conversion file adapted to the target communication protocol to convert the format of the message content in the uplink message to obtain a converted uplink message.
[0143] In some embodiments, the downlink message forwarding module 402 includes a second conversion unit, which is used to: determine the communication protocol supported by the target PLC device indicated by the downlink message based on the identification information carried by the downlink message and the identification information of each PLC device pre-stored in the PLC gateway and connected to the PLC gateway by wire; determine a second format conversion file adapted to the communication protocol supported by the target PLC device from multiple pre-stored second format conversion files; any of the second format conversion files includes a conversion rule for converting the format of the message content in the message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the PLC device; call the second format conversion file adapted to the communication protocol supported by the target PLC device to convert the format of the message content in the downlink message to obtain a converted downlink message.
[0144] In some embodiments, the identification information includes a protocol identification of a communication protocol supported by the PLC device and / or a device identification of the PLC device.
[0145] In some embodiments, the server stores first format conversion files and second format conversion files corresponding to different communication protocols, and the first format conversion files and second format conversion files corresponding to different communication protocols are uploaded to the server by calling a registration interface provided by the server; the multiple first format conversion files and multiple second format conversion files pre-stored in the PLC gateway are downloaded from the server.
[0146] In some embodiments, the communication device is applied to each of at least two PLC gateways; the at least two PLC gateways are communicatively connected; and different PLC gateways store first format conversion files adapted to different communication protocols.
[0147] The first conversion unit is also used for: after determining the target communication protocol supported by the PLC device sending the uplink message, when it is determined that the first format conversion file adapted to the target communication protocol is not stored in the current PLC gateway, determining from other PLC gateways a first target PLC gateway that pre-stores the first format conversion file adapted to the target communication protocol, forwarding the uplink message to the first target PLC gateway, so that the first target PLC gateway converts the format of the message content in the uplink message, and sends the converted uplink message to the server.
[0148] The uplink message forwarding module 401 includes a first receiving unit, which is used to: receive an uplink message sent by any one of the multiple PLC devices connected to the PLC gateway by wire; and / or receive an uplink message forwarded by other PLC gateways.
[0149] In some embodiments, the communication device is applied to each of at least two PLC gateways; the at least two PLC gateways are communicatively connected; and different PLC gateways store first format conversion files adapted to different communication protocols.
[0150] The second conversion unit is also used for: after determining the communication protocol supported by the target PLC device to be received by the downlink message, when it is determined that the second format conversion file adapted to the communication protocol supported by the target PLC device is not stored in the current PLC gateway, determining from other PLC gateways a second target PLC gateway that has pre-stored the second format conversion file adapted to the communication protocol supported by the target PLC device, and forwarding the downlink message to the second target PLC gateway, so that the second target PLC gateway converts the format of the message content in the downlink message and returns the converted downlink message.
[0151] The downlink message forwarding module 402 includes a second receiving unit, and the second receiving unit is used to: receive the downlink message directly sent by the server, and / or receive the downlink message forwarded by other PLC gateways.
[0152] In some embodiments, the PLC gateway is deployed with a first format conversion model, which is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the PLC device to the format indicated by the communication protocol supported by the server; the first format conversion model is obtained through supervised training based on a first training sample set, and the training samples in the first training sample set include a first message encapsulated based on the communication protocol supported by the PLC device, and a second message encapsulated based on the communication protocol supported by the server; the optimization goals of the first format conversion model during the training process include: minimizing the error between the second message and the first predicted message, and the first predicted message is obtained by format conversion of the first message by the first format conversion model to be trained.
[0153] The uplink message forwarding module 401 includes a first conversion unit, which is used to: input the uplink message into the first format conversion model, so that the first format conversion model converts the format of the message content in the uplink message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server, and outputs the converted uplink message.
[0154] In some embodiments, the PLC gateway is deployed with a second format conversion model, which is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the server to the format indicated by the communication protocol corresponding to the input protocol identifier; the second format conversion model is obtained by supervised training based on a second training sample set, and the training samples in the second training sample set include a third message encapsulated based on the communication protocol supported by the server, a fourth message encapsulated based on the communication protocol supported by the PLC device, and a protocol identifier of the communication protocol corresponding to the fourth message; the optimization goals of the second format conversion model during the training process include: minimizing the error between the fourth message and the second predicted message, and the second predicted message is obtained by the second format conversion model to be trained to convert the format of the third message according to the protocol identifier of the communication protocol corresponding to the fourth message.
[0155] The downlink message forwarding module 402 includes a second conversion unit, which is used to: obtain the protocol identifier of the communication protocol supported by the target PLC device indicated by the identification information according to the identification information carried by the downlink message; input the downlink message and the protocol identifier of the communication protocol supported by the target PLC device into the second format conversion model, so that the second format conversion model can convert the downlink message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the target PLC device according to the protocol identifier of the communication protocol supported by the target PLC device, and output the converted downlink message.
[0156] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0157] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units.
[0158] Corresponding to the embodiment of the aforementioned communication method, please refer to Figure 1 and Figure 2 The present disclosure also provides a communication system, including a server 10, at least one PLC gateway 20, and a plurality of PLC devices 30 connected to the PLC gateway 20 by wire.
[0159] The PLC device 30 is used to generate an uplink message according to the communication protocol supported by the device and send it to the PLC gateway 20; and / or receive a downlink message sent by the PLC gateway 29; wherein at least two of the multiple PLC devices 30 support different communication protocols, so that the formats of the message contents in the uplink messages sent by the at least two PLC devices 30 are different.
[0160] The PLC gateway 20 is used to execute the steps of the above-mentioned power line communication method.
[0161] The server 10 is used to receive the downlink message sent by the PLC gateway 20; and / or generate the downlink message according to the communication protocol supported by the server and send it to the PLC gateway 20.
[0162] For example, see Figure 3 The power line communication system further includes a user terminal 40 communicatively connected to the server 10 .
[0163] Corresponding to the embodiment of the aforementioned power line communication method, the present disclosure further provides a PLC gateway. The PLC gateway comprises:
[0164] processor;
[0165] a memory for storing a computer program executable by the processor;
[0166] Wherein, when the processor executes the program, the power line communication method recorded in any of the above embodiments is implemented.
[0167] like Figure 8 As shown, Figure 8The electronic device 500 may include one or more of the following components: a processing component 501, a memory 502, a power supply component 503, a multimedia component 504, an audio component 505, an input / output (I / O) interface 506, a sensor component 507, and a communication component 508.
[0168] The processing component 501 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 501 may include one or more processors 509 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 501 may include one or more modules to facilitate the interaction between the processing component 501 and other components. For example, the processing component 501 may include a multimedia module to facilitate the interaction between the multimedia component 504 and the processing component 501.
[0169] The memory 502 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0170] The power supply component 503 provides power to various components of the electronic device 500. The power supply component 503 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.
[0171] The multimedia component 504 includes a screen that provides an output interface between the electronic device 500 and the user. The screen may include a touch panel (TP) implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 504 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0172] The audio component 505 is configured to output and / or input audio signals. For example, the audio component 505 includes a microphone (MIC), and when the electronic device 500 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 502 or sent via the communication component 508. In some embodiments, the audio component 505 also includes a speaker for outputting audio signals.
[0173] I / O interface 506 provides an interface between processing component 501 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0174] The sensor assembly 507 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 507 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 507 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of contact between the user and the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 507 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 507 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 507 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a temperature sensor, a photoelectric sensor, or a GPS sensor.
[0175] The communication component 508 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G LTE, 5G NR (5G NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 508 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 508 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0176] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0177] The implementation process of the functions and effects of each component in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0178] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0179] Corresponding to the embodiments of the aforementioned power line communication method, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by the processor 509 of the aforementioned electronic device, implements the steps of the power line communication method recorded in any of the aforementioned embodiments.
[0180] The present disclosure may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0181] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0182] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0183] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A communication method, characterized in that: Applied to a PLC gateway, the PLC gateway is used to wirelessly connect to a server and to wiredly connect to multiple PLC devices; At least two of the multiple PLC devices support different communication protocols; the method comprises: Receiving an uplink message sent by the PLC device; Determining a communication protocol supported by the server, converting the format of the uplink message into the format of the communication protocol supported by the server and sending the format to the server; and / or Receive a downlink message sent by the server; determine the communication protocol supported by the target PLC device indicated by the downlink message, convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device.
2. The method according to claim 1, characterized in that The converting the format of the uplink message into the format of the communication protocol supported by the server includes: Determine the target communication protocol supported by the PLC device sending the uplink message according to the identification information carried by the uplink message and the identification information of each PLC device pre-stored in the PLC gateway and connected to the PLC gateway by wire; Determining a first format conversion file adapted to the target communication protocol from a plurality of pre-stored first format conversion files; any of the first format conversion files includes a conversion rule for converting a format of a message content in a message from a format of a communication protocol supported by a PLC device to a format of a communication protocol supported by the server; A first format conversion file adapted to the target communication protocol is called to convert the format of the message content in the uplink message to obtain a converted uplink message.
3. The method according to claim 1, characterized in that The converting the format of the downlink message into the format of the communication protocol supported by the target PLC device includes: Determine the communication protocol supported by the target PLC device indicated by the downlink message according to the identification information carried by the downlink message and the identification information of each PLC device pre-stored in the PLC gateway and connected to the PLC gateway by wire; Determining a second format conversion file adapted to the communication protocol supported by the target PLC device from a plurality of pre-stored second format conversion files; any of the second format conversion files includes a conversion rule for converting a format of a message content in a message from a format of the communication protocol supported by the server to a format of the communication protocol supported by the PLC device; A second format conversion file adapted to the communication protocol supported by the target PLC device is called to convert the format of the message content in the downlink message to obtain a converted downlink message.
4. The method according to claim 2 or 3, characterized in that: The identification information includes a protocol identification of a communication protocol supported by the PLC device and / or a device identification of the PLC device.
5. The method according to claim 2 or 3, characterized in that: The server stores a first format conversion file and a second format conversion file corresponding to different communication protocols, and the first format conversion file and the second format conversion file corresponding to the different communication protocols are uploaded to the server by calling a registration interface provided by the server; The multiple first format conversion files and multiple second format conversion files pre-stored in the PLC gateway are downloaded from the server.
6. The method according to claim 2, characterized in that The communication method is applied to each of at least two PLC gateways; the at least two PLC gateways are in communication connection; different PLC gateways store first format conversion files adapted to different communication protocols; After determining the target communication protocol supported by the PLC device sending the uplink message, the method further includes: In the case of determining that the first format conversion file adapted to the target communication protocol is not stored in the PLC gateway, determining a first target PLC gateway that pre-stores the first format conversion file adapted to the target communication protocol from other PLC gateways, forwarding the uplink message to the first target PLC gateway, so that the first target PLC gateway converts the format of the message content in the uplink message, and sends the converted uplink message to the server; The receiving an uplink message sent by the PLC device includes: Receive an uplink message sent by any one of the multiple PLC devices that are wired to the PLC gateway; and / or receive an uplink message forwarded by other PLC gateways.
7. The method according to claim 3, characterized in that The communication method is applied to each of at least two PLC gateways; the at least two PLC gateways are in communication connection; different PLC gateways store first format conversion files adapted to different communication protocols; After determining the communication protocol supported by the target PLC device indicated by the downlink message, the method further includes: In the case of determining that the second format conversion file adapted to the communication protocol supported by the target PLC device is not stored in the present PLC gateway, determining a second target PLC gateway pre-stored with the second format conversion file adapted to the communication protocol supported by the target PLC device from other PLC gateways, forwarding the downlink message to the second target PLC gateway, so that the second target PLC gateway converts the format of the message content in the downlink message, and returns the converted downlink message; The receiving a downlink message sent by the server includes: Receive downlink messages directly sent by the server, and / or receive downlink messages forwarded by other PLC gateways.
8. The method according to claim 1, characterized in that: The PLC gateway is deployed with a first format conversion model, and the first format conversion model is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the PLC device to the format indicated by the communication protocol supported by the server; The first format conversion model is obtained by supervised training based on a first training sample set, wherein the training samples in the first training sample set include a first message encapsulated based on a communication protocol supported by the PLC device, and a second message encapsulated based on a communication protocol supported by the server; The optimization goal of the first format conversion model during the training process includes: minimizing the error between the second message and the first predicted message, the first predicted message being obtained by performing format conversion on the first message by the first format conversion model to be trained; The converting the format of the uplink message into the format of the communication protocol supported by the server includes: The uplink message is input into the first format conversion model, so that the first format conversion model converts the format of the message content in the uplink message from the format of the communication protocol supported by the PLC device to the format of the communication protocol supported by the server, and outputs the converted uplink message.
9. The method according to claim 1, characterized in that: The PLC gateway is deployed with a second format conversion model, and the second format conversion model is used to convert the format of the message content in the message from the format indicated by the communication protocol supported by the server to the format indicated by the communication protocol corresponding to the input protocol identifier; The second format conversion model is obtained by supervised training based on a second training sample set, wherein the training samples in the second training sample set include a third message encapsulated based on a communication protocol supported by the server, a fourth message encapsulated based on a communication protocol supported by the PLC device, and a protocol identifier of the communication protocol corresponding to the fourth message; The optimization goal of the second format conversion model during the training process includes: minimizing the error between the fourth message and the second predicted message, the second predicted message being obtained by the second format conversion model to be trained by format conversion of the third message according to the protocol identifier of the communication protocol corresponding to the fourth message; The converting the format of the downlink message into the format of the communication protocol supported by the target PLC device includes: According to the identification information carried by the downlink message, obtaining a protocol identifier of a communication protocol supported by the target PLC device indicated by the identification information; The downlink message and the protocol identifier of the communication protocol supported by the target PLC device are input into the second format conversion model, so that the second format conversion model converts the downlink message from the format of the communication protocol supported by the server to the format of the communication protocol supported by the target PLC device according to the protocol identifier of the communication protocol supported by the target PLC device, and outputs the converted downlink message.
10. A communication device, characterized in that: Applied to a PLC gateway, the PLC gateway is used to wirelessly connect to a server and to wiredly connect to multiple PLC devices; At least two of the multiple PLC devices support different communication protocols; the device comprises: An uplink message forwarding module, used for receiving an uplink message sent by the PLC device; Acquire a communication protocol supported by the server, convert the format of the uplink message into the format of the communication protocol supported by the server and send it to the server; and / or The downlink message forwarding module is used to receive the downlink message sent by the server; obtain the communication protocol supported by the target PLC device indicated by the downlink message, convert the format of the downlink message into the format of the communication protocol supported by the target PLC device and send it to the target PLC device.
11. A communication system, characterized in that: It includes a server, at least one PLC gateway, and a plurality of PLC devices connected to the PLC gateway by wire; The PLC device is used to generate an uplink message according to the communication protocol supported by the device and send it to the PLC gateway; and / or receive a downlink message sent by the PLC gateway; wherein at least two of the multiple PLC devices support different communication protocols; The PLC gateway is used to perform the steps of the method according to any one of claims 1 to 9; The server is used to receive the downlink message sent by the PLC gateway; and / or generate the downlink message according to the communication protocol supported by the server and send it to the PLC gateway.
12. A PLC gateway, characterized in that: include: processor; a memory for storing a computer program executable by the processor; Wherein, when the processor executes the program, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Service calling method and device and electronic equipment
CN112532564A
Protocol message conversion method and device
CN116781797A
Extensible data transformation system
EP1612630A1
Method of controlling remote devices using PLC customprotocol and PLC gateway therefor
KR1020050030021A