CN113946369A - Automatic adding method, device, system, equipment and storage medium of equipment - Google Patents
Automatic adding method, device, system, equipment and storage medium of equipment Download PDFInfo
- Publication number
- CN113946369A CN113946369A CN202111130301.2A CN202111130301A CN113946369A CN 113946369 A CN113946369 A CN 113946369A CN 202111130301 A CN202111130301 A CN 202111130301A CN 113946369 A CN113946369 A CN 113946369A
- Authority
- CN
- China
- Prior art keywords
- address
- host
- equipment
- instruction
- receiving
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000004048 modification Effects 0.000 claims abstract description 83
- 238000012986 modification Methods 0.000 claims abstract description 83
- 238000004891 communication Methods 0.000 claims abstract description 29
- 230000005540 biological transmission Effects 0.000 claims description 8
- 238000012790 confirmation Methods 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 8
- 230000003111 delayed effect Effects 0.000 claims description 3
- 230000001737 promoting effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 6
- 230000006855 networking Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/34—Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
- G06F9/355—Indexed addressing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/06—Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
- G06F12/0646—Configuration or reconfiguration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Small-Scale Networks (AREA)
Abstract
The embodiment of the invention discloses an automatic equipment adding method, a device, a system, equipment and a storage medium, wherein the method comprises the following steps: receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address; receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment; and performing data communication with the host device through the modified device address. This scheme is showing and is promoting equipment and adding efficiency.
Description
Technical Field
The embodiment of the application relates to the field of device communication, in particular to a method, a device, a system, a device and a storage medium for automatically adding devices.
Background
With the development of computer technology, the way of communication between devices is more and more flexible. For example, one master device can be connected with a plurality of slave devices, so that communication between the master device and different slave devices is realized.
In the prior art, when adding the slave device, a manual adding mode is usually adopted, for example, address information of the slave device is manually configured to realize communication with the master device. However, this method is cumbersome to operate, and when there are many additional devices, the efficiency of adding devices is low, and improvement is needed.
Disclosure of Invention
The embodiment of the invention provides an automatic equipment adding method, device, system, equipment and storage medium, solves the problems of complex equipment adding operation and long time consumption in the prior art, and obviously improves the equipment adding efficiency.
In a first aspect, an embodiment of the present invention provides an automatic device adding method, where the method includes:
receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address;
receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment;
and performing data communication with the host device through the modified device address.
In a second aspect, an embodiment of the present invention further provides an apparatus for automatically adding equipment, where the apparatus includes:
the system comprises an instruction receiving module, an address modification module and a query module, wherein the instruction receiving module is used for receiving an initial query instruction sent by host equipment and receiving an address modification instruction sent by the host equipment;
the command response module is used for sending first feedback data to the host device when a delay reply condition is met, sending an address modification command to the host device, wherein the initial query command is used for querying whether a slave device exists in a current device address, modifying the device address according to the address modification command, and sending second feedback data to the host device for informing the host device of completing address modification;
and the data transmission module is used for carrying out data communication with the host equipment through the modified equipment address.
In a third aspect, an embodiment of the present invention further provides an automatic device adding system, including a master device and a plurality of slave devices, where the slave devices are configured to:
receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address;
receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment;
and performing data communication with the host device through the modified device address.
In a fourth aspect, an embodiment of the present invention further provides an apparatus for automatically adding an apparatus, where the apparatus includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the device auto-add method according to the embodiment of the present invention.
In a fifth aspect, the embodiment of the present invention further provides a storage medium storing computer-executable instructions, which are used for executing the device automatic adding method according to the embodiment of the present invention when executed by a computer processor.
In the embodiment of the invention, by receiving an initial query instruction sent by host equipment, when a delay reply condition is met, first feedback data is sent to the host equipment for the host equipment to generate an address modification instruction, the address modification instruction sent by the host equipment is received, equipment address modification is carried out according to the address modification instruction, second feedback data is sent to the host equipment, and data communication is carried out with the host equipment through a modified equipment address. According to the scheme, automatic adding of the equipment to be added is achieved, manual setting of a user is not needed, and equipment adding efficiency is remarkably improved.
Drawings
Fig. 1 is a flowchart of an automatic device adding method according to an embodiment of the present invention;
fig. 2 is a flowchart of another automatic device adding method according to an embodiment of the present invention;
fig. 3 is a flowchart of another automatic device adding method according to an embodiment of the present invention;
fig. 4 is a flowchart of another automatic device adding method according to an embodiment of the present invention;
fig. 5 is a block diagram of an apparatus automatic adding device according to an embodiment of the present invention;
fig. 6 is a block diagram of an automatic device adding system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an automatic device adding device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
Fig. 1 is a flowchart of an apparatus automatic adding method according to an embodiment of the present invention, where this embodiment is applicable to apparatus addition, and the method may be executed by a slave apparatus in a networking apparatus, and specifically includes the following steps:
step S101, receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction.
The master device is a device for issuing a main instruction in networking, and the slave device is a device mainly for receiving the instruction and feeding back data. In one embodiment, the RS485 communication protocol is taken as an example, and the slave device includes a master device and a plurality of slave devices, the slave devices need to be efficiently added to implement a data communication transmission function, and when a new slave device needs to be added, the scheme can enable the slave device to be quickly added.
The initial query instruction is received by the slave device, and the master device is an instruction for querying whether the current device address is the slave device to be accessed. In one embodiment, when the slave device accesses the master device, random selection of device addresses is automatically performed within an available address range, for example, the available addresses are address 2 to address 230, and an exemplary randomly selected address may be address 100. When adding the slave device, the master device will sequentially inquire whether each available address has the slave device in the available address range, such as address 2 to address 230, and if so, add the slave device.
In one embodiment, after receiving the initial query instruction, when a delay reply condition is satisfied, the first feedback data is sent to the host device. The delayed reply condition may be that the data transmission is not listened to in the data bus within a set delay time (e.g., 3 seconds). The first feedback data is sent to the host device, and the host device can confirm that the device needing address modification exists after obtaining the first feedback data, and then sends an address modification instruction. The specific content of the first feedback data is not limited, and may be feedback data in any format of the initial query instruction, so as to inform the host device that the slave device receives the initial feedback instruction and can normally respond. In one embodiment, if the delay reply condition is not satisfied, the delay is continued for a preset time (for example, 3 seconds), and then whether the delay reply condition is satisfied is determined, if so, the initial query instruction is responded, otherwise, the delay waiting is continued.
Step S102, receiving an address modification instruction sent by the host equipment, modifying the equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment.
The address modification instruction is used for the slave device to modify the device address so as to modify the designated device address allocated to the final host device. Illustratively, the current device address of the slave device is a first address, and the first address is an address randomly selected by the slave device from available addresses sent by the master device. The address modification instruction comprises a first designated address sent by the host device, and the slave device replaces the first designated address with the first designated address to modify the device address.
And step S103, carrying out data communication with the host equipment through the modified equipment address.
And when the slave equipment needs to communicate with the host equipment, the slave equipment performs data interaction with the host equipment through the modified equipment address. If the slave device receives a sensor data acquisition command sent by the host device, the slave device responds to the command to acquire sensor data of the slave device and feed the sensor data back to the host device.
According to the scheme, when the device is automatically added, the initial query instruction sent by the master device is received, the master device is made to determine that the slave device to be added exists through responding to the initial query instruction, the address of the slave device is modified, and the slave device is finally added to the networking to realize the data communication between the slave device and the master device.
Fig. 2 is a flowchart of another method for automatically adding devices according to an embodiment of the present invention, which shows a manner for determining an available address by a slave device, and specifically includes the following steps:
step S201, receiving an address allocation instruction sent by the host device, where the address allocation instruction includes an available address range.
In one embodiment, the slave device first randomly selects an available address during the process of automatically accessing the master device. Specifically, the method receives an address allocation instruction sent by the host device, wherein the address allocation instruction comprises an available address range. When the available address range is the range of available addresses that can be allocated to the slave device by the master device when the device addition is performed. In the illustrated example, the host device address range is address 1 through address 245, where it is assumed that addresses 230 through 245 have been allocated with slave devices, address 1 is a uniformly set address reserved for the slave devices to be added, and the available address range is address 2 through address 229.
In one embodiment, during the process of adding the slave device to the host device, the host device performs automatic addition after performing device search on the available address range one by one to search for the slave device. Specifically, the master device searches whether the slave device exists in the current device address by sending an initial query instruction, and the slave device receives the initial query instruction, responds to the initial query instruction, and sends first feedback data to the master device to inform the master device that the slave device exists in the current device address, so that subsequent address modification and data communication are realized.
In one embodiment, the available address range may be calculated by the host device determining the available address range according to the number of devices currently accessed and a preset address range. The preset address range is an available address range of the host device, and the number of the access devices is the number of the slave devices currently networked with the host device. Optionally, the specific manner of determining the available address range may be that an address between the maximum address in the preset address range minus the address corresponding to the number of access devices and the minimum address in the preset address direction is the available address range, and if the range includes the default initial allocated address of the device to be accessed, such as address 1, the address is correspondingly removed from the available address range. Taking the preset address range as the address 1 to the address 80, the address 1 as the default initial allocation address of the device to be accessed, and the current number of the access devices is 20 as an example, the available address range is the address 2 to the address 60.
Step S202, randomly determining a first address in the available address range as a device address.
After receiving the available address range, randomly selecting the device address, and taking the selected result as the first address. Taking the above available addresses as addresses 2 through 60 as an example, the first address selected randomly may be 30.
Step S203, receiving an initial query instruction sent by the host device, and sending first feedback data to the host device when a delay reply condition is satisfied, where the first feedback data is used for the host device to send an address modification instruction.
Step S204, receiving an address modification instruction sent by the host equipment, modifying the equipment address according to the address modification instruction, and sending second feedback data to the host equipment.
And S205, carrying out data communication with the host equipment through the modified equipment address.
According to the scheme, when the device is newly added, the slave device automatically receives the available address range sent by the host device and randomly selects one address as the first address, so that when the host device traverses the first address during subsequent device addition, the initial query instruction of the first address is sent to the slave device, the slave device receives the initial query instruction and responds the initial query instruction to modify the address, subsequent communication with the host device is realized based on the modified address, the intelligent access of the slave device is realized, the complex manual operation is avoided, and the automatic addition of the device is realized.
On the basis of the above technical solution, before receiving an address assignment instruction sent by a host device, the method further includes: and acquiring an initial default address, and setting the equipment address as the initial default address. For example, the initial default address may be address 1, that is, after the slave device enters into the networking, the device address used by the slave device defaults to address 1, and the host device sends an address allocation instruction containing an available address range to address 1.
Fig. 3 is a flowchart of another method for automatically adding devices according to the embodiment of the present invention, which further optimizes the process of automatically adding devices, and specifically includes the following steps:
step S301, receiving an address allocation instruction sent by the host device, wherein the address allocation instruction comprises an available address range.
Step S302, randomly determining a first address in the available address range as a device address.
Step S303, receiving an initial query instruction sent by the host device, and sending first feedback data to the host device when a delay reply condition is satisfied, where the first feedback data is used for the host device to send an address modification instruction.
Step S304, receiving an address modification instruction sent by the host equipment, modifying the equipment address from a first address to a first specified address, and sending second feedback data to the host equipment.
Step S305, receiving an address confirmation instruction sent by the host device, where the address confirmation instruction includes a first specified address, and if the current device address is the first specified address, sending second feedback data to the host device.
In an embodiment, after receiving the address modification instruction to modify the address, the method further includes receiving an address confirmation instruction sent by the host device, and notifying the host device that the current slave device is correctly added by replying to the address confirmation instruction, and may execute step S306 to perform data transmission.
And S306, carrying out data communication with the host equipment through the modified equipment address.
According to the scheme, the slave device firstly receives the available address range sent by the host device, randomly selects one available address, then receives the initial query instruction through the address to respond to the address, receives the address modification instruction to modify the final device address, and successfully adds the slave device according to the setting of the host device.
On the basis of the above technical solution, before receiving the address modification instruction sent by the host device, the method further includes: receiving a sensor configuration acquisition instruction sent by the host equipment; sending sensor configuration information to the host device. The sensor configuration information comprises the type of the sensor, the sensor data range, the sensor data unit, the sensor data calculation formula and the like, and the sensor configuration information is sent to the host equipment so as to ensure that the host equipment can correctly analyze data when the host equipment performs data communication with the host equipment.
Fig. 4 is a flowchart of another method for automatically adding devices according to an embodiment of the present invention, which shows a method for reallocating available addresses, and specifically includes the following steps:
step S401, receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address.
Step S402, receiving an address reallocation instruction sent by the host equipment, wherein the address reallocation instruction comprises an updated available address range, and randomly determining a second address as an equipment address in the updated available address range.
In one embodiment, when the slave device performs automatic addition, after feeding back the first feedback data to the master device, if the master device also receives feedback data sent by other devices in the current device address, an address reallocation instruction is sent. And the slave equipment receives the address reallocation instruction sent by the host equipment and randomly selects the available address again. Optionally, the address reallocation instruction includes an updated available address range of the host device, for example, the original available address range is address 2 to address 230, and the updated available address range may be address 2 to address 200. Which is exemplified by the randomly selected address 120 among addresses 2 through 200 as the second address as the current device address.
Step S403, receiving an address modification instruction sent by the host device, modifying a device address according to the address modification instruction, and sending second feedback data to the host device to notify the host device of completion of address modification.
And S404, performing data communication with the host device through the modified device address.
According to the scheme, the second address is randomly determined to be the equipment address in the updated available address range by receiving the address reallocation instruction sent by the host equipment, so that only the local machine is connected with the host equipment under the current equipment address during subsequent address modification, the error of address modification is avoided, and the accuracy and efficiency of equipment addition are ensured.
Fig. 5 is a block diagram of an apparatus for automatically adding devices according to an embodiment of the present invention, where the apparatus is configured to execute the apparatus automatic adding method according to the embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes: an instruction receiving module 101, an instruction responding module 102 and a data transmitting module 103, wherein,
the instruction receiving module 101 is configured to receive an initial query instruction sent by a host device, and receive an address modification instruction sent by the host device;
the instruction response module 102 is configured to send first feedback data to the host device when a delay reply condition is met, and is configured to send an address modification instruction to the host device, where the initial query instruction is used to query whether a slave device exists in a current device address, modify a device address according to the address modification instruction, and send second feedback data to the host device to notify the host device of completion of address modification;
and the data transmission module 103 is used for carrying out data communication with the host device through the modified device address.
According to the scheme, the initial query instruction sent by the host equipment is received, when the delay reply condition is met, the first feedback data are sent to the host equipment and used for the host equipment to generate the address modification instruction, the address modification instruction sent by the host equipment is received, the equipment address is modified according to the address modification instruction, the second feedback data are sent to the host equipment, and data communication is carried out between the modified equipment address and the host equipment. According to the scheme, automatic adding of the equipment to be added is achieved, manual setting of a user is not needed, and equipment adding efficiency is remarkably improved.
In a possible embodiment, the instruction receiving module 101 is further configured to:
before receiving an initial query instruction sent by a host device, receiving an address allocation instruction sent by the host device, wherein the address allocation instruction comprises an available address range;
the instruction response module 102 is specifically configured to: a first address is randomly determined as a device address in the available address range.
In a possible embodiment, the instruction receiving module 101 is further configured to:
before receiving an address allocation instruction sent by host equipment, acquiring an initial default address, and setting an equipment address as the initial default address.
In a possible embodiment, the address modification instruction includes a first specific address, and the instruction response module 102 is specifically configured to:
and modifying the device address from the first address to a first designated address.
In a possible embodiment, the instruction receiving module 101 is further configured to:
before data communication is carried out between the host equipment and the modified equipment address, receiving an address confirmation instruction sent by the host equipment, wherein the address confirmation instruction comprises a first specified address;
the instruction response module 102 is specifically configured to: and if the current equipment address is the first designated address, sending second feedback data to the host equipment for informing the host equipment of the completion of address modification.
In a possible embodiment, the instruction receiving module 101 is further configured to:
receiving a sensor configuration acquisition instruction sent by the host device before receiving an address modification instruction sent by the host device;
the instruction response module 102 is specifically configured to: sending sensor configuration information to the host device.
In a possible embodiment, the instruction receiving module 101 is further configured to:
receiving an address reallocation instruction sent by the host device, wherein the address reallocation instruction comprises an updated available address range;
the instruction response module 102 is specifically configured to: the second address is randomly determined as the device address in the updated available address range.
In one possible embodiment, the satisfying of the delayed reply condition includes:
in the set delay time, data transmission is not monitored in the data bus;
if the delay reply condition is not met, the delay is continued for the preset time length, and then whether the delay reply condition is met or not is judged.
Fig. 6 is a structural block diagram of an automatic device adding system according to an embodiment of the present invention, where the system is configured to execute the automatic device adding method according to the embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 6, the system includes a master device and a plurality of slave devices, wherein the slave devices are configured to: receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address; receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment; and performing data communication with the host device through the modified device address.
According to the scheme, the initial query instruction sent by the host equipment is received, when the delay reply condition is met, the first feedback data are sent to the host equipment and used for the host equipment to generate the address modification instruction, the address modification instruction sent by the host equipment is received, the equipment address is modified according to the address modification instruction, the second feedback data are sent to the host equipment, and data communication is carried out between the modified equipment address and the host equipment. According to the scheme, automatic adding of the equipment to be added is achieved, manual setting of a user is not needed, and equipment adding efficiency is remarkably improved.
Fig. 7 is a schematic structural diagram of an automatic adding device of a device according to an embodiment of the present invention, as shown in fig. 7, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of the processors 201 in the device may be one or more, and one processor 201 is taken as an example in fig. 7; the processor 201, the memory 202, the input device 203 and the output device 204 in the apparatus may be connected by a bus or other means, and fig. 7 illustrates the example of connection by a bus. The memory 202, which is a computer-readable storage medium, may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the device automatic adding method in the embodiment of the present invention. The processor 201 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 202, that is, implements the above-described device auto-addition method. The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the apparatus. The output device 204 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for automatic device addition, the method comprising:
receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address;
receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment;
and performing data communication with the host device through the modified device address.
It should be noted that, in the embodiment of the device automatic adding apparatus, each included unit and module are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
It should be noted that the foregoing is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will appreciate that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims (12)
1. The automatic adding method of the equipment is characterized by comprising the following steps:
receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address;
receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment;
and performing data communication with the host device through the modified device address.
2. The device automatic adding method according to claim 1, further comprising, before receiving the initial query instruction sent by the host device:
receiving an address allocation instruction sent by a host device, wherein the address allocation instruction comprises an available address range;
a first address is randomly determined as a device address in the available address range.
3. The device automatic addition method according to claim 2, further comprising, before receiving the address assignment instruction sent by the host device:
and acquiring an initial default address, and setting the equipment address as the initial default address.
4. The device automatic addition method according to claim 2, wherein the address modification instruction includes a first specified address, and the device address modification according to the address modification instruction includes:
and modifying the device address from the first address to a first designated address.
5. The device auto-addition method according to claim 4, further comprising, before performing data communication with the host device through the modified device address:
receiving an address confirmation instruction sent by host equipment, wherein the address confirmation instruction comprises a first specified address;
and if the current equipment address is the first designated address, sending second feedback data to the host equipment for informing the host equipment of the completion of address modification.
6. The device automatic addition method according to claim 1, further comprising, before receiving the address modification instruction sent by the host device:
receiving a sensor configuration acquisition instruction sent by the host equipment;
sending sensor configuration information to the host device.
7. The device automatic addition method according to claim 1, further comprising:
receiving an address reallocation instruction sent by the host device, wherein the address reallocation instruction comprises an updated available address range;
the second address is randomly determined as the device address in the updated available address range.
8. The automatic device adding method according to any one of claims 1 to 7, wherein the satisfying of the delayed reply condition includes:
in the set delay time, data transmission is not monitored in the data bus;
if the delay reply condition is not met, the delay is continued for the preset time length, and then whether the delay reply condition is met or not is judged.
9. Automatic device that adds of equipment, its characterized in that includes:
the system comprises an instruction receiving module, an address modification module and a query module, wherein the instruction receiving module is used for receiving an initial query instruction sent by host equipment and receiving an address modification instruction sent by the host equipment;
the command response module is used for sending first feedback data to the host device when a delay reply condition is met, sending an address modification command to the host device, wherein the initial query command is used for querying whether a slave device exists in a current device address, modifying the device address according to the address modification command, and sending second feedback data to the host device for informing the host device of completing address modification;
and the data transmission module is used for carrying out data communication with the host equipment through the modified equipment address.
10. An automatic device adding system comprising a master device and a plurality of slave devices, wherein the slave devices are configured to:
receiving an initial query instruction sent by a host device, and sending first feedback data to the host device when a delay reply condition is met, wherein the first feedback data is used for the host device to send an address modification instruction, and the initial query instruction is used for querying whether a slave device exists in a current device address;
receiving an address modification instruction sent by the host equipment, modifying an equipment address according to the address modification instruction, and sending second feedback data to the host equipment for informing the completion of the address modification of the host equipment;
and performing data communication with the host device through the modified device address.
11. An automatic device adding device, the device comprising: one or more processors; storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the device auto-add method of any one of claims 1-8.
12. A storage medium storing computer-executable instructions for performing the device auto-add method of any one of claims 1-8 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111130301.2A CN113946369A (en) | 2021-09-26 | 2021-09-26 | Automatic adding method, device, system, equipment and storage medium of equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111130301.2A CN113946369A (en) | 2021-09-26 | 2021-09-26 | Automatic adding method, device, system, equipment and storage medium of equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113946369A true CN113946369A (en) | 2022-01-18 |
Family
ID=79328762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111130301.2A Pending CN113946369A (en) | 2021-09-26 | 2021-09-26 | Automatic adding method, device, system, equipment and storage medium of equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113946369A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116319683A (en) * | 2023-03-27 | 2023-06-23 | 阳光电源股份有限公司 | Method, system and device for distributing networking address and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279434A (en) * | 2013-05-10 | 2013-09-04 | 青岛海信宽带多媒体技术有限公司 | Method and device for modifying address of slave unit |
CN110505319A (en) * | 2019-08-07 | 2019-11-26 | 金陵科技学院 | A kind of RS485 is from device address auto-allocation method and system |
CN111147619A (en) * | 2019-12-20 | 2020-05-12 | 海丰通航科技有限公司 | Method and system for realizing automatic address allocation of RS485 slave equipment locally |
CN111343300A (en) * | 2020-03-27 | 2020-06-26 | 珠海格力电器股份有限公司 | Address automatic allocation method and communication system |
CN111371659A (en) * | 2020-03-09 | 2020-07-03 | 深圳市锐同技术有限公司 | Method for automatically allocating RS485 slave equipment address |
CN112689028A (en) * | 2020-12-15 | 2021-04-20 | 上海宏力达信息技术股份有限公司 | Method for realizing automatic address allocation based on RS485 |
-
2021
- 2021-09-26 CN CN202111130301.2A patent/CN113946369A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279434A (en) * | 2013-05-10 | 2013-09-04 | 青岛海信宽带多媒体技术有限公司 | Method and device for modifying address of slave unit |
CN110505319A (en) * | 2019-08-07 | 2019-11-26 | 金陵科技学院 | A kind of RS485 is from device address auto-allocation method and system |
CN111147619A (en) * | 2019-12-20 | 2020-05-12 | 海丰通航科技有限公司 | Method and system for realizing automatic address allocation of RS485 slave equipment locally |
CN111371659A (en) * | 2020-03-09 | 2020-07-03 | 深圳市锐同技术有限公司 | Method for automatically allocating RS485 slave equipment address |
CN111343300A (en) * | 2020-03-27 | 2020-06-26 | 珠海格力电器股份有限公司 | Address automatic allocation method and communication system |
CN112689028A (en) * | 2020-12-15 | 2021-04-20 | 上海宏力达信息技术股份有限公司 | Method for realizing automatic address allocation based on RS485 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116319683A (en) * | 2023-03-27 | 2023-06-23 | 阳光电源股份有限公司 | Method, system and device for distributing networking address and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110096336B (en) | Data monitoring method, device, equipment and medium | |
CN115242752B (en) | Address allocation method, device, equipment and medium of battery management system | |
CN111541596A (en) | Relay response automatic numbering method, device, equipment and storage medium | |
CN114401250A (en) | Address allocation method and device | |
CN113946369A (en) | Automatic adding method, device, system, equipment and storage medium of equipment | |
CN116860391A (en) | GPU computing power resource scheduling method, device, equipment and medium | |
CN109067735B (en) | Dynamic configuration method of communication protocol, wireless communication device and intelligent equipment | |
CN112968793A (en) | Equipment upgrading method, device, equipment and storage medium based on Internet of things | |
CN109525417B (en) | Household appliance access method based on internet access, household appliance controller and storage medium | |
CN112000019A (en) | Method, device and equipment for sharing equipment instruction control | |
CN116578519A (en) | Communication method, device, equipment and medium | |
CN116389505A (en) | Networking method based on CAN bus and computer equipment | |
CN113556255B (en) | Method and device for configuring smart home | |
CN115622834A (en) | Bus communication control method, device, equipment and storage medium | |
CN111740972B (en) | Method, device, equipment and storage medium for updating communication protocol stack information | |
CN113949628B (en) | Automatic equipment adding method and system | |
CN112068972A (en) | Message queue consumption method based on multi-computer room realization and electronic equipment | |
CN113938471B (en) | Automatic device adding method, device, system, device and storage medium | |
CN111124923B (en) | Running state query method and device, server equipment and storage medium | |
CN115543343B (en) | Variable cross-thread operation method and device | |
CN112653776B (en) | Intelligent device searching method, computer apparatus, computer-readable storage medium | |
JP6878705B1 (en) | Communication devices, communication systems, communication methods, and programs | |
CN117749563A (en) | PLC module ad hoc network method, system and equipment | |
CN116069445A (en) | Virtualized service deployment method, device, equipment and storage medium | |
JP2713133B2 (en) | Polling data collection method |
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 |