WO2021052442A1 - Obtaining method, configuration method, edge computing cluster, and apparatuses - Google Patents

Obtaining method, configuration method, edge computing cluster, and apparatuses Download PDF

Info

Publication number
WO2021052442A1
WO2021052442A1 PCT/CN2020/116024 CN2020116024W WO2021052442A1 WO 2021052442 A1 WO2021052442 A1 WO 2021052442A1 CN 2020116024 W CN2020116024 W CN 2020116024W WO 2021052442 A1 WO2021052442 A1 WO 2021052442A1
Authority
WO
WIPO (PCT)
Prior art keywords
proxy object
gateway
data
message
edge computing
Prior art date
Application number
PCT/CN2020/116024
Other languages
French (fr)
Chinese (zh)
Inventor
李银龙
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2021052442A1 publication Critical patent/WO2021052442A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • This application relates to the field of communication technology, and in particular to a method for acquiring device data, a method for configuring a device, an edge computing cluster, and a device for acquiring device data, and a device for configuring a device.
  • the hardware capability of carrying services is usually weak.
  • the physical capacity of a single gateway hardware is limited, and a single gateway cannot be accessed when the amount of equipment is large (ten thousand).
  • the bottleneck may be the equipment wiring problem, or the single gateway interface may be insufficient or the hardware processing capacity is not enough, so Need to use multi-gateway access.
  • each gateway can only access the sub-devices assigned to its own gateway, and is "invisible” and “intangible” to the sub-devices connected to other gateways, and it is impossible to realize device control and data sharing at all.
  • the technical problem to be solved by the embodiments of this application is to provide a method for acquiring device data and a method for configuring devices to solve the problems of severe centralization dependence in edge computing in the prior art, and the inability to achieve cross-gateway device control and data sharing. .
  • an embodiment of the present application discloses a method for acquiring device data, which is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes a first proxy object , The second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the method includes:
  • the second proxy object obtains device data for the subscription request message, and sends the device data to the first proxy object.
  • the first gateway is in a communication connection with a cloud server, and the first gateway further includes a first operation proxy object communicatively connected with the cloud server and the first proxy object, the first proxy object Sending a subscription request message for the first device to the second proxy object includes:
  • the first operation agent object obtains the message route sent by the cloud server, and determines a subscription request message corresponding to the message route;
  • the first proxy object sends the subscription request message sent by the first operation proxy object to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object, and the second proxy object obtains device data for the subscription request message, and combines the device data Send to the first proxy object, including:
  • the second operation proxy object obtains the device data for the subscription request message sent by the first device, and sends the device data to the second proxy object;
  • the second proxy object sends the device data to the first proxy object.
  • the first gateway runs an application program, and the method further includes:
  • the first operation proxy object sends the device data sent by the first proxy object to the application.
  • the first gateway further includes a cloud proxy object communicatively connected to the cloud server and the first operation proxy object, and the first operation proxy object obtains the message route sent by the cloud server and determines The subscription request message corresponding to the message route includes:
  • the cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
  • the first operation agent object determines the subscription request message corresponding to the message route.
  • An embodiment of the application also discloses a device configuration method, which is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the first gateway includes a first proxy object, and the second
  • the gateway includes a second proxy object, the second gateway communicates with at least one first device, and the method includes:
  • the second proxy object sends a response message sent by the first device to the first proxy object, where the response message is a message that the first device completes the configuration of attributes according to the configuration information.
  • the first gateway runs an application program
  • the first gateway further includes a first operation proxy object communicatively connected with the first proxy object, and the first proxy object sends an application program to the first proxy object.
  • the configuration information configured by the device to the second proxy object includes:
  • the first proxy object sends the configuration information to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the second proxy object sends a response message sent by the first device, Send to the first proxy object, including:
  • the second proxy object sends the response message sent by the second operation proxy object to the first proxy object.
  • it also includes:
  • the first operation proxy object sends the response message sent by the first proxy object to the application.
  • the embodiment of the present application also discloses an edge computing cluster, which includes multiple gateways, each gateway is provided with a proxy object, and each gateway performs data interaction through the proxy object.
  • the gateway includes at least a first gateway communicatively connected to at least one first device, and a second gateway communicatively connected to at least one second device;
  • the proxy object includes a first gateway that is set in the first gateway.
  • the first gateway is configured to send first communication data for the second device through the first proxy object; and receive through the first proxy object for the first communication sent by the second gateway The first response data of the data;
  • the second gateway is configured to send second communication data for the first device through the second proxy object; and receive through the second proxy object for the second communication sent by the first gateway The second response data of the data.
  • the first gateway runs an application program
  • the first proxy object is used to send the first communication data sent by the application program to the second proxy object;
  • the second proxy object is used to send the first communication data to the second device; and obtain the first response data reported by the second device for the first communication data, and send the The first response data is sent to the first proxy object.
  • the first gateway includes an operation proxy object
  • the operation proxy object is used to send the first response data sent by the first proxy object to the application.
  • the operation proxy object is further configured to send the second communication data sent by the first proxy object to the first device, so that the first device performs the second communication with the first device The first device operation corresponding to the data; and sending the second response data sent by the first device to the second communication data to the first proxy object.
  • the operation proxy object is also used to send local operation data sent by the application program to the first device, so that the first device performs a second device operation corresponding to the local operation data .
  • the first gateway includes a cloud proxy object communicatively connected with a cloud server;
  • the cloud proxy object is used to obtain the message route sent by the cloud server, and send the message route to the operation proxy object;
  • the operation proxy object is used to determine the first communication data corresponding to the message route.
  • the first communication data includes a subscription request message, and the first response data includes device data;
  • the first proxy object is also used to send a subscription request message for the second device to the second proxy object;
  • the second proxy object is also used to obtain device data for the subscription request message sent by the second device; and send the device data to the first proxy object.
  • the second communication data includes device configuration information
  • the second response data includes a configuration response message
  • the second proxy object is also used to send the device configuration information for the first device to the first proxy object;
  • the operation proxy object is further configured to send the device configuration information sent by the first proxy object to the first device, so that the first device performs an operation corresponding to the device configuration information; and obtain Sending the configuration response message sent by the first device information to the first proxy object;
  • the first proxy object is also used to send the configuration response message to the second proxy object.
  • An embodiment of the application also discloses a device data acquisition device, which is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the first gateway includes a first proxy object, and the first gateway includes a first proxy object.
  • the second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
  • a subscription message sending module configured for the first proxy object to send a subscription request message for the first device to the second proxy object
  • the device data sending module is used for the second proxy object to obtain the device data for the subscription request message, and send the device data to the first proxy object.
  • the first gateway communicates with a cloud server, and the first gateway further includes a first operation proxy object communicatively connected with the cloud server and the first proxy object, and the subscription message sending module include:
  • the first subscription message determining submodule is used for the first operation agent object to obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route;
  • the subscription message sending submodule is used for the first proxy object to send the subscription request message sent by the first operation proxy object to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object, and the device data sending module includes:
  • the second subscription message sending submodule is configured to send the subscription request message sent by the second proxy object to the first device by the second operation proxy object;
  • a device data acquisition sub-module configured for the second operation proxy object to acquire the device data for the subscription request message sent by the first device, and send the device data to the second proxy object;
  • the device data sending submodule is used for the second proxy object to send the device data to the first proxy object.
  • the first gateway runs an application program
  • the device further includes:
  • the device data forwarding module is used for the first operation proxy object to send the device data sent by the first proxy object to the application program.
  • the first gateway further includes a cloud proxy object communicatively connected with the cloud server and the first operation proxy object, and the first subscription message determining submodule is specifically configured to:
  • the cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
  • the first operation agent object determines the subscription request message corresponding to the message route.
  • An embodiment of the application also discloses a device configuration device, which is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the first gateway includes a first proxy object, and the second
  • the gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
  • a configuration information sending module configured for the first proxy object to send configuration information for configuring the first device to the second proxy object
  • the response message sending module is used for the second proxy object to send the response message sent by the first device to the first proxy object, where the response message is completed by the first device according to the configuration information Attribute configuration message.
  • the first gateway runs an application program
  • the first gateway further includes a first operation proxy object communicatively connected with the first proxy object
  • the configuration information sending module includes:
  • the first information sending submodule is used for the first operation proxy object to send the configuration information sent by the application program to the first proxy object;
  • the second information sending submodule is used for the first proxy object to send the configuration information to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the response message sending module includes:
  • the configuration information sending sub-module is used for the second operation proxy object to send the configuration information sent by the second proxy object to the first device;
  • the response message sending submodule is used for the second proxy object to send the response message sent by the second operation proxy object to the first proxy object.
  • it also includes:
  • the response message forwarding module is configured to send the response message sent by the first proxy object to the application by the first operation proxy object.
  • the embodiments of the present application include the following advantages:
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object,
  • the second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object.
  • the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It ensures that the edge computing rules can be correlated across networks, realize decentralization and edge autonomy, and improve the linkage capability of edge computing.
  • FIG. 1 is a flowchart of the steps of Embodiment 1 of a method for acquiring device data according to the present application;
  • Embodiment 2 is a schematic diagram of data flow in Embodiment 1 of a method for acquiring device data according to the present application;
  • FIG. 3 is a flowchart of the steps of Embodiment 2 of a method for acquiring device data according to the present application;
  • FIG. 4 is a schematic diagram of data flow in the second embodiment of a method for acquiring device data according to the present application
  • FIG. 5 is a schematic diagram of data flow in the second embodiment of a method for acquiring device data according to the present application
  • FIG. 6 is a flow chart of the steps of Embodiment 1 of a device configuration method of the present application.
  • FIG. 7 is a schematic diagram of data flow in Embodiment 1 of a device configuration method of the present application.
  • FIG. 8 is a flowchart of the steps of Embodiment 2 of a device configuration method of the present application.
  • Embodiment 9 is a schematic diagram of data flow in Embodiment 2 of a device configuration method of the present application.
  • Embodiment 10 is a schematic diagram of data flow in Embodiment 2 of a device configuration method of the present application.
  • FIG. 11 is a structural block diagram of an embodiment of an edge computing cluster of the present application.
  • FIG. 12 is an architecture diagram of an edge computing cluster in an embodiment of an edge computing cluster of the present application.
  • FIG. 13 is a structural block diagram of an embodiment of an apparatus for acquiring device data according to the present application.
  • FIG. 14 is a structural block diagram of an embodiment of a device configuration device of the present application.
  • Embodiment 1 shows a flow chart of the steps of Embodiment 1 of a method for acquiring device data according to the present application.
  • edge computing In edge computing scenarios, it can be deployed in smart devices and computing nodes of different magnitudes, and connect devices with different protocols and different data formats through defined object models to provide safe, reliable, low-latency, low-cost, easy-scalable, and weakly dependent Local computing services.
  • the cloud server's big data, AI (Artificial Intelligence) learning, voice, video and other capabilities can be combined to create a cloud-side trinity computing system.
  • edge computing it mainly involves the device side, edge computing side and cloud server.
  • developers can use the device to access SDK (Software Development Kit, software development kit), convert non-standard devices into standard object models, and access the gateway nearby to realize device management and control.
  • the computing device running the application can be the edge computing terminal, that is, the edge gateway.
  • the gateway can collect, transfer, store, analyze and report the device data to the cloud, and the gateway provides rule engines and functions
  • the calculation engine facilitates scene orchestration and business expansion.
  • the cloud server can combine the uploaded device data with cloud functions, such as big data, AI learning, etc., and realize more functions and applications through standard API (Application Programming Interface) interfaces.
  • API Application Programming Interface
  • the hardware capability of carrying services is usually weak, and the physical capability of a single gateway hardware is limited.
  • a single gateway cannot be used for access.
  • Existing problems include equipment wiring, insufficient single gateway interface or insufficient hardware processing capacity, etc., which requires the use of multiple gateways for access.
  • field devices do not belong to the same gateway in terms of physical links.
  • the edge gateway is required to have the ability to implement cross-gateway device control and data sharing.
  • each gateway can only access the sub-devices assigned to its own gateway, and cannot directly control or obtain information on sub-devices connected to other gateways.
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object.
  • both the first gateway and the second gateway can respectively communicate with multiple devices, so that each gateway can implement device data collection, circulation, storage, analysis, and reporting.
  • the device data can be transferred between the gateways on demand.
  • gateway A needs to access the information of sub-device one under other gateways, it only needs to send a request to the unique device identifier of sub-device one, just like the sub-device of this gateway, so that the edge gateway can be decentralized, Autonomous way to realize data sharing and device control between gateways.
  • the method for acquiring the device data may include the following steps:
  • Step 101 The first proxy object sends a subscription request message for the first device to the second proxy object;
  • each gateway can run a proxy object and form an edge computing cluster between the proxy objects, so that it can subscribe to topics on any proxy object, and can also publish messages on any proxy object, and
  • the edge computing cluster forwards the message to the correct proxy object on demand, so that the gateway can obtain the corresponding message or data.
  • each gateway can pass through the local The proxy object in the gateway subscribes to topics in other gateways, and can also publish messages to other gateways through the proxy object in this gateway. Logical grouping can ensure that messages are forwarded to the correct proxy object on demand, and then to the correct gateway.
  • each gateway can run an MQTT Broker instance, and an MQTT (Message Queuing Telemetry Transport) cluster is formed between Brokers (brokers), so that each gateway can pass through the Broker Realize data sharing and device control between gateways.
  • the first proxy object and the second proxy object may be an external message broker in the gateway, which is responsible for data communication between the gateways.
  • the first proxy object and the second proxy object may be Mosquitto that implements the MQTT protocol.
  • each gateway can communicate data through Mosquitto to realize device data sharing and cross-gateway device control.
  • each gateway can subscribe to the internal MQTT Broker the device configuration of all sub-devices under the gateway, or publish the device data of the full quantum device of the gateway to the internal MQTT Broker, or subscribe to the internal MQTT Broker For the device data of interest, you can also process the received request message for subscribing to the device data of the gateway, and then respond.
  • the first gateway when the first gateway needs to obtain the device data of the first device under the second gateway, it can send a subscription request message for the first device to Mosquitto of the second gateway through Mosquitto to request the device data of the first device.
  • the second gateway receives the request, it can respond.
  • Step 102 The second proxy object obtains device data for the subscription request message, and sends the device data to the first proxy object.
  • the second gateway after the second gateway receives the subscription request message sent by the first proxy object through the second proxy object, it can obtain the device data for the subscription request message and send the device data to the first gateway The first proxy object.
  • each gateway can subscribe to the device data of interest through the internal MQTT Broker.
  • the first gateway sends a subscription request message to the second gateway through Mosquitto
  • the Mosquitto of the second gateway receives the subscription request message
  • the full device data of the device corresponding to the subscription request message under the gateway can be obtained, and the device data can be published through Mosquitto, so that the first gateway can obtain the device data sent by the second gateway through Mosquitto, and realize an edge computing cluster based on each gateway.
  • MQTT Broker can be used to share device data between gateways, ensuring that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
  • FIG. 2 a schematic diagram of data flow in an embodiment of a method for obtaining device data of the present application is shown, where the dotted line is the transmission path of the subscription request message, and the actual The line is the transmission path of the device data.
  • the MQTT cluster at least two gateways are included. Among them, the first gateway and the second gateway are in communication connection through the Mosquitto inside the gateway.
  • the first gateway when it needs to obtain the device data of the sub-device 1 under the second gateway, it can send a subscription request message for the sub-device 1 to the second Mosquitto of the second gateway through the first Mosquitto, and when the second Mosquitto obtains the subscription request message Then, you can obtain the full amount of device data of the sub-device 1, and publish the device data, so that the first Mosquitto of the first gateway can receive the device data sent by the second Mosquitto, and realize the cluster based on MQTT, and each gateway can pass through MQTT Broker realizes device data sharing between gateways, ensuring that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object,
  • the second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object.
  • the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It is ensured that the edge computing rules can be linked across networks, realize decentralization and edge autonomy, and improve the ability of edge computing.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the gateway includes a first proxy object, and the second gateway includes a second proxy object.
  • the second gateway can communicate with at least one first device.
  • the method can specifically include the following steps:
  • Step 301 The first operation agent object obtains a message route sent by the cloud server, and determines a subscription request message corresponding to the message route;
  • the cloud server when centralized collection of data is required, can issue a data collection task to one of the gateways, using the gateway as an intermediate gateway, and the gateway can obtain the data of sub-devices under other gateways, and pass The intermediate gateway uploads all data to the cloud server, thereby realizing centralized data collection.
  • the cloud server can issue a data collection task to one of the gateways, using the gateway as an intermediate gateway, and the gateway can obtain the data of sub-devices under other gateways, and pass The intermediate gateway uploads all data to the cloud server, thereby realizing centralized data collection.
  • the data collection process is simplified and the data collection efficiency is improved.
  • each gateway can communicate with the cloud server, and the gateway can also include an operation proxy object that communicates with the cloud server.
  • the operation proxy object can send local operation requests to the device operations under the gateway, and can also forward External device operation request, and other data forwarding, such as the forwarding of response messages, device data, etc.
  • each gateway can subscribe to the device data of sub-devices of other gateways through the proxy object of the gateway, and the cloud server that communicates with each gateway can use a gateway in the edge computing cluster as an intermediate gateway. Centralized acquisition of data is performed through the intermediate gateway.
  • the first gateway is an intermediate gateway
  • the first operation proxy object in the first gateway can obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route.
  • message routing can dynamically plan the transmission path of the message through routing rules, so that the message is transmitted from the message source to the target node according to the filtering conditions.
  • the cloud server can determine the transmission path of the device data that needs to be obtained by configuring the message routing. For example, to obtain the device data of the gateway A neutron device 1, the gateway C neutron device two, and the gateway D neutron device three, you can configure the message routing to include : Intermediate gateway-gateway A-intermediate gateway, intermediate gateway-gateway B-intermediate gateway, and intermediate gateway-gateway B-intermediate gateway, etc., so that each gateway can transmit data according to the message route, simplifying the data transmission process and improving Improve the efficiency of data transmission.
  • the operation proxy object may include a message broker within the gateway, such as Message-Router, which is responsible for data communication within the gateway.
  • the operation proxy object may also include a network correlation module, which acts as a data forwarding intermediary between the external message proxy object Mosquitto and the internal message proxy object Message-Router, which can convert the message sent by the Message-Router into a message based on the MQTT protocol. , And send it to Mosquitto, so that Mosquitto will forward the converted message in the MQTT cluster. It can also convert the message based on the MQTT protocol into a data format readable by the Message-Router and send it to the Message-Router.
  • the network linkage module may be Gw-Linkage, which is responsible for data forwarding between Mosquitto and Message-Router.
  • the gateway may also include a cloud proxy object communicatively connected with the cloud server, and the operation proxy object may also include a task scheduling module communicatively connected with the Message-Router.
  • the cloud proxy object can be used as the data communication intermediary between the cloud server and the gateway, responsible for the data communication between the cloud and the edge computing terminal, and the task scheduling module can be responsible for the allocation of scene linkage tasks, such as when the cloud needs to obtain
  • the task scheduling module can analyze the tasks issued by the cloud, determine the corresponding gateway and the corresponding sub-device, and perform corresponding operations.
  • the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • Device data when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • Device data when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • the cloud proxy object of the first gateway can obtain the message route issued by the cloud, and send the message route to the task scheduling module, and the task scheduling module parses the message route to determine The corresponding device data acquisition task, and the task is delivered to the Message-Router. After the Message-Router receives the task issued by the task scheduling module, it can generate the corresponding subscription request message.
  • the Message-Router can Generate the first subscription request message for the child device 1 and the second subscription request message for the child device 2, and send the first subscription request message and the second subscription request message to Gw-Linkage, so that Gw-Linkage can transfer the first subscription request message to Gw-Linkage.
  • the first subscription request message and the second subscription request message are converted into messages based on the MQTT protocol, so that the gateway can receive and process the message routing configured in the cloud.
  • Step 302 The first proxy object sends the subscription request message sent by the first operation proxy object to the second proxy object;
  • the first operation proxy object of the first gateway may send the subscription request message to the first proxy object, and the first proxy object sends the subscription request message to the second proxy object of the second gateway.
  • the Message-Router of the first gateway sends a subscription request message to Gw-Linkage
  • Gw-Linkage can convert the subscription request message to a message based on the MQTT protocol, and send the MQTT message to Mosquitto
  • the Mosquitto of the first gateway sends the MQTT message to the Mosquitto of the second gateway to implement data communication between the gateways.
  • Step 303 The second operation proxy object sends the subscription request message sent by the second proxy object to the first device;
  • the subscription request message can be sent to the second operation proxy object, and the second operation proxy The object sends the subscription request message to the first device.
  • Mosquitto of the second gateway can forward the message based on the MQTT protocol to Gw-Linkage, and Gw-Linkage will format the MQTT message to obtain the first The subscription request message of the device.
  • Step 304 The second operation proxy object obtains the device data for the subscription request message sent by the first device, and sends the device data to the second proxy object;
  • the second operation proxy object of the second gateway can receive the device data corresponding to the subscription request message reported by the first device, and send the device data to The second proxy object, so that the second proxy object sends the device data to the first gateway.
  • the Gw-Linkage of the second gateway can send the subscription request message to the Message-Router, and the Message-Router sends the subscription request message to the first device, and obtains the first device The sent device data for the subscription request message. Then Message-Router can send the device data to Gw-Linkage, and Gw-Linkage converts the device data into data based on the MQTT protocol.
  • Step 305 The second proxy object sends the device data to the first proxy object
  • the second proxy object of the second gateway can send the device data sent by the second operation proxy object to the first gateway located in the same edge computing cluster, so that the first gateway can receive it through the first proxy object The device data.
  • Mosquitto of the second gateway after Mosquitto of the second gateway forwards the device data sent by Gw-Linkage to Mosquitto of the first gateway, Mosquitto of the first gateway can convert the data based on the MQTT protocol into Message- Router can read data and send the converted device data to the Message-Router of the first gateway.
  • Step 306 The first operation proxy object sends the device data sent by the first proxy object to the application.
  • the gateway can also run an application program, which can implement local definition, development, testing, and debugging of a serverless application of the gateway, and upload device data to the cloud.
  • the first operation proxy object of the first gateway can send the device data sent by the first proxy object to the application, and the application processes the device data, such as controlling the corresponding device according to the device data, or The device data is reported to the cloud.
  • the Message-Router can send the device data to the application to complete the collection of the device data, so that the cloud
  • the first gateway acts as an intermediate gateway to collect device data from multiple other gateways.
  • multiple gateways can be taken as a whole and controlled by the cloud, which improves the linkage capability of edge computing.
  • the embodiment of the present application takes the first gateway as an example for illustrative description. It can be understood that after multiple gateways are networked to form an MQTT cluster, each gateway can share information about sub-devices and applications It can run on any gateway in the MQTT cluster. In addition, in addition to running applications, the gateway can also run IFTTT (If this then that) rules, so as to make full use of the computing power of the edge computing cluster and improve the application capabilities of edge computing.
  • IFTTT If this then that
  • FIG. 4 a schematic diagram of data flow in the second embodiment of a method for obtaining device data of the present application is shown.
  • multiple gateways are included, and each A proxy object runs in each gateway, and each gateway performs data interaction through the proxy object.
  • the first gateway can send the subscription request message to the first operation proxy object through the application, and then the first operation proxy object The subscription request message is sent to the first proxy object, and then the first proxy object sends the subscription request message to the second gateway.
  • the second gateway After the second gateway receives the subscription request message through the second proxy object, it can send the subscription request message to the second operation proxy object, and the second operation proxy object sends the subscription request message to the sub-device 1, and then obtains the sub-device.
  • the device data reported by the device 1 is transmitted to the application program of the first gateway according to the predetermined transmission path, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through proxy objects, ensuring In this way, edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
  • the data interaction between the gateway and the gateway in the edge computing cluster is taken as an example for illustrative description. It is understandable that, in addition to the data interaction between the gateway and the gateway in the edge computing cluster,
  • the data link for data collection can also include the data link between the cloud and the gateway for data collection.
  • a hybrid mode can be used for data interaction, and different data links can be used for device data acquisition according to different data acquisition speeds. For example, the speed of acquiring device data through the data link between the cloud and the gateway is faster than that through the gateway and the gateway. If the data link is fast, the device data can be obtained through the data link between the cloud and the gateway; otherwise, the device data can be obtained through the data link between the gateway and the gateway in the edge computing cluster.
  • the application is not restricted.
  • FIG. 5 a schematic diagram of data flow in the second embodiment of a method for acquiring device data of the present application is shown, where the solid line is the transmission path of the configuration information,
  • the dashed line is the transmission path of the response message.
  • the MQTT cluster includes at least a first gateway and a second gateway.
  • the first gateway and the second gateway respectively include the external message proxy object Mosquitto, the network linkage module Gw-Linkage, and the internal messages of the gateway.
  • the proxy object Message-Router, the task scheduling module Task-Dispatcher, and the cloud proxy object Cloud-Proxy, etc., and the gateway can also run applications.
  • the cloud can configure the message routing and deliver the configured message routing to the first gateway, so that the first gateway can process the message routing and obtain the corresponding device data.
  • the Cloud-Proxy of the first gateway after the Cloud-Proxy of the first gateway receives the message route issued by the cloud, it can send the message route to the Task-Dispatcher, and then the Task-Dispatcher can analyze the message route to determine the target device's data to be collected. Unique device identification, and send the device identification to the Message-Router of the first gateway, and the Message-Router generates a subscription request message for the target device, such as a subscription request message for the sub-device 1 of the second gateway, and then the subscription The request message is sent to Gw-Linkage, and Gw-Linkage can convert the subscription request message into a message based on the MQTT protocol and send it to Mosquitto.
  • Mosquitto of the first gateway sends the subscription request message to the second gateway located in the same MQTT cluster. .
  • the Mosquitto of the second gateway When the Mosquitto of the second gateway receives the subscription request message sent by the first gateway, it can send the subscription request message to Gw-Linkage, and Gw-Linkage can convert the message based on the MQTT protocol into a data format readable by Message-Router , And send the converted subscription request message to the Message-Router, and the Message-Router sends the subscription request message to the sub-device 1, so that the sub-device 1 can report the device data to the Message-Router, and the Message-Router can The entire data is forwarded to Gw-Linkage, and Gw-Linkage sends the device data to Mosquitto, so that Mosquitto of the second gateway can send the device data to the first gateway in the same MQTT cluster.
  • the Mosquitto of the first gateway When the Mosquitto of the first gateway receives the device data sent by the second gateway, it can transmit the device data to the application through the following transmission paths: Mosquitto to Gw-Linkage, Gw-Linkage to Message-Router, and then from Message-Router To the application program, so as to complete the device data collection of the second gateway sub-device 1.
  • the applications in gateways A and B are responsible for the preprocessing of the messages reported by the sensors under the gateway, and the application in gateway C subscribes to gateways A and B.
  • the device data of the sensor is a temperature sensor
  • the sensor corresponding to gateway B is a humidity sensor.
  • the application in gateway A can count the average temperature every 5 minutes
  • the application in gateway B can count the average humidity every 5 minutes
  • gateways A and B can publish the processed temperature and humidity data to gateway C.
  • the application performs further analysis to decide whether to change the configuration of the central air-conditioning system in the building or upload the temperature and humidity data to the cloud.
  • the device data collection performed by the first gateway on one sub-device in the second gateway is taken as an example for illustration. It is understandable that the gateway can perform multiple sub-devices under multiple gateways. At the same time, device data collection is performed, so that the cloud sends device data collection tasks to a certain gateway, and the gateway acts as an intermediate gateway to collect device data from multiple other gateways. On the one hand, it simplifies the data collection process and improves This improves the efficiency of data collection. On the other hand, in the device linkage scenario, multiple gateways can be taken as a whole and controlled by the cloud, which improves the linkage capability of edge computing.
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object,
  • the second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object.
  • the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It is ensured that the edge computing rules can be linked across networks, realize decentralization and edge autonomy, and improve the ability of edge computing.
  • Embodiment 1 of a device configuration method of the present application is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the first gateway includes a first proxy object
  • the second gateway includes a second proxy object
  • the second gateway communicates with at least one first device.
  • the method may specifically include the following steps:
  • Step 601 The first proxy object sends configuration information used to configure the first device to the second proxy object;
  • each gateway can run an MQTT Broker instance, and an MQTT cluster is formed between brokers, so that each gateway can implement data sharing and device control between gateways through Broker.
  • the first proxy object and the second proxy object may be an external message broker in the gateway, which is responsible for data communication between the gateways.
  • the first proxy object and the second proxy object may be Mosquitto that implements the MQTT protocol.
  • each gateway can communicate data through Mosquitto to realize device data sharing and cross-gateway device control.
  • each gateway can subscribe to the internal MQTT Broker the device configuration of all sub-devices under the gateway, or publish the device data of the full quantum device of the gateway to the internal MQTT Broker, or subscribe to the internal MQTT Broker For the device data of interest, you can also process the received request message for subscribing to the device data of the gateway, and then respond.
  • the configuration information used to configure the attributes of the first device can be sent to the second gateway through Mosquitto in the first gateway.
  • Mosquitto so that when the second gateway receives the configuration information, it can configure the attributes of the first device.
  • Step 602 The second proxy object sends a response message sent by the first device to the first proxy object, where the response message is a message for the first device to complete attribute configuration according to the configuration information .
  • Mosquitto can send the configuration information to the corresponding device, so that when the device receives the configuration information, it can perform attributes based on the configuration information Configuration.
  • the device can generate a response message for the configuration information and send the response message to Mosquitto.
  • Mosquitto sends the response message to the first gateway to inform the first gateway that the device has been configured.
  • each gateway can implement device control between gateways through proxy objects, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
  • FIG. 7 a schematic diagram of data flow in Embodiment 1 of a device configuration method of the present application is shown, where the dotted line is the transmission path of the configuration information, and the solid line is
  • the transmission path of the response message includes at least two gateways in the MQTT cluster, where the first gateway and the second gateway communicate through the Mosquitto inside the gateway. Then when the first gateway needs to control the sub-device 1 of the second gateway, the configuration information for the sub-device 1 can be sent to the second Mosquitto of the second gateway through the first Mosquitto.
  • the second Mosquitto After the second Mosquitto obtains the configuration information, it can Send the configuration information to the sub-device 1, and the sub-device 1 configures the attribute value according to the configuration information. After the configuration is completed, it can generate a response message and send the response message to Mosquitto. Then the Mosquitto of the second gateway can use the The response message is sent to the Mosquitto of the first gateway, which is based on MQTT cluster.
  • Each gateway can realize device control between gateways through MQTT Broker, which ensures that edge computing rules can be correlated across networks to achieve decentralization, edge autonomy, and improve The ability of edge computing.
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object,
  • the second gateway communicates with at least one first device, and the configuration information sent by the first gateway through the first proxy object is used to configure the configuration information of the first device under the second gateway to the second gateway, and then to the second gateway.
  • the gateway sends the response message sent by the first device to the first gateway through the second proxy object, where the response message is a message that the first device completes the attribute configuration according to the configuration information, so that based on the edge computing cluster, each gateway can pass through
  • the proxy object implements device control between gateways, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
  • the method is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway.
  • the first gateway includes a first proxy object
  • the second gateway includes a second proxy object
  • the second gateway communicates with at least one first device.
  • the method may specifically include the following steps:
  • Step 801 The first operation proxy object sends the configuration information sent by the application program to the first proxy object;
  • an application program can be run in the gateway, which can realize the local definition, development, testing, and debugging of the serverless (serverless) application of the gateway, and upload device data to the cloud. Then, when the application in the first gateway wants to control the first device in the second gateway, it can generate configuration information for configuring the first device, and send the configuration information to the first network association module, The first network association module sends the configuration information to the first proxy object.
  • the configuration information can be sent to Gw-Linkage, Gw-Linkage
  • the configuration information can be converted into information based on the MQTT protocol, and then the converted configuration information can be sent to Mosquitto.
  • Step 802 The first proxy object sends the configuration information to the second proxy object;
  • Mosquitto of the first gateway can send configuration information to Mosquitto of the second gateway.
  • Step 803 The second operation proxy object sends the configuration information sent by the second proxy object to the first device;
  • the second operation proxy object in the second gateway may send the configuration information sent by the second proxy object to the first device.
  • the Gw-Linkage of the second gateway can convert the configuration information based on the MQTT protocol into configuration information readable by the first device, and send the converted configuration information to the first device, After receiving the configuration information, the first device can set the attribute value according to the configuration information, generate a response message, and then send the response message to Gw-Linkage.
  • Step 804 The second proxy object sends the response message sent by the second operation proxy object to the first proxy object;
  • the second operation agent object in the second gateway may receive the response message sent by the first device, and the response message may be a message generated after the first device configures the attribute value according to the configuration information. Then the second proxy object can send the response message to the first proxy object in the first gateway.
  • the Gw-Linkage of the second gateway can convert the response message sent by the first device into a message based on the MQTT protocol, and send the converted response message to Mosquitto, and the second gateway The Mosquitto of the first gateway sends the response message to the Mosquitto of the first gateway.
  • Step 805 The first operation proxy object sends the response message sent by the first proxy object to the application.
  • the first operation proxy object of the first gateway can send the response message sent by the first proxy object to the application program, thereby notifying the application program that the first device in the second gateway has performed attributes according to the configuration information. Value configuration.
  • each gateway can implement device control between the gateways through proxy objects, ensuring the edge Computing rules can be linked across networks to achieve decentralization and edge autonomy, which improves the linkage capability of edge computing.
  • FIG. 4 a schematic diagram of data flow in the second embodiment of a device configuration method of the present application is shown.
  • each A proxy object runs in the gateway, and each gateway performs data interaction through the proxy object.
  • the first gateway can send the configuration information to the first operation proxy object through the application, and then the first operation proxy object The configuration information is sent to the first proxy object, and then the first proxy object sends the configuration information to the second gateway.
  • the second gateway After the second gateway receives the configuration information through the second proxy object, it can send the configuration information to the second operation proxy object, and the second operation proxy object sends the configuration information to the sub-device 1, and then the sub-device 1
  • the configuration information sets the attribute value, and sends a response message to the second operation agent object, and then transmits the response message to the application of the first gateway according to the predetermined transmission path, so that based on the edge computing cluster, each gateway can Implementing device control between gateways through proxy objects ensures that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
  • FIG. 9 a schematic diagram of data flow in the second embodiment of a device configuration method of the present application is shown, where the dashed line is the transmission path of the configuration information, and the solid line is
  • the transmission path of the response message, in the MQTT cluster includes at least a first gateway and a second gateway.
  • the first gateway and the second gateway may respectively include the external message proxy object Mosquitto, the network correlation module Gw-Linkage, and the message proxy inside the gateway.
  • Object Message-Router, task scheduling module Task-Dispatcher and cloud proxy object Cloud-Proxy, etc., and applications can also be run in the gateway.
  • the application in the first gateway needs to set the attribute value of the sub-device 1 in the second gateway
  • the application can generate configuration information for setting the sub-device 1, and then send the configuration information to Gw-Linkage , Gw-Linkage converts the configuration information into configuration information based on the MQTT protocol, and sends the converted configuration information to Mosquitto, and Mosquitto sends the configuration information to the second gateway.
  • the Mosquitto in the second gateway After the Mosquitto in the second gateway receives the configuration information, it can send the configuration information to Gw-Linkage, and Gw-Linkage converts the configuration information based on the MQTT protocol into the readable configuration information of the sub-device, and the configuration information Send to the sub-device1, then the sub-device1 can configure the attribute value according to the configuration information.
  • the configuration After the configuration is completed, it can generate a response message and send the response message to Gw-Linkage, and Gw-Linkage converts the response message It is a message based on the MQTT protocol, and sends the converted message to Mosquitto, and then Mosquitto sends the response message to the first gateway.
  • Mosquitto in the first gateway After Mosquitto in the first gateway receives the response message, it can transmit the response message to the application according to the following transmission path: Mosquitto to Gw-Linkage, and Gw-Linkage to the application, thereby completing cross-gateway device control.
  • the application programs in gateways A, B, C, and D are respectively responsible for the operation control of the sub-devices under the gateway, and each gateway forms an MQTT cluster.
  • all sub-devices under gateways A, B, C, and D can be linked through any one of gateways A, B, C, and D, so as to complete cross-gateway and multi-device linkage. Improved the linkage capability of edge computing.
  • gateway A and gateway B respectively form edge computing clusters through proxy objects under the gateway, and The application programs of gateway A and gateway B are respectively responsible for the operation control of the sub-devices under the gateway.
  • the cluster can be controlled by the application in the external device, such as the sub-devices dev_A1 and dev_A2 under the gateway A.
  • the sub-devices dev_B1 and dev_B2 under the gateway B carry out linkage control.
  • gateway B can be used as an intermediate gateway, and external applications can subscribe device data or device operation requests to gateway B, so that gateway B can send to other gateways (gateway A) in the cluster through the proxy object in this gateway. Subscribe to device data request messages or device operation requests, so that one gateway in the cluster can be used as an intermediate gateway to obtain the device data of the sub-devices under each gateway, and send device operation requests to each, so that the edge computing cluster can be used as a whole , Provide services to the outside world, and realize the edge computing cluster based.
  • a gateway can be used to obtain data or equipment control for each gateway in the cluster, which simplifies the data acquisition process and the equipment operation process, and greatly improves the work efficiency.
  • gateway B in addition to using gateway B as an intermediate gateway to control the sub-devices in gateway A, you can also directly control the sub-devices under gateway A and/or gateway B through the cloud.
  • the cloud can control the sub-devices in gateway A and/or gateway B.
  • the sub-device dev_A1 under gateway A and dev_B2 under gateway B send device operation requests to control the sub-devices dev_A1 and dev_B2, so that in the edge computing cluster, not only can the sub-devices be directly operated and controlled through the cloud, but also A gateway in the edge computing cluster is used as an intermediate gateway to perform operation control on other gateways or sub-devices under this gateway, which enriches the device control methods of edge computing scenarios.
  • the first gateway controls a sub-device in the second gateway as an example for exemplification. It is understandable that the gateway can control multiple different gateways at the same time. The sub-devices are controlled at the same time, so that based on the edge computing cluster, each gateway can realize the device control between the gateways through the proxy object, which ensures that the edge computing rules can be correlated across the network, realizes decentralization, edge autonomy, and improves edge computing The linkage ability.
  • the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object,
  • the second gateway communicates with at least one first device, and the configuration information sent by the first gateway through the first proxy object is used to configure the configuration information of the first device under the second gateway to the second gateway, and then to the second gateway.
  • the gateway sends the response message sent by the first device to the first gateway through the second proxy object, where the response message is a message that the first device completes the attribute configuration according to the configuration information, so that based on the edge computing cluster, each gateway can pass through
  • the proxy object implements device control between gateways, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
  • gateways A and B are responsible for the preprocessing of messages reported by sensors under this gateway, while applications in gateway C subscribe to the device data in gateways A and B.
  • the sensor corresponding to gateway A is a temperature sensor
  • the sensor corresponding to gateway B is a humidity sensor. Then the application in gateway A can count the average temperature every 5 minutes, and the application in gateway B can count the average humidity every 5 minutes, and then gateways A and B can publish the processed temperature and humidity data to gateway C.
  • the application program performs further analysis to determine whether to change the configuration of the central air-conditioning system in the building.
  • the gateway C can send the configuration information of the central air-conditioning system to the gateway D, and the gateway D transmits the configuration information to the central air-conditioning system to realize the attribute value setting of the central air-conditioning system.
  • FIG. 11 a structural block diagram of an embodiment of an edge computing cluster of the present application is shown.
  • the hardware capability of carrying services is usually weak, and the physical capability of a single gateway hardware is limited.
  • a single gateway cannot be used for access.
  • Existing problems include equipment wiring, insufficient single gateway interface or insufficient hardware processing capacity, etc., which requires the use of multiple gateways for access.
  • field devices do not belong to the same gateway in terms of physical links.
  • the edge gateway is required to have the ability to implement cross-gateway device control and data sharing.
  • each gateway can only access the sub-devices assigned to its own gateway, and cannot directly control or obtain information on sub-devices connected to other gateways. Therefore, the embodiment of the present application proposes an edge computing cluster, which can realize cross-network correlation between different gateways, and realize device data sharing and device control between gateways.
  • the edge computing cluster may include multiple gateways, each gateway may be provided with a proxy object, and each gateway may perform data interaction through the proxy object.
  • multiple edge gateways can be networked, and each edge gateway runs an MQTT Broker instance, so that the edge gateways are networked to form an edge computing cluster. Realize the collection, circulation, storage, analysis, and reporting of device data between various gateways.
  • the edge gateway may include a proxy object, and multiple different edge gateways can form an MQTT cluster through the proxy object.
  • each gateway can realize the transfer of device data between the gateways on demand.
  • the configuration items required for the networking of the edge computing cluster include: gateway identification, gateway IP address, and shared key.
  • Each edge gateway corresponds to an object of this structure, thus forming a Json array.
  • the data transmission link is connected to each gateway, and the data transmission link is encrypted, thereby completing the networking of the edge computing cluster.
  • the shared key is used for identity authentication and data transmission link encryption between gateways, and the pre-shared key TLS-PSK can be used for identity authentication and encryption, thereby taking into account security and flexibility.
  • different gateways in the edge computing cluster can mutually access sub-devices under other gateways to obtain corresponding device data, or for sub-devices under other gateways. Access and control.
  • other gateways located outside the edge computing cluster cannot access the gateway in the cluster through the edge computing cluster, nor can they access the sub-devices under the gateway.
  • sub-devices located in the same edge computing cluster can include a first sub-device and a second sub-device.
  • the first sub-device can be a device that can be accessed through a data link
  • the second sub-device can To encrypt the device, the device data on the second sub-device is encrypted data, and access to the device data on the second sub-device requires the access permission of the second sub-device to access it.
  • gateway A and gateway B are located in the same edge computing cluster, where the sub-device 1 under gateway A is the first sub-device and sub-device 2 is the second sub-device, then gateway B can pair the sub-devices through the data link in the cluster 1Access to obtain the device data of the sub-device 1 or control the sub-device 1; and for the sub-device 2, the access permission of the sub-device 2 is required to obtain the device data of the sub-device 2 or control the sub-device 2, thus For encryption devices in the same edge computing cluster, the access rights of the encryption devices need to be obtained before data acquisition or device control can be performed, which can effectively ensure the data security of the devices in the same edge computing cluster and the security of device control.
  • the gateway includes at least a first gateway communicatively connected with at least one first device, and a second gateway communicatively connected with at least one second device;
  • the proxy object includes A first proxy object set in the first gateway, and a second proxy object set in the second gateway;
  • the first gateway is configured to send first communication data for the second device through the first proxy object; and receive through the first proxy object for the first communication sent by the second gateway The first response data of the data;
  • the second gateway is configured to send second communication data for the first device through the second proxy object; and receive through the second proxy object for the second communication sent by the first gateway The second response data of the data.
  • each gateway in the edge computing cluster can subscribe to the device data of all sub-devices under the gateway through the proxy object, or publish the device data of the full quantum devices under the gateway through the proxy object, or subscribe through the proxy object
  • the device data of sub-devices under other gateways can also receive subscription request messages sent from other gateways to subscribe to the device data of sub-devices under this gateway through proxy objects.
  • each gateway in the edge computing cluster can run application programs, which can implement local definition, development, testing, and debugging of serverless (serverless) applications of the gateway, and upload device data to the cloud.
  • the first proxy object is used to send the first communication data sent by the application to the second proxy object; the second proxy object is used to send the first communication data to the second proxy object; Sending communication data to the second device; and obtaining first response data for the first communication data reported by the second device, and sending the first response data to the first proxy object.
  • the first gateway includes an operation proxy object; the operation proxy object is used to send the first response data sent by the first proxy object to the application.
  • the operation proxy object is further configured to send the second communication data sent by the first proxy object to the first device, so that the The first device performs a first device operation corresponding to the second communication data; and sends the second response data sent by the first device for the second communication data to the first proxy object.
  • the operation proxy object is also used to send the local operation data sent by the application to the first device, so that the first device executes and The second device operation corresponding to the local operation data.
  • the first proxy object when the first communication data is a subscription request message and the first response data includes device data, the first proxy object is also used to target the second device The subscription request message is sent to the second proxy object; the second proxy object is also used to obtain the device data sent by the second device for the subscription request message; and send the device data to the The first proxy object.
  • the first gateway when the first gateway needs to receive the device data of the first device located in the second gateway, it can send a subscription request message for the first device to the second proxy object of the second gateway through the first proxy object, then After the second gateway receives the subscription request message, it can send the device data for the subscription request message to the first proxy object through the second proxy object, so that based on the edge computing cluster, the gateways can communicate with each other through the proxy object. Inter-data sharing ensures that edge computing rules can be linked across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
  • the second proxy object when the second communication data includes device configuration information, and the second response data includes a configuration response message, the second proxy object is also used to target the The device configuration information of the first device is sent to the first proxy object; the operation proxy object is also used to send the device configuration information sent by the first proxy object to the first device, so that The first device performs an operation corresponding to the device configuration information; and obtains the configuration response message sent by the first device information, and sends the configuration response message to the first proxy object; The first proxy object is also used to send the configuration response message to the second proxy object.
  • the configuration information for the first device can be sent to the second proxy object of the second gateway through the first proxy object, Therefore, the second proxy object can send the configuration information to the first device, so that the first device performs attribute configuration based on the configuration information.
  • each gateway can implement device control between the gateways through the proxy object. It ensures that the edge computing rules can be correlated across networks, realize decentralization and edge autonomy, and improve the linkage capability of edge computing.
  • the gateway may further include a cloud proxy object communicatively connected with the cloud server, and the operation proxy object may further include a task scheduling module communicatively connected with the Message-Router.
  • the cloud proxy object can be used as the data communication intermediary between the cloud server and the gateway, responsible for the data communication between the cloud and the edge computing terminal, and the task scheduling module can be responsible for the allocation of scene linkage tasks, such as when the cloud needs to obtain
  • the task scheduling module can analyze the tasks issued by the cloud, determine the corresponding gateway and the corresponding sub-device, and perform corresponding operations.
  • the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • Device data when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • Device data when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route.
  • the cloud proxy object can be responsible for the communication between the edge gateway and the cloud server, the cloud can deliver data to the edge gateway, and the edge gateway can also report data to the cloud.
  • the cloud proxy object can monitor the device data uploaded by the gateway.
  • the device data When the device data is monitored as the device data of the sub-device under this gateway, it is reported to the cloud; when the device data is monitored as the device data of the sub-device under other gateways Data is not reported from the gateway to the cloud, that is, the gateway cannot report the device data of other gateway sub-devices to the cloud.
  • an architecture diagram of an edge computing cluster in an embodiment of an edge computing cluster of the present application is shown, and the edge computing cluster includes at least two edge gateways.
  • the edge gateway includes the first external message proxy object Mosquitto, the network related dynamic module Gw-Linkage, the second message proxy object Message-Router inside the gateway, the task scheduling module Task-Dispatcher, and the cloud proxy object Cloud-Proxy, etc.
  • the gateway can also run applications, and the gateway can communicate with at least one sub-device.
  • the solid line in Figure 10 represents the data flow
  • the dashed line represents the control flow.
  • the edge gateways can communicate through Mosquitto, and each module (application) in the gateway can communicate and connect according to the set data transmission path. This will not be repeated here.
  • the edge system includes at least a first gateway and a second gateway communicating with the first device; the first gateway includes a first proxy object, and the second gateway includes a second proxy object; Wherein, the first gateway is configured to send a subscription request message for the first device to the second proxy object through the first proxy object; the second gateway is configured to send a subscription request message for the first device to the second proxy object through the first proxy object; The second proxy object sends the device data for the subscription request message to the first proxy object, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, ensuring the edge computing rules It can be linked across networks to achieve decentralization, edge autonomy, and improve edge computing capabilities.
  • the first gateway is also used to send configuration information for the first device to the second proxy object through the first proxy object;
  • the second gateway is also used to send configuration information for the first device to the second proxy object through the first proxy object;
  • the second proxy object sends the configuration information to the first device, so that the first device performs attribute configuration based on the configuration information, so that based on the edge computing cluster, each gateway can implement inter-gateway communication through proxy objects.
  • Device control is also used to send configuration information for the first device to the second proxy object through the first proxy object;
  • the second gateway is also used to send configuration information for the first device to the second proxy object through the first proxy object;
  • the second proxy object sends the configuration information to the first device, so that the first device performs attribute configuration based on the configuration information, so that based on the edge computing cluster, each gateway can implement inter-gateway communication through proxy objects.
  • FIG. 13 there is shown a structural block diagram of an embodiment of an apparatus for acquiring device data of the present application, which is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes A first proxy object, the second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
  • the subscription message sending module 1301 is used for the first proxy object to send a subscription request message for the first device to the second proxy object;
  • the device data sending module 1302 is used for the second proxy object to obtain device data for the subscription request message, and send the device data to the first proxy object.
  • the first gateway is in a communication connection with a cloud server, and the first gateway further includes a first communication connection with the cloud server and the first proxy object.
  • the subscription message sending module 1301 includes:
  • the first subscription message determining submodule is used for the first operation agent object to obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route;
  • the subscription message sending submodule is used for the first proxy object to send the subscription request message sent by the first operation proxy object to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object
  • the device data sending module 1302 includes:
  • the second subscription message sending submodule is configured to send the subscription request message sent by the second proxy object to the first device by the second operation proxy object;
  • a device data acquisition sub-module configured for the second operation proxy object to acquire the device data for the subscription request message sent by the first device, and send the device data to the second proxy object;
  • the device data sending submodule is used for the second proxy object to send the device data to the first proxy object.
  • the first gateway runs an application
  • the device further includes:
  • the device data forwarding module is used for the first operation proxy object to send the device data sent by the first proxy object to the application program.
  • the first gateway further includes a cloud proxy object communicatively connected with the cloud server and the first operation proxy object, and the first subscription message determining submodule Specifically used for:
  • the cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
  • the first operation agent object determines the subscription request message corresponding to the message route.
  • FIG. 14 there is shown a structural block diagram of an embodiment of a device configuration apparatus of the present application, which is applied to an edge computing cluster.
  • the edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes a first gateway.
  • a response message sending module 1402 configured for the second proxy object to send a response message sent by the first device to the first proxy object, where the response message is based on the configuration information of the first device, Message to complete the property configuration.
  • the first gateway runs an application program
  • the first gateway further includes a first operation proxy object that is communicatively connected with the first proxy object
  • the sending module 1401 includes:
  • the first information sending submodule is used for the first operation proxy object to send the configuration information sent by the application program to the first proxy object;
  • the second information sending submodule is used for the first proxy object to send the configuration information to the second proxy object.
  • the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the response message sending module 1402 include:
  • the configuration information sending sub-module is used for the second operation proxy object to send the configuration information sent by the second proxy object to the first device;
  • the response message sending submodule is used for the second proxy object to send the response message sent by the second operation proxy object to the first proxy object.
  • the response message forwarding module is configured to send the response message sent by the first proxy object to the application by the first operation proxy object.
  • edge computing clusters and device embodiments since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiments.
  • the embodiments of the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, 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, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-persistent computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • Magnetic cassettes magnetic tape magnetic disk
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operation steps are executed on the computer or other programmable terminal equipment to produce computer-implemented processing, so that the computer or other programmable terminal equipment
  • the instructions executed above provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present application provide an obtaining method, a configuration method, an edge computing cluster, and apparatuses. The obtaining method is applied to an edge computing cluster, the edge computing cluster comprising at least a first gateway and a second gateway, the first gateway comprising a first proxy object, the second gateway comprising a second proxy object, and the second gateway being communicationally connected to at least one first device. The first gateway sends to the second gateway a subscription request message for the first device by means of the first proxy object, and then the second gateway obtains device data for the subscription request message by means of the second proxy object, and sends the device data to the first gateway. Thus, on the basis of the edge computing cluster, data sharing between gateways can be implemented by means of proxy objects, ensuring that edge computing rules can be linked across gateways, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.

