Master-slave device communication method, device, equipment, storage medium and program product

By establishing management channels and control channels between master and slave devices and adopting different transmission protocols, the problem of tight coupling of data communication between master and slave devices is solved, and efficient data transmission, reliability of management configuration data and low-latency transmission of real-time network indicators are achieved.

CN120750787APending Publication Date: 2025-10-03CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510935865.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

The existing data communication between master and slave devices results in tight coupling due to the use of private protocols, which reduces data communication efficiency.

Method used

By establishing independent channels based on different message transmission protocols between the master device and the slave device, the management channel is used to manage configuration data transmission, and the control channel is used to transmit real-time network indicators. The lightweight MQTT protocol and MQTT-SN protocol are used to realize data transmission of the management and control channels respectively.

Benefits of technology

It realizes data decoupling communication between master and slave devices, improves data communication efficiency, ensures high reliability of management configuration data and low-latency transmission of real-time network indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750787A_ABST
    Figure CN120750787A_ABST
Patent Text Reader

Abstract

The invention relates to a master-slave device communication method and device, equipment, a storage medium and a computer program product. The method comprises the following steps: sending a message instruction to slave equipment through a management module, receiving equipment information returned by the slave equipment according to the message instruction, and establishing a management channel between master equipment and the slave equipment under the condition that the equipment information passes verification; sending subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used for appointing the slave device to subscribe a target request sent by the master device; the control channel connection request sent by the slave device is received through the control module, and the control channel connection response request is sent to the slave device, so that the control channel between the master device and the slave device is established, decoupling communication between data is realized, and the data communication efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communication technology, and in particular to a master-slave device communication method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Data communication between master and slave devices is a common collaborative working mode between devices. The master device is responsible for initiating and controlling communication, sending instructions or requests, and coordinating the operations of slave devices. The slave devices respond to the instructions of the master device and perform specific tasks (such as data collection and execution operations).

[0003] Currently, data communication between master and slave devices is mainly achieved using Easymesh, private protocols, etc. However, due to the strong closed nature of private protocols, the data communication between master and slave devices is tightly coupled, reducing data communication efficiency. Summary of the Invention

[0004] Based on this, it is necessary to provide a master-slave device communication method, device, computer equipment, computer-readable storage medium and computer program product that can realize data decoupling communication between master and slave devices and improve data communication efficiency to address the above technical problems.

[0005] In a first aspect, the present application provides a master-slave device communication method, which is applied to a master device, wherein a controller of the master device is configured with a management module and a control module, including:

[0006] Sending a message instruction to the slave device through the management module, receiving device information returned by the slave device according to the message instruction, and establishing a management channel between the master device and the slave device when the device information passes the verification; the management channel is a data transmission channel based on the first message transmission protocol, used to transmit management configuration data between the master device and the slave device;

[0007] Sending subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify the slave device to subscribe to the target request sent by the master device; the target request at least includes a control channel connection response request;

[0008] The control module receives a control channel connection request sent by the slave device and sends a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device and the slave device.

[0009] In one embodiment, the data transmission reliability of the first message transmission protocol is greater than the data transmission reliability of the second message transmission protocol, and the data transmission delay of the first message transmission protocol is greater than the data transmission delay of the second message transmission protocol.

[0010] In one embodiment, the first message transmission protocol is the MQTT protocol based on TCP / IP.

[0011] In one embodiment, the second message transmission protocol is the MQTT-SN protocol based on UDP / IP.

[0012] In one embodiment, before the step of receiving a control channel connection request sent by a slave device through a control module, it includes: sending a start request for the control channel connection to the slave device through a management channel; the start request is used to trigger the slave device to send a control channel connection request to the control module.

[0013] In one embodiment, the method further includes: sending management configuration data to the slave device through the management channel, and receiving the management configuration data execution result returned by the slave device; and / or receiving device status data reported by the slave device through the management channel.

[0014] In one embodiment, after the step of receiving the device status data reported by the slave device through the management channel, it includes: analyzing and processing the device status data through the management module to obtain the device status of the slave device; when an abnormal device status of the slave device is detected, an alarm signal is issued through the management module.

[0015] In a second aspect, the present application further provides a master-slave device communication apparatus, comprising:

