CN110618634A - 485 communication interface expansion device and communication method - Google Patents

485 communication interface expansion device and communication method Download PDF

Info

Publication number
CN110618634A
CN110618634A CN201910924274.2A CN201910924274A CN110618634A CN 110618634 A CN110618634 A CN 110618634A CN 201910924274 A CN201910924274 A CN 201910924274A CN 110618634 A CN110618634 A CN 110618634A
Authority
CN
China
Prior art keywords
communication interface
data information
communication
uplink data
downlink data
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
CN201910924274.2A
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.)
Shenzhen Yunhuilian Technology Co Ltd
Original Assignee
Shenzhen Yunhuilian Technology Co 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 Shenzhen Yunhuilian Technology Co Ltd filed Critical Shenzhen Yunhuilian Technology Co Ltd
Priority to CN201910924274.2A priority Critical patent/CN110618634A/en
Publication of CN110618634A publication Critical patent/CN110618634A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application provides a 485 communication interface expansion device and a communication method. The device comprises a circuit board, a first communication interface, a plurality of second communication interfaces and a single chip microcomputer. The first communication interface is electrically connected with the circuit board and is used for communicating with an upper computer. The plurality of second communication interfaces are electrically connected with the circuit board. Each second communication interface is electrically connected with one lighting and brightening sensing device. The single chip microcomputer is used for acquiring downlink data information transmitted by the upper computer through the first communication interface, recognizing a data head identifier of the downlink data information and then sending the downlink data information to the illumination brightening sensing equipment according to a preset rule. The singlechip is also used for receiving uplink data information sent by the plurality of lighting and brightening sensing equipment through the plurality of second communication interfaces, and adding a data head identifier corresponding to the second communication interface to each uplink data information. And sequentially sending the uplink data information added with the data head identification to an upper computer according to a preset priority order of the second communication interface based on a preset rule.

Description