Description

获取方法、配置方法、边缘计算集群及装置Obtaining method, configuration method, edge computing cluster and device
本申请要求2019年09月19日递交的申请号为201910888040.7、发明名称为“获取方法、配置方法、边缘计算集群及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on September 19, 2019 with the application number 201910888040.7 and the invention title "Acquisition method, configuration method, edge computing cluster and device", the entire content of which is incorporated into this application by reference .
技术领域Technical field
本申请涉及通信技术领域,特别是涉及一种设备数据的获取方法,一种设备的配置方法,一种边缘计算集群以及一种设备数据的获取装置,一种设备的配置装置。This application relates to the field of communication technology, and in particular to a method for acquiring device data, a method for configuring a device, an edge computing cluster, and a device for acquiring device data, and a device for configuring a device.
背景技术Background technique
在边缘计算场景,承载业务的硬件能力通常较弱。单台网关硬件的物理能力有限,在设备量大(万级)的情况下无法用单台网关接入,其瓶颈可能是设备布线问题,可能是单台网关接口不足或者硬件处理能力不够,因此需要使用多网关接入。In edge computing scenarios, the hardware capability of carrying services is usually weak. The physical capacity of a single gateway hardware is limited, and a single gateway cannot be accessed when the amount of equipment is large (ten thousand). The bottleneck may be the equipment wiring problem, or the single gateway interface may be insufficient or the hardware processing capacity is not enough, so Need to use multi-gateway access.
如在工业或者楼宇现场,有很多设备,它们在物理链接上不属于同一个网关,但是在业务上有关联,这就需要边缘网关有能力进行跨网关的设备控制和数据共享。但目前每个网关只能访问分配到本网关的子设备,对接入其它网关下的子设备“看不见”、也“摸不着”,根本无法实现设备控制和数据共享。For example, in an industrial or building site, there are many devices that do not belong to the same gateway on the physical link, but are related in business. This requires the edge gateway to have the ability to perform cross-gateway device control and data sharing. But at present, each gateway can only access the sub-devices assigned to its own gateway, and is "invisible" and "intangible" to the sub-devices connected to other gateways, and it is impossible to realize device control and data sharing at all.
发明内容Summary of the invention
本申请实施例所要解决的技术问题是提供一种设备数据的获取方法、设备的配置方法,以解决现有技术中边缘计算中中心化依赖严重,无法实现跨网关的设备控制和数据共享等问题。The technical problem to be solved by the embodiments of this application is to provide a method for acquiring device data and a method for configuring devices to solve the problems of severe centralization dependence in edge computing in the prior art, and the inability to achieve cross-gateway device control and data sharing. .
为了解决上述问题,本申请实施例公开了一种设备数据的获取方法,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法包括:In order to solve the above-mentioned problem, an embodiment of the present application discloses a method for acquiring device data, which is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes a first proxy object , The second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the method includes:
所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;Sending, by the first proxy object, a subscription request message for the first device to the second proxy object;
所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。The second proxy object obtains device data for the subscription request message, and sends the device data to the first proxy object.
可选地,所述第一网关与云服务器进行通信连接,所述第一网关还包括与所述云服 务器以及所述第一代理对象通信连接的第一操作代理对象,所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象,包括:Optionally, the first gateway is in a communication connection with a cloud server, and the first gateway further includes a first operation proxy object communicatively connected with the cloud server and the first proxy object, the first proxy object Sending a subscription request message for the first device to the second proxy object includes:
所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息;The first operation agent object obtains the message route sent by the cloud server, and determines a subscription request message corresponding to the message route;
所述第一代理对象将所述第一操作代理对象发送的所述订阅请求消息,发送至所述第二代理对象。The first proxy object sends the subscription request message sent by the first operation proxy object to the second proxy object.
可选地,所述第二网关还包括与所述第二代理对象通信连接的第二操作代理对象,所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象,包括:Optionally, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object, and the second proxy object obtains device data for the subscription request message, and combines the device data Send to the first proxy object, including:
所述第二操作代理对象将所述第二代理对象发送的所述订阅请求消息,发送至所述第一设备;Sending, by the second operation proxy object, the subscription request message sent by the second proxy object to the first device;
所述第二操作代理对象获取所述第一设备发送的针对所述订阅请求消息的所述设备数据,并将所述设备数据发送至所述第二代理对象;The second operation proxy object obtains the device data for the subscription request message sent by the first device, and sends the device data to the second proxy object;
所述第二代理对象将所述设备数据,发送至所述第一代理对象。The second proxy object sends the device data to the first proxy object.
可选地,所述第一网关运行应用程序,所述方法还包括:Optionally, the first gateway runs an application program, and the method further includes:
所述第一操作代理对象将所述第一代理对象发送的所述设备数据,发送至所述应用程序。The first operation proxy object sends the device data sent by the first proxy object to the application.
可选地,所述第一网关还包括与所述云服务器以及所述第一操作代理对象通信连接的云代理对象,所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息,包括:Optionally, the first gateway further includes a cloud proxy object communicatively connected to the cloud server and the first operation proxy object, and the first operation proxy object obtains the message route sent by the cloud server and determines The subscription request message corresponding to the message route includes:
所述云代理对象获取所述云服务器发送的所述消息路由,并将所述消息路由发送至所述第一操作代理对象;The cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
所述第一操作代理对象确定与所述消息路由对应的订阅请求消息。The first operation agent object determines the subscription request message corresponding to the message route.
本申请实施例还公开了一种设备的配置方法,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法包括:An embodiment of the application also discloses a device configuration method, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The first gateway includes a first proxy object, and the second The gateway includes a second proxy object, the second gateway communicates with at least one first device, and the method includes:
所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;Sending, by the first proxy object, configuration information used to configure the first device to the second proxy object;
所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置的消息。The second proxy object sends a response message sent by the first device to the first proxy object, where the response message is a message that the first device completes the configuration of attributes according to the configuration information.
可选地,所述第一网关运行应用程序,所述第一网关还包括与所述第一代理对象通信连接的第一操作代理对象,所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象,包括:Optionally, the first gateway runs an application program, and the first gateway further includes a first operation proxy object communicatively connected with the first proxy object, and the first proxy object sends an application program to the first proxy object. The configuration information configured by the device to the second proxy object includes:
所述第一操作代理对象将所述应用程序发送的所述配置信息,发送至所述第一代理对象;Sending, by the first operation proxy object, the configuration information sent by the application program to the first proxy object;
所述第一代理对象将所述配置信息发送至所述第二代理对象。The first proxy object sends the configuration information to the second proxy object.
可选地,所述第二网关还包括与所述第二代理对象和所述第一设备通信连接的第二操作代理对象,所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,包括:Optionally, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the second proxy object sends a response message sent by the first device, Send to the first proxy object, including:
所述第二操作代理对象将所述第二代理对象发送的所述配置信息,发送至所述第一设备;Sending, by the second operation proxy object, the configuration information sent by the second proxy object to the first device;
所述第二代理对象将所述第二操作代理对象发送的所述回应消息,发送至所述第一代理对象。The second proxy object sends the response message sent by the second operation proxy object to the first proxy object.
可选地,还包括:Optionally, it also includes:
所述第一操作代理对象将所述第一代理对象发送的所述回应消息,发送至所述应用程序。The first operation proxy object sends the response message sent by the first proxy object to the application.
本申请实施例还公开了一种边缘计算集群,包括多个网关,每个网关中设置有代理对象,各个网关通过所述代理对象进行数据交互。The embodiment of the present application also discloses an edge computing cluster, which includes multiple gateways, each gateway is provided with a proxy object, and each gateway performs data interaction through the proxy object.
可选地,所述网关至少包括与至少一个第一设备通信连接的第一网关,与至少一个第二设备通信连接的第二网关;所述代理对象包括设置于所述第一网关的第一代理对象,以及设置于所述第二网关的第二代理对象;其中,Optionally, the gateway includes at least a first gateway communicatively connected to at least one first device, and a second gateway communicatively connected to at least one second device; the proxy object includes a first gateway that is set in the first gateway. A proxy object, and a second proxy object set in the second gateway; wherein,
所述第一网关,用于通过所述第一代理对象发送针对所述第二设备的第一通信数据;以及通过所述第一代理对象接收所述第二网关发送的针对所述第一通信数据的第一回应数据;The first gateway is configured to send first communication data for the second device through the first proxy object; and receive through the first proxy object for the first communication sent by the second gateway The first response data of the data;
所述第二网关,用于通过所述第二代理对象发送针对所述第一设备的第二通信数据;以及通过所述第二代理对象接收所述第一网关发送的针对所述第二通信数据的第二回应数据。The second gateway is configured to send second communication data for the first device through the second proxy object; and receive through the second proxy object for the second communication sent by the first gateway The second response data of the data.
可选地,所述第一网关运行应用程序;Optionally, the first gateway runs an application program;
所述第一代理对象,用于将所述应用程序发送的所述第一通信数据发送至所述第二代理对象;The first proxy object is used to send the first communication data sent by the application program to the second proxy object;
所述第二代理对象,用于将所述第一通信数据发送至所述第二设备;以及获取所述第二设备上报的针对所述第一通信数据的第一回应数据,并将所述第一回应数据发送至所述第一代理对象。The second proxy object is used to send the first communication data to the second device; and obtain the first response data reported by the second device for the first communication data, and send the The first response data is sent to the first proxy object.
可选地,所述第一网关包括操作代理对象;Optionally, the first gateway includes an operation proxy object;
所述操作代理对象,用于将所述第一代理对象发送的所述第一回应数据发送至所述应用程序。The operation proxy object is used to send the first response data sent by the first proxy object to the application.
可选地,所述操作代理对象,还用于将所述第一代理对象发送的所述第二通信数据,发送至所述第一设备,使所述第一设备执行与所述第二通信数据对应的第一设备操作;以及将所述第一设备发送的针对所述第二通信数据的第二回应数据,发送至所述第一代理对象。Optionally, the operation proxy object is further configured to send the second communication data sent by the first proxy object to the first device, so that the first device performs the second communication with the first device The first device operation corresponding to the data; and sending the second response data sent by the first device to the second communication data to the first proxy object.
可选地,所述操作代理对象,还用于将所述应用程序发送的本地操作数据发送至所述第一设备,使所述第一设备执行与所述本地操作数据对应的第二设备操作。Optionally, the operation proxy object is also used to send local operation data sent by the application program to the first device, so that the first device performs a second device operation corresponding to the local operation data .
可选地,所述第一网关包括与云服务器通信连接的云代理对象;Optionally, the first gateway includes a cloud proxy object communicatively connected with a cloud server;
所述云代理对象,用于获取所述云服务器发送的所述消息路由,并将所述消息路由发送至所述操作代理对象;The cloud proxy object is used to obtain the message route sent by the cloud server, and send the message route to the operation proxy object;
所述操作代理对象,用于确定与所述消息路由对应的第一通信数据。The operation proxy object is used to determine the first communication data corresponding to the message route.
可选地,所述第一通信数据包括订阅请求消息,所述第一回应数据包括设备数据;Optionally, the first communication data includes a subscription request message, and the first response data includes device data;
所述第一代理对象,还用于将针对所述第二设备的订阅请求消息发送至所述第二代理对象;The first proxy object is also used to send a subscription request message for the second device to the second proxy object;
所述第二代理对象,还用于获取所述第二设备发送的针对所述订阅请求消息的设备数据;并将所述设备数据发送至所述第一代理对象。The second proxy object is also used to obtain device data for the subscription request message sent by the second device; and send the device data to the first proxy object.
可选地,所述第二通信数据包括设备配置信息,所述第二回应数据包括配置回应消息;Optionally, the second communication data includes device configuration information, and the second response data includes a configuration response message;
所述第二代理对象,还用于将所述针对所述第一设备的设备配置信息发送至所述第一代理对象;The second proxy object is also used to send the device configuration information for the first device to the first proxy object;
所述操作代理对象,还用于将所述第一代理对象发送的所述设备配置信息发送至所述第一设备,使所述第一设备执行与所述设备配置信息对应的操作;以及获取所述第一设备信息发送的所述配置回应消息,并将所述配置回应消息发送至所述第一代理对象;The operation proxy object is further configured to send the device configuration information sent by the first proxy object to the first device, so that the first device performs an operation corresponding to the device configuration information; and obtain Sending the configuration response message sent by the first device information to the first proxy object;
所述第一代理对象,还用于将所述配置回应消息发送至所述第二代理对象。The first proxy object is also used to send the configuration response message to the second proxy object.
本申请实施例还公开了一种设备数据的获取装置,应用于边缘计算集群,所述边缘 计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述装置包括:An embodiment of the application also discloses a device data acquisition device, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The first gateway includes a first proxy object, and the first gateway includes a first proxy object. The second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
订阅消息发送模块,用于所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;A subscription message sending module, configured for the first proxy object to send a subscription request message for the first device to the second proxy object;
设备数据发送模块,用于所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。The device data sending module is used for the second proxy object to obtain the device data for the subscription request message, and send the device data to the first proxy object.
可选地,所述第一网关与云服务器进行通信连接,所述第一网关还包括与所述云服务器以及所述第一代理对象通信连接的第一操作代理对象,所述订阅消息发送模块包括:Optionally, the first gateway communicates with a cloud server, and the first gateway further includes a first operation proxy object communicatively connected with the cloud server and the first proxy object, and the subscription message sending module include:
第一订阅消息确定子模块,用于所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息;The first subscription message determining submodule is used for the first operation agent object to obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route;
订阅消息发送子模块,用于所述第一代理对象将所述第一操作代理对象发送的所述订阅请求消息,发送至所述第二代理对象。The subscription message sending submodule is used for the first proxy object to send the subscription request message sent by the first operation proxy object to the second proxy object.
可选地,所述第二网关还包括与所述第二代理对象通信连接的第二操作代理对象,所述设备数据发送模块包括:Optionally, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object, and the device data sending module includes:
第二订阅消息发送子模块,用于所述第二操作代理对象将所述第二代理对象发送的所述订阅请求消息,发送至所述第一设备;The second subscription message sending submodule is configured to send the subscription request message sent by the second proxy object to the first device by the second operation proxy object;
设备数据获取子模块,用于所述第二操作代理对象获取所述第一设备发送的针对所述订阅请求消息的所述设备数据,并将所述设备数据发送至所述第二代理对象;A device data acquisition sub-module, configured for the second operation proxy object to acquire the device data for the subscription request message sent by the first device, and send the device data to the second proxy object;
设备数据发送子模块,用于所述第二代理对象将所述设备数据,发送至所述第一代理对象。The device data sending submodule is used for the second proxy object to send the device data to the first proxy object.
可选地,所述第一网关运行应用程序,所述装置还包括:Optionally, the first gateway runs an application program, and the device further includes:
设备数据转发模块,用于所述第一操作代理对象将所述第一代理对象发送的所述设备数据,发送至所述应用程序。The device data forwarding module is used for the first operation proxy object to send the device data sent by the first proxy object to the application program.
可选地,所述第一网关还包括与所述云服务器以及所述第一操作代理对象通信连接的云代理对象,所述第一订阅消息确定子模块具体用于:Optionally, the first gateway further includes a cloud proxy object communicatively connected with the cloud server and the first operation proxy object, and the first subscription message determining submodule is specifically configured to:
所述云代理对象获取所述云服务器发送的所述消息路由,并将所述消息路由发送至所述第一操作代理对象;The cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
所述第一操作代理对象确定与所述消息路由对应的订阅请求消息。The first operation agent object determines the subscription request message corresponding to the message route.
本申请实施例还公开了一种设备的配置装置,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包 括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述装置包括:An embodiment of the application also discloses a device configuration device, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The first gateway includes a first proxy object, and the second The gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
配置信息发送模块,用于所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;A configuration information sending module, configured for the first proxy object to send configuration information for configuring the first device to the second proxy object;
回应消息发送模块,用于所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置的消息。The response message sending module is used for the second proxy object to send the response message sent by the first device to the first proxy object, where the response message is completed by the first device according to the configuration information Attribute configuration message.
可选地,所述第一网关运行应用程序,所述第一网关还包括与所述第一代理对象通信连接的第一操作代理对象,所述配置信息发送模块包括:Optionally, the first gateway runs an application program, the first gateway further includes a first operation proxy object communicatively connected with the first proxy object, and the configuration information sending module includes:
第一信息发送子模块,用于所述第一操作代理对象将所述应用程序发送的所述配置信息,发送至所述第一代理对象;The first information sending submodule is used for the first operation proxy object to send the configuration information sent by the application program to the first proxy object;
第二信息发送子模块,用于所述第一代理对象将所述配置信息发送至所述第二代理对象。The second information sending submodule is used for the first proxy object to send the configuration information to the second proxy object.
可选地,所述第二网关还包括与所述第二代理对象和所述第一设备通信连接的第二操作代理对象,所述回应消息发送模块包括:Optionally, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the response message sending module includes:
配置信息发送子模块,用于所述第二操作代理对象将所述第二代理对象发送的所述配置信息,发送至所述第一设备;The configuration information sending sub-module is used for the second operation proxy object to send the configuration information sent by the second proxy object to the first device;
回应消息发送子模块,用于所述第二代理对象将所述第二操作代理对象发送的所述回应消息,发送至所述第一代理对象。The response message sending submodule is used for the second proxy object to send the response message sent by the second operation proxy object to the first proxy object.
可选地,还包括:Optionally, it also includes:
回应消息转发模块,用于所述第一操作代理对象将所述第一代理对象发送的所述回应消息,发送至所述应用程序。The response message forwarding module is configured to send the response message sent by the first proxy object to the application by the first operation proxy object.
与现有技术相比,本申请实施例包括以下优点:Compared with the prior art, the embodiments of the present application include the following advantages:
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,第一网关通过所述第一代理对象发送针对所述第一设备的订阅请求消息,至第二网关,接着第二网关通过所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一网关,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。In this embodiment of the application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object, The second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object. Second, the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It ensures that the edge computing rules can be correlated across networks, realize decentralization and edge autonomy, and improve the linkage capability of edge computing.
附图说明Description of the drawings
图1是本申请的一种设备数据的获取方法实施例一的步骤流程图;FIG. 1 is a flowchart of the steps of Embodiment 1 of a method for acquiring device data according to the present application;
图2是本申请的一种设备数据的获取方法实施例一中数据流转示意图;2 is a schematic diagram of data flow in Embodiment 1 of a method for acquiring device data according to the present application;
图3是本申请的一种设备数据的获取方法实施例二的步骤流程图;FIG. 3 is a flowchart of the steps of Embodiment 2 of a method for acquiring device data according to the present application;
图4是本申请的一种设备数据的获取方法实施例二种数据流转示意图;4 is a schematic diagram of data flow in the second embodiment of a method for acquiring device data according to the present application;
图5是本申请的一种设备数据的获取方法实施例二种数据流转示意图;5 is a schematic diagram of data flow in the second embodiment of a method for acquiring device data according to the present application;
图6是本申请的一种设备的配置方法实施例一的步骤流程图;FIG. 6 is a flow chart of the steps of Embodiment 1 of a device configuration method of the present application;
图7是本申请的一种设备的配置方法实施例一中数据流转示意图;FIG. 7 is a schematic diagram of data flow in Embodiment 1 of a device configuration method of the present application;
图8是本申请的一种设备的配置方法实施例二的步骤流程图;FIG. 8 is a flowchart of the steps of Embodiment 2 of a device configuration method of the present application;
图9是本申请的一种设备的配置方法实施例二中数据流转示意图;9 is a schematic diagram of data flow in Embodiment 2 of a device configuration method of the present application;
图10是本申请的一种设备的配置方法实施例二中数据流转示意图;10 is a schematic diagram of data flow in Embodiment 2 of a device configuration method of the present application;
图11是本申请的一种边缘计算集群实施例的结构框图;FIG. 11 is a structural block diagram of an embodiment of an edge computing cluster of the present application;
图12是本申请的一种边缘计算集群实施例中边缘计算集群的架构图;FIG. 12 is an architecture diagram of an edge computing cluster in an embodiment of an edge computing cluster of the present application;
图13是本申请的一种设备数据的获取装置实施例的结构框图;FIG. 13 is a structural block diagram of an embodiment of an apparatus for acquiring device data according to the present application;
图14是本申请的一种设备的配置装置实施例的结构框图。FIG. 14 is a structural block diagram of an embodiment of a device configuration device of the present application.
具体实施方式detailed description
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。In order to make the above objectives, features, and advantages of the application more obvious and understandable, the application will be further described in detail below in conjunction with the accompanying drawings and specific implementations.
参照图1,示出了本申请的一种设备数据的获取方法实施例一的步骤流程图。1, it shows a flow chart of the steps of Embodiment 1 of a method for acquiring device data according to the present application.
在边缘计算场景,可部署于不同量级的智能设备和计算节点中,通过定义物模型连接不同协议、不同数据格式的设备,提供安全可靠、低延时、低成本、易扩展、弱依赖的本地计算服务。同时,可以结合云服务器的大数据、AI(Artificial Intelligence,人工智能)学习、语音、视频等能力,打造出云边端三位一体的计算体系。In edge computing scenarios, it can be deployed in smart devices and computing nodes of different magnitudes, and connect devices with different protocols and different data formats through defined object models to provide safe, reliable, low-latency, low-cost, easy-scalable, and weakly dependent Local computing services. At the same time, the cloud server's big data, AI (Artificial Intelligence) learning, voice, video and other capabilities can be combined to create a cloud-side trinity computing system.
在边缘计算中,主要涉及设备端、边缘计算端以及云服务器。其中,开发者可以使用设备接入SDK(Software Development Kit,软件开发工具包),将非标设备转换成标准物模型,就近接入网关,从而实现设备的管理和控制。运行应用程序的计算设备可以为边缘计算端,即边缘网关,当设备连接到网关后,网关可以实现设备数据的采集、流转、存储、分析和上报设备数据至云端,同时网关提供规则引擎、函数计算引擎,方便场景编排和业务扩展。云服务器则可以对上传的设备数据,结合云端的功能,如大数据、 AI学习等,通过标准API(Application Programming Interface,应用程序编程接口)接口,实现更多功能和应用。In edge computing, it mainly involves the device side, edge computing side and cloud server. Among them, developers can use the device to access SDK (Software Development Kit, software development kit), convert non-standard devices into standard object models, and access the gateway nearby to realize device management and control. The computing device running the application can be the edge computing terminal, that is, the edge gateway. When the device is connected to the gateway, the gateway can collect, transfer, store, analyze and report the device data to the cloud, and the gateway provides rule engines and functions The calculation engine facilitates scene orchestration and business expansion. The cloud server can combine the uploaded device data with cloud functions, such as big data, AI learning, etc., and realize more functions and applications through standard API (Application Programming Interface) interfaces.
作为一种示例,在边缘计算场景中,承载业务的硬件能力通常较弱,单台网关硬件的物理能力有限,在设备量大(如万级)的情况下无法采用单台网关接入,可能存在的问题包括设备布线、单台网关接口不足或者硬件处理能力不足等,从而需要使用多台网关接入。然而,在工业生产或楼宇现场中,现场设备在物理链接上不属于同一个网关,当设备在业务上有关联时,则需要边缘网关有能力实现跨网关的设备控制和数据共享。但每个网关只能访问分配本网关的子设备,对接入其他网关下的子设备无法直接进行控制或信息获取。As an example, in the edge computing scenario, the hardware capability of carrying services is usually weak, and the physical capability of a single gateway hardware is limited. In the case of a large amount of equipment (such as 10,000-level), a single gateway cannot be used for access. Existing problems include equipment wiring, insufficient single gateway interface or insufficient hardware processing capacity, etc., which requires the use of multiple gateways for access. However, in industrial production or building sites, field devices do not belong to the same gateway in terms of physical links. When the devices are related in business, the edge gateway is required to have the ability to implement cross-gateway device control and data sharing. However, each gateway can only access the sub-devices assigned to its own gateway, and cannot directly control or obtain information on sub-devices connected to other gateways.
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象。其中,第一网关与第二网关均可以分别与多台设备进行通信连接,从而各个网关可以实现设备数据的采集、流转、存储、分析和上报。In the embodiment of the present application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object. Among them, both the first gateway and the second gateway can respectively communicate with multiple devices, so that each gateway can implement device data collection, circulation, storage, analysis, and reporting.
需要说明的是,在本申请中以两个网关之间的数据交互为例进行示例性说明,可以理解的是,本申请不局限于此。It should be noted that, in this application, the data interaction between two gateways is taken as an example for exemplification. It should be understood that the application is not limited to this.
在具体实现中,通过对边缘网关进行自组网,实现设备数据按需在网关之间流转。如网关A需要访问其他网关下的子设备一的信息时,和访问本网关的子设备一样,只需要向子设备一的唯一设备标识发送请求即可,从而可以实现边缘网关以去中心化、自治的方式,实现网关之间的数据共享和设备控制。则所述设备数据的获取方法可以包括如下步骤:In the specific implementation, through the ad hoc network of the edge gateway, the device data can be transferred between the gateways on demand. For example, when gateway A needs to access the information of sub-device one under other gateways, it only needs to send a request to the unique device identifier of sub-device one, just like the sub-device of this gateway, so that the edge gateway can be decentralized, Autonomous way to realize data sharing and device control between gateways. The method for acquiring the device data may include the following steps:
步骤101,所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;Step 101: The first proxy object sends a subscription request message for the first device to the second proxy object;
在本申请实施例中,每个网关均可以运行一个代理对象,并在代理对象之间组建边缘计算集群,从而可以在任何一个代理对象上订阅主题,也可以在任何代理对象上发布消息,并通过边缘计算集群将消息按需转发到正确的代理对象,使网关获取对应的消息或数据。In the embodiment of this application, each gateway can run a proxy object and form an edge computing cluster between the proxy objects, so that it can subscribe to topics on any proxy object, and can also publish messages on any proxy object, and The edge computing cluster forwards the message to the correct proxy object on demand, so that the gateway can obtain the corresponding message or data.
在具体实现中,通过在每个网关中运行一个代理对象,并在对象之间组建边缘计算集群,从而使得原本孤立的多台边缘网关加入一个逻辑分组,在逻辑分组中,各个网关可以通过本网关中的代理对象订阅其他网关中的主题,还可以通过本网关中的代理对象向其他网关发布消息,逻辑分组可以保证消息按需转发到正确的代理对象,进而转发到 正确的网关。In the specific implementation, by running a proxy object in each gateway, and forming an edge computing cluster between the objects, the originally isolated multiple edge gateways can be added to a logical grouping. In the logical grouping, each gateway can pass through the local The proxy object in the gateway subscribes to topics in other gateways, and can also publish messages to other gateways through the proxy object in this gateway. Logical grouping can ensure that messages are forwarded to the correct proxy object on demand, and then to the correct gateway.
在本申请实施例的一种示例中,每个网关可以运行一个MQTT Broker实例,并在Broker(代理)之间组建MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)集群,从而各个网关可以通过Broker实现网关之间的数据共享和设备控制。其中,第一代理对象与第二代理对象可以为网关中对外的消息Broker,负责网关之间的数据通信。具体的,第一代理对象与第二代理对象可以为实现MQTT协议的Mosquitto,则MQTT集群中,各个网关之间可以通过Mosquitto进行数据通信,实现设备数据共享和跨网关的设备控制。In an example of the embodiment of the present application, each gateway can run an MQTT Broker instance, and an MQTT (Message Queuing Telemetry Transport) cluster is formed between Brokers (brokers), so that each gateway can pass through the Broker Realize data sharing and device control between gateways. Among them, the first proxy object and the second proxy object may be an external message broker in the gateway, which is responsible for data communication between the gateways. Specifically, the first proxy object and the second proxy object may be Mosquitto that implements the MQTT protocol. In the MQTT cluster, each gateway can communicate data through Mosquitto to realize device data sharing and cross-gateway device control.
在具体实现中,每台网关可以向内部的MQTT Broker订阅本网关下所有子设备的设备配置,也可以向内部的MQTT Broker发布本网关全量子设备的设备数据,也可以向内部的MQTT Broker订阅关心的设备数据,还可以对接收到的订阅本网关设备数据的请求消息,并进行处理,然后进行回应。In specific implementation, each gateway can subscribe to the internal MQTT Broker the device configuration of all sub-devices under the gateway, or publish the device data of the full quantum device of the gateway to the internal MQTT Broker, or subscribe to the internal MQTT Broker For the device data of interest, you can also process the received request message for subscribing to the device data of the gateway, and then respond.
具体的,当第一网关需要获取第二网关下第一设备的设备数据时,可以通过Mosquitto发送针对第一设备的订阅请求消息至第二网关的Mosquitto,请求获取第一设备的设备数据,从而当第二网关接收到请求后,可以进行回应。Specifically, when the first gateway needs to obtain the device data of the first device under the second gateway, it can send a subscription request message for the first device to Mosquitto of the second gateway through Mosquitto to request the device data of the first device. When the second gateway receives the request, it can respond.
步骤102,所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。Step 102: The second proxy object obtains device data for the subscription request message, and sends the device data to the first proxy object.
在本申请实施例中,当第二网关通过第二代理对象接收到第一代理对象发送的订阅请求消息后,可以获取针对该订阅请求消息的设备数据,并将该设备数据发送至第一网关的第一代理对象。In the embodiment of the present application, after the second gateway receives the subscription request message sent by the first proxy object through the second proxy object, it can obtain the device data for the subscription request message and send the device data to the first gateway The first proxy object.
在具体实现中,每台网关可以通过内部的MQTT Broker订阅关心的设备数据,则当第一网关通过Mosquitto向第二网关发送订阅请求消息时,第二网关的Mosquitto接收到该订阅请求消息后,可以获取网关下与该订阅请求消息对应的设备的全量设备数据,并将该设备数据通过Mosquitto发布,从而第一网关可以通过Mosquitto获得第二网关发送的设备数据,实现基于边缘计算集群,各个网关之间可以通过MQTT Broker实现网关之间的设备数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In a specific implementation, each gateway can subscribe to the device data of interest through the internal MQTT Broker. When the first gateway sends a subscription request message to the second gateway through Mosquitto, after the Mosquitto of the second gateway receives the subscription request message, The full device data of the device corresponding to the subscription request message under the gateway can be obtained, and the device data can be published through Mosquitto, so that the first gateway can obtain the device data sent by the second gateway through Mosquitto, and realize an edge computing cluster based on each gateway. MQTT Broker can be used to share device data between gateways, ensuring that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
在本申请实施例的一种示例中,如图2所示,示出了本申请的一种设备数据的获取方法实施例一种数据流转示意图,其中,虚线为订阅请求消息的传输路径,实线为设备数据的传输路径,在MQTT集群中,包括至少两个网关,其中,第一网关与第二网关之 间通过网关内部的Mosquitto进行通信连接。则当第一网关需要获取第二网关下子设备①的设备数据时,可以通过第一Mosquitto发送针对子设备①的订阅请求消息至第二网关的第二Mosquitto,当第二Mosquitto得到该订阅请求消息后,可以获取子设备①的全量设备数据,并对该设备数据进行发布,从而第一网关的第一Mosquitto可以接收到第二Mosquitto发送的设备数据,实现基于MQTT集群,各个网关之间可以通过MQTT Broker实现网关之间的设备数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In an example of an embodiment of the present application, as shown in FIG. 2, a schematic diagram of data flow in an embodiment of a method for obtaining device data of the present application is shown, where the dotted line is the transmission path of the subscription request message, and the actual The line is the transmission path of the device data. In the MQTT cluster, at least two gateways are included. Among them, the first gateway and the second gateway are in communication connection through the Mosquitto inside the gateway. Then, when the first gateway needs to obtain the device data of the sub-device ① under the second gateway, it can send a subscription request message for the sub-device ① to the second Mosquitto of the second gateway through the first Mosquitto, and when the second Mosquitto obtains the subscription request message Then, you can obtain the full amount of device data of the sub-device ①, and publish the device data, so that the first Mosquitto of the first gateway can receive the device data sent by the second Mosquitto, and realize the cluster based on MQTT, and each gateway can pass through MQTT Broker realizes device data sharing between gateways, ensuring that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,第一网关通过所述第一代理对象发送针对所述第一设备的订阅请求消息,至第二网关,接着第二网关通过所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一网关,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In this embodiment of the application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object, The second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object. Second, the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It is ensured that the edge computing rules can be linked across networks, realize decentralization and edge autonomy, and improve the ability of edge computing.
参照图3,示出了本申请的一种设备数据的获取方法实施例二的步骤流程图,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,其中第二网关可以与至少一个第一设备进行通信连接,所述方法具体可以包括如下步骤:3, there is shown a flow chart of the second embodiment of a method for acquiring device data of the present application, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The gateway includes a first proxy object, and the second gateway includes a second proxy object. The second gateway can communicate with at least one first device. The method can specifically include the following steps:
步骤301,所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息;Step 301: The first operation agent object obtains a message route sent by the cloud server, and determines a subscription request message corresponding to the message route;
在本申请实施例中,当需要进行数据的集中采集时,可以通过云服务器向其中一个网关下发数据采集任务,将该网关作为中间网关,由该网关获取其他网关下子设备的数据,并通过该中间网关将所有的数据上传到云服务器,从而实现数据的集中采集,相比分别通过各个网关进行设备采集,简化了数据采集的流程,提高了数据的采集效率。In the embodiment of the present application, when centralized collection of data is required, the cloud server can issue a data collection task to one of the gateways, using the gateway as an intermediate gateway, and the gateway can obtain the data of sub-devices under other gateways, and pass The intermediate gateway uploads all data to the cloud server, thereby realizing centralized data collection. Compared with equipment collection through each gateway, the data collection process is simplified and the data collection efficiency is improved.
在具体实现中,各个网关可以与云服务器进行通信连接,并且,网关还可以包括与云服务器通信连接的操作代理对象,操作代理对象可以向本网关下的设备操作发送本地操作请求,还可以转发外部设备操作请求,以及其他数据的转发,如回应消息,设备数据等的转发。In a specific implementation, each gateway can communicate with the cloud server, and the gateway can also include an operation proxy object that communicates with the cloud server. The operation proxy object can send local operation requests to the device operations under the gateway, and can also forward External device operation request, and other data forwarding, such as the forwarding of response messages, device data, etc.
具体的,在边缘计算集群中,各个网关可以通过本网关的代理对象订阅其他网关下子设备的设备数据,则与各个网关通信连接的云服务器,可以将边缘计算集群中的一个 网关作为中间网关,通过该中间网关进行数据的集中获取。当第一网关为中间网关时,第一网关中的第一操作代理对象可以获取云服务器发送的消息路由,并确定与该消息路由对应的订阅请求消息。Specifically, in an edge computing cluster, each gateway can subscribe to the device data of sub-devices of other gateways through the proxy object of the gateway, and the cloud server that communicates with each gateway can use a gateway in the edge computing cluster as an intermediate gateway. Centralized acquisition of data is performed through the intermediate gateway. When the first gateway is an intermediate gateway, the first operation proxy object in the first gateway can obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route.
其中,消息路由可以为通过路由规则动态规划消息的传输路径,使消息按照过滤条件,从消息源传输到目标节点。云服务器可以通过配置消息路由,确定需要获取的设备数据的传输路径,如获取网关A中子设备一、网关C中子设备二以及网关D中子设备三的设备数据,则可以配置消息路由包括:中间网关-网关A-中间网关、中间网关-网关B-中间网关以及中间网关-网关B-中间网关等,从而各个网关可以根据该消息路由进行数据的传输,简化了数据传输的流程,提高了数据传输的效率。Among them, message routing can dynamically plan the transmission path of the message through routing rules, so that the message is transmitted from the message source to the target node according to the filtering conditions. The cloud server can determine the transmission path of the device data that needs to be obtained by configuring the message routing. For example, to obtain the device data of the gateway A neutron device 1, the gateway C neutron device two, and the gateway D neutron device three, you can configure the message routing to include : Intermediate gateway-gateway A-intermediate gateway, intermediate gateway-gateway B-intermediate gateway, and intermediate gateway-gateway B-intermediate gateway, etc., so that each gateway can transmit data according to the message route, simplifying the data transmission process and improving Improve the efficiency of data transmission.
在本申请实施例的一种示例中,操作代理对象可以包括网关内部消息Broker,如Message-Router,负责网关内部的数据通信。并且,操作代理对象还可以包括网关联动模块,作为对外消息代理对象Mosquitto与对内消息代理对象Message-Router之间的数据转发中介,其可以将Message-Router发送的消息转换为基于MQTT协议的消息,并发送至Mosquitto,以使Mosquitto将转换后的消息在MQTT集群中进行转发,还可以将基于MQTT协议的消息转换为Message-Router可读的数据格式,并发送至Message-Router。具体的,网关联动模块可以为Gw-Linkage,负责Mosquitto与Message-Router之间的数据转发。In an example of the embodiment of the present application, the operation proxy object may include a message broker within the gateway, such as Message-Router, which is responsible for data communication within the gateway. In addition, the operation proxy object may also include a network correlation module, which acts as a data forwarding intermediary between the external message proxy object Mosquitto and the internal message proxy object Message-Router, which can convert the message sent by the Message-Router into a message based on the MQTT protocol. , And send it to Mosquitto, so that Mosquitto will forward the converted message in the MQTT cluster. It can also convert the message based on the MQTT protocol into a data format readable by the Message-Router and send it to the Message-Router. Specifically, the network linkage module may be Gw-Linkage, which is responsible for data forwarding between Mosquitto and Message-Router.
在具体实现中,网关还可以包括与云服务器通信连接的云代理对象,操作代理对象还可以包括与Message-Router通信连接的任务调度模块。其中,云代理对象可以作为云服务器与网关之间的数据通信中介,负责云端与边缘计算端之间的数据通信,而任务调度模块则可以为负责对场景联动任务进行分配,如当云端需要获取多个网关下各个子设备的设备数据时,则任务调度模块可以对云端下发的任务进行解析,并确定对应的网关,以及对应的子设备,并执行对应的操作。In a specific implementation, the gateway may also include a cloud proxy object communicatively connected with the cloud server, and the operation proxy object may also include a task scheduling module communicatively connected with the Message-Router. Among them, the cloud proxy object can be used as the data communication intermediary between the cloud server and the gateway, responsible for the data communication between the cloud and the edge computing terminal, and the task scheduling module can be responsible for the allocation of scene linkage tasks, such as when the cloud needs to obtain When the device data of each sub-device under multiple gateways is used, the task scheduling module can analyze the tasks issued by the cloud, determine the corresponding gateway and the corresponding sub-device, and perform corresponding operations.
具体的,当云端需要通过其中一个网关对其他网关的子设备进行设备数据的集中获取时,可以向网关下发对应的消息路由,使该网关可以通过该消息路由,获取其他网关的子设备的设备数据。Specifically, when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route. Device data.
在本申请实施例的一种示例中,第一网关的云代理对象可以获取云端下发的消息路由,并将该消息路由发送至任务调度模块,由任务调度模块对该消息路由进行解析,确定对应的设备数据获取任务,并将任务下发至Message-Router。当Message-Router接收到任务调度模块下发的任务后,可生成对应的订阅请求消息,如该设备数据获取任务包 括获取第二网关下子设备①与子设备②的设备数据,则Message-Router可以生成针对子设备①的第一订阅请求消息,以及针对子设备②的第二订阅请求消息,并将第一订阅请求消息与第二订阅请求消息发送至Gw-Linkage,从而Gw-Linkage可以将第一订阅请求消息与第二订阅请求消息转换为基于MQTT协议的消息,进而实现网关对云端配置的消息路由进行接收与处理。In an example of the embodiment of the present application, the cloud proxy object of the first gateway can obtain the message route issued by the cloud, and send the message route to the task scheduling module, and the task scheduling module parses the message route to determine The corresponding device data acquisition task, and the task is delivered to the Message-Router. After the Message-Router receives the task issued by the task scheduling module, it can generate the corresponding subscription request message. If the device data acquisition task includes acquiring the device data of the sub-device ① and the sub-device ② under the second gateway, the Message-Router can Generate the first subscription request message for the child device ① and the second subscription request message for the child device ②, and send the first subscription request message and the second subscription request message to Gw-Linkage, so that Gw-Linkage can transfer the first subscription request message to Gw-Linkage. The first subscription request message and the second subscription request message are converted into messages based on the MQTT protocol, so that the gateway can receive and process the message routing configured in the cloud.
步骤302,所述第一代理对象将所述第一操作代理对象发送的所述订阅请求消息,发送至所述第二代理对象;Step 302: The first proxy object sends the subscription request message sent by the first operation proxy object to the second proxy object;
在具体实现中,第一网关的第一操作代理对象可以将订阅请求消息发送至第一代理对象,由第一代理对象将订阅请求消息发送至第二网关的第二代理对象。In a specific implementation, the first operation proxy object of the first gateway may send the subscription request message to the first proxy object, and the first proxy object sends the subscription request message to the second proxy object of the second gateway.
在本申请实施例的一种示例中,第一网关的Message-Router将订阅请求消息发送至Gw-Linkage,Gw-Linkage可以将订阅请求消息转换为基于MQTT协议的消息,并将MQTT消息发送至Mosquitto,由第一网关的Mosquitto将该MQTT消息发送至第二网关的Mosquitto,实现网关之间的数据通信。In an example of the embodiment of the present application, the Message-Router of the first gateway sends a subscription request message to Gw-Linkage, and Gw-Linkage can convert the subscription request message to a message based on the MQTT protocol, and send the MQTT message to Mosquitto, the Mosquitto of the first gateway sends the MQTT message to the Mosquitto of the second gateway to implement data communication between the gateways.
步骤303,所述第二操作代理对象将所述第二代理对象发送的所述订阅请求消息,发送至所述第一设备;Step 303: The second operation proxy object sends the subscription request message sent by the second proxy object to the first device;
在具体实现中,当第二网关的第二代理对象接收到第一网关的第一代理对象发送的订阅请求消息后,可以将该订阅请求消息发送至第二操作代理对象,由第二操作代理对象将该订阅请求消息发送至第一设备。In a specific implementation, after the second proxy object of the second gateway receives the subscription request message sent by the first proxy object of the first gateway, the subscription request message can be sent to the second operation proxy object, and the second operation proxy The object sends the subscription request message to the first device.
在本申请实施例的一种示例中,第二网关的Mosquitto可以将基于MQTT协议的消息转发至Gw-Linkage,由Gw-Linkage将对MQTT消息进行格式转换,从而得到针对第二网关下第一设备的订阅请求消息。In an example of the embodiment of the present application, Mosquitto of the second gateway can forward the message based on the MQTT protocol to Gw-Linkage, and Gw-Linkage will format the MQTT message to obtain the first The subscription request message of the device.
步骤304,所述第二操作代理对象获取所述第一设备发送的针对所述订阅请求消息的所述设备数据,并将所述设备数据发送至所述第二代理对象;Step 304: The second operation proxy object obtains the device data for the subscription request message sent by the first device, and sends the device data to the second proxy object;
在具体实现中,第二网关的第二操作代理对象可以将订阅请求消息发送至第一设备后,可以接收第一设备上报的与该订阅请求消息对应的设备数据,并将该设备数据发送至第二代理对象,以使第二代理对象将该设备数据发送至第一网关。In a specific implementation, after sending the subscription request message to the first device, the second operation proxy object of the second gateway can receive the device data corresponding to the subscription request message reported by the first device, and send the device data to The second proxy object, so that the second proxy object sends the device data to the first gateway.
在本申请实施例的一种示例中,第二网关的Gw-Linkage可以将订阅请求消息发送至Message-Router中,由Message-Router将该订阅请求消息发送至第一设备,并获取第一设备发送的针对该订阅请求消息的设备数据。接着Message-Router可以将该设备数据发送至Gw-Linkage,由Gw-Linkage将该设备数据转换为基于MQTT协议的数据。In an example of the embodiment of the present application, the Gw-Linkage of the second gateway can send the subscription request message to the Message-Router, and the Message-Router sends the subscription request message to the first device, and obtains the first device The sent device data for the subscription request message. Then Message-Router can send the device data to Gw-Linkage, and Gw-Linkage converts the device data into data based on the MQTT protocol.
步骤305,所述第二代理对象将所述设备数据,发送至所述第一代理对象;Step 305: The second proxy object sends the device data to the first proxy object;
在具体实现中,第二网关的第二代理对象可以将第二操作代理对象发送的设备数据,发送至位于同一边缘计算集群中的第一网关,从而第一网关可以通过第一代理对象接收到该设备数据。In a specific implementation, the second proxy object of the second gateway can send the device data sent by the second operation proxy object to the first gateway located in the same edge computing cluster, so that the first gateway can receive it through the first proxy object The device data.
在本申请实施例的一种示例中,第二网关的Mosquitto将Gw-Linkage发送的设备数据,转发至第一网关的Mosquitto后,第一网关的Mosquitto可以将基于MQTT协议的数据转换为Message-Router可读的数据,并将转换后的设备数据发送至第一网关的Message-Router。In an example of the embodiment of the present application, after Mosquitto of the second gateway forwards the device data sent by Gw-Linkage to Mosquitto of the first gateway, Mosquitto of the first gateway can convert the data based on the MQTT protocol into Message- Router can read data and send the converted device data to the Message-Router of the first gateway.
步骤306,所述第一操作代理对象将所述第一代理对象发送的所述设备数据,发送至所述应用程序。Step 306: The first operation proxy object sends the device data sent by the first proxy object to the application.
在本申请实施例中,网关还可以运行应用程序,应用程序可以实现网关的本地定义、开发、测试、调试Serverless(无服务器)应用,并将设备数据上传至云端。In the embodiment of the present application, the gateway can also run an application program, which can implement local definition, development, testing, and debugging of a serverless application of the gateway, and upload device data to the cloud.
在具体实现中,第一网关的第一操作代理对象可以将第一代理对象发送的设备数据发送至应用程序,由应用程序对设备数据进行处理,如根据该设备数据控制对应的设备,或将该设备数据上报至云端。In a specific implementation, the first operation proxy object of the first gateway can send the device data sent by the first proxy object to the application, and the application processes the device data, such as controlling the corresponding device according to the device data, or The device data is reported to the cloud.
在本申请实施例的一种示例中,当第一网关的Gw-Linkage将设备数据发送至Message-Router后,Message-Router可以将该设备数据发送至应用程序,完成设备数据的采集,从而云端通过将设备数据采集任务下发至第一网关,由第一网关作为中间网关,对多个其他网关的设备数据进行集中采集,一方面简化了数据采集的流程,提高了数据的采集效率,另一方面在设备联动场景中,可以将多个网关作为整体,由云端进行控制,提高了边缘计算的联动能力。In an example of the embodiment of the present application, after the Gw-Linkage of the first gateway sends the device data to the Message-Router, the Message-Router can send the device data to the application to complete the collection of the device data, so that the cloud By sending the device data collection task to the first gateway, the first gateway acts as an intermediate gateway to collect device data from multiple other gateways. On the one hand, it simplifies the data collection process and improves the efficiency of data collection. On the one hand, in the device linkage scenario, multiple gateways can be taken as a whole and controlled by the cloud, which improves the linkage capability of edge computing.
需要说明的是,本申请实施例以第一网关为例进行示例性说明,可以理解的是,在多台网关组网,形成MQTT集群后,各个网关之间可以共享子设备的信息,应用程序可以运行在MQTT集群中的任意一台网关上。此外,网关除了可以运行应用程序外,还可以运行IFTTT(If this then that)规则,从而可以充分利用边缘计算集群的计算能力,提高边缘计算的应用能力。It should be noted that the embodiment of the present application takes the first gateway as an example for illustrative description. It can be understood that after multiple gateways are networked to form an MQTT cluster, each gateway can share information about sub-devices and applications It can run on any gateway in the MQTT cluster. In addition, in addition to running applications, the gateway can also run IFTTT (If this then that) rules, so as to make full use of the computing power of the edge computing cluster and improve the application capabilities of edge computing.
在本申请实施例的一种示例中,如图4所示,示出了本申请的一种设备数据的获取方法实施例二中数据流转示意图,在边缘计算集群中,包括多个网关,每个网关中运行有代理对象,各个网关通过代理对象进行数据交互。其中,当第一网关中的应用程序需要订阅第二网关中子设备①的设备数据时,则第一网关可以通过应用程序将订阅请求消 息发送至第一操作代理对象,接着第一操作代理对象将该订阅请求消息发送至第一代理对象,然后由第一代理对象将订阅请求消息发送至第二网关。In an example of an embodiment of the present application, as shown in FIG. 4, a schematic diagram of data flow in the second embodiment of a method for obtaining device data of the present application is shown. In an edge computing cluster, multiple gateways are included, and each A proxy object runs in each gateway, and each gateway performs data interaction through the proxy object. Wherein, when the application in the first gateway needs to subscribe to the device data of the sub-device ① in the second gateway, the first gateway can send the subscription request message to the first operation proxy object through the application, and then the first operation proxy object The subscription request message is sent to the first proxy object, and then the first proxy object sends the subscription request message to the second gateway.
当第二网关通过第二代理对象接收到订阅请求消息后,可以将该订阅请求消息发送至第二操作代理对象,由第二操作代理对象将该订阅请求消息发送至子设备①,然后获取子设备①上报的设备数据,并按照预定的传输路径将该设备数据传输至第一网关的应用程序中,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。After the second gateway receives the subscription request message through the second proxy object, it can send the subscription request message to the second operation proxy object, and the second operation proxy object sends the subscription request message to the sub-device ①, and then obtains the sub-device. The device data reported by the device ① is transmitted to the application program of the first gateway according to the predetermined transmission path, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through proxy objects, ensuring In this way, edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
需要说明的是,在本申请实施例中,以边缘计算集群中网关与网关之间的数据交互为例进行示例性说明,可以理解的是,除了可以通过边缘计算集群中网关与网关之间的数据链路进行数据采集,还可以包括云端与网关之间的数据链路进行数据采集。It should be noted that, in the embodiment of the present application, the data interaction between the gateway and the gateway in the edge computing cluster is taken as an example for illustrative description. It is understandable that, in addition to the data interaction between the gateway and the gateway in the edge computing cluster, The data link for data collection can also include the data link between the cloud and the gateway for data collection.
具体的,可以采用混合模式进行数据交互,根据不同的数据获取速度采用不同的数据链路进行设备数据获取,如通过云端与网关之间的数据链路获取设备数据的速度,比通过网关与网关之间的数据链路快,则可以通过云端与网关之间的数据链路获取设备数据;反之,则可以通过边缘计算集群中的网关与网关之间的数据链路进行设备数据的获取,本申请对此不作限制。Specifically, a hybrid mode can be used for data interaction, and different data links can be used for device data acquisition according to different data acquisition speeds. For example, the speed of acquiring device data through the data link between the cloud and the gateway is faster than that through the gateway and the gateway. If the data link is fast, the device data can be obtained through the data link between the cloud and the gateway; otherwise, the device data can be obtained through the data link between the gateway and the gateway in the edge computing cluster. The application is not restricted.
在本申请实施例的另一种示例中,如图5所示,示出了本申请的一种设备数据的获取方法实施例二中数据流转示意图,其中,实线为配置信息的传输路径,虚线为回应消息的传输路径,在MQTT集群中,至少包括第一网关和第二网关,第一网关和第二网关分别包括对外的消息代理对象Mosquitto,网关联动模块Gw-Linkage,网关内部的消息代理对象Message-Router,任务调度模块Task-Dispatcher以及云代理对象Cloud-Proxy等,并且网关中还可以运行应用程序。则当云端可以对消息路由进行配置,并将配置好的消息路由下发至第一网关,从而第一网关可以对消息路由进行处理,并获取对应的设备数据。In another example of the embodiment of the present application, as shown in FIG. 5, a schematic diagram of data flow in the second embodiment of a method for acquiring device data of the present application is shown, where the solid line is the transmission path of the configuration information, The dashed line is the transmission path of the response message. In the MQTT cluster, it includes at least a first gateway and a second gateway. The first gateway and the second gateway respectively include the external message proxy object Mosquitto, the network linkage module Gw-Linkage, and the internal messages of the gateway. The proxy object Message-Router, the task scheduling module Task-Dispatcher, and the cloud proxy object Cloud-Proxy, etc., and the gateway can also run applications. Then, the cloud can configure the message routing and deliver the configured message routing to the first gateway, so that the first gateway can process the message routing and obtain the corresponding device data.
具体的,第一网关的Cloud-Proxy接收到云端下发的消息路由后,可以将该消息路由发送至Task-Dispatcher,接着Task-Dispatcher可以对该消息路由进行解析,确定所要采集的目标设备的唯一设备标识,并将该设备标识发送至第一网关的Message-Router,由Message-Router生成针对目标设备的订阅请求消息,如针对第二网关中子设备①的订阅请求消息,然后可以将订阅请求消息发送至Gw-Linkage,Gw-Linkage可以将订阅请求消息转换为基于MQTT协议的消息,并发送至Mosquitto,由第一网关的Mosquitto将订 阅请求消息发送至位于同一MQTT集群中的第二网关。Specifically, after the Cloud-Proxy of the first gateway receives the message route issued by the cloud, it can send the message route to the Task-Dispatcher, and then the Task-Dispatcher can analyze the message route to determine the target device's data to be collected. Unique device identification, and send the device identification to the Message-Router of the first gateway, and the Message-Router generates a subscription request message for the target device, such as a subscription request message for the sub-device ① of the second gateway, and then the subscription The request message is sent to Gw-Linkage, and Gw-Linkage can convert the subscription request message into a message based on the MQTT protocol and send it to Mosquitto. Mosquitto of the first gateway sends the subscription request message to the second gateway located in the same MQTT cluster. .
当第二网关的Mosquitto接收到第一网关发送的订阅请求消息后,可以将该订阅请求消息发送至Gw-Linkage,Gw-Linkage可以将基于MQTT协议的消息转换为Message-Router可读的数据格式,并将转换后的订阅请求消息发送至Message-Router,由Message-Router将订阅请求消息发送至子设备①,从而子设备①可以设备数据上报至Message-Router,则Message-Router可以将该设备数据全量转发至Gw-Linkage,由Gw-Linkage将设备数据发送至Mosquitto,从而第二网关的Mosquitto可以将设备数据发送至位于同一MQTT集群中的第一网关。When the Mosquitto of the second gateway receives the subscription request message sent by the first gateway, it can send the subscription request message to Gw-Linkage, and Gw-Linkage can convert the message based on the MQTT protocol into a data format readable by Message-Router , And send the converted subscription request message to the Message-Router, and the Message-Router sends the subscription request message to the sub-device ①, so that the sub-device ① can report the device data to the Message-Router, and the Message-Router can The entire data is forwarded to Gw-Linkage, and Gw-Linkage sends the device data to Mosquitto, so that Mosquitto of the second gateway can send the device data to the first gateway in the same MQTT cluster.
当第一网关的Mosquitto接收到第二网关发送的设备数据后,可以通过如下传输路径将设备数据传输至应用程序中:Mosquitto至Gw-Linkage,Gw-Linkage至Message-Router,再由Message-Router至应用程序,从而完成对第二网关子设备①的设备数据采集。When the Mosquitto of the first gateway receives the device data sent by the second gateway, it can transmit the device data to the application through the following transmission paths: Mosquitto to Gw-Linkage, Gw-Linkage to Message-Router, and then from Message-Router To the application program, so as to complete the device data collection of the second gateway sub-device ①.
在本申请实施例的另一种示例中,在楼宇建筑场景中,网关A、B中的应用程序负责本网关下传感器上报消息的预处理,而网关C的应用程序订阅了网关A、B中传感器的设备数据。其中,网关A对应的传感器为温度传感器,网关B对应的传感器为湿度传感器。则网关A中的应用程序可以每5分钟统计一次平均温度,网关B中的应用程序可以每5分钟统计一次平均湿度,然后网关A、B可以将处理后的温湿度数据发布到网关C中的应用程序做进一步分析,从而决定是否更改楼宇建筑中的中央空调系统的配置,或者将温湿度数据上传至云端。In another example of the embodiment of the present application, in the building construction scenario, the applications in gateways A and B are responsible for the preprocessing of the messages reported by the sensors under the gateway, and the application in gateway C subscribes to gateways A and B. The device data of the sensor. Among them, the sensor corresponding to gateway A is a temperature sensor, and the sensor corresponding to gateway B is a humidity sensor. Then the application in gateway A can count the average temperature every 5 minutes, and the application in gateway B can count the average humidity every 5 minutes, and then gateways A and B can publish the processed temperature and humidity data to gateway C. The application performs further analysis to decide whether to change the configuration of the central air-conditioning system in the building or upload the temperature and humidity data to the cloud.
需要说明的是,在本申请实施例中,以第一网关对第二网关中一个子设备进行设备数据采集为例进行示例性说明,可以理解的是,网关可以对多个网关下多个子设备同时进行设备数据采集,从而云端通过将设备数据采集任务下发至某一网关,由该网关作为中间网关,对多个其他网关的设备数据进行集中采集,一方面简化了数据采集的流程,提高了数据的采集效率,另一方面在设备联动场景中,可以将多个网关作为整体,由云端进行控制,提高了边缘计算的联动能力。It should be noted that, in the embodiment of the present application, the device data collection performed by the first gateway on one sub-device in the second gateway is taken as an example for illustration. It is understandable that the gateway can perform multiple sub-devices under multiple gateways. At the same time, device data collection is performed, so that the cloud sends device data collection tasks to a certain gateway, and the gateway acts as an intermediate gateway to collect device data from multiple other gateways. On the one hand, it simplifies the data collection process and improves This improves the efficiency of data collection. On the other hand, in the device linkage scenario, multiple gateways can be taken as a whole and controlled by the cloud, which improves the linkage capability of edge computing.
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,第一网关通过所述第一代理对象发送针对所述第一设备的订阅请求消息,至第二网关,接着第二网关通过所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一网关,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计 算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In this embodiment of the application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object, The second gateway communicates with at least one first device, and the first gateway sends a subscription request message for the first device through the first proxy object to the second gateway, and then the second gateway uses the first proxy object. Second, the proxy object obtains the device data for the subscription request message, and sends the device data to the first gateway, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, It is ensured that the edge computing rules can be linked across networks, realize decentralization and edge autonomy, and improve the ability of edge computing.
参照图6,示出了本申请的一种设备的配置方法实施例一的步骤流程图,所述方法应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法具体可以包括如下步骤:6, there is shown a step flow chart of Embodiment 1 of a device configuration method of the present application. The method is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The first gateway includes a first proxy object, the second gateway includes a second proxy object, and the second gateway communicates with at least one first device. The method may specifically include the following steps:
步骤601,所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;Step 601: The first proxy object sends configuration information used to configure the first device to the second proxy object;
在具体实现中,每个网关可以运行一个MQTT Broker实例,并在broker之间组建MQTT集群,从而各个网关可以通过Broker实现网关之间的数据共享和设备控制。其中,第一代理对象与第二代理对象可以为网关中对外的消息Broker,负责网关之间的数据通信。具体的,第一代理对象与第二代理对象可以为实现MQTT协议的Mosquitto,则MQTT集群中,各个网关之间可以通过Mosquitto进行数据通信,实现设备数据共享和跨网关的设备控制。In specific implementation, each gateway can run an MQTT Broker instance, and an MQTT cluster is formed between brokers, so that each gateway can implement data sharing and device control between gateways through Broker. Among them, the first proxy object and the second proxy object may be an external message broker in the gateway, which is responsible for data communication between the gateways. Specifically, the first proxy object and the second proxy object may be Mosquitto that implements the MQTT protocol. In the MQTT cluster, each gateway can communicate data through Mosquitto to realize device data sharing and cross-gateway device control.
在具体实现中,每台网关可以向内部的MQTT Broker订阅本网关下所有子设备的设备配置,也可以向内部的MQTT Broker发布本网关全量子设备的设备数据,也可以向内部的MQTT Broker订阅关心的设备数据,还可以对接收到的订阅本网关设备数据的请求消息,并进行处理,然后进行回应。In specific implementation, each gateway can subscribe to the internal MQTT Broker the device configuration of all sub-devices under the gateway, or publish the device data of the full quantum device of the gateway to the internal MQTT Broker, or subscribe to the internal MQTT Broker For the device data of interest, you can also process the received request message for subscribing to the device data of the gateway, and then respond.
具体的,当第一网关需要设置位于第二网关中第一设备的设备属性时,可以通过第一网关中的Mosquitto发送用于对第一设备进行属性配置的配置信息,至第二网关中的Mosquitto,从而当第二网关接收到配置信息后,可以对第一设备进行属性配置。Specifically, when the first gateway needs to set the device attributes of the first device located in the second gateway, the configuration information used to configure the attributes of the first device can be sent to the second gateway through Mosquitto in the first gateway. Mosquitto, so that when the second gateway receives the configuration information, it can configure the attributes of the first device.
步骤602,所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置的消息。Step 602: The second proxy object sends a response message sent by the first device to the first proxy object, where the response message is a message for the first device to complete attribute configuration according to the configuration information .
在具体实现中,当第二网关的Mosquitto接收到第一网关发送的配置信息后,Mosquitto可以将该配置信息发送至对应的设备,从而当设备接收到该配置信息,可以依据该配置信息进行属性配置,当配置完毕后,设备可以生成针对该配置信息的回应消息,并将该回应消息发送至Mosquitto,由Mosquitto将回应消息发送至第一网关,以告知第一网关设备已经配置完成,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。In a specific implementation, after Mosquitto of the second gateway receives the configuration information sent by the first gateway, Mosquitto can send the configuration information to the corresponding device, so that when the device receives the configuration information, it can perform attributes based on the configuration information Configuration. After the configuration is completed, the device can generate a response message for the configuration information and send the response message to Mosquitto. Mosquitto sends the response message to the first gateway to inform the first gateway that the device has been configured. In an edge computing cluster, each gateway can implement device control between gateways through proxy objects, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
在本申请实施例的一种示例中,如图7所示,示出了本申请的一种设备的配置方法 实施例一中数据流转示意图,其中,虚线为配置信息的传输路径,实线为回应消息的传输路径,在MQTT集群中,包括至少两个网关,其中,第一网关与第二网关之间通过网关内部的Mosquitto进行通信连接。则当第一网关需要对第二网关下子设备①进行控制时,可以通过第一Mosquitto发送针对子设备①的配置信息至第二网关的第二Mosquitto,当第二Mosquitto得到该配置信息后,可以将该配置信息发送至子设备①,子设备①依据该配置信息进行属性值配置,当配置完毕后,可以生成回应消息,并将该回应消息发送至Mosquitto,则第二网关的Mosquitto可以将该回应消息发送至第一网关的Mosquitto,实现基于MQTT集群,各个网关之间可以通过MQTT Broker实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In an example of an embodiment of the present application, as shown in FIG. 7, a schematic diagram of data flow in Embodiment 1 of a device configuration method of the present application is shown, where the dotted line is the transmission path of the configuration information, and the solid line is The transmission path of the response message includes at least two gateways in the MQTT cluster, where the first gateway and the second gateway communicate through the Mosquitto inside the gateway. Then when the first gateway needs to control the sub-device ① of the second gateway, the configuration information for the sub-device ① can be sent to the second Mosquitto of the second gateway through the first Mosquitto. After the second Mosquitto obtains the configuration information, it can Send the configuration information to the sub-device ①, and the sub-device ① configures the attribute value according to the configuration information. After the configuration is completed, it can generate a response message and send the response message to Mosquitto. Then the Mosquitto of the second gateway can use the The response message is sent to the Mosquitto of the first gateway, which is based on MQTT cluster. Each gateway can realize device control between gateways through MQTT Broker, which ensures that edge computing rules can be correlated across networks to achieve decentralization, edge autonomy, and improve The ability of edge computing.
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,由第一网关通过第一代理对象发送,用于对第二网关下第一设备进行配置的配置信息,至第二网关,接着第二网关通过第二代理对象将第一设备发送的回应消息,发送至第一网关,其中,回应消息为第一设备依据配置信息完成属性配置的消息,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。In this embodiment of the application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object, The second gateway communicates with at least one first device, and the configuration information sent by the first gateway through the first proxy object is used to configure the configuration information of the first device under the second gateway to the second gateway, and then to the second gateway. The gateway sends the response message sent by the first device to the first gateway through the second proxy object, where the response message is a message that the first device completes the attribute configuration according to the configuration information, so that based on the edge computing cluster, each gateway can pass through The proxy object implements device control between gateways, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
参照图8,示出了本申请的一种设备的配置方法实施例二的步骤流程图,所述方法应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法具体可以包括如下步骤:Referring to Figure 8, there is shown a flow chart of the second embodiment of a device configuration method of the present application. The method is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway. The first gateway includes a first proxy object, the second gateway includes a second proxy object, and the second gateway communicates with at least one first device. The method may specifically include the following steps:
步骤801,所述第一操作代理对象将所述应用程序发送的所述配置信息,发送至所述第一代理对象;Step 801: The first operation proxy object sends the configuration information sent by the application program to the first proxy object;
在具体实现中,网关中可以运行应用程序,其可以实现网关的本地定义、开发、测试、调试Serverless(无服务器)应用,并将设备数据上传至云端。则当第一网关中的应用程序要对第二网关中的第一设备进行控制时,可以生成用于对第一设备进行配置的配置信息,并将该配置信息发送至第一网关联动模块,由第一网关联动模块将该配置信息发送至第一代理对象。In a specific implementation, an application program can be run in the gateway, which can realize the local definition, development, testing, and debugging of the serverless (serverless) application of the gateway, and upload device data to the cloud. Then, when the application in the first gateway wants to control the first device in the second gateway, it can generate configuration information for configuring the first device, and send the configuration information to the first network association module, The first network association module sends the configuration information to the first proxy object.
在本申请实施例的一种示例中,第一网关中的应用程序生成用于对第二网关中第一 设备进行配置的配置信息后,可以将该配置信息发送至Gw-Linkage,Gw-Linkage可以将配置信息转换为基于MQTT协议的信息,然后将转换后的配置信息发送至Mosquitto。In an example of the embodiment of the present application, after the application in the first gateway generates configuration information for configuring the first device in the second gateway, the configuration information can be sent to Gw-Linkage, Gw-Linkage The configuration information can be converted into information based on the MQTT protocol, and then the converted configuration information can be sent to Mosquitto.
步骤802,所述第一代理对象将所述配置信息发送至所述第二代理对象;Step 802: The first proxy object sends the configuration information to the second proxy object;
在具体实现中,第一网关的Mosquitto可以将配置信息发送至第二网关的Mosquitto。In a specific implementation, Mosquitto of the first gateway can send configuration information to Mosquitto of the second gateway.
步骤803,所述第二操作代理对象将所述第二代理对象发送的所述配置信息,发送至所述第一设备;Step 803: The second operation proxy object sends the configuration information sent by the second proxy object to the first device;
在具体实现中,第二网关中的第二操作代理对象可以将第二代理对象发送的配置信息,发送至第一设备中。In a specific implementation, the second operation proxy object in the second gateway may send the configuration information sent by the second proxy object to the first device.
在本申请实施例的一种示例中,第二网关的Gw-Linkage可以将基于MQTT协议的配置信息转换为第一设备可读的配置信息,并将转换后的配置信息发送至第一设备,则第一设备接收到该配置信息后,可以依据该配置信息进行属性值设置,并生成回应消息,然后将该回应消息发送至Gw-Linkage。In an example of the embodiment of the present application, the Gw-Linkage of the second gateway can convert the configuration information based on the MQTT protocol into configuration information readable by the first device, and send the converted configuration information to the first device, After receiving the configuration information, the first device can set the attribute value according to the configuration information, generate a response message, and then send the response message to Gw-Linkage.
步骤804,所述第二代理对象将所述第二操作代理对象发送的所述回应消息,发送至所述第一代理对象;Step 804: The second proxy object sends the response message sent by the second operation proxy object to the first proxy object;
在具体实现中,第二网关中的第二操作代理对象可以接收第一设备发送的回应消息,回应消息可以为第一设备依据配置信息进行属性值配置后,生成的消息。则第二代理对象可以将该回应消息发送至第一网关中的第一代理对象。In a specific implementation, the second operation agent object in the second gateway may receive the response message sent by the first device, and the response message may be a message generated after the first device configures the attribute value according to the configuration information. Then the second proxy object can send the response message to the first proxy object in the first gateway.
在本申请实施例的一种示例中,第二网关的Gw-Linkage可以将第一设备发送的回应消息转换为基于MQTT协议的消息,并将转换后的回应消息发送至Mosquitto,由第二网关的Mosquitto将该回应消息发送至第一网关的Mosquitto。In an example of the embodiment of the present application, the Gw-Linkage of the second gateway can convert the response message sent by the first device into a message based on the MQTT protocol, and send the converted response message to Mosquitto, and the second gateway The Mosquitto of the first gateway sends the response message to the Mosquitto of the first gateway.
步骤805,所述第一操作代理对象将所述第一代理对象发送的所述回应消息,发送至所述应用程序。Step 805: The first operation proxy object sends the response message sent by the first proxy object to the application.
在具体实现中,第一网关的第一操作代理对象可以将第一代理对象发送的回应消息发送至应用程序中,从而告知应用程序,第二网关中的第一设备已根据配置信息进行了属性值配置。In a specific implementation, the first operation proxy object of the first gateway can send the response message sent by the first proxy object to the application program, thereby notifying the application program that the first device in the second gateway has performed attributes according to the configuration information. Value configuration.
具体的,第一网关的Mosquitto接收到回应消息后,可以将该回应消息发送至Gw-Linkage,由Gw-Linkage将该基于MQTT协议的回应消息转换为应用程序可读的数据格式,并将转换后的回应消息发送至应用程序,告知应用程序,已对第二网关中的设备进行配置完毕,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高 了边缘计算的联动能力。Specifically, after Mosquitto of the first gateway receives the response message, it can send the response message to Gw-Linkage, and Gw-Linkage converts the response message based on the MQTT protocol into a data format readable by the application, and converts the response message The subsequent response message is sent to the application to inform the application that the device in the second gateway has been configured. Based on the edge computing cluster, each gateway can implement device control between the gateways through proxy objects, ensuring the edge Computing rules can be linked across networks to achieve decentralization and edge autonomy, which improves the linkage capability of edge computing.
在本申请实施例的一种示例中,如图4所示,示出了本申请的一种设备的配置方法实施例二中数据流转示意图,在边缘计算集群中,包括多个网关,每个网关中运行有代理对象,各个网关通过代理对象进行数据交互。其中,当第一网关中的应用程序需要设置第二网关中子设备①的设备属性值时,则第一网关可以通过应用程序将配置信息发送至第一操作代理对象,接着第一操作代理对象将该配置信息发送至第一代理对象,然后由第一代理对象将配置信息发送至第二网关。In an example of an embodiment of the present application, as shown in FIG. 4, a schematic diagram of data flow in the second embodiment of a device configuration method of the present application is shown. In an edge computing cluster, there are multiple gateways, each A proxy object runs in the gateway, and each gateway performs data interaction through the proxy object. Wherein, when the application in the first gateway needs to set the device attribute value of the sub-device ① in the second gateway, the first gateway can send the configuration information to the first operation proxy object through the application, and then the first operation proxy object The configuration information is sent to the first proxy object, and then the first proxy object sends the configuration information to the second gateway.
当第二网关通过第二代理对象接收到配置信息后,可以将该配置信息发送至第二操作代理对象,由第二操作代理对象将该配置信息发送至子设备①,然后子设备①依据该配置信息进行属性值的设置,并发送回应消息至第二操作代理对象,然后按照预定的传输路径将该回应消息传输至第一网关的应用程序中,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。After the second gateway receives the configuration information through the second proxy object, it can send the configuration information to the second operation proxy object, and the second operation proxy object sends the configuration information to the sub-device ①, and then the sub-device ① The configuration information sets the attribute value, and sends a response message to the second operation agent object, and then transmits the response message to the application of the first gateway according to the predetermined transmission path, so that based on the edge computing cluster, each gateway can Implementing device control between gateways through proxy objects ensures that edge computing rules can be correlated across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
在本申请实施例的一种示例中,如图9所示,示出了本申请的一种设备的配置方法实施例二中数据流转示意图,其中,虚线为配置信息的传输路径,实线为回应消息的传输路径,在MQTT集群中,至少包括第一网关和第二网关,第一网关和第二网关分别可以包括对外的消息代理对象Mosquitto,网关联动模块Gw-Linkage,网关内部的消息代理对象Message-Router,任务调度模块Task-Dispatcher以及云代理对象Cloud-Proxy等,并且网关中还可以运行应用程序。In an example of the embodiment of the present application, as shown in FIG. 9, a schematic diagram of data flow in the second embodiment of a device configuration method of the present application is shown, where the dashed line is the transmission path of the configuration information, and the solid line is The transmission path of the response message, in the MQTT cluster, includes at least a first gateway and a second gateway. The first gateway and the second gateway may respectively include the external message proxy object Mosquitto, the network correlation module Gw-Linkage, and the message proxy inside the gateway. Object Message-Router, task scheduling module Task-Dispatcher and cloud proxy object Cloud-Proxy, etc., and applications can also be run in the gateway.
当第一网关中应用程序需要对第二网关中的子设备①的属性值进行设置时,应用程序可以生成用于对子设备①进行设置的配置信息,然后将该配置信息发送至Gw-Linkage,由Gw-Linkage将该配置信息转换为基于MQTT协议的配置信息,并将转换后的配置信息发送至Mosquitto,由Mosquitto将该配置信息发送至第二网关。When the application in the first gateway needs to set the attribute value of the sub-device ① in the second gateway, the application can generate configuration information for setting the sub-device ①, and then send the configuration information to Gw-Linkage , Gw-Linkage converts the configuration information into configuration information based on the MQTT protocol, and sends the converted configuration information to Mosquitto, and Mosquitto sends the configuration information to the second gateway.
当第二网关中的Mosquitto接收到配置信息后,可以将该配置信息发送至Gw-Linkage,由Gw-Linkage将基于MQTT协议的配置信息转换为子设备①可读的配置信息,并将配置信息发送至子设备①,则子设备①可以依据该配置信息进行属性值的配置,配置完毕后,可以生成回应消息,并将该回应消息发送至Gw-Linkage,由Gw-Linkage将该回应消息转换为基于MQTT协议的消息,并将转换后的消息发送至Mosquitto,然后由Mosquitto将回应消息发送至第一网关。After the Mosquitto in the second gateway receives the configuration information, it can send the configuration information to Gw-Linkage, and Gw-Linkage converts the configuration information based on the MQTT protocol into the readable configuration information of the sub-device, and the configuration information Send to the sub-device①, then the sub-device① can configure the attribute value according to the configuration information. After the configuration is completed, it can generate a response message and send the response message to Gw-Linkage, and Gw-Linkage converts the response message It is a message based on the MQTT protocol, and sends the converted message to Mosquitto, and then Mosquitto sends the response message to the first gateway.
当第一网关中的Mosquitto接收到回应消息后,可以按照如下传输路径,将回应消息 传输至应用程序:Mosquitto至Gw-Linkage,Gw-Linkage至应用程序,从而完成跨网关的设备控制。After Mosquitto in the first gateway receives the response message, it can transmit the response message to the application according to the following transmission path: Mosquitto to Gw-Linkage, and Gw-Linkage to the application, thereby completing cross-gateway device control.
在本申请实施例的另一种示例中,在工业生产中,网关A、B、C、D中的应用程序分别负责本网关下子设备的运行控制,并且各个网关之间组建成MQTT集群。则在设备联动场景中,可以通过网关A、B、C、D中任意一个网关,对网关A、B、C、D下的所有子设备进行联动控制,从而完成跨网关、多设备的联动,提高了边缘计算的联动能力。In another example of the embodiment of the present application, in industrial production, the application programs in gateways A, B, C, and D are respectively responsible for the operation control of the sub-devices under the gateway, and each gateway forms an MQTT cluster. In the device linkage scenario, all sub-devices under gateways A, B, C, and D can be linked through any one of gateways A, B, C, and D, so as to complete cross-gateway and multi-device linkage. Improved the linkage capability of edge computing.
如图10所示,示出了本申请的一种设备的控制方法实施例二中数据流程示意图,在工业生产中,网关A和网关B分别通过本网关下的代理对象组建边缘计算集群,且网关A和网关B的应用程序分别负责本网关下子设备的运行控制,则在设备联动场景中,可以通过外部设备中的应用程序对该集群进行控制,如对网关A下的子设备dev_A1与dev_A2、网关B下的子设备dev_B1与dev_B2进行联动控制。As shown in Figure 10, it shows a schematic diagram of the data flow in the second embodiment of a device control method of the present application. In industrial production, gateway A and gateway B respectively form edge computing clusters through proxy objects under the gateway, and The application programs of gateway A and gateway B are respectively responsible for the operation control of the sub-devices under the gateway. In the device linkage scenario, the cluster can be controlled by the application in the external device, such as the sub-devices dev_A1 and dev_A2 under the gateway A. , The sub-devices dev_B1 and dev_B2 under the gateway B carry out linkage control.
具体的,可以将网关B作为中间网关,外部应用程序可以向网关B订阅设备数据,或设备操作请求,从而网关B可以通过本网关中的代理对象向集群中的其他网关(网关A),发送订阅设备数据的请求消息,或设备操作请求,从而可以通过集群中的一个网关作为中间网关,获取各个网关下子设备的设备数据,并向各个发送设备操作请求,进而将边缘计算集群可以作为一个整体,对外提供服务,实现了基于边缘计算集群,可以通过一个网关对集群中各个网关进行数据获取或设备控制,简化了数据获取的流程和设备操作的流程,大大提高了工作效率。Specifically, gateway B can be used as an intermediate gateway, and external applications can subscribe device data or device operation requests to gateway B, so that gateway B can send to other gateways (gateway A) in the cluster through the proxy object in this gateway. Subscribe to device data request messages or device operation requests, so that one gateway in the cluster can be used as an intermediate gateway to obtain the device data of the sub-devices under each gateway, and send device operation requests to each, so that the edge computing cluster can be used as a whole , Provide services to the outside world, and realize the edge computing cluster based. A gateway can be used to obtain data or equipment control for each gateway in the cluster, which simplifies the data acquisition process and the equipment operation process, and greatly improves the work efficiency.
此外,除了可以将网关B作为中间网关,进行网关A中的子设备进行控制外,还可以直接通过云端对网关A和/或网关B下的子设备进行控制,如云端可以边缘计算集群中的网关A下的子设备dev_A1,以及网关B下的dev_B2发送设备操作请求,以对子设备dev_A1与dev_B2进行控制,从而在边缘计算集群中,不仅可以通过云端直接对子设备进行操作控制,还可以将边缘计算集群中的一个网关作为中间网关,对其他网关或本网关下的子设备进行操作控制,丰富了边缘计算场景的设备控制方式。In addition, in addition to using gateway B as an intermediate gateway to control the sub-devices in gateway A, you can also directly control the sub-devices under gateway A and/or gateway B through the cloud. For example, the cloud can control the sub-devices in gateway A and/or gateway B. The sub-device dev_A1 under gateway A and dev_B2 under gateway B send device operation requests to control the sub-devices dev_A1 and dev_B2, so that in the edge computing cluster, not only can the sub-devices be directly operated and controlled through the cloud, but also A gateway in the edge computing cluster is used as an intermediate gateway to perform operation control on other gateways or sub-devices under this gateway, which enriches the device control methods of edge computing scenarios.
需要说明的是,在本申请实施例中,以第一网关对第二网关中一个子设备进行控制为例进行示例性说明,可以理解的是,网关可以同时对多个不同的网关下不同的子设备进行同时控制,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。It should be noted that, in the embodiment of the present application, the first gateway controls a sub-device in the second gateway as an example for exemplification. It is understandable that the gateway can control multiple different gateways at the same time. The sub-devices are controlled at the same time, so that based on the edge computing cluster, each gateway can realize the device control between the gateways through the proxy object, which ensures that the edge computing rules can be correlated across the network, realizes decentralization, edge autonomy, and improves edge computing The linkage ability.
在本申请实施例中,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与 第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,由第一网关通过第一代理对象发送,用于对第二网关下第一设备进行配置的配置信息,至第二网关,接着第二网关通过第二代理对象将第一设备发送的回应消息,发送至第一网关,其中,回应消息为第一设备依据配置信息完成属性配置的消息,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。In this embodiment of the application, it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a second proxy object, The second gateway communicates with at least one first device, and the configuration information sent by the first gateway through the first proxy object is used to configure the configuration information of the first device under the second gateway to the second gateway, and then to the second gateway. The gateway sends the response message sent by the first device to the first gateway through the second proxy object, where the response message is a message that the first device completes the attribute configuration according to the configuration information, so that based on the edge computing cluster, each gateway can pass through The proxy object implements device control between gateways, ensuring that edge computing rules can be associated across networks, achieving decentralization and edge autonomy, and improving the linkage capability of edge computing.
需要说明的是,在本申请实施例中以设备数据的获取和设备的配置为例分别进行说明,可以理解的是,两者可以相互结合。例如,在楼宇建筑的场景中,网关A、B中的应用程序负责本网关下传感器上报消息的预处理,而网关C的应用程序订阅了网关A、B中的设备数据。其中,网关A对应的传感器为温度传感器,网关B对应的传感器为湿度传感器。则网关A中的应用程序可以每5分钟统计一次平均温度,网关B中的应用程序可以每5分钟统计一次平均湿度,然后网关A、B可以将处理后的温湿度数据发布到网关C中的应用程序做进一步分析,从而决定是否更改楼宇建筑中的中央空调系统的配置。当需要更改时,则网关C可以将中央空调系统的配置信息发送至网关D,由网关D将配置信息传递给中控空调系统,实现中央空调系统的属性值设置。It should be noted that, in the embodiments of the present application, the acquisition of device data and the configuration of the device are taken as examples for description respectively. It is understandable that the two can be combined with each other. For example, in a building construction scenario, applications in gateways A and B are responsible for the preprocessing of messages reported by sensors under this gateway, while applications in gateway C subscribe to the device data in gateways A and B. Among them, the sensor corresponding to gateway A is a temperature sensor, and the sensor corresponding to gateway B is a humidity sensor. Then the application in gateway A can count the average temperature every 5 minutes, and the application in gateway B can count the average humidity every 5 minutes, and then gateways A and B can publish the processed temperature and humidity data to gateway C. The application program performs further analysis to determine whether to change the configuration of the central air-conditioning system in the building. When it needs to be changed, the gateway C can send the configuration information of the central air-conditioning system to the gateway D, and the gateway D transmits the configuration information to the central air-conditioning system to realize the attribute value setting of the central air-conditioning system.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the described sequence of actions, because According to the embodiments of the present application, certain steps may be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
参照图11,示出了本申请的一种边缘计算集群实施例的结构框图。Referring to FIG. 11, a structural block diagram of an embodiment of an edge computing cluster of the present application is shown.
作为一种示例,在边缘计算场景中,承载业务的硬件能力通常较弱,单台网关硬件的物理能力有限,在设备量大(如万级)的情况下无法采用单台网关接入,可能存在的问题包括设备布线、单台网关接口不足或者硬件处理能力不足等,从而需要使用多台网关接入。然而,在工业生产或楼宇现场中,现场设备在物理链接上不属于同一个网关,当设备在业务上有关联时,则需要边缘网关有能力实现跨网关的设备控制和数据共享。但每个网关只能访问分配本网关的子设备,对接入其他网关下的子设备无法直接进行控制或信息获取。因此,本申请实施例提出一种边缘计算集群,可以实现不同网关之间的跨网关联动,实现网关之间的设备数据共享和设备控制。As an example, in the edge computing scenario, the hardware capability of carrying services is usually weak, and the physical capability of a single gateway hardware is limited. In the case of a large amount of equipment (such as 10,000-level), a single gateway cannot be used for access. Existing problems include equipment wiring, insufficient single gateway interface or insufficient hardware processing capacity, etc., which requires the use of multiple gateways for access. However, in industrial production or building sites, field devices do not belong to the same gateway in terms of physical links. When the devices are related in business, the edge gateway is required to have the ability to implement cross-gateway device control and data sharing. However, each gateway can only access the sub-devices assigned to its own gateway, and cannot directly control or obtain information on sub-devices connected to other gateways. Therefore, the embodiment of the present application proposes an edge computing cluster, which can realize cross-network correlation between different gateways, and realize device data sharing and device control between gateways.
在本申请实施例中,边缘计算集群可以包括多个网关,每个网关中可以设置有代理对象,各个网关可以通过所述代理对象进行数据交互。In the embodiment of the present application, the edge computing cluster may include multiple gateways, each gateway may be provided with a proxy object, and each gateway may perform data interaction through the proxy object.
在本申请实施例的一种示例中,可以将多个边缘网关进行组网,各个边缘网关中运行一个MQTT Broker实例,从而通过对边缘网关进行组网,将多个边缘网关组成边缘计算集群,实现各个网关之间设备数据的采集、流转、存储、分析和上报。In an example of the embodiment of the present application, multiple edge gateways can be networked, and each edge gateway runs an MQTT Broker instance, so that the edge gateways are networked to form an edge computing cluster. Realize the collection, circulation, storage, analysis, and reporting of device data between various gateways.
具体的,边缘网关可以包括代理对象,则多个不同的边缘网关可以通过该代理对象,组建成MQTT集群,在该MQTT集群中,各个网关可以实现设备数据按需在网关之间流转等。Specifically, the edge gateway may include a proxy object, and multiple different edge gateways can form an MQTT cluster through the proxy object. In the MQTT cluster, each gateway can realize the transfer of device data between the gateways on demand.
在具体实现中,边缘计算集群的组网需要的配置项包括:网关标识、网关IP地址以及共享密钥,则每个边缘网关都会对应为一个该结构的对象,从而组成一个Json数组,通过部署数据传输链路到各个网关中,并对数据传输链路进行加密,从而完成边缘计算集群的组网。其中,共享密钥用于网关之间的身份认证和数据传输链路的加密,可以使用预共享密钥TLS-PSK进行身份认证和加密,从而兼顾安全性和灵活性。In the specific implementation, the configuration items required for the networking of the edge computing cluster include: gateway identification, gateway IP address, and shared key. Each edge gateway corresponds to an object of this structure, thus forming a Json array. The data transmission link is connected to each gateway, and the data transmission link is encrypted, thereby completing the networking of the edge computing cluster. Among them, the shared key is used for identity authentication and data transmission link encryption between gateways, and the pre-shared key TLS-PSK can be used for identity authentication and encryption, thereby taking into account security and flexibility.
具体的,当不同边缘网关组建成边缘计算集群后,则在边缘计算集群中的不同网关之间可以相互访问其他网关下的子设备,以获取对应的设备数据,或对其他网关下的子设备进行访问并控制。而位于边缘计算集群之外的其他网关,则无法通过该边缘计算集群对集群中的网关进行访问,也无法访问网关下的子设备。Specifically, after different edge gateways are assembled into an edge computing cluster, different gateways in the edge computing cluster can mutually access sub-devices under other gateways to obtain corresponding device data, or for sub-devices under other gateways. Access and control. However, other gateways located outside the edge computing cluster cannot access the gateway in the cluster through the edge computing cluster, nor can they access the sub-devices under the gateway.
此外,对于位于同一边缘计算集群中的子设备而言,其可以包括第一子设备与第二子设备,第一子设备可以为通过数据链路即可进行访问的设备,第二子设备可以为加密设备,第二子设备上的设备数据为加密数据,访问第二子设备上的设备数据需要得到第二子设备的访问权限,才能进行访问。如位于同一边缘计算集群中网关A与网关B,其中,网关A下的子设备①为第一子设备,子设备②为第二子设备,则网关B可以通过集群中数据链路对子设备①进行访问,以获取子设备①的设备数据或控制子设备①;而对于子设备②,则需要得到子设备②的访问权限,方能获取子设备②的设备数据或控制子设备②,从而对于同一边缘计算集群中的加密设备,需要先获取加密设备的访问权限,才能进行数据获取或设备控制,可以有效地保证同一边缘计算集群中设备的数据安全,以及设备控制的安全性。In addition, for sub-devices located in the same edge computing cluster, it can include a first sub-device and a second sub-device. The first sub-device can be a device that can be accessed through a data link, and the second sub-device can To encrypt the device, the device data on the second sub-device is encrypted data, and access to the device data on the second sub-device requires the access permission of the second sub-device to access it. If gateway A and gateway B are located in the same edge computing cluster, where the sub-device ① under gateway A is the first sub-device and sub-device ② is the second sub-device, then gateway B can pair the sub-devices through the data link in the cluster ①Access to obtain the device data of the sub-device ① or control the sub-device ①; and for the sub-device ②, the access permission of the sub-device ② is required to obtain the device data of the sub-device ② or control the sub-device ②, thus For encryption devices in the same edge computing cluster, the access rights of the encryption devices need to be obtained before data acquisition or device control can be performed, which can effectively ensure the data security of the devices in the same edge computing cluster and the security of device control.
需要说明的是,在本申请实施例中,以边缘网关运行MQTT Broker实例进行示例性说明,可以理解的是,在本申请实施例的教导下,本领域技术人员还可以采用其他实例,本申请对此不作限制。It should be noted that in the embodiments of this application, an example of an edge gateway running MQTT Broker is used as an example. It should be understood that under the teaching of the embodiments of this application, those skilled in the art can also use other examples. There is no restriction on this.
在本申请实施例的一种可选实施例中,所述网关至少包括与至少一个第一设备通信连接的第一网关,与至少一个第二设备通信连接的第二网关;所述代理对象包括设置于所述第一网关的第一代理对象,以及设置于所述第二网关的第二代理对象;其中,In an optional embodiment of the embodiments of the present application, the gateway includes at least a first gateway communicatively connected with at least one first device, and a second gateway communicatively connected with at least one second device; the proxy object includes A first proxy object set in the first gateway, and a second proxy object set in the second gateway; wherein,
所述第一网关,用于通过所述第一代理对象发送针对所述第二设备的第一通信数据;以及通过所述第一代理对象接收所述第二网关发送的针对所述第一通信数据的第一回应数据;The first gateway is configured to send first communication data for the second device through the first proxy object; and receive through the first proxy object for the first communication sent by the second gateway The first response data of the data;
所述第二网关,用于通过所述第二代理对象发送针对所述第一设备的第二通信数据;以及通过所述第二代理对象接收所述第一网关发送的针对所述第二通信数据的第二回应数据。The second gateway is configured to send second communication data for the first device through the second proxy object; and receive through the second proxy object for the second communication sent by the first gateway The second response data of the data.
在具体实现中,在边缘计算集群中的各个网关可以通过代理对象订阅本网关下所有子设备的设备数据,也可以通过代理对象发布本网关下全量子设备的设备数据,也可以通过代理对象订阅其他网关下子设备的设备数据,还可以通过代理对象接收来自其他网关发送的,订阅本网关下子设备的设备数据的订阅请求消息。In specific implementation, each gateway in the edge computing cluster can subscribe to the device data of all sub-devices under the gateway through the proxy object, or publish the device data of the full quantum devices under the gateway through the proxy object, or subscribe through the proxy object The device data of sub-devices under other gateways can also receive subscription request messages sent from other gateways to subscribe to the device data of sub-devices under this gateway through proxy objects.
在本申请实施例中,边缘计算集群中的各个网关可以运行应用程序,应用程序可以实现网关的本地定义、开发、测试、调试Serverless(无服务器)应用,并将设备数据上传至云端。In the embodiment of the present application, each gateway in the edge computing cluster can run application programs, which can implement local definition, development, testing, and debugging of serverless (serverless) applications of the gateway, and upload device data to the cloud.
在具体实现中,所述第一代理对象,用于将所述应用程序发送的所述第一通信数据发送至所述第二代理对象;所述第二代理对象,用于将所述第一通信数据发送至所述第二设备;以及获取所述第二设备上报的针对所述第一通信数据的第一回应数据,并将所述第一回应数据发送至所述第一代理对象。In a specific implementation, the first proxy object is used to send the first communication data sent by the application to the second proxy object; the second proxy object is used to send the first communication data to the second proxy object; Sending communication data to the second device; and obtaining first response data for the first communication data reported by the second device, and sending the first response data to the first proxy object.
在本申请实施例中,所述第一网关包括操作代理对象;所述操作代理对象,用于将所述第一代理对象发送的所述第一回应数据发送至所述应用程序。In the embodiment of the present application, the first gateway includes an operation proxy object; the operation proxy object is used to send the first response data sent by the first proxy object to the application.
在本申请实施例的一种可选实施例中,所述操作代理对象,还用于将所述第一代理对象发送的所述第二通信数据,发送至所述第一设备,使所述第一设备执行与所述第二通信数据对应的第一设备操作;以及将所述第一设备发送的针对所述第二通信数据的第二回应数据,发送至所述第一代理对象。In an optional embodiment of the embodiments of the present application, the operation proxy object is further configured to send the second communication data sent by the first proxy object to the first device, so that the The first device performs a first device operation corresponding to the second communication data; and sends the second response data sent by the first device for the second communication data to the first proxy object.
在本申请实施例的另一种可选实施例中,所述操作代理对象,还用于将所述应用程序发送的本地操作数据发送至所述第一设备,使所述第一设备执行与所述本地操作数据对应的第二设备操作。In another optional embodiment of the embodiments of the present application, the operation proxy object is also used to send the local operation data sent by the application to the first device, so that the first device executes and The second device operation corresponding to the local operation data.
在本申请实施例的一种可选实施例中,当第一通信数据为订阅请求消息,第一回应 数据包括设备数据时,所述第一代理对象,还用于将针对所述第二设备的订阅请求消息发送至所述第二代理对象;所述第二代理对象,还用于获取所述第二设备发送的针对所述订阅请求消息的设备数据;并将所述设备数据发送至所述第一代理对象。In an optional embodiment of the embodiments of the present application, when the first communication data is a subscription request message and the first response data includes device data, the first proxy object is also used to target the second device The subscription request message is sent to the second proxy object; the second proxy object is also used to obtain the device data sent by the second device for the subscription request message; and send the device data to the The first proxy object.
在具体实现中,当第一网关需要接收位于第二网关中第一设备的设备数据时,可以通过第一代理对象向第二网关的第二代理对象发送针对第一设备的订阅请求消息,则第二网关接收到该订阅请求消息后,可以通过第二代理对象将针对订阅请求消息的设备数据,发送至第一代理对象,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In a specific implementation, when the first gateway needs to receive the device data of the first device located in the second gateway, it can send a subscription request message for the first device to the second proxy object of the second gateway through the first proxy object, then After the second gateway receives the subscription request message, it can send the device data for the subscription request message to the first proxy object through the second proxy object, so that based on the edge computing cluster, the gateways can communicate with each other through the proxy object. Inter-data sharing ensures that edge computing rules can be linked across networks, achieving decentralization and edge autonomy, and improving edge computing capabilities.
在本申请实施例的一种可选实施例中,当第二通信数据包括设备配置信息,所述第二回应数据包括配置回应消息,则所述第二代理对象,还用于将所述针对所述第一设备的设备配置信息发送至所述第一代理对象;所述操作代理对象,还用于将所述第一代理对象发送的所述设备配置信息发送至所述第一设备,使所述第一设备执行与所述设备配置信息对应的操作;以及获取所述第一设备信息发送的所述配置回应消息,并将所述配置回应消息发送至所述第一代理对象;所述第一代理对象,还用于将所述配置回应消息发送至所述第二代理对象。In an optional embodiment of the embodiments of the present application, when the second communication data includes device configuration information, and the second response data includes a configuration response message, the second proxy object is also used to target the The device configuration information of the first device is sent to the first proxy object; the operation proxy object is also used to send the device configuration information sent by the first proxy object to the first device, so that The first device performs an operation corresponding to the device configuration information; and obtains the configuration response message sent by the first device information, and sends the configuration response message to the first proxy object; The first proxy object is also used to send the configuration response message to the second proxy object.
在具体实现中,当第一网关需要设置位于第二网关中的第一设备的属性时,可以通过第一代理对象将针对第一设备的配置信息,发送至第二网关的第二代理对象,从而第二代理对象可以将该配置信息发送至第一设备,使第一设备依据该配置信息进行属性配置,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的联动能力。In a specific implementation, when the first gateway needs to set the attributes of the first device located in the second gateway, the configuration information for the first device can be sent to the second proxy object of the second gateway through the first proxy object, Therefore, the second proxy object can send the configuration information to the first device, so that the first device performs attribute configuration based on the configuration information. Based on the edge computing cluster, each gateway can implement device control between the gateways through the proxy object. It ensures that the edge computing rules can be correlated across networks, realize decentralization and edge autonomy, and improve the linkage capability of edge computing.
在本申请实施例中,网关还可以包括与云服务器通信连接的云代理对象,操作代理对象还可以包括与Message-Router通信连接的任务调度模块。其中,云代理对象可以作为云服务器与网关之间的数据通信中介,负责云端与边缘计算端之间的数据通信,而任务调度模块则可以为负责对场景联动任务进行分配,如当云端需要获取多个网关下各个子设备的设备数据时,则任务调度模块可以对云端下发的任务进行解析,并确定对应的网关,以及对应的子设备,并执行对应的操作。In the embodiment of the present application, the gateway may further include a cloud proxy object communicatively connected with the cloud server, and the operation proxy object may further include a task scheduling module communicatively connected with the Message-Router. Among them, the cloud proxy object can be used as the data communication intermediary between the cloud server and the gateway, responsible for the data communication between the cloud and the edge computing terminal, and the task scheduling module can be responsible for the allocation of scene linkage tasks, such as when the cloud needs to obtain When the device data of each sub-device under multiple gateways is used, the task scheduling module can analyze the tasks issued by the cloud, determine the corresponding gateway and the corresponding sub-device, and perform corresponding operations.
具体的,当云端需要通过其中一个网关对其他网关的子设备进行设备数据的集中获取时,可以向网关下发对应的消息路由,使该网关可以通过该消息路由,获取其他网关 的子设备的设备数据。Specifically, when the cloud needs to collect device data from the sub-devices of other gateways through one of the gateways, the corresponding message route can be issued to the gateway so that the gateway can obtain the information of the sub-devices of other gateways through the message route. Device data.
在具体实现中,云代理对象可以负责边缘网关与云服务器之前的通信,云端可以下发数据至边缘网关,边缘网关也可以上报数据至云端。此外,在边缘计算集群中,由于设备数据可以在多个网关之间进行共享,则设备数据有可能从其他网关上报至云端,因此,为了避免订阅的设备数据从本网关上报至云端,造成设备数据的重复上传,云代理对象可以对网关上传的设备数据进行监控,当监测到设备数据为本网关下子设备的设备数据时,则上报至云端;当监测到设备数据为其他网关下子设备的设备数据时,则不从本网关上报至云端,即网关无法将其他网关子设备的设备数据上报至云端。In a specific implementation, the cloud proxy object can be responsible for the communication between the edge gateway and the cloud server, the cloud can deliver data to the edge gateway, and the edge gateway can also report data to the cloud. In addition, in an edge computing cluster, since device data can be shared among multiple gateways, device data may be reported to the cloud from other gateways. Therefore, in order to avoid subscribed device data from being reported to the cloud from this gateway, the device data may be reported to the cloud. For repeated uploads of data, the cloud proxy object can monitor the device data uploaded by the gateway. When the device data is monitored as the device data of the sub-device under this gateway, it is reported to the cloud; when the device data is monitored as the device data of the sub-device under other gateways Data is not reported from the gateway to the cloud, that is, the gateway cannot report the device data of other gateway sub-devices to the cloud.
在本申请实施例的一种示例中,如图12所示,示出了本申请的一种边缘计算集群实施例中边缘计算集群的架构图,边缘计算集群至少包括两个边缘网关。其中,边缘网关中包括对外的第一消息代理对象Mosquitto,网关联动模块Gw-Linkage,网关内部的第二消息代理对象Message-Router,任务调度模块Task-Dispatcher以及云代理对象Cloud-Proxy等,并且网关中还可以运行应用程序,且网关可以与至少一个子设备进行通信连接。具体的,图10中实线表示数据流,虚线表示控制流,则边缘网关之间可以通过Mosquitto进行通信连接,网关中各个模块(应用程序)可以根据设定的数据传输路径进行通信连接,在此不再赘述。In an example of an embodiment of the present application, as shown in FIG. 12, an architecture diagram of an edge computing cluster in an embodiment of an edge computing cluster of the present application is shown, and the edge computing cluster includes at least two edge gateways. Among them, the edge gateway includes the first external message proxy object Mosquitto, the network related dynamic module Gw-Linkage, the second message proxy object Message-Router inside the gateway, the task scheduling module Task-Dispatcher, and the cloud proxy object Cloud-Proxy, etc., and The gateway can also run applications, and the gateway can communicate with at least one sub-device. Specifically, the solid line in Figure 10 represents the data flow, and the dashed line represents the control flow. Then the edge gateways can communicate through Mosquitto, and each module (application) in the gateway can communicate and connect according to the set data transmission path. This will not be repeated here.
在本申请实施例中,边缘系统至少包括第一网关,以及与第一设备进行通信连接的第二网关;所述第一网关包括第一代理对象,所述第二网关包括第二代理对象;其中,所述第一网关,用于通过所述第一代理对象将针对所述第一设备的订阅请求消息,发送至所述第二代理对象;所述第二网关,用于通过所述第二代理对象将针对所述订阅请求消息的设备数据,发送至所述第一代理对象,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的数据共享,保证了边缘计算规则可以跨网关联动,实现去中心化、边缘自治,提高了边缘计算的能力。In the embodiment of the present application, the edge system includes at least a first gateway and a second gateway communicating with the first device; the first gateway includes a first proxy object, and the second gateway includes a second proxy object; Wherein, the first gateway is configured to send a subscription request message for the first device to the second proxy object through the first proxy object; the second gateway is configured to send a subscription request message for the first device to the second proxy object through the first proxy object; The second proxy object sends the device data for the subscription request message to the first proxy object, so that based on the edge computing cluster, each gateway can realize data sharing between the gateways through the proxy object, ensuring the edge computing rules It can be linked across networks to achieve decentralization, edge autonomy, and improve edge computing capabilities.
并且,所述第一网关,还用于通过所述第一代理对象将针对所述第一设备的配置信息,发送至所述第二代理对象;所述第二网关,还用于通过所述第二代理对象将所述配置信息发送至所述第一设备,使所述第一设备依据所述配置信息进行属性配置,从而基于边缘计算集群,各个网关之间可以通过代理对象实现网关之间的设备控制。In addition, the first gateway is also used to send configuration information for the first device to the second proxy object through the first proxy object; the second gateway is also used to send configuration information for the first device to the second proxy object through the first proxy object; The second proxy object sends the configuration information to the first device, so that the first device performs attribute configuration based on the configuration information, so that based on the edge computing cluster, each gateway can implement inter-gateway communication through proxy objects. Device control.
参考图13,示出了本申请的一种设备数据的获取装置实施例的结构框图,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通 信连接,所述装置包括:Referring to FIG. 13, there is shown a structural block diagram of an embodiment of an apparatus for acquiring device data of the present application, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes A first proxy object, the second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
订阅消息发送模块1301,用于所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;The subscription message sending module 1301 is used for the first proxy object to send a subscription request message for the first device to the second proxy object;
设备数据发送模块1302,用于所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。The device data sending module 1302 is used for the second proxy object to obtain device data for the subscription request message, and send the device data to the first proxy object.
在本申请实施例的一种可选实施例中,所述第一网关与云服务器进行通信连接,所述第一网关还包括与所述云服务器以及所述第一代理对象通信连接的第一操作代理对象,所述订阅消息发送模块1301包括:In an optional embodiment of the embodiment of the present application, the first gateway is in a communication connection with a cloud server, and the first gateway further includes a first communication connection with the cloud server and the first proxy object. To operate a proxy object, the subscription message sending module 1301 includes:
第一订阅消息确定子模块,用于所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息;The first subscription message determining submodule is used for the first operation agent object to obtain the message route sent by the cloud server, and determine the subscription request message corresponding to the message route;
订阅消息发送子模块,用于所述第一代理对象将所述第一操作代理对象发送的所述订阅请求消息,发送至所述第二代理对象。The subscription message sending submodule is used for the first proxy object to send the subscription request message sent by the first operation proxy object to the second proxy object.
在本申请实施例的一种可选实施例中,所述第二网关还包括与所述第二代理对象通信连接的第二操作代理对象,所述设备数据发送模块1302包括:In an optional embodiment of the embodiment of the present application, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object, and the device data sending module 1302 includes:
第二订阅消息发送子模块,用于所述第二操作代理对象将所述第二代理对象发送的所述订阅请求消息,发送至所述第一设备;The second subscription message sending submodule is configured to send the subscription request message sent by the second proxy object to the first device by the second operation proxy object;
设备数据获取子模块,用于所述第二操作代理对象获取所述第一设备发送的针对所述订阅请求消息的所述设备数据,并将所述设备数据发送至所述第二代理对象;A device data acquisition sub-module, configured for the second operation proxy object to acquire the device data for the subscription request message sent by the first device, and send the device data to the second proxy object;
设备数据发送子模块,用于所述第二代理对象将所述设备数据,发送至所述第一代理对象。The device data sending submodule is used for the second proxy object to send the device data to the first proxy object.
在本申请实施例的一种可选实施例中,所述第一网关运行应用程序,所述装置还包括:In an optional embodiment of the embodiment of the present application, the first gateway runs an application, and the device further includes:
设备数据转发模块,用于所述第一操作代理对象将所述第一代理对象发送的所述设备数据,发送至所述应用程序。The device data forwarding module is used for the first operation proxy object to send the device data sent by the first proxy object to the application program.
在本申请实施例的一种可选实施例中,所述第一网关还包括与所述云服务器以及所述第一操作代理对象通信连接的云代理对象,所述第一订阅消息确定子模块具体用于:In an optional embodiment of the embodiment of the present application, the first gateway further includes a cloud proxy object communicatively connected with the cloud server and the first operation proxy object, and the first subscription message determining submodule Specifically used for:
所述云代理对象获取所述云服务器发送的所述消息路由,并将所述消息路由发送至所述第一操作代理对象;The cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
所述第一操作代理对象确定与所述消息路由对应的订阅请求消息。The first operation agent object determines the subscription request message corresponding to the message route.
参考图14,示出了本申请的一种设备的配置装置实施例的结构框图,应用于边缘计 算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述装置包括:Referring to FIG. 14, there is shown a structural block diagram of an embodiment of a device configuration apparatus of the present application, which is applied to an edge computing cluster. The edge computing cluster includes at least a first gateway and a second gateway, and the first gateway includes a first gateway. A proxy object, the second gateway includes a second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
配置信息发送模块1401,用于所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;A configuration information sending module 1401, configured for the first proxy object to send configuration information for configuring the first device to the second proxy object;
回应消息发送模块1402,用于所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置的消息。A response message sending module 1402, configured for the second proxy object to send a response message sent by the first device to the first proxy object, where the response message is based on the configuration information of the first device, Message to complete the property configuration.
在本申请实施例的一种可选实施例中,所述第一网关运行应用程序,所述第一网关还包括与所述第一代理对象通信连接的第一操作代理对象,所述配置信息发送模块1401包括:In an optional embodiment of the embodiment of the present application, the first gateway runs an application program, the first gateway further includes a first operation proxy object that is communicatively connected with the first proxy object, and the configuration information The sending module 1401 includes:
第一信息发送子模块,用于所述第一操作代理对象将所述应用程序发送的所述配置信息,发送至所述第一代理对象;The first information sending submodule is used for the first operation proxy object to send the configuration information sent by the application program to the first proxy object;
第二信息发送子模块,用于所述第一代理对象将所述配置信息发送至所述第二代理对象。The second information sending submodule is used for the first proxy object to send the configuration information to the second proxy object.
在本申请实施例的一种可选实施例中,所述第二网关还包括与所述第二代理对象和所述第一设备通信连接的第二操作代理对象,所述回应消息发送模块1402包括:In an optional embodiment of the embodiment of the present application, the second gateway further includes a second operation proxy object communicatively connected with the second proxy object and the first device, and the response message sending module 1402 include:
配置信息发送子模块,用于所述第二操作代理对象将所述第二代理对象发送的所述配置信息,发送至所述第一设备;The configuration information sending sub-module is used for the second operation proxy object to send the configuration information sent by the second proxy object to the first device;
回应消息发送子模块,用于所述第二代理对象将所述第二操作代理对象发送的所述回应消息,发送至所述第一代理对象。The response message sending submodule is used for the second proxy object to send the response message sent by the second operation proxy object to the first proxy object.
在本申请实施例的一种可选实施例中,还包括:In an optional embodiment of the embodiment of the present application, it further includes:
回应消息转发模块,用于所述第一操作代理对象将所述第一代理对象发送的所述回应消息,发送至所述应用程序。The response message forwarding module is configured to send the response message sent by the first proxy object to the application by the first operation proxy object.
对于边缘计算集群、装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the edge computing clusters and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiments.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other.
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软 件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media. Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, 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, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-persistent computer-readable media (transitory media), such as modulated data signals and carrier waves.
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The embodiments of the present application are described with reference to the flowcharts and/or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal equipment to generate a machine, so that instructions executed by the processor of the computer or other programmable data processing terminal equipment A device for realizing the functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram is generated.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operation steps are executed on the computer or other programmable terminal equipment to produce computer-implemented processing, so that the computer or other programmable terminal equipment The instructions executed above provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. Or there is any such actual relationship or sequence between operations. Moreover, the terms "including", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes those that are not explicitly listed. Other elements listed, or also include elements inherent to this process, method, article, or terminal device. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or terminal device that includes the element.
以上对本申请所提供的一种设备数据的获取方法、一种设备的配置方法、一种边缘计算集群以及一种设备数据的获取装置、一种设备的配置装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above provides a detailed introduction to a method for obtaining device data, a method for configuring a device, an edge computing cluster, a device for obtaining device data, and a device for configuring the device provided in this application. Specific examples are given to illustrate the principles and implementation of the application. The descriptions of the above examples are only used to help understand the methods and core ideas of the application; at the same time, for those of ordinary skill in the art, based on the ideas of the application, There will be changes in the specific implementation and the scope of application. In summary, the content of this specification should not be construed as a limitation to this application.

Claims (20)

  1. 一种设备数据的获取方法,其特征在于,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法包括:A method for acquiring device data, characterized in that it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes For the second proxy object, the second gateway communicates with at least one first device, and the method includes:
    所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;Sending, by the first proxy object, a subscription request message for the first device to the second proxy object;
    所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。The second proxy object obtains device data for the subscription request message, and sends the device data to the first proxy object.
  2. 根据权利要求1所述的方法,其特征在于,所述第一网关与云服务器进行通信连接,所述第一网关还包括与所述云服务器以及所述第一代理对象通信连接的第一操作代理对象,所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象,包括:The method according to claim 1, wherein the first gateway communicates with a cloud server, and the first gateway further comprises a first operation of communicating with the cloud server and the first proxy object The proxy object, where the first proxy object sends a subscription request message for the first device to the second proxy object, including:
    所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息;The first operation agent object obtains the message route sent by the cloud server, and determines a subscription request message corresponding to the message route;
    所述第一代理对象将所述第一操作代理对象发送的所述订阅请求消息,发送至所述第二代理对象。The first proxy object sends the subscription request message sent by the first operation proxy object to the second proxy object.
  3. 根据权利要求2所述的方法,其特征在于,所述第二网关还包括与所述第二代理对象通信连接的第二操作代理对象,所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象,包括:The method according to claim 2, wherein the second gateway further comprises a second operation proxy object communicatively connected with the second proxy object, and the second proxy object obtains information about the subscription request message Device data, and sending the device data to the first proxy object includes:
    所述第二操作代理对象将所述第二代理对象发送的所述订阅请求消息,发送至所述第一设备;Sending, by the second operation proxy object, the subscription request message sent by the second proxy object to the first device;
    所述第二操作代理对象获取所述第一设备发送的针对所述订阅请求消息的所述设备数据,并将所述设备数据发送至所述第二代理对象;The second operation proxy object obtains the device data for the subscription request message sent by the first device, and sends the device data to the second proxy object;
    所述第二代理对象将所述设备数据,发送至所述第一代理对象。The second proxy object sends the device data to the first proxy object.
  4. 根据权利要求3所述的方法,其特征在于,所述第一网关运行应用程序,所述方法还包括:The method according to claim 3, wherein the first gateway runs an application, and the method further comprises:
    所述第一操作代理对象将所述第一代理对象发送的所述设备数据,发送至所述应用程序。The first operation proxy object sends the device data sent by the first proxy object to the application.
  5. 根据权利要求2所述的方法,其特征在于,所述第一网关还包括与所述云服务器以及所述第一操作代理对象通信连接的云代理对象,所述第一操作代理对象获取所述云服务器发送的消息路由,并确定与所述消息路由对应的订阅请求消息,包括:The method according to claim 2, wherein the first gateway further comprises a cloud proxy object communicatively connected with the cloud server and the first operation proxy object, and the first operation proxy object obtains the The message routing sent by the cloud server and determining the subscription request message corresponding to the message routing includes:
    所述云代理对象获取所述云服务器发送的所述消息路由,并将所述消息路由发送至所述第一操作代理对象;The cloud proxy object obtains the message route sent by the cloud server, and sends the message route to the first operation proxy object;
    所述第一操作代理对象确定与所述消息路由对应的订阅请求消息。The first operation agent object determines the subscription request message corresponding to the message route.
  6. 一种设备的配置方法,其特征在于,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述方法包括:A device configuration method, characterized in that it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a first gateway. Two proxy objects, the second gateway communicates with at least one first device, and the method includes:
    所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;Sending, by the first proxy object, configuration information used to configure the first device to the second proxy object;
    所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置的消息。The second proxy object sends a response message sent by the first device to the first proxy object, where the response message is a message that the first device completes the configuration of attributes according to the configuration information.
  7. 根据权利要求6所述的方法,其特征在于,所述第一网关运行应用程序,所述第一网关还包括与所述第一代理对象通信连接的第一操作代理对象,所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象,包括:The method according to claim 6, wherein the first gateway runs an application program, the first gateway further comprises a first operation proxy object communicatively connected with the first proxy object, and the first proxy The object sending configuration information for configuring the first device to the second proxy object includes:
    所述第一操作代理对象将所述应用程序发送的所述配置信息,发送至所述第一代理对象;Sending, by the first operation proxy object, the configuration information sent by the application program to the first proxy object;
    所述第一代理对象将所述配置信息发送至所述第二代理对象。The first proxy object sends the configuration information to the second proxy object.
  8. 根据权利要求6所述的方法,其特征在于,所述第二网关还包括与所述第二代理对象和所述第一设备通信连接的第二操作代理对象,所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,包括:The method according to claim 6, wherein the second gateway further comprises a second operation proxy object communicatively connected with the second proxy object and the first device, and the second proxy object connects all The response message sent by the first device and sent to the first proxy object includes:
    所述第二操作代理对象将所述第二代理对象发送的所述配置信息,发送至所述第一设备;Sending, by the second operation proxy object, the configuration information sent by the second proxy object to the first device;
    所述第二代理对象将所述第二操作代理对象发送的所述回应消息,发送至所述第一代理对象。The second proxy object sends the response message sent by the second operation proxy object to the first proxy object.
  9. 根据权利要求7所述的方法,其特征在于,还包括:The method according to claim 7, further comprising:
    所述第一操作代理对象将所述第一代理对象发送的所述回应消息,发送至所述应用程序。The first operation proxy object sends the response message sent by the first proxy object to the application.
  10. 一种边缘计算集群,其特征在于,包括多个网关,每个网关中设置有代理对象,各个网关通过所述代理对象进行数据交互。An edge computing cluster is characterized by comprising multiple gateways, each gateway is provided with a proxy object, and each gateway performs data interaction through the proxy object.
  11. 根据权利要求10所述的边缘计算集群,其特征在于,所述网关至少包括与至少一个第一设备通信连接的第一网关,与至少一个第二设备通信连接的第二网关;所述代 理对象包括设置于所述第一网关的第一代理对象,以及设置于所述第二网关的第二代理对象;其中,The edge computing cluster according to claim 10, wherein the gateway includes at least a first gateway communicatively connected with at least one first device, and a second gateway communicatively connected with at least one second device; the proxy object Including a first proxy object set in the first gateway, and a second proxy object set in the second gateway; wherein,
    所述第一网关,用于通过所述第一代理对象发送针对所述第二设备的第一通信数据;以及通过所述第一代理对象接收所述第二网关发送的针对所述第一通信数据的第一回应数据;The first gateway is configured to send first communication data for the second device through the first proxy object; and receive through the first proxy object for the first communication sent by the second gateway The first response data of the data;
    所述第二网关,用于通过所述第二代理对象发送针对所述第一设备的第二通信数据;以及通过所述第二代理对象接收所述第一网关发送的针对所述第二通信数据的第二回应数据。The second gateway is configured to send second communication data for the first device through the second proxy object; and receive through the second proxy object for the second communication sent by the first gateway The second response data of the data.
  12. 根据权利要求11所述的边缘计算集群,其特征在于,所述第一网关运行应用程序;The edge computing cluster of claim 11, wherein the first gateway runs an application program;
    所述第一代理对象,用于将所述应用程序发送的所述第一通信数据发送至所述第二代理对象;The first proxy object is used to send the first communication data sent by the application program to the second proxy object;
    所述第二代理对象,用于将所述第一通信数据发送至所述第二设备;以及获取所述第二设备上报的针对所述第一通信数据的第一回应数据,并将所述第一回应数据发送至所述第一代理对象。The second proxy object is used to send the first communication data to the second device; and obtain the first response data reported by the second device for the first communication data, and send the The first response data is sent to the first proxy object.
  13. 根据权利要求11所述的边缘计算集群,其特征在于,所述第一网关运行应用程序、且包括操作代理对象;The edge computing cluster according to claim 11, wherein the first gateway runs an application program and includes an operation proxy object;
    所述操作代理对象,用于将所述第一代理对象发送的所述第一回应数据发送至所述应用程序。The operation proxy object is used to send the first response data sent by the first proxy object to the application.
  14. 根据权利要求13所述的边缘计算集群,其特征在于,The edge computing cluster of claim 13, wherein:
    所述操作代理对象,还用于将所述第一代理对象发送的所述第二通信数据,发送至所述第一设备,使所述第一设备执行与所述第二通信数据对应的第一设备操作;以及将所述第一设备发送的针对所述第二通信数据的第二回应数据,发送至所述第一代理对象。The operation proxy object is also used to send the second communication data sent by the first proxy object to the first device, so that the first device executes the second communication data corresponding to the second communication data. A device operation; and sending the second response data for the second communication data sent by the first device to the first proxy object.
  15. 根据权利要求13所述的边缘计算集群,其特征在于,The edge computing cluster of claim 13, wherein:
    所述操作代理对象,还用于将所述应用程序发送的本地操作数据发送至所述第一设备,使所述第一设备执行与所述本地操作数据对应的第二设备操作。The operation proxy object is also used to send the local operation data sent by the application program to the first device, so that the first device executes the second device operation corresponding to the local operation data.
  16. 根据权利要求11所述的边缘计算集群,其特征在于,所述第一网关包括与云服务器通信连接的云代理对象和操作代理对象;The edge computing cluster according to claim 11, wherein the first gateway comprises a cloud proxy object and an operation proxy object that are communicatively connected with a cloud server;
    所述云代理对象,用于获取所述云服务器发送的消息路由,并将所述消息路由发送 至所述操作代理对象;The cloud proxy object is used to obtain the message route sent by the cloud server, and send the message route to the operation proxy object;
    所述操作代理对象,用于确定与所述消息路由对应的第一通信数据。The operation proxy object is used to determine the first communication data corresponding to the message route.
  17. 根据权利要求11所述的边缘计算集群,其特征在于,所述第一通信数据包括订阅请求消息,所述第一回应数据包括设备数据;The edge computing cluster of claim 11, wherein the first communication data includes a subscription request message, and the first response data includes device data;
    所述第一代理对象,还用于将针对所述第二设备的订阅请求消息发送至所述第二代理对象;The first proxy object is also used to send a subscription request message for the second device to the second proxy object;
    所述第二代理对象,还用于获取所述第二设备发送的针对所述订阅请求消息的设备数据;并将所述设备数据发送至所述第一代理对象。The second proxy object is also used to obtain device data for the subscription request message sent by the second device; and send the device data to the first proxy object.
  18. 根据权利要求13所述的边缘计算集群,其特征在于,所述第二通信数据包括设备配置信息,所述第二回应数据包括配置回应消息;The edge computing cluster of claim 13, wherein the second communication data includes device configuration information, and the second response data includes a configuration response message;
    所述第二代理对象,还用于将所述针对所述第一设备的设备配置信息发送至所述第一代理对象;The second proxy object is also used to send the device configuration information for the first device to the first proxy object;
    所述操作代理对象,还用于将所述第一代理对象发送的所述设备配置信息发送至所述第一设备,使所述第一设备执行与所述设备配置信息对应的操作;以及获取所述第一设备信息发送的所述配置回应消息,并将所述配置回应消息发送至所述第一代理对象;The operation proxy object is further configured to send the device configuration information sent by the first proxy object to the first device, so that the first device performs an operation corresponding to the device configuration information; and obtain Sending the configuration response message sent by the first device information to the first proxy object;
    所述第一代理对象,还用于将所述配置回应消息发送至所述第二代理对象。The first proxy object is also used to send the configuration response message to the second proxy object.
  19. 一种设备数据的获取装置,其特征在于,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述装置包括:An apparatus for acquiring device data, characterized in that it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes The second proxy object, the second gateway communicates with at least one first device, and the apparatus includes:
    订阅消息发送模块,用于所述第一代理对象发送针对所述第一设备的订阅请求消息,至所述第二代理对象;A subscription message sending module, configured for the first proxy object to send a subscription request message for the first device to the second proxy object;
    设备数据发送模块,用于所述第二代理对象获取针对所述订阅请求消息的设备数据,并将所述设备数据发送至所述第一代理对象。The device data sending module is used for the second proxy object to obtain the device data for the subscription request message, and send the device data to the first proxy object.
  20. 一种设备的配置装置,其特征在于,应用于边缘计算集群,所述边缘计算集群至少包括第一网关与第二网关,所述第一网关包括第一代理对象,所述第二网关包括第二代理对象,所述第二网关与至少一个第一设备进行通信连接,所述装置包括:A device configuration device, characterized in that it is applied to an edge computing cluster, the edge computing cluster includes at least a first gateway and a second gateway, the first gateway includes a first proxy object, and the second gateway includes a first gateway. Two proxy objects, the second gateway communicates with at least one first device, and the device includes:
    配置信息发送模块,用于所述第一代理对象发送用于对所述第一设备进行配置的配置信息,至所述第二代理对象;A configuration information sending module, configured for the first proxy object to send configuration information for configuring the first device to the second proxy object;
    回应消息发送模块,用于所述第二代理对象将所述第一设备发送的回应消息,发送至所述第一代理对象,所述回应消息为所述第一设备依据所述配置信息,完成属性配置 的消息。The response message sending module is used for the second proxy object to send the response message sent by the first device to the first proxy object, where the response message is completed by the first device according to the configuration information Attribute configuration message.
