CN115589422A - Communication method, device, equipment and storage medium based on interface multiplexing - Google Patents

Communication method, device, equipment and storage medium based on interface multiplexing Download PDF

Info

Publication number
CN115589422A
CN115589422A CN202210988241.6A CN202210988241A CN115589422A CN 115589422 A CN115589422 A CN 115589422A CN 202210988241 A CN202210988241 A CN 202210988241A CN 115589422 A CN115589422 A CN 115589422A
Authority
CN
China
Prior art keywords
instruction
equipment
control
data
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210988241.6A
Other languages
Chinese (zh)
Inventor
麦浩贤
罗森
雷朋飞
宗毅
刘志力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong PHNIX Eco Energy Solution Ltd
Original Assignee
Guangdong PHNIX Eco Energy Solution Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong PHNIX Eco Energy Solution Ltd filed Critical Guangdong PHNIX Eco Energy Solution Ltd
Priority to CN202210988241.6A priority Critical patent/CN115589422A/en
Publication of CN115589422A publication Critical patent/CN115589422A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C19/00Electric signal transmission systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The invention relates to the technical field of communication, and discloses a communication method, a communication device, communication equipment and a storage medium based on interface multiplexing. The method comprises the following steps: intercepting a first instruction sent to the slave equipment by the control equipment and acquiring a second instruction sent by the external equipment through the relay equipment; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; and the slave equipment performs data interaction in sequence according to a preset communication protocol based on the first instruction and the second instruction to obtain response information, and performs operation control on the controlled equipment according to the response information. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.

Description