485 communication interface expansion device and communication method
Technical Field
The application relates to the technical field of communication interface expansion, in particular to a 485 communication interface expansion device and a communication method.
Background
With the change of the internet of things technology, the urban lighting brightening industry further moves to a new direction of intelligent control and fine management from the initial timer control and remote control. And the access of terminal Internet of things sensing equipment such as a door opening and closing alarm, an electric energy meter reading adapter, a load current monitor and the like enables the illumination brightening management equipment of a single building to gradually approach the role of routing management of the building Internet of things equipment. The number of accessed terminal internet of things devices is increased, so that the number of hardware expansion interfaces is also increased.
Because the tail end sensing equipment of the internet of things belongs to communication low-speed equipment, the existing hardware expansion interface equipment mainly switches communication channels through a switch chip, and therefore an industrial 485 communication channel is expanded into a plurality of channels.
The switch chip is used for switching communication channels, so that communication data packet loss is easily caused although the price is economical and practical. Because the switch chip has a time limit when switching the communication channel, once the current channel is overtime, the current channel is forced to be switched to the next channel, and thus the packet loss of the communication data is caused.
Disclosure of Invention
Therefore, it is necessary to provide a 485 communication interface expansion device and a communication method for solving the problem of communication data packet loss in the existing hardware expansion interface equipment due to the fact that the switch chip is adopted for communication channel switching.
The utility model provides a 485 communication interface extension fixture, is applied to illumination brightening sensing equipment, includes:
a circuit board;
the first communication interface is electrically connected with the circuit board and is used for communicating with an upper computer;
the plurality of second communication interfaces are electrically connected with the circuit board, and each second communication interface is electrically connected with one lighting and brightening sensing device; and
the single chip microcomputer is electrically connected with the first communication interface and the plurality of second communication interfaces through the circuit board, and is used for acquiring downlink data information transmitted by the upper computer through the first communication interface, identifying a data head identifier of the downlink data information, and then sending the downlink data information to the lighting and brightening sensing equipment through the second communication interface corresponding to the data head identifier according to a preset rule;
the single chip microcomputer is further used for receiving uplink data information sent by the plurality of lighting and brightening sensing devices through the plurality of second communication interfaces, adding a data head identifier corresponding to the second communication interface to each uplink data information, and sending the plurality of uplink data information added with the data head identifiers to the upper computer through the first communication interface in sequence according to the preset priority order of the second communication interfaces on the basis of the preset rule;
the preset rule includes that if any one of the second communication interfaces continuously has multiple groups of uplink data information or downlink data information for transmission, after the single chip microcomputer finishes transmission of one group of uplink data information or downlink data information, the single chip microcomputer needs to poll the other second communication interfaces in sequence according to the preset priority order, and then can transmit the other uplink data information or downlink data information of the second communication interface again.
In one embodiment, the preset rule includes:
if the uplink data information requirement and the downlink data information requirement of the first communication interface occur simultaneously, preferentially transmitting the downlink data information;
and if the uplink data information requirement and the downlink data information requirement of the second communication interface occur simultaneously, preferentially transmitting the uplink data information.
In one embodiment, the 485 communication interface extension device further includes:
the first communication interface is electrically connected with the isolation communication chip through the circuit board, the first communication interface is electrically connected with the single chip microcomputer through one isolation communication chip, each second communication interface is electrically connected with the isolation communication chip through the circuit board, and each second communication interface is electrically connected with the single chip microcomputer through one isolation communication chip.
In one embodiment, the 485 communication interface extension device further includes:
the first communication interface corresponds to one LED indicator lamp, each second communication interface corresponds to one LED indicator lamp, and the LED indicator lamps are used for displaying the communication state of the first communication interface and/or the second communication interface.
In one embodiment, the 485 communication interface extension device further includes:
and the reset switch is electrically connected with the singlechip through the circuit board.
In one embodiment, the 485 communication interface extension device further includes:
the circuit board and the single chip microcomputer are arranged in the shell, and the first communication interfaces and the second communication interfaces are fixed on the side wall of the shell and exposed.
In one embodiment, the 485 communication interface extension device further includes:
and the protective tube is fixed on the side wall of the shell and is electrically connected with the circuit board.
In one embodiment, the first communication interface and the second communication interfaces are both RJ11 female sockets.
A 485 communication method, applied to the 485 communication interface extension device in any of the above embodiments, the method includes:
acquiring downlink data information transmitted by the upper computer through the first communication interface, identifying a data head identifier of the downlink data information, and sending the downlink data information to illumination brightening sensing equipment through the second communication interface corresponding to the data head identifier according to the preset rule in a downlink manner;
acquiring uplink data information sent by the plurality of lighting and brightening sensing equipment through the plurality of second communication interfaces, adding a data head identifier corresponding to the second communication interface to each uplink data information, and sending the plurality of uplink data information added with the data head identifiers to the upper computer through the first communication interface in sequence according to the preset priority order of the second communication interface based on the preset rule;
the preset rules include: if any one of the second communication interfaces continuously transmits a plurality of groups of uplink data information or downlink data information, after the singlechip finishes transmitting one group of uplink data information or downlink data information, the singlechip needs to poll the other second communication interfaces in sequence according to the preset priority order, and then the singlechip can transmit the other uplink data information or downlink data information of the second communication interface again.
In one embodiment, the preset rule further includes:
if the uplink data information requirement and the downlink data information requirement of the first communication interface occur simultaneously, preferentially transmitting the downlink data information;
and if the uplink data information requirement and the downlink data information requirement of the second communication interface occur simultaneously, preferentially transmitting the uplink data information.
Compared with the prior art, the 485 communication interface expansion device and the communication method have the advantages that the downlink data information transmitted by the upper computer is obtained through the first communication interface, the data head identification of the downlink data information is identified through the single chip microcomputer, and the downlink data information is sent to the lighting and brightening sensing equipment through the second communication interface corresponding to the data head identification according to the preset rule. Meanwhile, the single chip microcomputer can also receive uplink data information sent by the plurality of lighting and brightening sensing devices, and after a data head identifier corresponding to the second communication interface is added to each uplink data information, the plurality of uplink data information added with the data head identifiers sequentially pass through the first communication interface and the upper computer according to the preset priority sequence of the second communication interface based on the preset rule. By adopting the above mode, the data packet loss can be prevented, the reliability of data transmission is improved, and the production cost can be reduced.
Drawings
Fig. 1 is an exploded view of a 485 communication interface extension device according to an embodiment of the present disclosure;
fig. 2 is a control block diagram of a 485 communication interface extension device according to an embodiment of the present disclosure;
fig. 3 is a schematic application diagram of a 485 communication interface extension apparatus according to an embodiment of the present application;
fig. 4 is an overall schematic diagram of a 485 communication interface extension device according to an embodiment of the present application;
fig. 5 is an exploded view of a 485 communication interface extension device according to another embodiment of the present application;
fig. 6 is an overall schematic view of a 485 communication interface extension device according to another embodiment of the present application;
fig. 7 is a flowchart of a 485 communication method according to another embodiment of the present application.
10485 communication interface expansion device
100 circuit board
101 illumination brightening sensing device
200 first communication interface
201 upper computer
300 second communication interface
400 single chip microcomputer
500 keep apart communication chip
600 LED indicator light
610 power supply indicator lamp
620 power switch
700 reset switch
800 casing
810 upper cover
811 first via
812 second via
820 base
900 protective tube
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the present application are described in detail below with reference to the accompanying drawings. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of embodiments in many different forms than those described herein and those skilled in the art will be able to make similar modifications without departing from the spirit of the application and it is therefore not intended to be limited to the embodiments disclosed below.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Referring to fig. 1 to 4, an embodiment of the present application provides a 485 communication interface expansion device 10, which can be applied to lighting and brightening sensing equipment 101, such as a door opening and closing alarm, an electric energy meter reading adapter, a load current monitor, and the like. The 485 communication interface extension device 10 includes: the circuit board 100, the first communication interface 200, a plurality of second communication interfaces 300 and the single chip microcomputer 400. The first communication interface 200 is electrically connected to the circuit board 100. The first communication interface 200 is used for communicating with an upper computer 201. A plurality of the second communication interfaces 300 are electrically connected to the circuit board 100. Each of the second communication interfaces 300 is electrically connected to one of the illumination and brightness sensing devices 101. The single chip microcomputer 400 is electrically connected to the first communication interface 200 and the plurality of second communication interfaces 300 through the circuit board 100.
The single chip microcomputer 400 is configured to obtain downlink data information transmitted by the upper computer 201 through the first communication interface 200, identify a data header identifier of the downlink data information, and send the downlink data information to the lighting and brightening sensing device 101 through the second communication interface 300 corresponding to the data header identifier according to a preset rule in a downlink manner. The single chip microcomputer 400 is further configured to receive uplink data information sent by the plurality of lighting and brightening sensing devices 101 through the plurality of second communication interfaces 300, add a data header identifier corresponding to the second communication interface 300 to each uplink data information, and send the plurality of uplink data information with the data header identifier added to the upper computer 201 through the first communication interface 200 in sequence according to a preset priority order of the second communication interfaces 300 based on the preset rule.
The preset rule includes that if any one of the second communication interfaces 300 in the plurality of second communication interfaces 300 continuously transmits a plurality of groups of uplink data information or downlink data information, after the one group of uplink data information or downlink data information is transmitted by the single chip microcomputer 400, the other second communication interfaces 300 need to be polled in sequence according to the preset priority order, and then the other uplink data information or downlink data information of the second communication interface 300 can be transmitted again.
In one embodiment, the Circuit Board 100 may be a PCB (Printed Circuit Board). In one embodiment, the number of the second communication interfaces 300 may be at least two, so that the second communication interfaces 300 may receive uplink data information sent by at least two of the lighting and lightening sensing devices 101. I.e. the number of the second communication interfaces 300 is the same as the number of the lighting and brightening sensor devices 101. In one embodiment, the second communication interface 300 can be an RJ11 female socket, which has the advantage of quick plugging.
In one embodiment, the first communication interface 200 may be an RJ11 female socket. The first communication interface 200 can be electrically connected with the upper computer 201 through a 6P twisted copper core wire, so that information interaction with the upper computer 201 is realized. Specifically, two ends of the 6P twisted copper core wire are respectively provided with a plastic-sealed 6P RJ11 crystal head. One end of the crystal plug is inserted into the RJ11 seat of the upper computer 201, and the other end is inserted into the first communication interface 200, so that communication connection can be completed. Similarly, the second communication interface 300 may also perform information interaction with the lighting and brightening sensor apparatus 101 through a 6P twisted copper pair core.
After the communication line connection is completed, the power switch 620 may be turned on, so as to implement the power-on operation of the 485 communication interface expansion device 10. After the machine is started, the flow direction of 485 data has two directions, one is that the data flows downwards from the upper computer 201 to the 485 communication interface expansion device 10, and then flows downwards from the 485 communication interface expansion device 10 to the illumination brightening sensing equipment 101 at the tail end; the other is that the illumination brightening sensing equipment flows into the 485 communication interface expansion device 10 from the tail end upwards, and then flows into the upper computer 201 from the 485 communication interface expansion device 10 upwards.
Specifically, the single chip microcomputer 400 may obtain downlink data information transmitted by the upper computer 201 through the first communication interface 200, and perform identification analysis of a data header identifier on the downlink data information. In an embodiment said data header identifies information comprising from which of said second communication interfaces 300 the downstream data information should proceed downstream. After the single chip microcomputer 400 identifies the data header identifier, according to the information of the data header identifier, the downlink data information is sent to the lighting and brightening sensing device 101 in a downlink manner through the second communication interface 300 corresponding to the data header identifier according to the preset rule. Therefore, the downlink data information sent by the upper computer 201 is transmitted to the tail end of the lighting and lightening sensing equipment 101 through the 485 communication interface extension device 10 in a downlink manner.
In the data transmission process, the 485 communication interface expansion device 10 can perform data transmission according to the preset rule to prevent the problem of data robbing the communication bus, thereby ensuring normal and orderly communication. Specifically, the preset rule may include: if the uplink data information requirement and the downlink data information requirement of the first communication interface 200 occur at the same time, the downlink data information is preferentially transmitted. That is, the first communication interface 200 preferentially transmits the downlink data information, and after the transmission of the downlink data information is completed, the first communication interface may allow the transmission of the uplink data.
In one embodiment, the preset rule further includes: if the uplink data information requirement and the downlink data information requirement of the second communication interface 300 occur at the same time, the uplink data information is preferentially transmitted. That is, the second communication interface 300 preferentially transmits the uplink data information, and after the transmission of the uplink data information is completed, the second communication interface may allow the transmission of the downlink data.
In one embodiment, the preset rule further includes: if a plurality of second communication interfaces 300 simultaneously uplink data to the single chip microcomputer 400, the single chip microcomputer 400 needs to sequentially send the uplink data information transmitted by the second communication interfaces 300 to the upper computer 201 through the first communication interface 200 according to the preset priority order. For example, when the number of the second communication interfaces 300 is four, the four second communication interfaces 300 may be sorted from serial No. 1 to serial No. 4. When the uplink data is simultaneously sent to the single chip microcomputer 400, the single chip microcomputer 400 can sequentially transmit data information from number 1 to number 4 according to the serial number.
In an embodiment, when a plurality of groups of uplink data are continuously transmitted to the single chip microcomputer 400 by the second communication interface 300 with a certain serial number, after the single chip microcomputer 400 transmits a group of uplink data of the second communication interface 300 with the serial number, the remaining second communication interfaces 300 need to be polled in sequence according to the preset priority order, and after the polling is finished, the remaining uplink data of the second communication interface 300 with the serial number can be transmitted again, and so on until the data transmission is finished.
Similarly, when the single chip microcomputer 400 continuously transmits multiple sets of downlink data of the second communication interface 300 with a certain serial number, after the single chip microcomputer 400 transmits a set of downlink data of the second communication interface 300 with the serial number, the other second communication interfaces 300 need to be polled in sequence according to the preset priority order, and after polling is finished, the remaining downlink data of the second communication interface 300 with the serial number can be retransmitted, and so on until data transmission is finished. By the method, data packet loss can be prevented during data transmission, and the reliability of data transmission is improved.
In an embodiment, the single chip microcomputer 400 may receive the uplink data information sent by the lighting and brightening sensing devices 101 through the second communication interfaces 300, and add a data header identifier corresponding to the second communication interface 300 to each uplink data information. By means of said data header identification it is possible to determine through which of said second communication interfaces 300 the set of data was transmitted. Therefore, the upper computer 201 can recognize the uplink data information conveniently, and after the uplink data information is processed, the upper computer 201 can perform a next instruction added with the same data head identification.
Then, the single chip microcomputer 400 sends the plurality of pieces of uplink data information added with the data header identifier to the upper computer 201 through the first communication interface 200 in sequence according to the preset priority order of the second communication interface 300 based on the preset rule. Therefore, the uplink data information sent by the lighting and brightening sensing equipment 101 is transmitted to the upper computer 201 through the 485 communication interface extension device 10 in an uplink mode. In one embodiment, the header identification may be a 5 byte header.
In the process of data transmission, data that cannot be uplink-transmitted temporarily (i.e., the uplink data information added with the data header identifier) may be temporarily stored in the storage space of the single chip microcomputer 400, and after the data are sequentially uplink-transmitted, the storage space is cleared again for temporary storage when a plurality of uplink data of the second communication interface 300 arrive at the same time later again. Therefore, data packet loss caused by a peak of busy data transmission can be avoided, and the reliability of data transmission is improved.
In one embodiment, the 485 communication interface extension device 10 uses the single chip microcomputer 400 to process data, so that the overall cost of the 485 communication interface extension device 10 can be reduced, and the purpose of saving cost is achieved.
In this embodiment, the downlink data information transmitted by the upper computer 201 is acquired through the first communication interface 200, and after the data header identifier of the downlink data information is identified by the single chip microcomputer 400, the downlink data information is sent to the lighting and brightening sensing device 101 in a downlink manner through the second communication interface 300 corresponding to the data header identifier according to a preset rule. Meanwhile, the single chip microcomputer 400 may further receive uplink data information sent by the plurality of lighting and brightening sensing devices 101, add a data header identifier corresponding to the second communication interface to each uplink data information, and send the plurality of uplink data information added with the data header identifier to the upper computer 201 through the first communication interface 200 in sequence according to the preset priority order of the second communication interface 300 based on the preset rule. By adopting the above mode, the embodiment can not only prevent data packet loss and improve the reliability of data transmission, but also reduce the production cost.
In one embodiment, the 485 communication interface extension device 10 further includes: a plurality of isolated communication chips 500. The first communication interface 200 is electrically connected to one of the isolated communication chips 500 through the circuit board 100, and the first communication interface 200 transmits data information with the single chip microcomputer 400 through one of the isolated communication chips 500. Each of the second communication interfaces 300 is electrically connected to one of the isolated communication chips 500 through the circuit board 100, and each of the second communication interfaces 300 transmits data information with the single chip microcomputer 400 through one of the isolated communication chips 500.
In one embodiment, the sum of the number of the first communication interfaces 200 and the second communication interfaces 300 is the same as the number of the isolated communication chips 500, and the isolated communication chips 500 correspond to the first communication interfaces 200 and the second communication interfaces 300 one to one. In one embodiment, the isolated communication chip 500 may be a magnetically isolated communication chip. By setting the isolation communication chip 500, superimposed interference signals on the communication cable can be effectively isolated, so that the communication quality is greatly improved, data packet loss caused by communication error codes is prevented, and the reliability of data transmission is improved.
Referring to fig. 5 and 6, in an embodiment, the 485 communication interface extension device 10 further includes: a plurality of LED indicator lights 600. The first communication interface 200 corresponds to one of the LED indicator lamps 600. Each of the second communication interfaces 300 corresponds to one of the LED indicator lamps 600. The LED indicator lamp 600 is used for displaying the communication status of the first communication interface 200 and/or the second communication interface 300.
Specifically, when the first communication interface 200 and/or the second communication interface 300 has data uplink, the LED indicator lamp 600 corresponding to the first communication interface 200 and/or the plurality of second communication interfaces 300 is in a yellow flashing state. If the first communication interface 200 and/or the second communication interface 300 has data to go down, the LED indicator light 600 is in a green flashing state.
In one embodiment, the 485 communication interface extension device 10 further includes: the switch 700 is reset. The reset switch 700 is electrically connected to the single chip microcomputer 400 through the circuit board 100. When the 485 communication interface expansion device 10 is in use, if a breakdown type abnormality occurs, manual reset intervention can be performed through the reset switch 700 to recover the communication of the 485 communication interface expansion device 10.
In one embodiment, the 485 communication interface extension device 10 further includes: a housing 800. The circuit board 100 and the single chip microcomputer 400 are both disposed in the case 800. The first communication interface 200 and the plurality of second communication interfaces 300 are fixed to a sidewall of the housing 800 and exposed. In one embodiment, the housing 800 may be made of a plastic material.
In one embodiment, the housing 800 may include an upper cover 810 and a base 820. The base 820 and the upper cover 810 are fastened and installed by screws. Specifically, the method comprises the following steps. The base 820 has 4 screw hole columns, the circuit board 100 can be placed on the 4 screw hole columns of the base 820, then the upper cover 810 is buckled, screws are placed into the 4 screw holes of the base 820, and the screws are tightened, so that the fastening and installation can be completed.
In one embodiment, a plurality of LED indicators 600 may extend out of the housing 800 along the first through hole 811 of the upper cover 810, thereby facilitating the operator to observe the communication status. In one embodiment, the 485 communication interface extension device 10 further comprises a power indicator 610. The power indicator 610 is electrically connected to the circuit board. The power indicator 610 may be disposed within the housing 800 and extend out of the housing 800 along the second through hole 812 of the upper cover 810. And the power indicator 610 indicates whether the 485 communication interface expansion device 10 supplies power. Specifically, the power indicator 61 is displayed in red when power is supplied, and the power indicator 61 is turned off when no power is supplied. Thereby being convenient for the operating personnel to observe the power supply condition.
In one embodiment, the 485 communication interface extension device 10 further includes: the fuse tube 900. The fuse tube 900 is fixed to a sidewall of the housing 800 and electrically connected to the circuit board 100. When the current or voltage in the power supply line suddenly increases and changes, the fuse tube 900 in the 485 communication interface expansion device 10 will fuse in time to disconnect the power supply line, thereby protecting the rear end circuit and avoiding damage.
Referring to fig. 7, an embodiment of the present application provides a 485 communication method applied to the 485 communication interface extension device 10 according to any of the above embodiments, where the method includes:
s102: acquiring downlink data information transmitted by the upper computer 201 through the first communication interface 200, identifying a data head identifier of the downlink data information, and sending the downlink data information to the lighting and lightening sensing equipment 101 through the second communication interface 300 corresponding to the data head identifier according to the preset rule.
In one embodiment, the single chip microcomputer 400 may obtain downlink data information transmitted by the upper computer 201 through the first communication interface 200, and perform identification analysis of a data header identifier on the downlink data information. In an embodiment said data header identifies information comprising from which of said second communication interfaces 300 the downstream data information should proceed downstream. After the single chip microcomputer 400 identifies the data header identifier, according to the information of the data header identifier, the downlink data information is sent to the lighting and brightening sensing device 101 in a downlink manner through the second communication interface 300 corresponding to the data header identifier according to the preset rule. Therefore, the downlink data information sent by the upper computer 201 is transmitted to the tail end of the lighting and lightening sensing equipment 101 through the 485 communication interface extension device 10 in a downlink manner.
In one embodiment, the preset rules may include: if the uplink data information requirement and the downlink data information requirement of the first communication interface 200 occur at the same time, the downlink data information is preferentially transmitted. If the uplink data information requirement and the downlink data information requirement of the second communication interface 300 occur at the same time, the uplink data information is preferentially transmitted. If a plurality of second communication interfaces 300 simultaneously uplink data to the single chip microcomputer 400, the single chip microcomputer 400 needs to sequentially send the uplink data information transmitted by the second communication interfaces 300 to the upper computer 201 through the first communication interface 200 according to the preset priority order.
If there are multiple groups of uplink data information or downlink data information transmitted continuously by any one of the second communication interfaces 300 in the plurality of second communication interfaces 300, after the one group of uplink data information or downlink data information is transmitted by the single chip microcomputer 400, the remaining second communication interfaces 300 need to be polled in sequence according to the preset priority order, and then the remaining uplink data information or downlink data information of the second communication interface 300 can be transmitted again, and so on until the data transmission is completed. By the method, data packet loss can be prevented during data transmission, and the reliability of data transmission is improved.
S104: the method comprises the steps of obtaining uplink data information sent by a plurality of lighting and brightening sensing devices 101 through a plurality of second communication interfaces 300, adding a data head identifier corresponding to the second communication interface 300 to each uplink data information, and sending the plurality of uplink data information added with the data head identifiers to the upper computer 201 through the first communication interface 200 in sequence according to the preset priority order of the second communication interfaces 300 based on the preset rules.
In an embodiment, the single chip microcomputer 400 may receive the uplink data information sent by the lighting and brightening sensing devices 101 through the second communication interfaces 300, and add a data header identifier corresponding to the second communication interface 300 to each uplink data information. The host computer 201 can identify through the data header which of the second communication interfaces 300 the group of data is transmitted through. After processing the uplink data information, the upper computer 201 will perform a next instruction with the same data header identifier.
Then, the single chip microcomputer 400 sends the plurality of pieces of uplink data information added with the data header identifier to the upper computer 201 through the first communication interface 200 in sequence according to the preset priority order of the second communication interface 300 based on the preset rule. Therefore, the uplink data information sent by the lighting and brightening sensing equipment 101 is transmitted to the upper computer 201 through the 485 communication interface extension device 10 in an uplink mode.
In the process of data transmission, data that cannot be uplink-transmitted temporarily (i.e., the uplink data information added with the data header identifier) may be temporarily stored in the storage space of the single chip microcomputer 400, and after the data are sequentially uplink-transmitted, the storage space is cleared again for temporary storage when a plurality of uplink data of the second communication interface 300 arrive at the same time later again. Therefore, data packet loss caused by a peak of busy data transmission can be avoided, and the reliability of data transmission is improved.
To sum up, this application passes through first communication interface 200 acquires the downlink data information of host computer 201 transmission, through singlechip 400 discerns behind downlink data information's the data head sign, and will downlink data information according to predetermineeing the rule through with the data head sign corresponds second communication interface 300 downlink sends to illumination brightening sensing equipment 101. Meanwhile, the single chip microcomputer 400 may further receive uplink data information sent by the plurality of lighting and brightening sensing devices 101, add a data header identifier corresponding to the second communication interface to each uplink data information, and send the plurality of uplink data information added with the data header identifier to the upper computer 201 through the first communication interface 200 in sequence according to the preset priority order of the second communication interface 300 based on the preset rule. By adopting the above mode, the data packet loss can be prevented, and the reliability of data transmission is improved.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. The 485 communication interface expansion device is applied to lighting and brightening sensing equipment (101), and is characterized by comprising:
a circuit board (100);
the first communication interface (200) is electrically connected with the circuit board (100) and is used for communicating with an upper computer (201);
a plurality of second communication interfaces (300) electrically connected to the circuit board (100), each of the second communication interfaces (300) being electrically connected to one of the illumination and brightness sensing devices (101); and
the single chip microcomputer (400) is electrically connected with the first communication interface (200) and the plurality of second communication interfaces (300) through the circuit board (100), and the single chip microcomputer (400) is used for acquiring downlink data information transmitted by the upper computer (201) through the first communication interface (200), identifying a data head identifier of the downlink data information, and sending the downlink data information to the lighting and brightening sensing equipment (101) through the second communication interface (300) corresponding to the data head identifier according to a preset rule in a downlink mode;
the single chip microcomputer (400) is further configured to receive uplink data information sent by the plurality of lighting and brightening sensing devices (101) through the plurality of second communication interfaces (300), add a data header identifier corresponding to each second communication interface (300) to each uplink data information, and send the plurality of uplink data information added with the data header identifiers to the upper computer (201) through the first communication interface (200) in sequence according to the preset priority order of the second communication interfaces (300) based on the preset rule;
the preset rule includes that if any one of the second communication interfaces (300) in the plurality of second communication interfaces (300) continuously transmits a plurality of groups of uplink data information or downlink data information, after the single chip microcomputer (400) finishes transmitting a group of uplink data information or downlink data information, the other second communication interfaces (300) need to be polled in sequence according to the preset priority order, and then the other uplink data information or downlink data information of the second communication interface (300) can be transmitted again.
2. The 485 communication interface extension device of claim 1, wherein the predefined rules comprise:
if the uplink data information requirement and the downlink data information requirement of the first communication interface (200) occur simultaneously, downlink data information is transmitted preferentially;
and if the uplink data information requirement and the downlink data information requirement of the second communication interface (300) occur simultaneously, preferentially transmitting the uplink data information.
3. The 485 communication interface extension device of claim 1, further comprising:
a plurality of keep apart communication chip (500), first communication interface (200) pass through circuit board (100) and one keep apart communication chip (500) electricity and connect, just first communication interface (200) are through one keep apart communication chip (500) with singlechip (400) transmission data information, every second communication interface (300) all pass through circuit board (100) and one keep apart communication chip (500) electricity and connect, and every second communication interface (300) all pass through one keep apart communication chip (500) with singlechip (400) transmission data information.
4. The 485 communication interface extension device of claim 1, further comprising:
the LED communication interface comprises a plurality of LED indicating lamps (600), the first communication interface (200) corresponds to one LED indicating lamp (600), each second communication interface (300) corresponds to one LED indicating lamp (600), and the LED indicating lamps (600) are used for displaying the communication state of the first communication interface (200) and/or the second communication interface (300).
5. The 485 communication interface extension device of claim 1, further comprising:
and the reset switch (700) is electrically connected with the singlechip (400) through the circuit board (100).
6. The 485 communication interface extension device of any of claims 1-5, further comprising:
the circuit board (100) and the single chip microcomputer (400) are arranged in the shell (800), and the first communication interface (200) and the second communication interfaces (300) are fixed on the side wall of the shell (800) and exposed.
7. The 485 communication interface extension device of claim 6, further comprising:
and the fuse tube (900) is fixed on the side wall of the shell (800) and is electrically connected with the circuit board (100).
8. The 485 communication interface extension device of claim 6, wherein the first communication interface (200) and the plurality of second communication interfaces (300) are RJ11 female sockets.
9. A 485 communication method, applied to the 485 communication interface extension device (10) according to any of claims 1-5, the method comprising:
acquiring downlink data information transmitted by the upper computer (201) through the first communication interface (200), identifying a data head identifier of the downlink data information, and sending the downlink data information to the lighting and brightening sensing equipment (101) through the second communication interface (300) corresponding to the data head identifier according to the preset rule in a downlink manner;
acquiring uplink data information sent by the plurality of lighting and brightening sensing devices (101) through the plurality of second communication interfaces (300), adding a data head identifier corresponding to the second communication interface (300) to each uplink data information, and sending the plurality of uplink data information added with the data head identifiers to the upper computer (201) through the first communication interface (200) in sequence according to the preset priority sequence of the second communication interfaces (300) based on the preset rule;
the preset rules include: if any one of the second communication interfaces (300) in the plurality of second communication interfaces (300) continuously transmits a plurality of groups of uplink data information or downlink data information, after the single chip microcomputer (400) finishes transmitting a group of uplink data information or downlink data information, the other second communication interfaces (300) need to be polled in sequence according to the preset priority order, and then the other uplink data information or downlink data information of the second communication interface (300) can be transmitted again.
10. The 485 communication method of claim 1, wherein the predefined rules further comprise:
if the uplink data information requirement and the downlink data information requirement of the first communication interface (200) occur simultaneously, downlink data information is transmitted preferentially;
and if the uplink data information requirement and the downlink data information requirement of the second communication interface (300) occur simultaneously, preferentially transmitting the uplink data information.
CN201910924274.2A 2019-09-27 2019-09-27 485 communication interface expansion device and communication method Pending CN110618634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910924274.2A CN110618634A (en) 2019-09-27 2019-09-27 485 communication interface expansion device and communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910924274.2A CN110618634A (en) 2019-09-27 2019-09-27 485 communication interface expansion device and communication method

