Bidirectional communication method and device and storage medium

By realizing two-way communication between the control end and the device end, transmitting target instructions and receiving back-transmitted information using preset communication methods, the problem that data transmission can only be carried out in one direction in the prior art is solved, real-time data acquisition and management of the device end is realized, and management efficiency is improved.

CN120075651APending Publication Date: 2025-05-30SHENZHEN SUNMOON MICROELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311545049.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, data transmission can only be carried out in one direction, and the control end cannot obtain information from the device end in time, resulting in the objects managing the device end need to frequently go to the location of the device end to view the working conditions of the device end, and it is impossible to collect and manage data in real time on the device end.

Method used

By realizing bidirectional communication between the control end and the device end, target instructions are transmitted using preset communication methods (such as point-to-point communication or broadcast communication), and information returned by the device end based on the target instructions.

Benefits of technology

It realizes two-way data transmission between the control end and the device end, allowing the control end to obtain information from the device end in a timely manner, facilitates real-time data acquisition and management of the device end, and improves the efficiency of device management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075651A_ABST
    Figure CN120075651A_ABST
Patent Text Reader

Abstract

The invention provides a two-way communication method and device and a storage medium, and relates to the technical field of data transmission. The two-way communication method comprises the following steps: for a to-be-transmitted target instruction, obtaining type information of the target instruction; if the type information indicates that the target instruction is the first preset instruction, transmitting the target instruction to the target device end in a preset communication mode; and receiving information returned by the target device end based on the target instruction. According to the embodiment of the invention, when the target instruction is the first preset instruction, the target instruction can be sent by adopting the preset communication mode, and the return information is correspondingly received, so that the bidirectional communication requirement of the control end and the equipment end is met, and the data acquisition and management of the equipment end are facilitated in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data transmission. Specifically, this application relates to a two-way communication method, apparatus, and storage medium. Background Art

[0002] Currently, in LED lamp control and other control systems with device ends and control ends, traditional communication protocols such as the DMX512 protocol and the return-to-zero code protocol are usually adopted to transmit digital control data to achieve device control. These protocols are actually the commonly used abbreviations of a technical standard in the industry, which is a technical standard for asynchronous serial transmission of digital control data in a system of control devices and accessories. The main contents include the physical platform for implementing control data transmission, the electrical characteristics of the signal interface, the signal timing on the system data bus, the data packet format, etc.

[0003] Although these communication protocols are widely used in control systems, they have the disadvantage of only being able to transmit signals unidirectionally to control devices. Thus, the control end using these communication protocols can only transmit signals to the device end to control the operation of the device end. However, it is unable to obtain device information in a timely manner, resulting in the need for the object managing the device end to frequently go to the location where the device end is located to check the working conditions of the device end, and it is impossible to perform real-time data collection and management on the device end. Summary of the Invention

[0004] Embodiments of this application provide a two-way communication method, apparatus, and storage medium, which can solve the problem that existing data can only be transmitted unidirectionally and device information cannot be obtained. To achieve this purpose, the embodiments of this application provide the following several solutions.

[0005] According to one aspect of the embodiments of this application, a two-way communication method for a control end connected to at least one device end is provided, including:

[0006] For a target instruction to be transmitted, obtain the type information of the target instruction, where the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction;

[0007] If the type information indicates that the target instruction is a first preset instruction, transmit the target instruction to the target device end in a preset communication manner, where the preset communication manner includes any one of point-to-point communication and broadcast communication;

[0008] Receive the information returned by the target device end based on the target instruction.

[0009] In a possible implementation manner, the method further includes:

[0010] If the type information indicates that the target instruction is a second preset instruction, the target instruction is transmitted to the target device end through the communication protocol corresponding to the target device end or the control end;

[0011] The second preset instruction includes a grayscale instruction, and the communication protocol includes at least one of the DMX512 protocol, the return-to-zero code protocol, the two-wire protocol, the SPI protocol, the serial port protocol, and the IIC protocol.

[0012] In a possible implementation, transmitting the target instruction to the target device end in the preset communication manner includes:

[0013] Obtain the identification information of the target device end corresponding to the target instruction;

[0014] According to the identification information and the preset communication manner, transmit the target instruction to the target device end at a predetermined transmission interval, where the identification information includes the number of the target device end.

[0015] In a possible implementation, the first preset instruction includes any one of a control instruction and a register configuration instruction, and receiving the information returned by the target device end based on the target instruction includes:

[0016] If the first preset instruction is the control instruction, receive the control parameters returned by the target device end based on the control instruction and the predetermined transmission interval, where the control parameters include at least one of temperature, voltage, current, power, LED open circuit or short circuit, device number, working time, address, and register parameters;

[0017] If the first preset instruction is a register configuration instruction, receive the register information returned by the target device end based on the register configuration instruction and the predetermined transmission interval, where the register information includes at least one of the information on whether the register value is successfully configured and the register parameters.

[0018] In a possible implementation, at least one of the control ends communicates bidirectionally with the response port of at least one of the device ends through a command port, and obtaining the type information of the target instruction includes:

[0019] If it is determined that the current state is an active state, obtain the type information of the target instruction;

[0020] Transmitting the target instruction to the target device end in the preset communication manner includes:

[0021] Transmit the target instruction to the response port of the device end through the command port in the preset communication manner;

[0022] Receiving the information returned by the target device end based on the target instruction, including:

[0023] Receiving, through the command port, the information returned by the target device end through the response port in the working mode indicated by the target instruction, where the working mode includes any one of a passive return mode and an active return mode.

[0024] According to one aspect of the present application, a two-way communication method is provided for a device end connected to at least one control end, including:

[0025] Receiving a target instruction sent by any one of the control ends, where the target instruction includes an instruction transmitted in a preset communication manner after the control end obtains the type information of the target instruction and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication;

[0026] Returning information to the control end according to the target instruction.

[0027] In a possible implementation manner, the returning information to the control end according to the target instruction includes:

[0028] Obtaining the type information of the target instruction and the working mode indicated by the target instruction, where the working mode includes any one of a passive return mode and an active return mode;

[0029] Obtaining return information according to the type information, and transmitting the return information to the control end based on the working mode.

[0030] In a possible implementation manner, the first preset instruction includes any one of a control instruction and a register configuration instruction, and the transmitting the return information to the control end based on the working mode includes:

[0031] If it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is a passive return mode, then obtaining the control parameter corresponding to the control instruction and returning the control parameter to the control end according to the transmission interval of the control end;

[0032] If it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is an active return mode, then after determining that a preset condition is satisfied, modifying the exception flag, and returning the control parameter corresponding to the control instruction to the control end according to the transmission interval of the control end, where the preset condition includes detecting abnormal control parameters of a preset number of frames and the frames corresponding to the abnormal control parameters being adjacent.

[0033] According to one aspect of the embodiments of the present application, a bidirectional communication device is provided, including:

[0034] A type information acquisition module, configured to acquire type information of a target instruction to be transmitted, where the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction;

[0035] An instruction transmission module, configured to, if the type information indicates that the target instruction is a first preset instruction, transmit the target instruction to a target device end in a preset communication manner, where the preset communication manner includes any one of point-to-point communication and broadcast communication;

[0036] An information reception module, configured to receive information returned by the target device end based on the target instruction;

[0037] Or

[0038] An instruction reception module, configured to receive a target instruction sent by any control end, where the target instruction is an instruction transmitted in a preset communication manner after the control end acquires type information of the target instruction and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication;

[0039] An information feedback module, configured to feedback information to the control end according to the target instruction.

[0040] According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0041] According to one aspect of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the steps of the method described above.

[0042] The beneficial effects brought by the technical solution provided by the embodiments of the present application are:

[0043] This application provides a two-way communication method. Specifically, for a target instruction to be transmitted, the type information of the target instruction is obtained. If the type information indicates that the target instruction is a first preset instruction, the target instruction is transmitted to the target device end in a preset communication manner, and the information returned by the target device end based on the target instruction is received. In the embodiment of this application, the type information of the target instruction is obtained. After determining that the type information indicates that the target instruction is a first preset instruction, the target instruction is transmitted in a point-to-point communication or broadcast communication manner, and the information returned by the target device end is received. The embodiment of this application can, when the target instruction is a first preset instruction, send the target instruction in a preset communication manner, and correspondingly receive the returned information, meeting the two-way communication requirements between the control end and the device end, and facilitating data collection and management of the device end in a timely manner. Description of the Drawings

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the following briefly introduces the drawings required for the description in the embodiments of this application.

[0045] Figure 1 Flowchart of the two-way communication method for the control end provided by the embodiment of this application;

[0046] Figure 2 Connection diagram between the control end and the device end provided by the embodiment of this application;

[0047] Figure 3 Schematic diagram of data return in the passive return mode provided by the embodiment of this application;

[0048] Figure 4 Schematic diagram of data return in the active return mode provided by the embodiment of this application;

[0049] Figure 5 Flowchart of the two-way communication method for the device end provided by the embodiment of this application;

[0050] Figure 6 Structural diagram of a two-way communication device provided by the embodiment of this application;

[0051] Figure 7 Another structural diagram of the two-way communication device provided by the embodiment of this application;

[0052] Figure 8 Structural diagram of an electronic device provided by the embodiment of this application. Detailed Embodiments

[0053] The following describes the embodiments of this application in conjunction with the drawings in this application. It should be understood that the embodiments described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute limitations on the technical solutions of the embodiments of this application.

[0054] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the terms "comprising" and "including" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation of other features, information, data, steps, operations, elements, components and / or their combinations supported by the technical field of the present invention, etc. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include a wireless connection or a wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term. For example, "A and / or B" means implemented as "A", or implemented as "B", or implemented as "A and B".

[0055] To make the objectives, technical solutions and advantages of the present invention clearer, the following will further describe the embodiments of the present invention in detail with reference to the accompanying drawings.

