CN111817820B - Equipment coding method and device and coding system based on two buses - Google Patents

Equipment coding method and device and coding system based on two buses Download PDF

Info

Publication number
CN111817820B
CN111817820B CN202010469220.4A CN202010469220A CN111817820B CN 111817820 B CN111817820 B CN 111817820B CN 202010469220 A CN202010469220 A CN 202010469220A CN 111817820 B CN111817820 B CN 111817820B
Authority
CN
China
Prior art keywords
coding
encoding
instruction
local time
slave device
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.)
Active
Application number
CN202010469220.4A
Other languages
Chinese (zh)
Other versions
CN111817820A (en
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010469220.4A priority Critical patent/CN111817820B/en
Publication of CN111817820A publication Critical patent/CN111817820A/en
Application granted granted Critical
Publication of CN111817820B publication Critical patent/CN111817820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy
    • 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
    • H04L12/40006Architecture of a communication node

Abstract

The invention provides a device coding method and device and a coding system based on two buses, wherein the method comprises the following steps: sending a coding instruction to a slave device, wherein the coding instruction carries a first local time of a master device; receiving an encoding parameter fed back by the slave device based on the encoding instruction, wherein the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction; and setting the coding sequence number of the slave equipment according to the coding parameter. The invention solves the technical problem of high coding error rate in the related technology, shortens the coding time and the installation and debugging period of the equipment, does not need professional debugging personnel, reduces the debugging cost, and reduces the coding error rate by adopting an automatic coding mode.

Description

Equipment coding method and device and coding system based on two buses
Technical Field
The invention relates to the field of automation, in particular to a device coding method and device and a coding system based on two buses.
Background
In the related art, with the rapid development of mobile internet, internet of things and cloud computing, as an original entrance of information, a detector generally needs to be coded and networked or directly connected to the internet, and equipment in each network needs an identity for communication or searching.
In the related technology of the fire-fighting internet of things, the main coding mode of the fire alarm detectors such as temperature sensing detectors, smoke sensing detectors and the like of the two-bus type is to adopt an encoder to carry out manual coding. In many large-scale building, the field device quantity is huge, and the control is counted a lot, and manual coding's way is that the artificial fire alarm detectors such as smoke detector of earlier passing through the encoder code and then installing, does not only work load big like this, and the condition that has the mistake transmission number appears moreover, and the coding efficiency is low.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a device coding method and device and a coding system based on two buses, and aims to solve the technical problem of high coding error rate in the related technology.
According to an embodiment of the present invention, there is provided an encoding method of a device, including: sending a coding instruction to a slave device, wherein the coding instruction carries a first local time of a master device; receiving an encoding parameter fed back by the slave device based on the encoding instruction, wherein the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction; and setting the coding sequence number of the slave equipment according to the coding parameter.
Optionally, sending the encoding instruction to the slave device includes: sending a first encoding instruction to the slave device, wherein the first encoding instruction is used for instructing the slave device to read the second local time; and after the slave device reads the second local time, sending a second coding instruction to the slave device, wherein the second coding instruction carries the first local time.
Optionally, the number of the slave devices is multiple, and setting the coding sequence number of the slave device according to the coding parameter includes: ordering the encoding parameters of the plurality of slave devices; determining a sorting sequence number corresponding to each slave device as a coding sequence number; and respectively sending a control instruction to the plurality of slave devices, wherein the control instruction is used for instructing the slave devices to update the local addresses to the code sequence numbers.
Optionally, before sending the encoding instruction to the slave device, the method further includes: determining that the master device is connected with the slave device in a bus topology of a hand-in-hand; clock synchronizing the slave device based on the local clock of the master device.
According to an embodiment of the present invention, there is provided an encoding method of another apparatus, including: receiving a coding instruction from a main device, wherein the coding instruction carries a first local time of the main device; calculating a coding parameter according to the first local time, and sending the coding parameter to the main equipment; and receiving a coding sequence number fed back by the main equipment based on the coding parameter, and updating a local address by using the coding sequence number.
Optionally, calculating the encoding parameter according to the first local time includes: acquiring a second local time of the local equipment when the local equipment receives the coding instruction; calculating a time difference between the first local time and the second local time; and calculating the coding parameters according to the time difference and a preset coding coefficient.
According to another embodiment of the present invention, there is provided an encoding apparatus of a device, including: the device comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a coding instruction to the slave device, and the coding instruction carries the first local time of the master device; a receiving module, configured to receive an encoding parameter fed back by the slave device based on the encoding instruction, where the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction; and the equipment module is used for setting the coding serial number of the slave equipment according to the coding parameter.
Optionally, the sending module includes: a first sending unit, configured to send a first encoding instruction to the slave device, where the first encoding instruction is used to instruct the slave device to read the second local time; and a second sending unit, configured to send a second encoding instruction to the slave device after the slave device reads the second local time, where the second encoding instruction carries the first local time.
Optionally, the number of the slave devices is multiple, and the setting module includes: the sequencing unit is used for sequencing the coding parameters of the plurality of slave devices; the determining unit is used for determining the sequencing serial number corresponding to the slave equipment as a coding serial number for each slave equipment; a sending unit, configured to send a control instruction to each of the plurality of slave devices, where the control instruction is used to instruct the slave device to update a local address to the code sequence number.
Optionally, the apparatus further comprises: the determining module is used for determining that the master device is connected with the slave device in a bus topology of a hand-in-hand before the sending module sends the coding instruction to the slave device; a synchronization module to perform clock synchronization on the slave device based on a local clock of the master device.
According to another embodiment of the present invention, there is provided an encoding apparatus of another device, including: the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a coding instruction from a main device, and the coding instruction carries a first local time of the main device; the processing module is used for calculating a coding parameter according to the first local time and sending the coding parameter to the main equipment; and the coding module is used for receiving a coding sequence number fed back by the main equipment based on the coding parameter and updating a local address by using the coding sequence number.
Optionally, the processing module includes: the acquisition unit is used for acquiring a second local time when the local equipment receives the coding instruction; a first calculation unit configured to calculate a time difference between the first local time and the second local time; and the second calculating unit is used for calculating the coding parameters according to the time difference and preset coding coefficients.
According to another embodiment of the present invention, there is also provided a two-bus based coding system, including a central control device and several fire fighting probes, which are connected by a bus topology using a hand-pulling device, wherein the central control device includes the apparatus as described in the above embodiments, and the fire fighting probes include the apparatus as described in the above embodiments.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps in any of the apparatus embodiments described above when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the coding instruction carrying the first local time of the master device is sent to the slave device, then the coding parameter fed back by the slave device based on the coding instruction is received, the coding serial number of the slave device is set according to the coding parameter, and the technical problem of high coding error rate in the related technology is solved by adopting an automatic coding mode of the master device and the slave device based on time difference, so that the coding time and the installation and debugging period of the device are shortened, professional debugging personnel are not needed, the debugging cost is reduced, and the coding error rate is reduced by adopting an automatic coding mode.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of an encoding controller of an apparatus according to an embodiment of the present invention;
FIG. 2 is a flow chart of an encoding method of a device according to an embodiment of the present invention;
FIG. 3 is a network architecture diagram of an embodiment of the present invention;
FIG. 4 is a flow chart of an encoding method of another device according to an embodiment of the present invention;
FIG. 5 is an automated encoding flow diagram of an embodiment of the present invention;
FIG. 6 is a block diagram of an apparatus encoding device according to an embodiment of the present invention;
fig. 7 is a block diagram of a coding apparatus of another device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method embodiments provided in the first embodiment of the present application may be executed in a processor, a computer, a detector, a controller, or similar electronic devices. Taking the operation on the controller as an example, fig. 1 is a block diagram of a coding controller of a device according to an embodiment of the present invention. As shown in fig. 1, the controller 10 may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is merely illustrative and is not intended to limit the structure of the controller. For example, the controller 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a controller program, for example, a software program and a module of application software, such as a controller program corresponding to a coding control method of a device in an embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the controller program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the controller 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the controller 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, an encoding method of a device is provided, and fig. 2 is a flowchart of an encoding method of a device according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, sending a coding instruction to the slave device, wherein the coding instruction carries the first local time of the master device;
the network architecture applied in this embodiment includes a master device and a slave device, where the master device may be a control device of a single device, or may be a device with a control function selected from multiple devices, and the first local time is the local time of the master device, and when the master device is connected to the multiple slave devices, the first local times received by the multiple slave devices are the same.
Step S204, receiving a coding parameter fed back by the slave device based on the coding instruction, wherein the coding parameter is generated according to the time difference between the first local time and the second local time, and the second local time is the time when the slave device receives the coding instruction;
and step S206, setting the coding serial number of the slave device according to the coding parameters.
The coded serial number of this embodiment may be a communication address, a physical address, a user number of the slave device, or other types of identification addresses.
Through the steps, the coding instruction carrying the first local time of the master device is sent to the slave device, then the coding parameter fed back by the slave device based on the coding instruction is received, the coding sequence number of the slave device is set according to the coding parameter, and the technical problem of high coding error rate in the related technology is solved by adopting an automatic coding mode of the master device and the slave device based on time difference, so that the coding time and the installation and debugging period of the device are shortened, professional debugging personnel are not needed, the debugging cost is reduced, and the coding error rate is reduced by adopting an automatic coding mode.
In an embodiment of this embodiment, sending the encoding instruction to the slave device includes: sending a first encoding instruction to the slave device, wherein the first encoding instruction is used for indicating the slave device to read a second local time; and after reading the second local time from the slave device, sending a second coding instruction to the slave device, wherein the second coding instruction carries the first local time.
In another embodiment, the master device sends the encoding instruction only once, and the encoding instruction carries the first local time, and after receiving the encoding instruction, each slave device can obtain the second local time of the slave device and perform processing based on the second local time and the first local time.
In this embodiment, the number of the slave devices may be one or more, and when there are a plurality of slave devices, setting the code sequence number of the slave device according to the coding parameter includes:
s11, sorting the coding parameters of the plurality of slave devices;
in the present embodiment, the encoding parameters are numbers in predetermined units, such as time, distance, and the like, and the slave devices including the slave device 1, the slave device 2, and the slave device 3 are exemplified as follows: the encoding parameters of the slave device 1, the slave device 2 and the slave device 3 are respectively T1, T2 and T3, and by sorting, T1> T2> T3;
s12, determining the sorting sequence number corresponding to the slave device as the coding sequence number for each slave device;
the sorting serial numbers may be converted and mapped to obtain corresponding coding serial numbers, for example, a, b, and c for device 1, slave device 2, and slave device 3, respectively, by performing sequential coding according to mother-son abcd …, or 001,002, and 003 for device 1, slave device 2, and slave device 3, respectively, by performing sequential coding according to numbers.
And S13, respectively sending control instructions to the plurality of slave devices, wherein the control instructions are used for instructing the slave devices to update the local addresses to the code sequence numbers.
Optionally, before sending the encoding instruction to the slave device, the method further includes: determining that the master equipment is connected with the slave equipment in a bus topology of a hand-in-hand; the slave devices are clocked based on the local clock of the master device. Through clock synchronization, the reference time of the master device and the slave device can be calibrated, and coding errors caused by time errors are avoided.
Fig. 3 is a network architecture diagram of an embodiment of the present invention, where a master device is a central control device, a slave device is a detector (including a detector 1, a detector 2, and a detector 3), the central control device and the detector are connected by a bus topology using a hand, each path has only one start device and one end device, and distances from the detectors to the bus are substantially the same and distances between the detectors are longer during actual installation.
In this embodiment, another encoding method for a device is provided, and fig. 4 is a flowchart of an encoding method for another device according to an embodiment of the present invention, which is applied to a slave device, as shown in fig. 4, the flowchart includes the following steps:
step S402, receiving a coding instruction from the main device, wherein the coding instruction carries a first local time of the main device;
step S404, calculating a coding parameter according to the first local time, and sending the coding parameter to the main equipment;
and step S406, receiving the coding sequence number fed back by the main device based on the coding parameter, and updating the local address by using the coding sequence number.
Optionally, calculating the encoding parameter according to the first local time includes:
s21, acquiring a second local time when the local device receives the coding instruction;
the following description will be given by taking slave devices including slave device 1, slave device 2, and slave device 3 as examples: the slave device 1, the slave device 2 and the slave device 3 receive the encoding commands at the times T1, T2 and T3 respectively;
s22, calculating the time difference between the first local time and the second local time;
since the first local time is the same, taking T as an example, the time differences calculated by the slave device 1, the slave device 2, and the slave device 3 are respectively: T1-T, T2-T, T3-T;
and S23, calculating the coding parameters according to the time difference and the preset coding coefficient.
In an example of the embodiment, an automatic encoding method for a detector based on a fire-fighting two-bus is provided, and according to the scheme of the embodiment, equipment can be directly installed, and then an encoding command is sent through a central control device, so that slave devices can automatically encode in sequence. The central control equipment sends out a coding command, each detector realizes automatic coding according to the time difference of the received command, the coding number is calculated according to the signal delay time, the purpose of automatically distributing the equipment address is realized, and each slave equipment automatically obtains the coding through the control of the central control equipment, so that manual coding is avoided. In this embodiment, the master device and the slave device are connected in parallel in a "master-slave" manner, and the time in a unified time zone is recorded when the central control device and each alarm detector leave a factory and is clocked by the same high-precision clock unit.
FIG. 5 is a flow chart of automatic encoding according to an embodiment of the present invention, including the following steps:
step S501, when automatic coding operation is required, the central control equipment reads the current time T and sends a coding command to inform all connected alarm detectors on the bus;
step S502, after receiving the coding command, reading the current time by each alarm detector, wherein the time for the coding signal to reach each alarm detector is different because the signal is transmitted on the communication line and has time delay, so that the time read by the alarm detector 1 is T + delta T1, the time read by the alarm detector 2 is T + delta T1+ delta T2, the time read by the alarm detector 3 is T + delta T1+ delta T2+ delta T3, and so on;
step S503, after all the detectors finish reading time, the central control equipment informs all the detectors of time T;
step S504, each detector subtracts the time read by the local computer from T to obtain each signal delay time delta T, multiplies the delta T by the same coding coefficient a to obtain a number a delta T, for example, the number of the detector 1 is a delta T1, the number of the detector 2 is a (delta T1+ delta T2), the number of the detector 3 is a (delta T1+ delta T2+ delta T3) … …, writes the numbers into a register for storing the local computer address, and then packs and transmits the numbers back to the central control device;
in step S505, because the numbers are different in size, the central control device successively roll names the devices with corresponding numbers in the order from small to large and makes the modified local addresses 1,2,3 … … in order, that is, the probe 1 changes the address a Δ t1 to 1, the probe 2 changes the address a (Δ t1+ Δ t2) to 2, and the probe 3 changes the address a (Δ t1+ Δ t2+ Δ t3) to 3 … …, so as to achieve the purpose of automatically allocating addresses in order. The central control device commands the detector 1 to change the number a delta t1 to 1, commands the detector 2 to change the number a (delta t1+ delta t2) to 2, and so on, so as to achieve the aim of reassigning the number, because the number of a delta is not intuitive and clear like the number of 001,002,003,
the equipment coding mode of the embodiment can be applied to engineering projects, and because the manual coding mode is not only low in efficiency, but also easy to make mistakes. The scheme of the embodiment can realize on-site efficient equipment coding and shorten the installation period. The single person can accomplish the coding work, need not professional debugging personnel, reduce the cost. The automatic coding mode reduces the coding error rate.
Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, an encoding apparatus of a device and an encoding system based on two buses are also provided, which are used to implement the foregoing embodiments and preferred embodiments, and are not described again after being described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
The embodiment provides an encoding apparatus of a device, and fig. 6 is a block diagram of a structure of the encoding apparatus of the device according to the embodiment of the present invention, where the apparatus includes: a sending module 60, a receiving module 62, a setting module 64, wherein,
a sending module 60, configured to send an encoding instruction to a slave device, where the encoding instruction carries a first local time of a master device;
a receiving module 62, configured to receive an encoding parameter fed back by the slave device based on the encoding instruction, where the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction;
and a setting module 64, configured to set the coding sequence number of the slave device according to the coding parameter.
Optionally, the sending module includes: a first sending unit, configured to send a first encoding instruction to the slave device, where the first encoding instruction is used to instruct the slave device to read the second local time; and a second sending unit, configured to send a second encoding instruction to the slave device after the slave device reads the second local time, where the second encoding instruction carries the first local time.
Optionally, the number of the slave devices is multiple, and the setting module includes: the sequencing unit is used for sequencing the coding parameters of the plurality of slave devices; the determining unit is used for determining the sequencing serial number corresponding to the slave equipment as a coding serial number for each slave equipment; a sending unit, configured to send a control instruction to each of the plurality of slave devices, where the control instruction is used to instruct the slave device to update a local address to the code sequence number.
Optionally, the apparatus further comprises: the determining module is used for determining that the master device is connected with the slave device in a bus topology of a hand-in-hand before the sending module sends the coding instruction to the slave device; a synchronization module to perform clock synchronization on the slave device based on a local clock of the master device.
The embodiment provides an encoding apparatus of another device, and fig. 7 is a block diagram of a structure of the encoding apparatus of another device according to the embodiment of the present invention, where the apparatus includes: a receiving module 70, a processing module 72, an encoding module 74, wherein,
a receiving module 70, configured to receive an encoding instruction from a master device, where the encoding instruction carries a first local time of the master device;
the processing module 72 is configured to calculate a coding parameter according to the first local time, and send the coding parameter to the master device;
and the encoding module 74 is configured to receive a coding sequence number fed back by the master device based on the coding parameter, and update the local address by using the coding sequence number.
Optionally, the processing module includes: the acquisition unit is used for acquiring a second local time when the local equipment receives the coding instruction; a first calculation unit configured to calculate a time difference between the first local time and the second local time; and the second calculating unit is used for calculating the coding parameters according to the time difference and preset coding coefficients.
The embodiment also provides a coding system based on two buses, which is applied to a fire-fighting network and comprises a central control device and a plurality of fire-fighting detectors (such as temperature-sensing, smoke-sensing and other fire alarm detectors) which are connected in a bus topology by a hand-in-hand, wherein the central control device comprises the device described in the above embodiment, and the fire-fighting detectors comprise the device described in the above embodiment.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in an aspect of the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, sending an encoding instruction to the slave device, wherein the encoding instruction carries the first local time of the master device;
s2, receiving an encoding parameter fed back by the slave device based on the encoding instruction, where the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction;
and S3, setting the coding serial number of the slave device according to the coding parameter.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in an aspect of this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, sending an encoding instruction to the slave device, wherein the encoding instruction carries the first local time of the master device;
s2, receiving an encoding parameter fed back by the slave device based on the encoding instruction, where the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction;
and S3, setting the coding serial number of the slave device according to the coding parameter.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method of encoding for a device, comprising:
sending a coding instruction to a slave device, wherein the coding instruction carries a first local time of a master device;
receiving an encoding parameter fed back by the slave device based on the encoding instruction, wherein the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction;
and setting the coding sequence number of the slave equipment according to the coding parameter.
2. The method of claim 1, wherein sending the encoding instructions to the slave device comprises:
sending a first encoding instruction to the slave device, wherein the first encoding instruction is used for instructing the slave device to read the second local time;
and after the slave device reads the second local time, sending a second coding instruction to the slave device, wherein the second coding instruction carries the first local time.
3. The method of claim 1, wherein the slave device is multiple, and wherein setting the coding sequence number of the slave device according to the coding parameter comprises:
ordering the encoding parameters of the plurality of slave devices;
determining a sorting sequence number corresponding to each slave device as a coding sequence number;
and respectively sending a control instruction to the plurality of slave devices, wherein the control instruction is used for instructing the slave devices to update the local addresses to the code sequence numbers.
4. The method of claim 1, wherein prior to sending the encoding instructions to the slave device, the method further comprises:
determining that the master device is connected with the slave device in a bus topology of a hand-in-hand;
clock synchronizing the slave device based on the local clock of the master device.
5. A method of encoding for a device, comprising:
receiving a coding instruction from a main device, wherein the coding instruction carries a first local time of the main device;
calculating a coding parameter according to the first local time, and sending the coding parameter to the main equipment;
and receiving a coding sequence number fed back by the main equipment based on the coding parameter, and updating a local address by using the coding sequence number.
6. The method of claim 5, wherein computing the encoding parameter based on the first local time comprises:
acquiring a second local time of the local equipment when the local equipment receives the coding instruction;
calculating a time difference between the first local time and the second local time;
and calculating the coding parameters according to the time difference and a preset coding coefficient.
7. An encoding apparatus of a device, comprising:
the device comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a coding instruction to the slave device, and the coding instruction carries the first local time of the master device;
a receiving module, configured to receive an encoding parameter fed back by the slave device based on the encoding instruction, where the encoding parameter is generated according to a time difference between the first local time and a second local time, and the second local time is a time when the slave device receives the encoding instruction;
and the setting module is used for setting the coding serial number of the slave equipment according to the coding parameter.
8. An encoding apparatus of a device, comprising:
the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a coding instruction from a main device, and the coding instruction carries a first local time of the main device;
the processing module is used for calculating a coding parameter according to the first local time and sending the coding parameter to the main equipment;
and the coding module is used for receiving a coding sequence number fed back by the main equipment based on the coding parameter and updating a local address by using the coding sequence number.
9. A two-bus based coding system, comprising a central control device and a plurality of fire fighting probes connected by a bus topology of hand-pulling, wherein the central control device comprises the apparatus of claim 7, and the fire fighting probes comprise the apparatus of claim 8.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202010469220.4A 2020-05-28 2020-05-28 Equipment coding method and device and coding system based on two buses Active CN111817820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010469220.4A CN111817820B (en) 2020-05-28 2020-05-28 Equipment coding method and device and coding system based on two buses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010469220.4A CN111817820B (en) 2020-05-28 2020-05-28 Equipment coding method and device and coding system based on two buses

Publications (2)

Publication Number Publication Date
CN111817820A CN111817820A (en) 2020-10-23
CN111817820B true CN111817820B (en) 2021-08-20

Family

ID=72847765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010469220.4A Active CN111817820B (en) 2020-05-28 2020-05-28 Equipment coding method and device and coding system based on two buses

Country Status (1)

Country Link
CN (1) CN111817820B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077616B (en) * 2021-03-24 2023-05-30 深圳市高新投三江电子股份有限公司 Intelligent coding control method, device and equipment for automatic fire alarm and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181659A (en) * 2016-03-10 2017-09-19 深圳市祈飞科技有限公司 Intelligent cabinet communication means and system based on RS485 buses
CN107368432A (en) * 2017-07-14 2017-11-21 上海冉能自动化科技有限公司 logical address allocation method
CN108446888A (en) * 2018-02-09 2018-08-24 惠州市蓝微新源技术有限公司 The method for numbering serial and its numbering system of battery management system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004064341A (en) * 2002-07-26 2004-02-26 Uniden Corp Wireless terminal device, communication system, and communication control method
US10524267B2 (en) * 2018-01-11 2019-12-31 Cisco Technology, Inc. Traffic and mobility aware virtual access points
CN109976216A (en) * 2019-03-29 2019-07-05 浙江理工大学 A kind of CAN controller and control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181659A (en) * 2016-03-10 2017-09-19 深圳市祈飞科技有限公司 Intelligent cabinet communication means and system based on RS485 buses
CN107368432A (en) * 2017-07-14 2017-11-21 上海冉能自动化科技有限公司 logical address allocation method
CN108446888A (en) * 2018-02-09 2018-08-24 惠州市蓝微新源技术有限公司 The method for numbering serial and its numbering system of battery management system

Also Published As

Publication number Publication date
CN111817820A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
US10754329B2 (en) Automatic distribution of device parameters for commissioning portions of a disconnected process control loop
EP3211497A1 (en) Master device, slave device, information processing device, event log collecting system, control method of master device, control method of slave device and control program
CN103403692B (en) Data transmission device
JP6355275B2 (en) Realization method of broadband bus setting management in industrial Internet site
KR101480642B1 (en) Event input module
US20190265668A1 (en) Simulation device and simulation method
CN111817820B (en) Equipment coding method and device and coding system based on two buses
CN108316975A (en) A kind of coal mine safety monitoring system sensor address auto-allocation method
CN105278413A (en) Communication method for upper computer and CAN equipment of same type
CN103444134A (en) Monitoring system, monitoring device, program for monitoring device, terminal device, and program for terminal device
CN110135532A (en) A kind of numerical control code method for down loading, device and equipment
CN111131536B (en) Efficient configuration method, device and system for communication address and electric meter
CN109656756A (en) Multi-core CPU board adjustment method and device, mobile memory medium
WO2016204986A1 (en) Rtu serial communication mechanism
JP6408277B2 (en) Data collection device and industrial network system
CN108271018B (en) Space camera electronics emulation test system
EP3528067A1 (en) Computing device and control system
US10482195B2 (en) Management method of an electric installation and management system of one such installation
CN108898201B (en) Information association system and method for solar assembly
CN113557692A (en) Network management device, management method, management program, and recording medium
CN112650815B (en) Method and device for synchronizing environment data, storage medium and electronic device
CN112367250A (en) Internet of things multi-protocol gateway
CN116166585A (en) BMC access control method and device and BMC system
CN117234993B (en) Parameter synchronization method, device, equipment and storage medium
CN111830895B (en) Data scheduling method, medium, PLC device and scheduling system based on PLC array

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
GR01 Patent grant
GR01 Patent grant