Publications (1)

Publication Number Publication Date
CN110618634A true CN110618634A (en) 2019-12-27

Family

ID=68924774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910924274.2A Pending CN110618634A (en) 2019-09-27 2019-09-27 485 communication interface expansion device and communication method

Country Status (1)

Country Link
CN (1) CN110618634A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840096A (en) * 2022-11-14 2023-03-24 杭州飞仕得科技股份有限公司 Data acquisition equipment and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420684A (en) * 2011-11-04 2012-04-18 展讯通信(上海)有限公司 Processing method of TCP (Transmission Control Protocol) data stream and communication device
CN202267957U (en) * 2011-09-23 2012-06-06 福建星网锐捷通讯股份有限公司 Interrupt expansion circuit in communication device
CN104142901A (en) * 2013-05-07 2014-11-12 北京化工大学 Implementation method of serial port multiplexer with transmission priority
CN105718403A (en) * 2016-01-18 2016-06-29 沈阳东软医疗系统有限公司 Expansion interface and method for data communication through same
CN105896215A (en) * 2016-06-17 2016-08-24 史晓祎 Cabin section concentrator
CN207399226U (en) * 2017-07-31 2018-05-22 北京华电众信技术股份有限公司 Network interface expanding unit
CN110071858A (en) * 2019-04-12 2019-07-30 杭州涂鸦信息技术有限公司 The anti-collision of 485 interface chips receives and dispatches switching circuit device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202267957U (en) * 2011-09-23 2012-06-06 福建星网锐捷通讯股份有限公司 Interrupt expansion circuit in communication device
CN102420684A (en) * 2011-11-04 2012-04-18 展讯通信(上海)有限公司 Processing method of TCP (Transmission Control Protocol) data stream and communication device
CN104142901A (en) * 2013-05-07 2014-11-12 北京化工大学 Implementation method of serial port multiplexer with transmission priority
CN105718403A (en) * 2016-01-18 2016-06-29 沈阳东软医疗系统有限公司 Expansion interface and method for data communication through same
CN105896215A (en) * 2016-06-17 2016-08-24 史晓祎 Cabin section concentrator
CN207399226U (en) * 2017-07-31 2018-05-22 北京华电众信技术股份有限公司 Network interface expanding unit
CN110071858A (en) * 2019-04-12 2019-07-30 杭州涂鸦信息技术有限公司 The anti-collision of 485 interface chips receives and dispatches switching circuit device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840096A (en) * 2022-11-14 2023-03-24 杭州飞仕得科技股份有限公司 Data acquisition equipment and method