[0016] a management channel establishing unit, configured to send a message instruction to the slave device via the management module, receive device information returned by the slave device in accordance with the message instruction, and establish a management channel between the master device and the slave device if the device information passes verification; the management channel is a data transmission channel based on the first message transmission protocol, and is used to transmit management configuration data between the master device and the slave device;

[0017] A configuration information sending unit is used to send a subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify that the slave device subscribe to a target request sent by the master device; the target request at least includes a control channel connection response request;

[0018] The control channel establishment unit is used to receive a control channel connection request sent by the slave device through the control module, and send a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, and is used to transmit real-time network indicators between the master device and the slave device.

[0019] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method steps of the first aspect when executing the computer program.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the method steps of the first aspect when the computer program is executed by a processor.

[0021] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the method steps of the first aspect when executed by a processor.

[0022] The above-mentioned master-slave device communication method, apparatus, computer equipment, computer-readable storage medium and computer program product send message instructions to the slave device through the management module, receive device information returned by the slave device according to the message instructions, and establish a management channel between the master device and the slave device when the device information passes the verification; the management channel is a data transmission channel based on the first message transmission protocol, which is used to transmit management configuration data between the master device and the slave device; a request to subscribe to configuration information is sent to the slave device through the management channel; the request to subscribe to configuration information is used to specify the slave device to subscribe to the target request sent by the master device; the target request at least includes a control channel connection response request; the control channel connection request sent by the slave device is received through the control module, and a control channel connection response request is sent to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device and the slave device. According to the above content, this application is based on the first message transmission protocol, and the management module of the master device establishes a management channel with the slave device, and the management configuration data is transmitted through the management channel; based on the second message transmission protocol, the control module of the master device establishes a control channel with the slave device, and the real-time network indicators are transmitted through the control channel; since the management channel and the control channel are independent of each other, the management configuration data and real-time network indicators between the master and slave devices are distinguished, realizing decoupled communication between data, thereby improving data communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 A diagram illustrating an application environment of a master-slave device communication method according to an embodiment;

[0025] Figure 2 1 is a flow chart of a master-slave device communication method according to an embodiment;

[0026] Figure 3 A system architecture diagram of a master-slave device communication method in one embodiment;

[0027] Figure 4 is a timing flow chart of a master-slave device communication method in one embodiment;

[0028] Figure 5 is a structural block diagram of a master-slave device communication apparatus in one embodiment;

[0029] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0031] It should be noted that the terms "first", "second", etc. used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "including" and "having" used in this application and any variations thereof are intended to cover non-exclusive inclusions. The term "plurality" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions or any combination of multiple solutions.

[0032] The master-slave device communication method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the master device 102 communicates with the slave device 104. The controller of the master device 102 is configured with a management module 1022 and a control module 1024. The management module 1022 sends a message instruction to the slave device 104, receives device information returned by the slave device 104 according to the message instruction, and establishes a management channel between the master device 102 and the slave device 104 when the device information is verified; the management channel is a data transmission channel based on the first message transmission protocol, which is used to transmit management configuration data between the master device 102 and the slave device 104; a request to subscribe to configuration information is sent to the slave device 104 through the management channel; the request to subscribe to configuration information is used to specify that the slave device 104 subscribes to the target request sent by the master device 102; the target request includes at least a control channel connection response request; the control channel connection request sent by the slave device 104 is received through the control module 1024, and a control channel connection response request is sent to the slave device 104 to establish a control channel between the master device 102 and the slave device 104; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device 102 and the slave device 104.

[0033] In one embodiment, Figure 2 As shown, a master-slave device communication method is provided. This embodiment uses this method to Figure 1 Taking the master device 102 in FIG. 1 as an example, the method includes the following steps:

[0034] S210, sending a message instruction to the slave device through the management module, receiving the device information returned by the slave device according to the message instruction, and establishing a management channel between the master device and the slave device when the device information passes the verification; the management channel is a data transmission channel based on the first message transmission protocol, which is used to transmit management configuration data between the master device and the slave device.

[0035] The master device can be a master gateway (master optical modem), which is used to directly connect to the operator's fiber-to-the-home line. The slave device can be a slave gateway (slave optical modem), which is connected to the master device via optical fiber and is used to extend the network to other areas (such as conference rooms, offices, etc.).

[0036] The controller is a hardware device used to manage and control slave devices, including but not limited to microprocessors, central processing units, and system-on-chips. The management module is a logical processing module configured within the controller, responsible for configuration management, data reporting, and alarms. The control module is a logical processing module configured within the controller, responsible for user permissions, user resource management, and user roaming management.

[0037] The message command is used to request the device to return device information. Specifically, the message command can be an OMCI (Optical Network Management and Control Interface) message. Device information includes, but is not limited to, the device's MAC (Media Access Control Address), LOID (Local IDentifer), and SN (Serial Number).

[0038] The first message transmission protocol is a lightweight, open message transmission protocol commonly used for inter-device communication in IoT applications. Specifically, the first message transmission protocol may be MQTT (Message Queuing Telemetry Transport).

[0039] The management configuration data is used to configure and manage the slave device, including but not limited to the WIFI name, WIFI password, WIFI SSID (Service Set Identifier), and channel settings of the slave device.

[0040] In an embodiment of the present application, when a slave device accesses a fiber optic network, the master device sends a CONNECT packet to the slave device, which responds with a CONNACK packet, establishing an MQTT connection between the master and slave devices. The master device sends a message instruction to the slave device via the management module. The slave device parses the message instruction, obtains its own device information, and sends this information to the master device. Specifically, the device information includes the slave device's MAC address and LOID code, or the slave device's MAC address and SN code.

[0041] The master device stores a pre-set device whitelist containing information about each device. Specifically, this information includes the device's MAC address and LOID code, or the device's MAC address and SN code. The master device matches the received device information with the whitelist. If the device information matches the information stored in the whitelist, the master device determines that the device information returned by the slave device has been verified and establishes a management channel between the master and slave devices.

[0042] In one embodiment, when the device information is inconsistent with the device information stored in the device whitelist, it is determined that the device information returned by the slave device fails verification, and the management channel between the master device and the slave device is not established.

[0043] S220, sending subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify the slave device to subscribe to the target request sent by the master device; the target request at least includes a control channel connection response request.

[0044] The MQTT protocol's publish-subscribe mechanism involves publishers (master or slave devices) sending messages to one or more topics on a proxy service. Subscribers (slave or master devices) subscribe to messages from the proxy service on one or more topics. The proxy service forwards messages to ensure that each subscriber receives the messages they are interested in. The proxy service can be integrated with the master device.

[0045] The subscription configuration information requested includes but is not limited to the subscription request type and request content.

[0046] The control channel connection response request is a response request returned by the master device based on the control channel connection request issued by the slave device.

[0047] In an embodiment of the present application, after establishing a management channel between the master and slave devices, it is also necessary to establish a control channel between the master and slave devices. Since the management channel and the control channel share a proxy service, and only the management channel is allowed to transmit management configuration data, and only the control channel is allowed to transmit real-time network indicators, it is necessary to convert the publish-subscribe mechanism of the control channel based on the management channel.

[0048] Specifically, the subscription request configuration information is sent to the slave device through the management channel, the slave device parses the subscription request configuration information, and subscribes to the target request to the proxy service.

[0049] S230, receiving a control channel connection request sent by the slave device through the control module, and sending a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device and the slave device.

[0050] The second message transmission protocol is an extended protocol of the second message transmission protocol and is specially designed for sensor networks.

[0051] The real-time network indicators include, but are not limited to, device status data of slave devices, authority management data of the master device over the slave devices, and resource allocation data.

[0052] In an embodiment of the present application, the master device subscribes to the control channel connection request. When the slave device publishes the channel connection request to the proxy service, the proxy service forwards the control channel connection request to the master device.

[0053] The slave device subscribes to the control channel connection response request, the master device sends the control channel connection response request to the proxy service, and the proxy service forwards the control channel connection response request to the slave device to establish a control channel between the master device and the slave device.

[0054] In order to better understand steps S210 to S230, Figure 3 Figure 2 shows a system architecture diagram of a master-slave device communication method. The master device includes a master bus, an agent, and a controller. The master bus serves as the data exchange channel within the master device, connecting the agent and controller within the master device. The master agent interacts with the master bus to handle data forwarding, protocol conversion, and management tasks. The controller is the control core of the master device, responsible for decision-making and scheduling, and directly connects to the slave bus to manage the slave devices. The controller includes a management module and a control module. The slave device includes a slave bus and an agent. The slave bus serves as the data channel within the slave device, connecting the agent within the slave device. The slave agent interacts with the slave bus, receiving commands from the master and returning data. The master controller directly connects to the slave bus, enabling the master to control the slave device. The master agent and the slave agent do not communicate directly, but instead interact with the controller via the master / slave bus.

[0055] like Figure 4As shown, a sequential flow chart of a master-slave device communication method is provided. The master device's controller establishes MQTT connections with the master bus, the master bus with the slave bus, and the slave bus with the slave agent. The master and slave devices define a management interface L1 and a control interface L2. The master device's controller and the slave agent register and go online through the L1 interface for a management channel. The specific process is described in step S210 above. After establishing the management channel, the master device's controller subscribes to inquiries sent by the slave device to the master and responses from the slave device to the master's requests. Inquiries include control channel connection requests. The slave device's agent subscribes to queries sent by the master to the slave device and replies from the master to the slave device. Replies include control channel connection response requests, thereby implementing a publish-subscribe mechanism conversion for the control channel. The specific process is described in step S220 above. The master device's controller initiates the control channel through the L1 interface. Specifically, this triggers the slave device's agent to issue a control channel connection request. The Controller of the master device and the Agent of the slave device establish a control channel connection through the L2 interface. For details, refer to the above step S230. After the control channel is established, the Controller of the master device and the Agent of the slave device control network indicators to interact normally through the L2 interface.

[0056] The above-mentioned master-slave device communication method sends a message instruction to the slave device through the management module, receives the device information returned by the slave device according to the message instruction, and establishes a management channel between the master device and the slave device when the device information passes the verification; the management channel is a data transmission channel based on the first message transmission protocol, which is used to transmit management configuration data between the master device and the slave device; sends a request to subscribe to configuration information to the slave device through the management channel; the request to subscribe to configuration information is used to specify the slave device to subscribe to the target request sent by the master device; the target request at least includes a control channel connection response request; receives the control channel connection request sent by the slave device through the control module, and sends a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device and the slave device. According to the above content, this application is based on the first message transmission protocol, and the management module of the master device establishes a management channel with the slave device, and the management configuration data is transmitted through the management channel; based on the second message transmission protocol, the control module of the master device establishes a control channel with the slave device, and the real-time network indicators are transmitted through the control channel; since the management channel and the control channel are independent of each other, the management configuration data and real-time network indicators between the master and slave devices are distinguished, realizing decoupled communication between data, thereby improving data communication efficiency.

[0057] In one embodiment, the data transmission reliability of the first message transmission protocol is greater than the data transmission reliability of the second message transmission protocol, and the data transmission delay of the first message transmission protocol is greater than the data transmission delay of the second message transmission protocol.

[0058] In the embodiment of the present application, since the management module implements core functions such as configuration management, data reporting and alarm, the first message transmission protocol is adopted to ensure high reliability of data transmission in the management channel.

[0059] Since the control module implements real-time business functions such as user authority management, resource allocation and roaming control, the second message transmission protocol is adopted to ensure low latency in data transmission through the control channel.

[0060] In one embodiment, the first message transmission protocol is the MQTT protocol based on TCP / IP.

[0061] Among them, the MQTT protocol based on TCP / IP can provide reliable, orderly and error-free data transmission.

[0062] In one embodiment, the second message transmission protocol is the MQTT-SN protocol based on UDP / IP.

[0063] Among them, the UDP / IP-based MQTT-SN protocol is lighter than TCP and is suitable for resource-constrained devices or scenarios requiring low latency, but it does not provide reliability guarantees (such as packet retransmission).

[0064] In one embodiment, before the step of receiving, by the control module, a control channel connection request sent from the device, step S201 is included, specifically as follows:

[0065] S201, sending a control channel connection start request to the slave device through the management channel; the start request is used to trigger the slave device to send a control channel connection request to the control module.

[0066] In an embodiment of the present application, the master device sends a startup request for the control channel connection to the slave device through the management channel. The slave device parses the startup request for the control channel connection, generates a control channel connection request, and sends the control channel connection request to the master device for subsequent control channel connection online.

[0067] The embodiment of the present application can flexibly control the establishment of a control channel between a master and a slave device by sending a start request for a control channel connection.

[0068] In one embodiment, the master-slave device communication method further includes steps S240 to S250, which are specifically as follows:

[0069] S240: Sending management configuration data to the slave device through the management channel, and receiving the management configuration data execution result returned by the slave device; and / or,

[0070] In an embodiment of the present application, taking the management configuration data as a WIFI name as an example, the user modifies the WIFI name of the slave device on the master device, the master device sends the modified WIFI name to the slave device, the slave device updates the WIFI name, and feeds back the updated result of the WIFI name to the master device.

[0071] S250: Receive device status data reported by the device through the management channel.

[0072] The device status data includes but is not limited to the signal strength, online and offline status, and number of online devices from the device.

[0073] In the embodiment of the present application, the slave device periodically reports device status data, the master device receives the device status data, and stores the device status data in a database.

[0074] In the embodiment of the present application, the master and slave devices can realize convenient communication of management configuration data and device status data based on the management channel.

[0075] In one embodiment, after the step of receiving the device status data reported by the slave device through the management channel, steps S252 to S254 are further included, specifically as follows:

[0076] S252: Analyze and process the device status data through the management module to obtain the device status of the slave device.

[0077] The device status includes normal status and abnormal status.

[0078] In the embodiment of the present application, if the signal strength of the device is less than a preset signal strength threshold, the device state is determined to be abnormal. If the signal strength of the device is greater than or equal to the preset signal strength threshold, the device state is determined to be normal.

[0079] S254: When it is detected that the device status of the slave device is abnormal, an alarm signal is issued through the management module.

[0080] In an embodiment of the present application, the management module pushes an alarm signal to the operation and maintenance APP to remind the operation and maintenance personnel of the abnormality of the slave device and to clean up the abnormality of the slave device in time.

[0081] It should be understood that, although the various steps in the flowcharts involved in the above embodiments are displayed in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps. It is understandable that the various steps in different embodiments can be freely combined as needed, and the various non-contradictory schemes formed by the combination all fall within the scope of protection of this application.

[0082] Based on the same inventive concept, embodiments of the present application further provide a master-slave device communication apparatus for implementing the master-slave device communication method described above. The implementation solution provided by this apparatus is similar to the implementation solution described in the above-mentioned method. Therefore, the specific limitations in one or more embodiments of the master-slave device communication apparatus provided below can be found in the above-mentioned limitations on the master-slave device communication method and will not be further elaborated here.

[0083] In an exemplary embodiment, Figure 5 As shown, a master-slave device communication device 5 is provided, comprising:

[0084] A management channel establishing unit 510 is configured to send a message instruction to a slave device via the management module, receive device information returned by the slave device in accordance with the message instruction, and establish a management channel between the master device and the slave device if the device information passes verification. The management channel is a data transmission channel based on the first message transmission protocol and is used to transmit management configuration data between the master device and the slave device.

[0085] The configuration information sending unit 520 is configured to send a subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify that the slave device subscribe to a target request sent by the master device; the target request at least includes a control channel connection response request;

[0086] The control channel establishment unit 530 is used to receive a control channel connection request sent by the slave device through the control module, and send a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, and is used to transmit real-time network indicators between the master device and the slave device.

[0087] In one embodiment, before the step of receiving a control channel connection request sent by a slave device through a control module, it includes: sending a start request for the control channel connection to the slave device through a management channel; the start request is used to trigger the slave device to send a control channel connection request to the control module.

[0088] In one embodiment, management configuration data is sent to the slave device through the management channel, and the execution result of the management configuration data returned by the slave device is received; and / or, device status data reported by the slave device is received through the management channel.

[0089] In one embodiment, after the step of receiving the device status data reported by the slave device through the management channel, the following steps are included:

[0090] Through the management module, the device status data is analyzed and processed to obtain the device status of the slave device;

[0091] When an abnormal device status of a slave device is detected, an alarm signal is sent through the management module.

[0092] The above-mentioned master-slave device communication device sends a message instruction to the slave device through the management module, receives the device information returned by the slave device according to the message instruction, and establishes a management channel between the master device and the slave device when the device information passes the verification; the management channel is a data transmission channel based on the first message transmission protocol, which is used to transmit management configuration data between the master device and the slave device; sends a request to subscribe to configuration information to the slave device through the management channel; the request to subscribe to configuration information is used to specify the slave device to subscribe to the target request sent by the master device; the target request at least includes a control channel connection response request; receives the control channel connection request sent by the slave device through the control module, and sends a control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on the second message transmission protocol, which is used to transmit real-time network indicators between the master device and the slave device. According to the above content, this application is based on the first message transmission protocol, and the management module of the master device establishes a management channel with the slave device, and the management configuration data is transmitted through the management channel; based on the second message transmission protocol, the control module of the master device establishes a control channel with the slave device, and the real-time network indicators are transmitted through the control channel; since the management channel and the control channel are independent of each other, the management configuration data and real-time network indicators between the master and slave devices are distinguished, realizing decoupled communication between data, thereby improving data communication efficiency.