PCT/CN2020/116024 2019-09-19 2020-09-18 Obtaining method, configuration method, edge computing cluster, and apparatuses WO2021052442A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910888040.7 2019-09-19
CN201910888040.7A CN112532671A (en) 2019-09-19 2019-09-19 Acquisition method, configuration method, edge computing cluster and device

Publications (1)

Publication Number Publication Date
WO2021052442A1 true WO2021052442A1 (en) 2021-03-25

Family

ID=74883394

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116024 WO2021052442A1 (en) 2019-09-19 2020-09-18 Obtaining method, configuration method, edge computing cluster, and apparatuses

Country Status (3)

Country Link
CN (1) CN112532671A (en)
TW (1) TW202113627A (en)
WO (1) WO2021052442A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301809A (en) * 2021-12-31 2022-04-08 郑州云海信息技术有限公司 Edge computing platform architecture
CN114520749A (en) * 2022-01-27 2022-05-20 厦门锐谷通信设备有限公司 Modbus data monitoring method and system based on cloud platform deployment object model
CN114615277A (en) * 2022-03-04 2022-06-10 杭州觅恒科技有限公司 EMQ X-based multi-cluster dynamic expansion method and system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113381894B (en) * 2021-06-10 2024-04-12 北京小程科技有限公司 Decentralized data communication system and method for urban road parking management
CN113612605B (en) * 2021-08-02 2023-09-26 中电信量子科技有限公司 Method, system and equipment for enhancing MQTT protocol identity authentication by using symmetric cryptographic technology

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750651A (en) * 2005-10-31 2006-03-22 北京中星微电子有限公司 Multimedia monitor system
KR20100073808A (en) * 2008-12-23 2010-07-01 주식회사 케이티 Method for configurating addresses of mobile node in multiples of gateway connected manet and method for selecting a basic gateway of mobile node
CN104935484A (en) * 2015-05-28 2015-09-23 北京海尔广科数字技术有限公司 Method and apparatus for calling appliance service via gateways
CN106331200A (en) * 2015-06-30 2017-01-11 华为技术有限公司 Method for transmitting data between nodes, gateway node and node

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10057382B2 (en) * 2015-09-24 2018-08-21 Amrita Vishwa Vidyapeetham Intelligent “IoT gateway”
CN107404512B (en) * 2016-05-19 2021-03-05 华为技术有限公司 Resource subscription method, resource subscription device and resource subscription system
CN106169957A (en) * 2016-06-12 2016-11-30 福建星网锐捷通讯股份有限公司 A kind of implementation method carrying out based on smart machine spanning gateway linking
CN107231262B (en) * 2017-06-26 2021-05-14 华南理工大学 Message routing method based on MQTT multi-layer cascade
CN109861978B (en) * 2018-12-28 2021-06-18 浙江工业大学 Internet of things SaaS platform based on MQTT protocol
CN109474936B (en) * 2019-01-03 2021-11-23 上海顺舟智能科技股份有限公司 Internet of things communication method and system applied among multiple lora gateways

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750651A (en) * 2005-10-31 2006-03-22 北京中星微电子有限公司 Multimedia monitor system
KR20100073808A (en) * 2008-12-23 2010-07-01 주식회사 케이티 Method for configurating addresses of mobile node in multiples of gateway connected manet and method for selecting a basic gateway of mobile node
CN104935484A (en) * 2015-05-28 2015-09-23 北京海尔广科数字技术有限公司 Method and apparatus for calling appliance service via gateways
CN106331200A (en) * 2015-06-30 2017-01-11 华为技术有限公司 Method for transmitting data between nodes, gateway node and node

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301809A (en) * 2021-12-31 2022-04-08 郑州云海信息技术有限公司 Edge computing platform architecture
CN114301809B (en) * 2021-12-31 2024-02-09 郑州云海信息技术有限公司 Edge computing platform architecture
CN114520749A (en) * 2022-01-27 2022-05-20 厦门锐谷通信设备有限公司 Modbus data monitoring method and system based on cloud platform deployment object model
CN114520749B (en) * 2022-01-27 2024-04-02 厦门锐谷通信设备有限公司 Modbus data monitoring method and system based on cloud platform deployment object model
CN114615277A (en) * 2022-03-04 2022-06-10 杭州觅恒科技有限公司 EMQ X-based multi-cluster dynamic expansion method and system
CN114615277B (en) * 2022-03-04 2024-01-16 杭州觅恒科技有限公司 Multi-cluster dynamic expansion method and system based on EMQ X