[0056] The following describes the technical solutions of the embodiments of the present invention and the technical effects produced by the technical solutions of the present invention through the description of several exemplary embodiments. It should be noted that the following embodiments can refer to, draw on or combine with each other. For the same terms, similar features and similar implementation steps in different embodiments, they will not be described repeatedly.

[0057] The two-way communication method, device and storage medium provided by the present application are intended to solve at least one technical problem existing in the prior art.

[0058] In the embodiments of the present application, a two-way communication method is provided, as Figures 1-4 shown. The two-way communication method is used for a control end connected to at least one device end. The control system composed of the device end and the control end can be used for LED control, street lamp control, signal lamp control and the control of other objects. The control end can be a device such as a chip, a microcontroller, a microprocessor, etc. that can send a target instruction and receive the information fed back by the device end according to the target instruction.

[0059] Optionally, the number of device ends can be multiple. A single control end can be connected to multiple device ends, and a single device end can be connected to multiple control ends.

[0060] In one embodiment, the control end sends target instructions through its command port or receives the information returned by the device end. The device end receives the target instructions and the returned information through its response port. The control end and the device end form a set of RDM (The Remote Device Management Protocol) system. This system can have one or more controllers, but only one controller can be in an active state at the same time. The response port of each device end can be used for two-way communication. Specifically, as Figure 2 shown, the response port of the device end includes two address ports, ADRI and ADRO, and the command port of the control end includes two ports, DATA_A and DATA_B. The control end and the device end perform data transmission through a differential two-wire protocol. The device ends are connected in a cascaded manner. The ADRO port of one device end is connected to the ADRI port of the next device end. The ADRI port is connected to the voltage VDD and pulled up to a high level. The ADRO port is left floating (each ADRO port is default floating). When the ADRI port and the ADRO port are connected, the ADRI port is pulled down to a low level (when the device end is not processing data and the ADRI port and the ADRO port are connected, both ports are pulled down to a low level). Each device end is provided with three output ports, R, G, and B, and the display of the LED product is adjusted through this output port.

[0061] Optionally, multiple communication protocols (including but not limited to at least one of the DMX512 protocol, the return-to-zero code protocol, the two-wire protocol, the SPI (Serial Peripheral Interface) protocol, the serial port protocol, and the IIC (Inter-Integrated Circuit) protocol, which can be any communication protocol capable of information transmission between the device end and the control end) can be used for data transmission between the device end and the control end. Moreover, in order to facilitate the control end to monitor and configure the device end through the data link, the RDM can also be used to achieve data transmission between the control end and the device end.

[0062] Optionally, the device end is an LED. The control end is connected to multiple LEDs, sends target instructions to the LEDs, and displays and manages the information of the LEDs (such as the current active state, whether there is a fault, etc.) according to the information returned by the LEDs. As Figure 1 shown, the two-way communication method of the present application includes:

[0063] S101: For the target instruction to be transmitted, obtain the type information of the target instruction.

[0064] Optionally, the target instruction to be transmitted includes all instructions such as control instructions, register configuration instructions, grayscale instructions, etc. that can be used to manage LEDs or collect LED information. This type of information includes information indicating whether the target instruction is a first preset instruction or a second preset instruction. Among them, the control end can obtain the type information of the target instruction through information such as the content, format, and encoding of the target instruction.

[0065] Optionally, the target instruction to be transmitted can be generated by the control end itself or transmitted to the control end by other devices connected to the control end. After generating or receiving the target instruction, the control end can immediately transmit the target instruction to the device end, or determine the transmission time or transmission order of the target instruction according to the current state, time, and type information of the target instruction.

[0066] Optionally, the control end is provided with a command port, and the device end is provided with a response port. At least one control end communicates bidirectionally with the response port of at least one device end through the command port. And, in order to prevent interference between different control ends. Obtaining the type information of the target instruction includes: if it is determined that the current state is the active state, then obtaining the type information of the target instruction.

[0067] In one embodiment, a single device end is connected to multiple control ends. Before sending the target instruction, the control end detects whether its current state is active. If so, it is determined that the target instruction can be sent to the device end currently, and the type information of the target instruction is obtained.

[0068] Optionally, the first preset instruction includes at least one of a control instruction and a register configuration instruction. Among them, the register instruction can be used to configure the register value and register parameters of the device end (such as register parameters such as address, PWM refresh rate, current gain, low gray compensation, channel hysteresis, etc.). The second preset instruction includes a grayscale instruction, and this grayscale instruction indicates the grayscale of the device end in a certain frame. The control end sends the first preset instruction or the second preset instruction to the device end according to actual requirements and the received instruction.

[0069] S102: If the type information indicates that the target instruction is a first preset instruction, then transmit the target instruction to the target device end in a preset communication manner.

[0070] Optionally, the preset communication manner includes any one of point-to-point communication and broadcast communication. Among them, the control end and the device end perform point-to-point communication or broadcast communication based on the RDM protocol.

[0071] Optionally, if the type information indicates that the target instruction is a second preset instruction, the target instruction is transmitted to the target device end using the communication protocol corresponding to the target device end. The second preset instruction includes a grayscale instruction, and the communication protocol is any traditional communication protocol supported by the target device end, including but not limited to at least one of the DMX512 protocol, the return-to-zero code protocol, the two-wire protocol, the SPI protocol, the serial port protocol, and the IIC protocol. Among them, the second preset instruction may be a start instruction for controlling the device end to start working, a shutdown instruction for controlling the device end to stop working, and other instructions that can be transmitted through the communication protocol corresponding to the target device end.

[0072] In one embodiment, the second preset instruction is a grayscale instruction. If the control end determines that the target instruction is a grayscale instruction according to the type information of the target instruction, the target device end that receives the grayscale instruction is obtained according to the grayscale instruction or the pre-stored instruction sending information, and the grayscale instruction is sent using the communication protocol corresponding to the target device end.

[0073] Optionally, to facilitate the device end to return information, when the target instruction is a first preset instruction or a second preset instruction, the target instruction is transmitted to the target device end in a preset communication manner, including: obtaining the identification information of the target device end corresponding to the target instruction; transmitting the target instruction to the target device end at a predetermined transmission interval according to the identification information and the preset communication manner. The identification information includes the number of the target device end. Different target instructions are separated by this transmission interval, and it is convenient for the device end to return information through this transmission interval.

[0074] Optionally, the number of the target device end is a UID (unique identifier) unique identifier, and the UID of each device end is different. Among them, the identification information may also be the name, address, group, response port number of the device end, and other information that can identify the target device end.

[0075] Optionally, the control end can obtain the preset communication manner for sending the target instruction according to the preset information or the content of the target instruction, or can select one of point-to-point communication and broadcast communication for instruction sending according to information such as the sending object, sending time, sending quantity, and size of the target instruction.

[0076] In one embodiment, the target instruction is a first preset instruction, and the preset communication manner is point-to-point communication. The control end obtains the number of the target device end corresponding to the first preset instruction, and sends the number appended with the target instruction to the device end it is connected to. The device end that receives the target instruction matches the number in the target instruction with its own number. If it is determined to be consistent, it determines that itself is the target device end and executes the target instruction. If it is determined that the number is inconsistent with its own number, it does not execute the target instruction.

[0077] In another embodiment, the preset communication mode is broadcast communication, the target instruction is the first preset instruction, the control end obtains the target instruction, and determines that the target instruction needs to be sent to all device ends connected thereto. Then, the numbers corresponding to all device ends (i.e., the UIDs that can be recognized by all device ends) are obtained, the number is appended to the target instruction, and the target instruction is sent to the connected device ends. The device ends receive the target instruction and determine that they need to execute the target instruction according to the number in the target instruction.

[0078] S103: Receive the information returned by the target device end based on the target instruction.

[0079] Optionally, the first preset instruction includes any one of a control instruction and a register configuration instruction, and the returned information corresponding to the control instruction and the register configuration instruction is different. Receiving the information returned by the target device end based on the target instruction includes: if the first preset instruction is the control instruction, receiving the control parameters returned by the target device end based on the control instruction and a predetermined transmission interval. The control parameters include, but are not limited to, at least one of temperature, voltage, current, power, LED open / short circuit, device number, working time, address, and register parameters. The information included in the control parameters can be changed accordingly according to conditions such as the type of the target device end, the currently executable control operations, and actual requirements; if the first preset instruction is a register configuration instruction, receiving the register information returned by the target device end based on the register configuration instruction and a predetermined transmission interval. The register information includes at least one of the information on whether the register value is configured successfully and register parameters.

[0080] Optionally, when the first preset instruction is a control instruction, the control parameters returned by the target device end can include the control parameters of the target device end itself or the control parameters of other device ends, and the content it includes can be set according to the requirements of the target instruction.

[0081] Optionally, the device end returns information to the control end through its own response port. Receiving the information returned by the target device end based on the target instruction includes: receiving, through the command port, the information returned by the target device end through the response port in the working mode indicated by the target instruction. The working mode includes any one of a passive return mode and an active return mode. Among them, the target device end can determine the working mode used for returning information according to information such as the classification of the target instruction and the currently used working mode. Correspondingly, the target instruction may not include information indicating the working mode either.

[0082] Optionally, the device end returns information at the target instruction sending interval (i.e., the predetermined transmission interval) of the control end. The device end and the control end can also set multiple ports for data transmission, so that the device end uses different ports to receive the target instruction and return information. Furthermore, the device end can transmit data to the control end when the control end sends the target instruction.

[0083] In one embodiment, as Figure 3 shown, the first preset instruction is a control instruction. The device side includes #1, #2, and #3. The control side respectively sends target instructions for obtaining control data to #1, #2, and #3 (corresponding to #1 control data, #2 control data, and #3 control data in the figure). And when sending, each control instruction is separated and sent at a predetermined transmission interval. The device side sequentially receives the target instructions. If it is determined according to the information of the target instructions that the control parameters need to be transmitted in the passive feedback mode, then #1, #2, and #3 obtain the control parameters and sequentially generate #1 feedback data, #2 feedback data, and #3 feedback data according to the control parameters. The device side sequentially transmits the feedback data to the control side through its own response port (DINA). Among them, #1 transmits the #1 feedback data to the control side during the gap between the control side sending control instructions to #1 and #2 (i.e., the gap between #1 control data and #2 control data in the figure).

[0084] In one embodiment, as Figure 4 shown, the first preset instruction is a control instruction, and this control instruction instructs to use the active feedback mode to feedback information. After the target device side receives the control instruction, it detects whether there are continuous multi-frame control parameter abnormalities (such as temperature higher than the preset value, LED open circuit, etc.) in itself or the device corresponding to the control instruction. If so, at the end of the frame of the control data sending gray scale instruction (each gray scale instruction corresponds to one frame of gray scale data), the abnormality flag (which is a register value, default is 0) is set to 1 (other device sides will not set the abnormality flag to 1 at this time), and the control parameters are feedback during the gap when the control side sends the gray scale instruction. And after continuous multi-frame detection of normal control parameters, the abnormality flag is reset to 0. By setting the abnormality flag, it is avoided that only one device side performs information feedback at the same time. Among them, the number of frames corresponding to the continuous multi-frame is the preset frame, and the number of frames of this preset frame can be 1 frame, 2 frames, and other values, and the specific size can be defined according to actual needs.

[0085] The bidirectional communication method of the present application obtains the type information of the target instruction. After determining that the type information indicates that the target instruction is the first preset instruction, the target instruction is transmitted in a point-to-point communication or broadcast communication manner and the information feedback by the target device side is received. The embodiment of the present application can, when the target instruction is the first preset instruction, send the target instruction by using a preset communication method and correspondingly implement the reception of the feedback information, meet the bidirectional communication requirements between the control side and the device side, and facilitate data collection and management of the device side in a timely manner.

[0086] According to one aspect of the present application, the present application also proposes a bidirectional communication method, as Figures 2-5 shown, this bidirectional communication method is for a device side connected to at least one control side, and this bidirectional communication method includes:

[0087] S201: Receive a target instruction sent by any control terminal.

[0088] Optionally, after the control terminal obtains the type information of the target instruction, if it is determined that the type information indicates that the target instruction is a first preset instruction, it is transmitted in a preset communication manner; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication.

[0089] Optionally, it further includes that if the type information indicates that the target instruction is a second preset instruction, the target instruction is transmitted to the target device terminal by using the communication protocol corresponding to the target device terminal; the second preset instruction includes a gray scale instruction, and the communication protocol can be any communication protocol that can be used for information transmission between the device terminal and the control terminal, including but not limited to at least one of the DMX512 protocol, the return-to-zero code protocol, the two-wire protocol, the SPI protocol, the serial port protocol, and the IIC protocol. Among them, the communication protocol can be selected according to the protocol compatibility information of the control terminal and the target device terminal.

[0090] In one embodiment, the second preset instruction is a gray scale instruction, and the instruction is transmitted by using the traditional communication protocol corresponding to the control terminal, so as to improve the compatibility of gray scale display control and facilitate more device terminals to receive and support the gray scale instruction.

[0091] Optionally, transmitting the target instruction in a preset communication manner includes: obtaining the identification information of the target device terminal corresponding to the target instruction; and transmitting the target instruction to the target device terminal at a predetermined transmission interval according to the identification information and the preset communication manner. The identification information includes the number of the target device terminal.

[0092] Optionally, at least one control terminal communicates bidirectionally with the response port of at least one device terminal through a command port to obtain the type information of the target instruction, including: if it is determined that the current state is an active state, obtaining the type information of the target instruction; and transmitting the target instruction to the target device terminal in a preset communication manner, including: transmitting the target instruction to the response port of the device terminal through the command port in a preset communication manner.

[0093] In one embodiment, the response ports on the device side include two address ports, ADRI and ADRO, and the command ports on the control side include two ports, DATA_A and DATA_B. The device sides are connected in a cascaded manner. The ADRO port of one device side is connected to the ADRI port of the next device side. The ADRI port is connected to the voltage VDD and pulled up to the high level. The ADRO port is left floating (each ADRO port is default floating). When the ADRI port and the ADRO port are connected, the ADRI port is pulled down to the low level (when the device side is not performing data processing and the ADRI port and the ADRO port are connected, both of these ports are pulled down to the low level).

[0094] S202: Transmit information back to the control side according to the target instruction.

[0095] Optionally, the target instruction includes an instruction transmitted in a preset communication manner after the control side obtains the type information of the target instruction and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication.

[0096] Optionally, transmitting information back to the control side according to the target instruction includes: obtaining the type information of the target instruction and the working mode indicated by the target instruction, where the working mode includes any one of a passive feedback mode and an active feedback mode; obtaining the feedback information according to the type information, and transmitting the feedback information to the control side based on the working mode.

[0097] Optionally, the first preset instruction includes any one of a control instruction and a register configuration instruction. The content included in the control instruction and the register configuration instruction can be adjusted according to information such as the type of the target device side and the firmware version used to adapt to different device sides.

[0098] Optionally, transmitting the feedback information to the control side based on the working mode includes: if it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is the passive feedback mode, then obtaining the control parameters corresponding to the control instruction and transmitting the control parameters back to the control side according to the transmission interval of the control side; if it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is the active feedback mode, then after determining that the preset conditions are met, modifying the exception flag and transmitting the control parameters corresponding to the control instruction back to the control side according to the transmission interval of the control side. The preset conditions include detecting that a preset number of frames of control parameters are abnormal and the frames corresponding to the abnormal control parameters are adjacent.

[0099] In one embodiment, as Figure 2 、 Figure 3As shown, the two-way communication method in the passive feedback mode is described according to the DATA_A port of the control end and the DINA port of the device end. The signal output from the DATA_B port is the differential signal of the signal output from the DATA_A port, and the signal of the DINB port is the differential signal of the signal of the DINA port. Figure 2 The #1 control data, #2 control data, and #3 control data in it are control instructions sent by the control end, and the #1 feedback data, #2 feedback data, and #3 feedback data are information feedback by the device end. The control end sends a point-to-point sending template instruction based on the UID or a broadcast target instruction based on the broadcast UID. The target instruction may include the working mode used to indicate the device end to feedback information. When the target instruction is a control instruction, the format of the control instruction may be: identification code (A55A) + target device end UID + tail check code (D25A). When sending point-to-point, the UIDs corresponding to different target device ends are different. When sending broadcast, the UIDs of all control instructions are the same broadcast UID (the broadcast UID can be recognized by all device ends). In the passive feedback mode, after receiving the control instruction, the device end sequentially and passively feedbacks parameters including but not limited to the temperature, voltage, current, power, LED open circuit or short circuit, device number, etc. of the target device end itself. Among them, the passive feedback mode requires the control end to send a control instruction separately, and the device end needs to feedback information every time it receives a control instruction, which takes a long time.

[0100] In another embodiment, as Figure 4 shown, the device end uses the active feedback mode to feedback information. Figure 4One frame of grayscale data represents the grayscale instruction sent by the control terminal, and the #1 return data and #3 return data are the data returned by the device terminal. The device terminal enters the active return mode according to the control instruction sent by the control terminal. In the active return mode, the device terminal receives the grayscale instruction sent by the control terminal and detects whether its own control parameters are abnormal for multiple consecutive frames (such as high temperature, LED open circuit, etc.). When this occurs, it will set the abnormal flag (default value is 0) to 1 at the end of the frame corresponding to the grayscale data, and reset the abnormal flag to 0 after detecting that the control parameters are normal for multiple consecutive frames. The device terminal will only perform parameter return when the abnormal flag is 1, which avoids multiple parameter returns from the same device terminal and simultaneous return operations by multiple device terminals. Only the data of one device terminal is returned in each frame of grayscale data frame (the time occupied by each grayscale instruction transmission and the time interval between the start time points of the next grayscale instruction are used as one frame of grayscale data frame). The device terminal judges the level of ADRI at the end of the grayscale data frame (the device terminal takes turns to raise the level of ADRO to avoid simultaneous return by multiple terminals). If ADRI is at a high level and its own parameters are abnormal, it will return data and raise ADRO at the start of the next frame of data after the return ends; if ADRI is at a low level or its own parameters are normal, it will not perform data return and will raise ADRO at the same time.