Similar Documents

Publication Publication Date Title
US7808122B2 (en) Automatic sensing power systems and methods
US7812479B1 (en) Power sampling systems and methods
CN108292836A (en) Circuit protection system and method
US20090273334A1 (en) System and Method for Efficient Association of a Power Outlet and Device
CN104755882A (en) Circuit branch measuring system
US20020197907A1 (en) Universal wire harness for detectors
CN110618634A (en) 485 communication interface expansion device and communication method
CN114651379A (en) A charger
CN208656083U (en) Electric connector
CN104251931B (en) General changeable type charge indicating device
KR101902465B1 (en) Modulized controller of street lamp
EP2289140A1 (en) System and method for efficient association of a power outlet and device
CN109683108B (en) Hot-pluggable power supply monitoring device
US20170187648A1 (en) Signalling from port connections to switches
GB2527310A (en) Patchmate cable tracer and continuity tester
CN104838735A (en) Input module having a self-supporting connection
CN107635379B (en) Fan module, network equipment and fan information identification method
CN102650490A (en) Ultralow-temperature refrigerator electric cabinet provided with patch-cord misplug prevention function
KR101257652B1 (en) Motor control center using harness connectinon for stardinizing power control
CN111769535A (en) Intelligent protection automatic phase separation controller based on wireless network
CN210270879U (en) High-frequency instrument expansion device based on USB bus
EP2765589B1 (en) A smart fuse
KR102418183B1 (en) Patch panel system with network monitoring function, and communication cable management systems using the same
CN213149524U (en) Signal conditioning system based on Ethercat bus
CN213877969U (en) Plastic case circuit breaker

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191227