[0093] Each module in the master-slave device communication apparatus described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0094] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near-field communication (NFC), or other technologies. When executed by the processor, the computer program implements an email processing method. The display unit of the computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0095] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned master-slave device communication method. The steps of the master-slave device communication method here can be the steps of the master-slave device communication method in each of the above-mentioned embodiments.

[0096] In one embodiment, a computer-readable storage medium is provided, storing a computer program. When executed by a processor, the computer program causes the processor to perform the steps of the master-slave device communication method described above. The steps of the master-slave device communication method described herein may be the steps of the master-slave device communication method described in each of the above embodiments.

[0097] In one embodiment, a computer program product is provided, including a computer program. When executed by a processor, the computer program causes the processor to perform the steps of the master-slave device communication method described above. The steps of the master-slave device communication method described herein may be the steps of the master-slave device communication method described in each of the above embodiments.

[0098] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0099] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

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

[0101] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A master-slave device communication method, characterized in that: Applied to a master device, wherein a controller of the master device is configured with a management module and a control module, the method includes: Sending a message instruction to the slave device through the management module, receiving device information returned by the slave device according to the message instruction, and establishing a management channel between the master device and the slave device if the device information passes verification; the management channel is a data transmission channel based on a first message transmission protocol, used for transmitting management configuration data between the master device and the slave device; Sending subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify that the slave device subscribes to the target request sent by the master device; the target request at least includes a control channel connection response request; The control module receives a control channel connection request sent by the slave device, and sends the control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on a second message transmission protocol, and is used to transmit real-time network indicators between the master device and the slave device.

2. The master-slave device communication method according to claim 1, wherein: The data transmission reliability of the first message transmission protocol is greater than the data transmission reliability of the second message transmission protocol, and the data transmission delay of the first message transmission protocol is greater than the data transmission delay of the second message transmission protocol.

3. The master-slave device communication method according to claim 2, wherein: The first message transmission protocol is the MQTT protocol based on TCP / IP.

4. The master-slave device communication method according to claim 2, wherein: The second message transmission protocol is the MQTT-SN protocol based on UDP / IP.

5. The master-slave device communication method according to claim 1, wherein: Before the step of receiving, by the control module, the control channel connection request sent by the slave device, the step includes: A control channel connection start request is sent to the slave device via the management channel; the start request is used to trigger the slave device to send the control channel connection request to the control module.

6. The master-slave device communication method according to any one of claims 1 to 5, characterized in that: Also includes: Sending the management configuration data to the slave device through the management channel, and receiving the management configuration data execution result returned by the slave device; and / or, The device status data reported by the slave device is received through the management channel.

7. The master-slave device communication method according to claim 6, wherein: After the step of receiving the device status data reported by the slave device through the management channel, the method further includes: Analyzing and processing the device status data through the management module to obtain the device status of the slave device; When it is detected that the device status of the slave device is abnormal, an alarm signal is sent through the management module.

8. A master-slave device communication device, characterized in that: The device comprises: a management channel establishing unit, configured to send a message instruction to a slave device via the management module, receive device information returned by the slave device in accordance with the message instruction, and establish a management channel between the master device and the slave device if the device information passes verification; the management channel being a data transmission channel based on a first message transmission protocol, and configured to transmit management configuration data between the master device and the slave device; a configuration information sending unit, configured to send subscription request configuration information to the slave device through the management channel; the subscription request configuration information is used to specify that the slave device subscribe to a target request sent by the master device; the target request at least includes a control channel connection response request; A control channel establishing unit is used to receive a control channel connection request sent by the slave device through the control module, and send the control channel connection response request to the slave device to establish a control channel between the master device and the slave device; the control channel is a data transmission channel based on a second message transmission protocol, and is used to transmit real-time network indicators between the master device and the slave device.

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

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

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.