[0101] Specifically, as Figure 4 shown, the device terminal receives a large number of grayscale data frames before returning. The first device terminal (#1) and the third device terminal (#3) detect that their own parameters are abnormal, and the second device terminal has normal own parameters. Therefore, at the end of the grayscale data frame, after the first device terminal finishes returning data, it raises the ADRI of the second device terminal. The second device terminal does not return data and raises ADRO at the same time (ADRI and ADRO are connected in sequence, and the change in the ADRO level of the previous device terminal will change the ADRI level of this device terminal. The level of ADRO of this device terminal is controlled by this device terminal itself). After the third device terminal confirms that ADRI is raised, it performs parameter return and raises ADRO at the start of the next frame of grayscale data frame after the return ends.

[0102] The two-way communication method of this application expands the two-way communication function on traditional protocols (such as DMX512 protocol, return-to-zero code protocol, two-wire protocol, SPI protocol, serial port protocol, IIC protocol, etc.), and at the same time retains its original functions (such as register configuration, chip addressing, etc.). The data that the device terminal can transmit to the controller includes but is not limited to parameters such as the temperature, voltage, current, power, LED open / short circuit, device number UID, working time, address, and register parameters of the terminal itself.

[0103] According to one aspect of this application, this application also provides a two-way communication device, as Figure 6As shown in the figure, the two-way communication device 300 includes a type information acquisition module 301, an instruction transmission module 302, and an information reception module 303. Among them, the type information acquisition module 301 is used to acquire the type information of the target instruction to be transmitted. The type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction. The instruction transmission module 302 is used to transmit the target instruction to the target device end in a preset communication manner if the type information indicates that the target instruction is a first preset instruction. The preset communication manner includes any one of point-to-point communication and broadcast communication. The information reception module 303 is used to receive the information returned by the target device end based on the target instruction.

[0104] Optionally, the instruction transmission module 302 is further used to transmit the target instruction to the target device end through the communication protocol corresponding to the target device end or the control end if the type information indicates that the target instruction is a second preset instruction. The second preset instruction includes a grayscale instruction, and the communication protocol includes at least one of, but is not limited to, the DMX512 protocol, the return-to-zero code protocol, the two-wire protocol, the SPI protocol, the serial port protocol, and the IIC protocol.

[0105] Optionally, transmitting the target instruction to the target device end in a preset communication manner includes: acquiring the identification information of the target device end corresponding to the target instruction; and transmitting the target instruction to the target device end at a predetermined transmission interval according to the identification information and the preset communication manner. The identification information includes the number of the target device end.

[0106] Optionally, the first preset instruction includes any one of a control instruction and a register configuration instruction. Receiving the information returned by the target device end based on the target instruction includes: if the first preset instruction is the control instruction, receiving the control parameters returned by the target device end based on the control instruction and the predetermined transmission interval. The control parameters include at least one of, but are not limited to, temperature, voltage, current, power, LED open / short circuit, device number, working time, address, and register parameters. If the first preset instruction is a register configuration instruction, receiving the register information returned by the target device end based on the register configuration instruction and the predetermined transmission interval. The register information includes at least one of information indicating whether the register value is configured successfully and register parameters.

[0107] Optionally, at least one of the control ends communicates bidirectionally with the response port of at least one of the device ends through a command port. The obtaining of the type information of the target instruction includes: if it is determined that the current state is the active state, obtaining the type information of the target instruction; the transmitting of the target instruction to the target device end in a preset communication manner includes: transmitting the target instruction to the response port of the device end through the command port in the preset communication manner; the receiving of the information returned by the target device end based on the target instruction includes: receiving, through the command port, the information returned by the target device end through the response port in the working mode indicated by the target instruction, and the working mode includes any one of the passive return mode and the active return mode.

[0108] According to one aspect of the present application, there is also provided a bidirectional communication device, as Figure 7 shown. The bidirectional communication device 300 includes an instruction receiving module 304 and an information return module 305. Among them, the instruction receiving module 304 is configured to receive a target instruction sent by any control end. The target instruction includes an instruction transmitted in a preset communication manner after the control end obtains the type information of the target instruction and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication; the information return module 305 is configured to return information to the control end according to the target instruction.

[0109] Optionally, the returning of the information to the control end according to the target instruction includes: obtaining the type information of the target instruction and the working mode indicated by the target instruction, and the working mode includes any one of the passive return mode and the active return mode; obtaining the return information according to the type information, and transmitting the return information to the control end based on the working mode.

[0110] Optionally, the first preset instruction includes any one of a control instruction and a register configuration instruction. The transmitting of the return information to the control end based on the working mode includes: if it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is the passive return mode, obtaining the control parameter corresponding to the control instruction, and returning the control parameter to the control end according to the transmission interval of the control end; if it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is the active return mode, after determining that a preset condition is met, modifying the exception flag, and returning the control parameter corresponding to the control instruction to the control end according to the transmission interval of the control end, and the preset condition includes detecting that a preset number of frames of control parameters are abnormal, and the frames corresponding to the abnormal control parameters are adjacent.

[0111] In an alternative embodiment, an electronic device is provided, such as Figure 8 as shown. Figure 8 The electronic device 4000 shown in Figure 8 includes: a processor 4001 and a memory 4003. Among them, the processor 4001 and the memory 4003 are connected, such as connected through a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present application.

[0112] The processor 4001 may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in connection with the disclosure of the present application. The processor 4001 may also be a combination that implements computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0113] The bus 4002 may include a path for transmitting information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard structure) bus, etc. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0114] The memory 4003 can be a ROM (ReadOnlyMemory), or other types of static storage devices that can store static information and instructions, a RAM (RandomAccessMemory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (ElectricallyErasableProgrammableReadOnlyMemory), a CD-ROM (CompactDiscReadOnlyMemory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, which is not limited herein.

[0115] The memory 4003 is used to store the computer program for implementing the embodiments of the present application and is controlled by the processor 4001 for execution. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.

[0116] Among them, the electronic device can be any kind of electronic product that can perform human-computer interaction with an object. For example, a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an Internet Protocol Television (IPTV), a smart wearable device, etc.

[0117] The electronic device may further include a network device and / or an object device. Among them, the network device includes, but is not limited to, a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing (CloudComputing).

[0118] The network where the electronic device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0119] The embodiments of the present application provide a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.

[0120] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the description, claims and above-mentioned drawings of this application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application described herein can be implemented in an order other than the illustrated or described order.

[0121] It should be understood that although the flowcharts of the embodiments of this application indicate each operation step by an arrow, the execution order of these steps is not limited to the order indicated by the arrow. Unless there is a clear description in this article, in some implementation scenarios of the embodiments of this application, the implementation steps in each flowchart can be executed in other orders according to requirements. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiments of this application do not limit this.

[0122] The above are only optional implementation manners of some implementation scenarios of this application. It should be noted that for those of ordinary skill in the art, without departing from the technical concept of the solution of this application, using other similar implementation means based on the technical idea of this application also belongs to the protection scope of the embodiments of this application.

Claims

1. A two-way communication method, characterized in that, a control end for connecting with at least one device end includes: For a target instruction to be transmitted, obtaining type information of the target instruction, where the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction; If the type information indicates that the target instruction is a first preset instruction, transmitting the target instruction to a target device end in a preset communication manner, where the preset communication manner includes any one of point-to-point communication and broadcast communication; Receiving information returned by the target device end based on the target instruction.

2. The two-way communication method according to claim 1, characterized in that, the method further includes: If the type information indicates that the target instruction is a second preset instruction, transmitting the target instruction to the target device end through a communication protocol corresponding to the target device end or the control end; The second preset instruction includes a grayscale instruction, and the communication protocol includes at least one of DMX512 protocol, return-to-zero code protocol, two-wire protocol, SPI protocol, serial port protocol, and IIC protocol.

3. The two-way communication method according to claim 1, characterized in that, transmitting the target instruction to a target device end in a preset communication manner includes: Obtaining identification information of the target device end corresponding to the target instruction; According to the identification information and the preset communication manner, transmitting the target instruction to the target device end at a predetermined transmission interval, where the identification information includes the number of the target device end.

4. The two-way communication method according to claim 3, characterized in that, the first preset instruction includes any one of a control instruction and a register configuration instruction, and receiving information returned by the target device end based on the target instruction includes: If the first preset instruction is the control instruction, receiving control parameters returned by the target device end based on the control instruction and the predetermined transmission interval, where the control parameters include at least one of temperature, voltage, current, power, LED open / short circuit, device number, working time, address, and register parameters; If the first preset instruction is a register configuration instruction, receiving register information returned by the target device end based on the register configuration instruction and the predetermined transmission interval, where the register information includes at least one of information indicating whether the register value is successfully configured and register parameters.

5. The two-way communication method according to claim 1, characterized in that, at least one of the control ends communicates bidirectionally with a response port of at least one of the device ends through a command port, and obtaining the type information of the target instruction includes: If it is determined that the current state is an active state, obtaining the type information of the target instruction; transmitting the target instruction to a target device end in a preset communication manner includes: Transmitting the target instruction to the response port of the device end through the command port in a preset communication manner; receiving information returned by the target device end based on the target instruction includes: Receiving, through the command port, information returned by the target device end in the working mode indicated by the target instruction through the response port, where the working mode includes any one of a passive return mode and an active return mode.

6. A two-way communication method, characterized in that a device end for connecting to at least one control end includes: Receiving a target instruction sent by any one of the control ends, where the target instruction includes an instruction transmitted in a preset communication manner after the control end obtains the type information of the target instruction and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication; Returning information to the control end according to the target instruction.

7. The two-way communication method according to claim 6, characterized in that the returning information to the control end according to the target instruction includes: Obtaining the type information of the target instruction and the working mode indicated by the target instruction, where the working mode includes any one of a passive return mode and an active return mode; Obtaining return information according to the type information, and transmitting the return information to the control end based on the working mode.

8. The two-way communication method according to claim 7, characterized in that the first preset instruction includes any one of a control instruction and a register configuration instruction, and the transmitting the return information to the control end based on the working mode includes: If it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is a passive return mode, obtaining the control parameter corresponding to the control instruction, and returning the control parameter to the control end according to the transmission interval of the control end; If it is determined that the first preset instruction is a control instruction and the working mode indicated by the control instruction is an active return mode, after determining that a preset condition is satisfied, modifying an exception flag, and returning the control parameter corresponding to the control instruction to the control end according to the transmission interval of the control end, where the preset condition includes detecting that a preset number of frames of control parameters are abnormal and the frames corresponding to the abnormal control parameters are adjacent.

9. A two-way communication device, characterized in that it includes: A type information obtaining module, configured to obtain the type information of a target instruction to be transmitted, where the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction; An instruction transmission module, configured to, if the type information indicates that the target instruction is a first preset instruction, transmit the target instruction to a target device end in a preset communication manner, where the preset communication manner includes any one of point-to-point communication and broadcast communication; An information receiving module, configured to receive information returned by the target device end based on the target instruction; or An instruction receiving module, configured to receive a target instruction sent by any control end, where the target instruction includes an instruction transmitted in a preset communication manner after the control end obtains the type information of the target instruction to be transmitted and determines that the type information indicates that the target instruction is a first preset instruction; the type information includes information indicating that the target instruction is a first preset instruction or a second preset instruction, and the preset communication manner includes any one of point-to-point communication and broadcast communication; An information feedback module, configured to feedback information to the control end according to the target instruction.

10. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1-8 are implemented.