Also Published As

Publication number Publication date
CN112532671A (en) 2021-03-19
TW202113627A (en) 2021-04-01

Similar Documents

Publication Publication Date Title
WO2021052442A1 (en) Obtaining method, configuration method, edge computing cluster, and apparatuses
Zhang et al. Federated learning for the internet of things: Applications, challenges, and opportunities
Grüner et al. RESTful industrial communication with OPC UA
WO2019141111A1 (en) Communication method and communication apparatus
WO2017140216A1 (en) Method and device for network load balancing, control, and network interaction
Wen et al. A RESTful framework for Internet of things based on software defined network in modern manufacturing
CN112838940B (en) Network controller frame and data processing method
US11070639B2 (en) Network infrastructure system and method for data processing and data sharing using the same
CN112887356A (en) System for sharing memory data distribution service and operation method thereof
Song et al. V2x-boosted federated learning for cooperative intelligent transportation systems with contextual client selection
US20190182356A1 (en) Data networking method in data-centric network system and apparatus implementing same
Montpetit The network as a computer board: Architecture concepts for in-network computing in the 6G era
CN116157806A (en) System and method for supporting artificial intelligence services in a network
Human et al. Digital Twin Data Pipeline Using MQTT in SLADTA
Richerzhagen Mechanism Transitions in Publish/Subscribe Systems: Adaptive Event Brokering for Location-based Mobile Social Applications
Maló et al. Self-organised middleware architecture for the internet-of-things
Thirupathi et al. Web of Things an intelligent approach to solve interoperability issues of Internet of Things communication protocols
Lin et al. Gigabit Modbus user datagram protocol fieldbus network integrated with industrial vision communication
TWI774110B (en) System for data distribution service with shared memory suitable for industrial automation equipment and operation method thereof
US20150081774A1 (en) System and method for implementing augmented object members for remote procedure call
CN110276705B (en) Method for providing intelligent manufacturing service for industrial park enterprises based on ESN
Hiriyannaiah et al. A multi-layered framework for Internet of Everything (IoE) via wireless communication and distributed computing in Industry 4.0
KR20180052289A (en) A publish/subscribe-based contents delivery platform system which utilizes mashup through topic virtualization, a mashup server and a publish/subscribe-based contents delivery method
Bovet A scalable and sustainable web of buildings architecture
Walcher et al. KNX to MQTT/AMQP

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20866408

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20866408

Country of ref document: EP

Kind code of ref document: A1