Communication method, device, equipment and storage medium based on interface multiplexing
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication method, apparatus, device, and storage medium based on interface multiplexing.
Background
Currently, data interaction between a host and an external system can be realized in a wireless communication mode and a wired interface communication mode, wherein a communication interface used for the wired interface communication is an interface for wired connection and interaction between an internal system of the host and the external system. For a heat pump unit host comprising a color screen, data exchange between the host and an external system is realized by analyzing the number of external devices required to be connected by the current host device and setting a corresponding external interface according to the requirement of the design space of the host product. However, because there is a need for accessing some additional external devices, there is usually no extra interface for connection in the design of the heat pump unit host product, so that the need for some additional external devices of customers cannot be well met.
Nowadays, because the color screen reads the interaction information of the main board as required, the number of the read instructions is variable, and the sending period is disordered, so that the interface is always occupied and cannot be reused. The existing color screen interface can not realize data communication multiplexing of the interface, so that the difficulty of communicating with other external control systems of the existing heat pump unit is higher.
Disclosure of Invention
The invention mainly aims to solve the problem that the existing color screen interface can not realize data communication multiplexing of the interface, so that the difficulty of the external connection of a heat pump unit with other control systems is high.
The first aspect of the present invention provides a communication method based on interface multiplexing, which is applied to a communication system based on interface multiplexing, where the communication system includes a control device, a slave device, and a controlled device, and the communication system further includes at least one external device and a relay device, where the control device and the external device are respectively connected to the relay device, the relay device is connected to the slave device, and the slave device is connected to the controlled device, and the communication method includes: intercepting a first instruction sent to the slave equipment by the control equipment and acquiring a second instruction sent by the external equipment through the relay equipment; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission cycle; and the slave equipment performs data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and performs operation control on the controlled equipment according to the response information.
Optionally, in a first implementation manner of the first aspect of the present invention, before intercepting, by the relay device, the first instruction sent by the control device to the slave device and acquiring the second instruction sent by the external device, the method further includes: according to a preset communication protocol, performing first data query setting on the control equipment to obtain first query data, and generating a corresponding first instruction based on the first query data; and according to a preset communication protocol, performing second data query setting on the external equipment to obtain second query data, and generating a corresponding second instruction based on the second query data.
Optionally, in a second implementation manner of the first aspect of the present invention, the performing, according to a preset communication protocol, a first data query setting on the control device to obtain first query data, and generating a corresponding first instruction based on the first query data includes: acquiring an inquiry period of the control equipment and a display control page number and a hidden display page number of the control equipment, and generating a first reading period based on the inquiry period; reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to the first reading period; and combining the first control parameter and the second control parameter according to a preset first inquiry data format to obtain first inquiry data.
Optionally, in a third implementation manner of the first aspect of the present invention, the performing, according to a preset communication protocol, a second data query setting on the external device to obtain second query data, and generating a corresponding second instruction based on the second query data includes: determining a second reading period according to a preset polling strategy based on the first reading period; reading the state data of the external equipment according to the second reading period, and generating a state packet based on the state data; reading the parameter data of the external equipment according to the second reading period, and generating a parameter packet based on the state data; and combining the state packet and the parameter packet according to a preset second inquiry data format to obtain second inquiry data.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the detecting a sending time sequence of the first instruction and the second instruction includes: caching the first instruction to a first channel of the relay device and caching the second instruction to a second channel of the relay device; detecting first caching time corresponding to the caching instruction identification in the first channel and detecting second caching time corresponding to the caching instruction identification in the second channel; and comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the preset transmission period includes a first transmission period and a second transmission period, and the sequentially transmitting the first instruction and the second instruction to the slave device according to the detected sending time sequence and the preset transmission period includes: if the sending time sequence is that the sending time of the first instruction is earlier than that of the second instruction, sending the first instruction in the first channel to the slave equipment, and sending the second instruction in the second channel to the slave equipment according to the first transmission cycle; if the sending time sequence is that the sending time of the first instruction is not earlier than that of the second instruction, sending the second instruction in the second channel to the slave equipment, and sending the first instruction in the first channel to the slave equipment according to the second transmission cycle.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the response information includes first response information corresponding to the first instruction and second response information corresponding to the second instruction, and after the slave device performs data interaction according to a preset communication protocol based on the first instruction and the second instruction, and generates the response information based on the interacted data, the method further includes: according to the detected sending time sequence and the transmission period, respectively returning the first response information and the second response information to the relay equipment in sequence; and detecting the control levels corresponding to the control equipment and the external equipment, and sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control levels.
A second aspect of the present invention provides a communication device based on interface multiplexing, including: the command acquisition module is used for intercepting a first command sent by the control equipment to the slave equipment and acquiring a second command sent by the external equipment through the relay equipment; the instruction sending module is used for detecting the sending time sequence of the first instruction and the second instruction and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; and the data response module is used for the slave equipment to perform data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information and perform operation control on the controlled equipment according to the response information.
Optionally, in a first implementation manner of the second aspect of the present invention, before the instruction obtaining module, an instruction constructing module is further provided, where the instruction constructing module includes: the first construction unit is used for performing first data query setting on the control equipment according to a preset communication protocol to obtain first query data, and generating a corresponding first instruction based on the first query data; and the second construction unit is used for performing second data inquiry setting on the external equipment according to a preset communication protocol to obtain second inquiry data, and generating a corresponding second instruction based on the second inquiry data.
Optionally, in a second implementation manner of the second aspect of the present invention, the first building unit includes: acquiring an inquiry period of the control equipment and a display control page number and a hidden display page number of the control equipment, and generating a first reading period based on the inquiry period; reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to the first reading period; and combining the first control parameter and the second control parameter according to a preset first inquiry data format to obtain first inquiry data.
Optionally, in a third implementation manner of the second aspect of the present invention, the second building unit includes: determining a second reading period according to a preset polling strategy based on the first reading period; reading the state data of the external equipment according to the second reading period, and generating a state packet based on the state data; reading the parameter data of the external equipment according to the second reading period, and generating a parameter packet based on the state data; and combining the state packet and the parameter packet according to a preset second inquiry data format to obtain second inquiry data.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the instruction sending module includes: the instruction cache unit is used for caching the first instruction to a first channel of the relay equipment and caching the second instruction to a second channel of the relay equipment; the identification detection unit is used for detecting first cache time corresponding to the cache instruction identification in the first channel and detecting second cache time corresponding to the cache instruction identification in the second channel; and the time comparison unit is used for comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the instruction sending module further includes: a first sending unit, configured to send a first instruction in the first channel to the slave device if a sending time sequence is that a sending time of the first instruction is earlier than that of the second instruction, and send a second instruction in the second channel to the slave device according to the first transmission cycle; and a second sending unit, configured to send the second instruction in the second channel to the slave device if the sending time sequence is that the sending time of the first instruction is not earlier than the second instruction, and send the first instruction in the first channel to the slave device according to the second transmission cycle.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the data response module includes: a response returning unit, configured to return the first response information and the second response information to the relay device in sequence according to the detected sending time sequence and the detected transmission period, respectively; and the instruction control unit is used for detecting the control levels corresponding to the control equipment and the external equipment and sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control levels.
A third aspect of the present invention provides a communication device based on interface multiplexing, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor calls the instructions in the memory to enable the interface multiplexing-based communication device to execute the steps of the interface multiplexing-based communication method.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the above-mentioned interface multiplexing-based communication method.
In the technical scheme provided by the invention, the communication system comprises a control device, a slave device, a controlled device and at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device, the relay device is connected with the slave device, a first instruction sent to the slave device by the control device is intercepted by the relay device, and a second instruction sent by the external device is obtained; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; and the slave equipment carries out data interaction in sequence according to a preset communication protocol based on the first instruction and the second instruction to obtain response information, and carries out operation control on controlled equipment according to the response information. Compared with the prior art, the method and the device have the advantages that the command information transmitted by the control device and the external device is intercepted through the relay device, and then the command is transmitted to the slave device according to the sequence of the command transmission time and the preset transmission period, so that the corresponding response information is generated, and the work of the corresponding device is controlled. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a communication method based on interface multiplexing according to an embodiment of the present invention;
fig. 2 is a diagram illustrating a second embodiment of a communication method based on interface multiplexing according to an embodiment of the invention;
fig. 3 is a schematic diagram of a third embodiment of a communication method based on interface multiplexing according to an embodiment of the present invention;
FIG. 4 is a diagram of an embodiment of a communication device based on interface multiplexing according to an embodiment of the invention;
FIG. 5 is a diagram of another embodiment of a communication device based on interface multiplexing according to an embodiment of the invention;
fig. 6 is a schematic diagram of an embodiment of a communication device based on interface multiplexing according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a communication method, a device, equipment and a storage medium based on interface multiplexing, wherein the method comprises the following steps: intercepting a first instruction sent to the slave equipment by the control equipment and acquiring a second instruction sent by the external equipment through the relay equipment; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission cycle; and the slave equipment performs data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and performs operation control on the controlled equipment according to the response information. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a detailed flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of the communication method based on interface multiplexing in the embodiment of the present invention includes:
101. intercepting a first instruction sent to the slave equipment by the control equipment through the relay equipment and acquiring a second instruction sent by the external equipment;
it should be understood that the execution subject of the present invention may be a communication device based on interface multiplexing, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In this embodiment, the relay device refers to a device in which a plurality of data lines are concentrated into a single line, and here, two cache isolation type concentrators are taken as an example, that is, communication multiplexing is more than two lines, and this application takes communication multiplexing two lines as an example for description; the control equipment refers to color screen equipment of the heat pump unit; the external device refers to other control devices which are not considered at the beginning of the design of the heat pump unit, such as control devices of customers and the like; the first instruction refers to relevant control and display instruction information sent by the color screen device; the second command here refers to the relevant control command information sent in the client system.
In practical application, according to a preset communication protocol, performing first data query setting on control equipment to obtain first query data, and generating a corresponding first instruction based on the first query data, namely, generating a first reading period by acquiring a query period of the control equipment and a display control page number and a hidden display page number of the control equipment and based on the query period; reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to a first reading period; and combining the first control parameter and the second control parameter according to a preset first inquiry data format to obtain first inquiry data. According to a preset communication protocol, performing second data inquiry setting on the external equipment to obtain second inquiry data, and generating a corresponding second instruction based on the second inquiry data, namely determining a second reading period based on the first reading period and according to a preset polling strategy; reading the state data of the external equipment according to the second reading period, and generating a state packet based on the state data; reading parameter data of the external equipment according to the second reading period, and generating a parameter packet based on the state data; and combining the state packet and the parameter packet according to a preset second inquiry data format to obtain second inquiry data. And then according to the corresponding sending period, intercepting first instruction information sent to the slave equipment by the control equipment in one sending period through the relay equipment, and acquiring second instruction information sent to the slave equipment by the external equipment in one sending period.
102. Detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period;
in this embodiment, the sending time sequence refers to a sequence of sending the corresponding instruction to the relay device by the control device and the external device; the transmission cycle herein refers to a response time period of the slave device to the command.
In practical application, the first instruction is cached to a first channel of the relay device, and the second instruction is cached to a second channel of the relay device; further detecting first cache time corresponding to the cache instruction identification in the first channel and detecting second cache time corresponding to the cache instruction identification in the second channel; further comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction; if the sending time sequence is that the sending time of the first instruction is earlier than that of the second instruction, the first instruction in the first channel is sent to the slave equipment, and the second instruction in the second channel is sent to the slave equipment according to the first transmission cycle; and if the sending time sequence is that the sending time of the first instruction is not earlier than that of the second instruction, sending the second instruction in the second channel to the slave equipment, and sending the first instruction in the first channel to the slave equipment according to a second transmission cycle.
103. The slave equipment carries out data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and carries out operation control on the controlled equipment according to the response information.
In this embodiment, the communication protocol refers to a protocol for communicating between the slave device and the slave device of the related control system, such as a Modbus protocol, which is a communication protocol between the single chip PLC devices, and the application takes the Modbus protocol as an example for description; the response information here refers to instruction information for controlling the operation of the relevant equipment and data response information such as display parameter information required by the display equipment such as color frequency; the controlled device refers to other working devices connected in the heat pump unit, such as a heating device, a temperature detecting device and the like.
In practical applications, the slave device performs data interaction according to a preset communication protocol based on a first instruction and a second instruction, and generates response information based on the interacted data, that is, reads parameter information and control instruction information required for color screen page display based on the first instruction sent by the control device, so as to search feedback information corresponding to the current overall device, and further generate corresponding response information according to the feedback information, and analyzes related instructions in the instruction information based on the second instruction of the external device, that is, the PLC device, by analyzing 03 instructions therein (where the 03 instructions are some data formats specified by the Modbus protocol, for example, sending data 03 1389 00 5A 10 f, meaning to query the register with the first address of 0x1389 from the slave 01 address, and data content of 90 registers down), so as to read two required data packet information, or read 06 instructions (where the instructions are also read from the register with the first address of 0x1389, for example, sending data 01 d 00 d 64 from the slave device after receiving the data format specified by the Modbus protocol), so as to read two required data packet information, or read corresponding instructions (this instruction is a value of a corresponding switch parameter when the switch parameter is modified 1380, and the switch parameter is set to a corresponding parameter, and a corresponding command is generated, and a corresponding command is assigned to a corresponding switch parameter to a corresponding parameter to a switch parameter of the switch corresponding to be read (1380, and a switch). And then according to the detected sending time sequence and transmission cycle, respectively returning the first response information and the second response information to the relay equipment in sequence; and detecting the control levels corresponding to the control equipment and the external equipment, sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control levels, and controlling the controlled equipment by heating, temperature setting and the like according to the response information.
In the embodiment of the invention, the communication system comprises a control device, a slave device and a controlled device, and also comprises at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device, the relay device is connected with the slave device, and a first instruction sent to the slave device by the control device is intercepted by the relay device and a second instruction sent by the external device is obtained; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; the slave equipment carries out data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and carries out operation control on the controlled equipment according to the response information. Compared with the prior art, the method and the device have the advantages that the command information transmitted by the control device and the external device is intercepted through the relay device, and then the command is transmitted to the slave device according to the sequence of the command transmission time and the preset transmission period, so that the corresponding response information is generated, and the work of the corresponding device is controlled. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.
Referring to fig. 2, a second embodiment of the communication method based on interface multiplexing according to the embodiment of the present invention includes:
201. performing first data query setting on the control equipment according to a preset communication protocol to obtain first query data, and generating a corresponding first instruction based on the first query data;
in this embodiment, the communication protocol refers to a Modbus protocol of the single chip microcomputer; the data query setting refers to setting a display parameter instruction and a control instruction required by the current control device according to a corresponding transmission information format according to a preset communication protocol, so that data communication between different devices can be normally performed.
In practical application, for the parameters of the color screen device for reading page numbers, 2s is required to be set as a period to inquire the parameters, and the time for completing the reading of the parameters is about 2-3 s, and the time for completing each polling is less than 5s, so that the actions of the PLC device and the color screen device for inquiring the mainboard are greatly staggered by setting the inquiry period to 5s, and the normal operation of the relay device is ensured. Generating a first reading period 5s by acquiring an inquiry period (i.e., a reading time and an inquiry time) of the control device and a display control page number and a hidden display page number of the control device, and based on the inquiry period; further reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to a first reading period; and then according to the first data inquiry setting (namely the data sending format), matching the sending format of the data communication of the current color screen equipment, and adding the first control parameter and the second control parameter to the corresponding positions of the data communication sending format to generate a corresponding first instruction.
202. According to a preset communication protocol, performing second data query setting on the external equipment to obtain second query data, and generating a corresponding second instruction based on the second query data;
in this embodiment, the second data query setting refers to a transmission format in which the control system of the external device, such as a client, performs data communication with the slave system.
In practical application, based on the first reading period, according to a preset polling strategy, determining a second reading period, namely according to the reading period of a color screen for 5s, setting the second reading period of the external equipment to have 5s or 5s relative proportion time; further, according to a second reading period, reading state data of the external device, generating a state packet based on the state data, if relevant state information of the slave device needs to be read, generating an instruction (such as an instruction 003) corresponding to the state address information, reading parameter data of the external device according to the second reading period, generating a parameter packet based on the state data, if relevant parameter information of the slave device needs to be read, and generating an instruction (such as an instruction 006) corresponding to the parameter address information; and then according to the second data inquiry setting, matching a corresponding second inquiry data format (namely a data sending format), and combining the state packet instruction information and the parameter packet instruction information into the corresponding data sending format to generate a corresponding second instruction.
203. Intercepting a first instruction sent to the slave equipment by the control equipment through the relay equipment and acquiring a second instruction sent by the external equipment;
204. detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period;
205. respectively returning the first response information and the second response information to the relay equipment in sequence according to the detected sending time sequence and the detected transmission period;
in this embodiment, the transmission cycle refers to a cycle of data exchange between the repeater and the slave device, and a communication cycle 5s of the color screen device is used as the transmission cycle.
In practical application, after the slave device performs data interaction according to a preset communication protocol based on a first instruction and a second instruction and generates response information based on the interacted data, the slave device returns the first response information and the second response information to the relay device according to the detected sending time sequence and transmission cycle and the communication time sequence.
206. And detecting the control level corresponding to the control equipment and the external equipment, and sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control level.
In this embodiment, the control level herein refers to a control priority level between different devices.
In practical application, by detecting the control levels corresponding to the control equipment and the external equipment, namely whether the current control instruction is high in the priority of the client system equipment or the control priority of the color screen equipment, the response information in the relay equipment is subjected to instruction control according to the level detection result, if the priority of the client system equipment is high, the client instruction is preferentially sent and the control response is carried out, and if the priority of the color screen equipment is high, the client instruction is preferentially sent and the control response is carried out; and then the controlled equipment is controlled according to the response information.
In the embodiment of the invention, according to a preset communication protocol, first data inquiry setting is carried out on control equipment to obtain first inquiry data, and a corresponding first instruction is generated based on the first inquiry data; according to a preset communication protocol, performing second data query setting on the external equipment to obtain second query data, and generating a corresponding second instruction based on the second query data; respectively returning the first response information and the second response information to the relay equipment in sequence according to the detected sending time sequence and the detected transmission period; and detecting the control level corresponding to the control equipment and the external equipment, and sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control level. Compared with the prior art, the method and the device have the advantages that corresponding instruction information is generated according to related communication protocols, and the generated response information is used for sequentially controlling corresponding equipment to complete corresponding functions according to corresponding control priorities. And data communication and response control among different external control devices are realized.
Referring to fig. 3, a third embodiment of the communication method based on interface multiplexing according to the embodiment of the present invention includes:
301. intercepting a first instruction sent to the slave equipment by the control equipment through the relay equipment and acquiring a second instruction sent by the external equipment;
302. caching the first instruction to a first channel of the relay device, and caching the second instruction to a second channel of the relay device;
in this embodiment, the first channel here refers to a channel used for temporarily buffering data, to which the relay device and the control device are connected; the first channel refers to a channel to which the relay device and the external device are connected for temporarily buffering data.
In practical application, according to the obtained first instruction and the second instruction, the first instruction is cached to a first channel of the relay device, and the second instruction is cached to a second channel of the relay device.
303. Detecting first caching time corresponding to the caching instruction identification in the first channel and detecting second caching time corresponding to the caching instruction identification in the second channel;
in this embodiment, the cache instruction identifier refers to address identification information of the first data cached to the cache space by the relevant instruction.
In practical application, the first cache time corresponding to the instruction identifier is identified and cached by detecting the cache instruction identifier in the first channel, and the second cache time corresponding to the instruction identifier is identified and cached by detecting the cache instruction identifier in the second channel.
304. Comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction;
in this embodiment, the time sequence of the first instruction and the second instruction is obtained by comparing the first cache time and the second cache time obtained by the processing.
305. If the sending time sequence is that the sending time of the first instruction is earlier than that of the second instruction, sending the first instruction in the first channel to the slave equipment, and sending the second instruction in the second channel to the slave equipment according to the first transmission cycle;
in this embodiment, according to the detected sending time sequence, if the sending time of the first instruction is earlier than the sending time of the second instruction, the first instruction in the first channel is sent to the slave device for performing the parameter permission and the data exchange, and the second instruction in the second channel is sent to the slave device for performing the parameter permission and the data exchange in the next sending period according to the preset period.
306. If the sending time sequence is that the sending time of the first instruction is not earlier than that of the second instruction, sending the second instruction in the second channel to the slave equipment, and sending the first instruction in the first channel to the slave equipment according to a second transmission cycle;
in this embodiment, if the sending time of the first instruction is not earlier than that of the second instruction, the second instruction in the second channel is sent to the slave device for performing the related parameter permission and data exchange, and the first instruction in the first channel is sent to the slave device for performing the related parameter permission and data exchange in the next cycle according to the preset cycle.
307. The slave equipment carries out data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and carries out operation control on the controlled equipment according to the response information.
In the embodiment of the invention, a first instruction is cached to a first channel of the relay equipment, and a second instruction is cached to a second channel of the relay equipment; detecting first caching time corresponding to a caching instruction identifier in a first channel and detecting second caching time corresponding to a caching instruction identifier in a second channel; comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction; if the sending time sequence is that the sending time of the first instruction is earlier than that of the second instruction, sending the first instruction in the first channel to the slave equipment, and sending the second instruction in the second channel to the slave equipment according to the first transmission cycle; and if the sending time sequence is that the sending time of the first instruction is not earlier than that of the second instruction, sending the second instruction in the second channel to the slave equipment, and sending the first instruction in the first channel to the slave equipment according to the second transmission cycle. Compared with the prior art, the method and the device have the advantages that the sending time sequence of the corresponding instructions is identified, and then the instruction information is sent to the slave equipment in sequence, so that data disorder caused when the instructions are sent by the same slave interface is avoided, the loss of communication data is avoided, and normal communication between the single color screen interface and the slave equipment and among a plurality of control devices is realized.
With reference to fig. 4, the communication device based on interface multiplexing according to the embodiment of the present invention is described above, and an embodiment of the communication device based on interface multiplexing according to the embodiment of the present invention includes:
the instruction acquisition module 401 is configured to intercept, by the relay device, a first instruction sent by the control device to the slave device, and acquire a second instruction sent by the external device;
an instruction sending module 402, configured to detect a sending time sequence of the first instruction and the second instruction, and sequentially transmit the first instruction and the second instruction to the slave device according to a preset transmission cycle according to the detected sending time sequence;
and a data response module 403, configured to perform data interaction sequentially according to a preset communication protocol by the slave device based on the first instruction and the second instruction, obtain response information, and perform operation control on the controlled device according to the response information.
In the embodiment of the invention, the communication system comprises a control device, a slave device and a controlled device, and also comprises at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device, the relay device is connected with the slave device, and a first instruction sent to the slave device by the control device is intercepted by the relay device and a second instruction sent by the external device is obtained; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; and the slave equipment carries out data interaction in sequence according to a preset communication protocol based on the first instruction and the second instruction to obtain response information, and carries out operation control on controlled equipment according to the response information. Compared with the prior art, the method and the device have the advantages that the command information transmitted by the control device and the external device is intercepted through the relay device, and then the command is transmitted to the slave device according to the sequence of the command transmission time and the preset transmission period, so that the corresponding response information is generated, and the work of the corresponding device is controlled. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.
Referring to fig. 5, another embodiment of the communication device based on interface multiplexing according to the embodiment of the present invention includes:
the instruction obtaining module 401 is configured to intercept, by the relay device, a first instruction sent by the control device to the slave device, and obtain a second instruction sent by the external device;
an instruction sending module 402, configured to detect a sending time sequence of the first instruction and the second instruction, and sequentially transmit the first instruction and the second instruction to the slave device according to a preset transmission cycle according to the detected sending time sequence;
and a data response module 403, configured to perform data interaction sequentially according to a preset communication protocol by the slave device based on the first instruction and the second instruction, obtain response information, and perform operation control on the controlled device according to the response information.
Further, before the instruction obtaining module 401, there is an instruction constructing module 404, where the instruction constructing module 404 includes:
a first constructing unit 4041, configured to perform first data query setting on the control device according to a preset communication protocol to obtain first query data, and generate a corresponding first instruction based on the first query data;
a second constructing unit 4042, configured to perform second data query setting on the external device according to a preset communication protocol, to obtain second query data, and generate a corresponding second instruction based on the second query data.
Further, the first building unit 4041 includes:
acquiring an inquiry period of the control equipment and a display control page number and a hidden display page number of the control equipment, and generating a first reading period based on the inquiry period; reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to the first reading period; and combining the first control parameter and the second control parameter according to a preset first inquiry data format to obtain first inquiry data.
Further, the second building unit 4042 includes:
determining a second reading period according to a preset polling strategy based on the first reading period; reading the state data of the external equipment according to the second reading period, and generating a state packet based on the state data; reading the parameter data of the external equipment according to the second reading period, and generating a parameter packet based on the state data; and combining the state packet and the parameter packet according to a preset second inquiry data format to obtain second inquiry data.
Further, the instruction sending module 402 includes:
an instruction cache unit 4021, configured to cache the first instruction to a first channel of the relay device, and cache the second instruction to a second channel of the relay device;
an identifier detecting unit 4022, configured to detect a first cache time corresponding to the identifier of the cache instruction in the first channel and detect a second cache time corresponding to the identifier of the cache instruction in the second channel;
a time comparison unit 4023, configured to compare the first cache time and the second cache time to obtain a sending time sequence of the first instruction and the second instruction.
Further, the instruction sending module 402 further includes:
a first sending unit 4024, configured to send the first instruction in the first channel to the slave device if the sending time sequence is that the sending time of the first instruction is earlier than the second instruction, and send the second instruction in the second channel to the slave device according to the first transmission cycle;
a second sending unit 4025, configured to send the second instruction in the second channel to the slave device if the sending time order is that the sending time of the first instruction is not earlier than the second instruction, and send the first instruction in the first channel to the slave device according to the second transmission cycle.
Further, the data response module 403 includes:
a response returning unit 4031, configured to return the first response information and the second response information to the relay device in sequence according to the detected transmission time sequence and the detected transmission cycle, respectively;
and the instruction control unit 4032 is configured to detect a control level corresponding to the control device and the external device, and send the first response information or the second response information in the relay device to the corresponding control device and/or the external device according to the detected control level.
In the embodiment of the invention, the communication system comprises a control device, a slave device and a controlled device, and also comprises at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device; detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period; and the slave equipment carries out data interaction in sequence according to a preset communication protocol based on the first instruction and the second instruction to obtain response information, and carries out operation control on controlled equipment according to the response information. Compared with the prior art, the method and the device have the advantages that the command information transmitted by the control device and the external device is intercepted through the relay device, and then the command is transmitted to the slave device according to the sequence of the command transmission time and the preset transmission period, so that the corresponding response information is generated, and the work of the corresponding device is controlled. The communication of multiplexing a plurality of external control systems of a single control equipment interface of the heat pump unit is realized.
Fig. 4 and fig. 5 describe the communication device based on interface multiplexing in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the communication device based on interface multiplexing in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 6 is a schematic structural diagram of a communication device based on interface multiplexing according to an embodiment of the present invention, where the communication device 600 based on interface multiplexing may generate relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing applications 633 or data 632. Memory 620 and storage medium 630 may be, among other things, transient or persistent storage. The program stored in the storage medium 630 may include one or more modules (not shown), each of which may include a series of instruction operations for the interface multiplexing-based communication apparatus 600. Further, the processor 610 may be configured to communicate with the storage medium 630 and execute a series of instruction operations in the storage medium 630 on the interface multiplexing based communication device 600.
The interface multiplexing-based communication device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input-output interfaces 660, and/or one or more operating systems 631, such as Windows Server, mac OS X, unix, linux, freeBSD, and the like. Those skilled in the art will appreciate that the configuration of the interface multiplexing based communication device shown in fig. 6 does not constitute a limitation of the interface multiplexing based communication device, and may include more or less components than those shown, or combine some components, or arrange different components.
The present invention further provides a communication device based on interface multiplexing, where the computer device includes a memory and a processor, where the memory stores computer-readable instructions, and the computer-readable instructions, when executed by the processor, cause the processor to perform the steps of the communication method based on interface multiplexing in the above embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, having stored therein instructions, which, when executed on a computer, cause the computer to perform the steps of the interface multiplexing-based communication method.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A communication method based on interface multiplexing is applied to a communication system based on interface multiplexing, the communication system comprises a control device, a slave device and a controlled device, and is characterized in that the communication system also comprises at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device, the relay device is connected with the slave device, and the slave device is connected with the controlled device, the communication method comprises the following steps:
intercepting a first instruction sent to the slave equipment by the control equipment and acquiring a second instruction sent by the external equipment through the relay equipment;
detecting the sending time sequence of the first instruction and the second instruction, and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission period;
and the slave equipment performs data interaction according to a preset communication protocol in sequence based on the first instruction and the second instruction to obtain response information, and performs operation control on the controlled equipment according to the response information.
2. The communication method according to claim 1, wherein before the intercepting, by the relay device, the first instruction sent by the control device to the slave device and the second instruction sent by the external device, the method further comprises:
performing first data query setting on the control equipment according to a preset communication protocol to obtain first query data, and generating a corresponding first instruction based on the first query data;
and according to a preset communication protocol, performing second data query setting on the external equipment to obtain second query data, and generating a corresponding second instruction based on the second query data.
3. The communication method according to claim 2, wherein the performing a first data query setting on the control device according to a preset communication protocol to obtain first query data includes:
acquiring an inquiry period of the control equipment and a display control page number and a hidden display page number of the control equipment, and determining a first reading period in the inquiry period;
reading a first control parameter corresponding to display control in the display control page number and a second control parameter corresponding to display control in the hidden display page number according to the first reading period;
and combining the first control parameter and the second control parameter according to a preset first inquiry data format to obtain first inquiry data.
4. The communication method according to claim 3, wherein the performing a second data query setting on the external device according to a preset communication protocol to obtain second query data includes:
determining a second reading period according to a preset polling strategy based on the first reading period;
reading the state data of the external equipment according to the second reading period, and generating a state packet based on the state data;
reading the parameter data of the external equipment according to the second reading period, and generating a parameter packet based on the state data;
and combining the state packet and the parameter packet according to a preset second inquiry data format to obtain second inquiry data.
5. The method according to claim 1, wherein the detecting the transmission time sequence of the first command and the second command comprises:
caching the first instruction to a first channel of the relay device and caching the second instruction to a second channel of the relay device;
detecting first caching time corresponding to the caching instruction identification in the first channel and detecting second caching time corresponding to the caching instruction identification in the second channel;
and comparing the first cache time with the second cache time to obtain the sending time sequence of the first instruction and the second instruction.
6. The communication method according to claim 5, wherein the preset transmission cycle includes a first transmission cycle and a second transmission cycle, and the transmitting the first command and the second command to the slave device in sequence according to the detected transmission time sequence and the preset transmission cycle includes:
if the sending time sequence is that the sending time of the first instruction is earlier than that of the second instruction, sending the first instruction in the first channel to the slave equipment, and sending the second instruction in the second channel to the slave equipment according to the first transmission cycle;
if the sending time sequence is that the sending time of the first instruction is not earlier than that of the second instruction, sending the second instruction in the second channel to the slave equipment, and sending the first instruction in the first channel to the slave equipment according to the second transmission cycle.
7. The communication method according to claim 5 or 6, wherein the response information includes first response information corresponding to the first command and second response information corresponding to the second command, and after the slave device performs data interaction according to a preset communication protocol based on the first command and the second command, and generates response information based on the interacted data, the method further comprises:
according to the detected sending time sequence and the detected transmission period, respectively returning the first response information and the second response information to the relay equipment in sequence;
and detecting the control levels corresponding to the control equipment and the external equipment, and sending the first response information or the second response information in the relay equipment to the corresponding control equipment and/or the external equipment according to the detected control levels.
8. A communication device based on interface multiplexing is applied to a communication system based on interface multiplexing, the communication system comprises a control device, a slave device and a controlled device, and is characterized in that the communication system further comprises at least one external device and a relay device, wherein the control device and the external device are respectively connected with the relay device, the relay device is connected with the slave device, the slave device is connected with the controlled device, and the communication device based on interface multiplexing comprises:
the command acquisition module is used for intercepting a first command sent by the control equipment to the slave equipment and acquiring a second command sent by the external equipment through the relay equipment;
the instruction sending module is used for detecting the sending time sequence of the first instruction and the second instruction and sequentially transmitting the first instruction and the second instruction to the slave equipment according to the detected sending time sequence and a preset transmission cycle;
and the data response module is used for the slave equipment to sequentially carry out data interaction according to a preset communication protocol based on the first instruction and the second instruction to obtain response information and carry out operation control on the controlled equipment according to the response information.
9. A communication device based on interface multiplexing, wherein the communication device based on interface multiplexing comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invokes the instructions in the memory to cause the interface multiplexing based communication device to perform the steps of the interface multiplexing based communication method according to any of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which when executed by a processor, implement the steps of the interface multiplexing-based communication method according to any of claims 1 to 7.
CN202210988241.6A 2022-08-17 2022-08-17 Communication method, device, equipment and storage medium based on interface multiplexing Pending CN115589422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210988241.6A CN115589422A (en) 2022-08-17 2022-08-17 Communication method, device, equipment and storage medium based on interface multiplexing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210988241.6A CN115589422A (en) 2022-08-17 2022-08-17 Communication method, device, equipment and storage medium based on interface multiplexing

Publications (1)

Publication Number Publication Date
CN115589422A true CN115589422A (en) 2023-01-10

Family

ID=84772383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210988241.6A Pending CN115589422A (en) 2022-08-17 2022-08-17 Communication method, device, equipment and storage medium based on interface multiplexing

Country Status (1)

Country Link
CN (1) CN115589422A (en)

Similar Documents

Publication Publication Date Title
EP3575975B1 (en) Method and apparatus for operating smart network interface card
EP1949595B1 (en) Method for the construction and execution of a distributed workflow in a communication system
KR100554115B1 (en) Computer and device driver having interface driver program for computer and recording medium therefor
JPS6170654A (en) Resource control system of decentralized processing system
CN110912782B (en) Data acquisition method, device and storage medium
CN101102259A (en) Network access control system and its method
CN112764877B (en) Method and system for communication between hardware acceleration device and process in dock
CN109462659B (en) Remote access control system, method and storage medium for embedded device
EP2804361B1 (en) Integrated interface system for power-system monitoring and control system
CN114422537B (en) Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment
CN1960276B (en) Remote control system and method
CN112070456A (en) Task issuing method, terminal equipment, robot and storage medium
CN203299613U (en) Intelligent building control system
CN115589422A (en) Communication method, device, equipment and storage medium based on interface multiplexing
US20190042812A1 (en) Location based situation awareness system and method thereof
CN210005883U (en) Intelligent micro-grid communication module and intelligent micro-grid system
CN104678945B (en) Path affinity apparatus and advanced process control component
CN114866534B (en) Image processing method, device, equipment and medium
CN111124923B (en) Running state query method and device, server equipment and storage medium
JP2596173B2 (en) Communication controller for multilink
CN114584622A (en) Batch data processing method and device, computer equipment and storage medium
CN118233239A (en) MODBUS communication method and system based on thermal power DCS
CN118277478A (en) Method, device and storage medium for processing database
JP2015049600A (en) Peripheral equipment controller, peripheral equipment control method and peripheral equipment control program
CN116506377A (en) Data processing method, system, equipment and medium applied to data processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination