CN114301731B - Address management method, master device and slave device - Google Patents

Address management method, master device and slave device Download PDF

Info

Publication number
CN114301731B
CN114301731B CN202111682574.8A CN202111682574A CN114301731B CN 114301731 B CN114301731 B CN 114301731B CN 202111682574 A CN202111682574 A CN 202111682574A CN 114301731 B CN114301731 B CN 114301731B
Authority
CN
China
Prior art keywords
address
master device
resource pool
slave
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
CN202111682574.8A
Other languages
Chinese (zh)
Other versions
CN114301731A (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.)
Delixi Electric Co Ltd
Original Assignee
Delixi Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Delixi Electric Co Ltd filed Critical Delixi Electric Co Ltd
Priority to CN202111682574.8A priority Critical patent/CN114301731B/en
Publication of CN114301731A publication Critical patent/CN114301731A/en
Application granted granted Critical
Publication of CN114301731B publication Critical patent/CN114301731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application provides an address management method, a master device and a slave device. The address management method comprises the following steps: the slave device modifies the current address of the slave device into a first address according to an address application instruction generated by the slave device triggered by a user, and sends the first address to the master device; the method comprises the steps that a master device receives a first address and judges whether the first address is in a protocol address resource pool set by the master device, if the first address is in the protocol address resource pool, an address modifying instruction is generated, a second address in an unassigned address resource pool set by the master device is obtained, and the address modifying instruction and the second address are sent to a slave device; and receiving an address modifying instruction and a second address from the device, and modifying the first address to the second address according to the address modifying instruction. The address management method provided by the embodiment of the application can enable the master device to allocate a unique address for the slave device.

Description

Address management method, master device and slave device
Technical Field
The embodiment of the application relates to the field of bus address management, in particular to an address management method, a master device and a slave device.
Background
Some electrical appliances, such as circuit breakers, switch panels, temperature control panels, etc., which are common and commonly used in life, are often mass produced by factories. For these mass-produced industrial or consumer products, equipment addresses are often not assigned to each product due to low cost, high quantity.
However, in use, if a single device cannot possess a unique address, it is difficult to distinguish between multiple devices for accurate management when they are used simultaneously.
Therefore, how to accurately manage a plurality of devices becomes a technical problem to be solved.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide an address management method, a master device, and a slave device, where a unique address may be allocated to the slave device by the master device, so as to accurately manage the slave device.
In a first aspect, an embodiment of the present application provides an address management method, applied to a master device, where the method includes:
the method comprises the steps that a master device receives a first address which is sent by a slave device and is modified by the slave device according to an address application instruction;
the master device judges whether the first address is in a protocol address resource pool set by the master device, if the first address is in the protocol address resource pool, an address modifying instruction is generated, and a second address in an unallocated address resource pool set by the master device is obtained;
the master device sends an address modifying instruction and a second address to the slave device so that the slave device modifies the first address used by the slave device to the second address.
In a possible implementation manner of the first aspect, obtaining a second address in the unallocated address resource pool set by the master device includes:
The master device randomly selects from the unassigned address resource pool to obtain a second address; or (b)
The master device selects addresses according to the sequence from low to high of the serial numbers of the addresses in the unassigned address resource pool to obtain a second address; or (b)
And the master device selects the addresses according to the sequence from high to low of the serial numbers of the addresses in the unassigned address resource pool to obtain a second address.
In a possible implementation manner of the first aspect, the method further includes:
the master adds the second address to the allocated address resource pool set by the master, and deletes the second address from the unallocated address resource pool of the master.
In a possible implementation manner of the first aspect, the method further includes:
the method comprises the steps that a master device receives an address resetting application instruction sent by any first slave device and a third address currently used by the first slave device;
the master device judges whether the third address is in the allocated address resource pool of the master device, if the third address is in the allocated address resource pool of the master device, the third address is deleted from the allocated address resource pool according to the address resetting instruction and added into the unallocated address resource pool.
In a possible implementation manner of the first aspect, the method further includes:
The method comprises the steps that a master device obtains currently used addresses of a plurality of slave devices from an allocated address resource pool of the master device according to a reset address instruction generated by triggering the master device by a user;
the master device deletes the use addresses of the slave devices from the allocated address resource pool of the master device and adds the use addresses to the unallocated address resource pool of the master device;
the master device generates a confirmation reset address instruction, and transmits the confirmation reset address instruction to the plurality of slave devices based on the respective use addresses of the plurality of slave devices, respectively, so that the plurality of slave devices modify the respective use addresses.
In a second aspect, an embodiment of the present application provides an address management method, applied to a slave device, where the method includes:
the slave device modifies the current address of the slave device into a first address according to an address application instruction generated by the slave device triggered by a user;
the slave device sends the first address to the master device;
the method comprises the steps that a slave device receives a modified address instruction and a second address sent by a master device, wherein the modified address instruction is generated by the master device after judging that a first address is in a protocol address resource pool set by the master device, and the second address is acquired by the master device in an unallocated address resource pool set by the master device;
The slave device modifies the first address used to a second address according to the address modification instruction.
In a possible implementation manner of the second aspect, the method further includes:
the slave device generates an application reset address instruction according to user trigger, and sends the application reset address instruction and a third address currently used by the slave device to the master device;
the slave device modifies the third address to a default address that does not belong to the allocated address resource pool, the unallocated address resource pool, and the protocol address resource pool set by the master device.
In a possible implementation manner of the second aspect, the method further includes:
the slave device receives a confirmation reset address instruction sent by the master device, and modifies the currently used address of the slave device into a default address, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and a protocol address resource pool which are set by the master device.
In a third aspect, an embodiment of the present application provides an address management apparatus, which is applied to a master device, including:
the receiving module is used for receiving a first address which is transmitted by the slave equipment and is modified by the slave equipment according to the address application instruction;
the processing module is used for judging whether the first address is in a protocol address resource pool set by the main equipment, generating an address modifying instruction if the first address is in the protocol address resource pool, and acquiring a second address in an unassigned address resource pool set by the main equipment;
And the sending module is used for sending an address modifying instruction and the second address to the slave equipment so as to modify the first address used by the slave equipment into the second address.
In a fourth aspect, an embodiment of the present application provides an address management apparatus, applied to a slave device, including:
the address modification module is used for modifying the current address of the slave device into a first address according to an address application instruction generated by the slave device triggered by a user;
the information sending module is used for sending the first address to the main equipment;
the information receiving module is used for receiving a modified address instruction and a second address sent by the main equipment, wherein the modified address instruction is generated by the main equipment after judging that the first address is in a protocol address resource pool set by the main equipment, and the second address is acquired by the main equipment in an unallocated address resource pool set by the main equipment;
the address modifying module is also used for modifying the used first address into a second address according to the address modifying instruction.
In a fifth aspect, embodiments of the present application provide a master device, including: a memory, a processor, and instructions stored in the memory and executable on the processor, the processor implementing the address management method of any of the above first aspects when executing the instructions.
In a sixth aspect, embodiments of the present application provide a slave device, including: a memory, a processor, and instructions stored in the memory and executable on the processor, the processor implementing the address management method of any of the second aspects described above when executing the instructions.
In a seventh aspect, embodiments of the present application provide a chip configured to store and execute instructions, where the instructions when executed by a processor implement the address management method of any one of the first aspects above.
In an eighth aspect, embodiments of the present application provide a chip configured to store and execute instructions, where the instructions when executed by a processor implement the address management method of any one of the second aspects above.
In a ninth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the address management method of any one of the first aspects.
In a tenth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the address management method of any one of the above second aspects.
In an eleventh aspect, embodiments of the present application provide a computer program product for, when run on a terminal device, causing the terminal device to perform the address management method of any one of the first aspects.
In a twelfth aspect, embodiments of the present application provide a computer program product for, when run on a terminal device, causing the terminal device to perform the address management method of any one of the above second aspects.
According to the address management method, the master device and the slave device, the address of the slave device is modified to be the first address existing in the protocol address resource pool of the master device, and the current address can be simply and directly used as the first address to indicate that the slave device applies for distributing the address to the master device. By sending the first address to the master device, the master device can determine to assign a unique address to the slave device directly from the presence of the first address in the pool of protocol address resources. The master device obtains the second address from the unassigned address resource pool, so that the second address is ensured to be the unique address, and the addresses of the plurality of slave devices are prevented from being repeated after the addresses are assigned to the plurality of slave devices. The master device can accurately send an address modifying instruction and a second address to the slave device applying for address allocation based on the first address, and the slave device modifies the first address into the second address through the address modifying instruction, so that the slave device with the address modified into the first address can modify the address into the second address again, the unique second address in the unassigned address resource pool can be accurately allocated to the slave device, and then the master device can be ensured to allocate the unique address to each slave device, so that the slave device can be effectively and accurately managed.
The foregoing description is only an overview of the technical solutions of the embodiments of the present application, and may be implemented according to the content of the specification, so that the technical means of the embodiments of the present application can be more clearly understood, and the following detailed description of the present application will be presented in order to make the foregoing and other objects, features and advantages of the embodiments of the present application more understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of an address management method provided in an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a master device according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a slave device according to an embodiment of the present application.
Fig. 4 is a flow chart of an address management method according to an embodiment of the present application.
Fig. 5 is a flowchart of another address management method according to an embodiment of the present application.
Fig. 6 is a flowchart of another address management method according to an embodiment of the present application.
Fig. 7 is a flowchart of still another address management method according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an address management apparatus applied to a master device according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an address management apparatus applied to a slave device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the drawings are intended to cover, but not exclude, other matters. The word "a" or "an" does not exclude the presence of a plurality.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of the phrase "an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Furthermore, the terms first, second and the like in the description and in the claims of the present application or in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order, and may be used to expressly or implicitly include one or more such features.
In the description of the present application, unless otherwise indicated, the meaning of "plurality" means two or more (including two), and similarly, "plural sets" means two or more (including two).
In the description of the present application, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "coupled" are to be construed broadly, and for example, the terms "connected" or "coupled" of a mechanical structure may refer to a physical connection, an electrical connection or a signal connection, for example, may be a direct connection, i.e., a physical connection, or may be an indirect connection via at least one element therebetween, so long as electrical communication is achieved, or may be internal to two elements; signal connection may refer to signal connection through a medium such as radio waves, in addition to signal connection through a circuit. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context.
The address management method provided by the embodiment of the application can be applied to the management of the addresses of the slave devices. Fig. 1 is an application scenario schematic diagram of an address management method provided in an embodiment of the present application. As shown in fig. 1, a wired communication connection or a wireless communication connection is established between a master device and a plurality of slave devices, and for simplicity of description, a direct link between the master device and the slave devices may be referred to as a communication link, for example, the wired communication connection may be implemented by a cable or an optical fiber adopting an RS485 standard protocol, for example, the wireless communication connection may be a WiFi connection, and information is transmitted between the master device and the slave devices through the communication link, and the master device confirms that the information is transmitted to the slave devices according to addresses of the slave devices. For example, when the addresses of the slave device 01, the slave device 02, the slave devices 03, … and the slave device N are respectively 0x11, 0x12, 0x13, … and 0xN, and the master device wants to transmit information to the slave device 02, the master device may transmit information to the slave device with the address of 0x12 through the communication link, thereby achieving the purpose of transmitting information to the slave device 02 by the master device.
Optionally, in some application scenarios, a connection between the terminal and the master device may also be established through a wireless communication manner (e.g., wiFi), so that the master device may be remotely controlled through the terminal, and thus the slave device may be remotely managed. For example, the user can select the slave device to be managed by clicking on the display screen of the terminal, so that information such as the address of the slave device can be conveniently and directly viewed.
For example, the terminal may be a static device, such as a device fixedly disposed in a place, such as a desktop computer, although the terminal may also be a mobile device, such as a mobile phone, a wearable device, or the like.
A terminal (terminal) may include various handheld devices, vehicle mount devices, wearable devices, computing devices, or other processing devices connected to a wireless modem with wireless communication capabilities; and may also include a subscriber unit (subscriber unit), a cellular phone (cellular phone), a smart phone (smart phone), a wireless data card, a personal digital assistant (personal digital assistant, PDA) computer, a tablet computer, a wireless modem (modem), a hand-held device (handheld), a laptop computer (laptop), a cordless phone (cord) or a wireless local loop (wireless local loop, WLL) station, a machine type communication (machine type communication, MTC) terminal, a User Equipment (UE), a Mobile Station (MS), a terminal device (terminal device), a relay user equipment, or the like. The relay user equipment may be, for example, a 5G home gateway (residential gateway, RG). For convenience of description, the above-mentioned devices are collectively referred to as a terminal in this application.
It should be understood that the terminal in the embodiment of the present application may be a terminal in various vertical industry application fields such as an internet of things terminal device, a port, an intelligent factory, railway traffic, logistics, an unmanned aerial vehicle, an unmanned automobile, and the like. For example: mobile Robot (Mobile Robot), automated guided vehicle (Automated Guided Vehicle, AGV), unmanned car, on-train control equipment, factory deployed control equipment, etc.
Alternatively, the master device may also be a part of the terminal, and the master device is directly controlled by the terminal to manage the slave devices.
It should be noted that, in the embodiment of the present application, the number of the master devices is not limited, for example, there may be a plurality of master devices, and each master device manages a plurality of slave devices. In some embodiments, a plurality of master devices may be managed by a terminal, thereby managing slave devices. Specifically, the plurality of master devices may be connected to the terminal through a wireless communication manner, and the plurality of master devices may also be a part of the terminal.
The master device and the slave device in the embodiment of the application are mutually matched in structure, and the structure and the size of the master device and the slave device are not limited in the embodiment of the application.
Fig. 2 is a schematic structural diagram of a master device according to an embodiment of the present application. As shown in fig. 2, the master device 1 provided in the embodiment of the present application may include: the processor 10, the memory 11, and the instructions 12 stored in the memory 11 and executable on the processor 10, the processor 10 can implement the address management method executed by the host device provided in the following embodiments of the present application when executing the instructions 12. The processor 10 may be powered by a battery alone or by an external power source.
Optionally, the master device 1 may further comprise a wired communication module 13 and/or a wireless communication module 14. For example, the wired communication module 13 is configured to establish a wired communication connection with the slave device when the master device is connected to the slave device by wired communication, and the wireless communication module 14 is configured to establish a wireless communication connection with the slave device when the master device is connected to the slave device by wireless communication. For another example, the wired communication module 13 may also be used to establish a wired communication connection with a terminal when the master device is part of the terminal, and the wireless communication module 14 may also be used to establish a wireless communication connection with the terminal when the master device and the terminal are two mutually independent devices.
In particular, the processor 10 may communicate data with the memory 11, the wired communication module 13 and the wireless communication module 14, and the specific content of the data is not limited in this application. For example, the master device may allocate an address acquired from an unassigned address resource, such as a second address, to the slave device, or may be a modified address instruction, a confirm reset address instruction, or the like, which is sent by the master device to the slave device, or an apply address instruction, an apply reset address instruction, or the like, which is sent by the slave device to the master device.
Specifically, the memory 11 includes a storage space for storing an unallocated address resource pool, an allocated address resource pool, and a protocol address resource pool.
It will be appreciated that in principle a master device comprises at least N wired communication interfaces 13 for establishing communication connections with N slave devices, respectively.
In the embodiment of the present application, the number and types of the processor 10, the memory 11, the wired communication module 13, and the wireless communication module 14 are not limited.
Fig. 3 is a schematic structural diagram of a slave device according to an embodiment of the present application. As shown in fig. 3, the slave device 2 provided in the embodiment of the present application may include: the processor 20, the memory 21, and the instructions 22 stored in the memory 21 and executable on the processor 20, the processor 20 can implement the address management method executed by the slave device provided in the following embodiments of the present application when executing the instructions 22.
Optionally, the slave device 2 further comprises a wired communication module 23 and/or a wireless communication module 24 for communication connection with the master device.
The number and types of the processor 20, the memory 21, the wired communication module 23, and the wireless communication module 24 are not limited in the embodiment of the present application.
It will be appreciated that in principle the slave device 2 comprises at least one wired communication module 23 and/or one wireless communication module 24, the wired communication module 23 being arranged to establish a wired communication connection with a master device when a wired communication connection is made between the master device and the slave device, and the wireless communication module 24 being arranged to establish a wireless communication connection with a master device when a wireless communication connection is made between the master device and the slave device.
The technical solutions in the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, different technical features may be combined with each other.
Fig. 4 is a flow chart of an address management method according to an embodiment of the present application, and as shown in fig. 4, the address management method according to the embodiment may be as follows.
S101, the slave device modifies the current address of the slave device into a first address according to an address application instruction generated by the slave device triggered by a user.
For example, a master device may be communicatively coupled to a plurality of slave devices via wired or wireless connections. The plurality of slave devices do not have unique addresses when leaving the factory, so that the master device is required to allocate the unique addresses to each slave device before use, and the master device can accurately manage the slave devices when the subsequent slave devices are put into use.
Optionally, a dial switch, a button for applying for address allocation, or a touch screen for applying for address by clicking a screen may be disposed on a panel of the slave device, and the internal circuits of the slave device are respectively connected. The user can trigger the slave device to generate the application address instruction by toggling the dial switch, can trigger the slave device to generate the application address instruction by pressing a button for applying for address allocation, and can trigger the slave device to generate the application address instruction by selecting the application address after clicking the selected slave device on the touch screen.
For example, the current address refers to an address used by the slave device when triggered by the user to generate an address application instruction.
Alternatively, the current address may be a default address that is uniformly set from the factory of the device. For example, the default addresses of the plurality of slave devices are all 0x01, and the current address of the slave device triggered by the user to generate the address application instruction is also the default address, i.e. 0x01.
Alternatively, the current address may be an address assigned by the slave device prior to triggering by the user to generate the address application instruction. For example, the slave device has been assigned an address by another master device in the network composed of the other master device and the slave device, for example, 0x23, and after the slave device is added to the management network of the new master device, it is necessary to reassign the address by the new master device.
Optionally, the first address is a predetermined fixed address between the slave device and the master device, which may also be referred to as a protocol address, to indicate that the slave device whose address is the first address needs to apply for assigning a unique address to the master device, and any slave device triggered by the user to generate an address application instruction modifies the address to be the fixed address. For example, the first address may be set to 0xff, and when the user triggers the slave device to generate an application address instruction, the current address (e.g., 0x01 or 0x 23) of the slave device is modified to the first address (e.g., 0 xff).
S102, the slave device sends the first address to the master device.
Illustratively, after the slave device modifies the current address to a first address (e.g., 0 xff) according to the apply for address instruction, the slave device sends the first address (e.g., 0 xff) to the master device over a communication link with the master device.
S103, the master device receives a first address which is sent by the slave device and is modified by the slave device according to the address application instruction.
Illustratively, the master receives a first address (e.g., 0 xff) sent by the slave via a bus to which the slave is connected.
S104, the master device judges whether the first address is in a protocol address resource pool set by the master device, if the first address is in the protocol address resource pool, an address modifying instruction is generated, and a second address in an unassigned address resource pool set by the master device is obtained.
The addresses in the protocol address resource pool are set by the master device. For example, the master device sets 0xff as an address in the protocol address resource pool, and 0xff is transmitted as a first address of the slave device to the master device, and the master device determines that the first address (for example, 0 xff) is an address in the protocol address resource pool, thereby generating an address modification instruction, and acquires a second address in the unassigned address resource pool set by the master device. The address modifying instruction is used for indicating the slave device to modify the address.
For example, the addresses in the unallocated address resource pool set by the master device do not include the default address and the addresses in the protocol address resource pool. For example, when the default address is 0x01 and the address in the protocol address resource pool is 0xff, the address in the unallocated address resource pool set by the master device may be 0x02-0xfe.
For example, the master device randomly selects from the unassigned address resource pool to obtain the second address, or selects the addresses according to the sequence from low to high of the sequence numbers of the addresses in the unassigned address resource pool to obtain the second address, or selects the addresses according to the sequence from high to low of the sequence numbers of the addresses in the unassigned address resource pool to obtain the second address.
For example, when the address in the unallocated address resource pool set by the master device is 0x02-0xfe, the master device may randomly select, for example, 0x56 as the second address, may select 0x02 as the second address from low to high according to the serial number of the address, and may select 0xfe as the second address from high to low according to the serial number of the address.
S105, the master device sends an address modifying instruction and a second address to the slave device so that the slave device modifies the first address used by the slave device into the second address.
For example, the master device sends a modification address instruction and a second address to a slave device connected to the master device, wherein the current address is a first address, and the modification address instruction is used for indicating the slave device to modify the address, and the second address provides address modification information for the slave device, so that the slave device can modify the first address into the second address according to the modification address instruction.
S106, the slave device receives the address modifying instruction and the second address sent by the master device.
For example, the slave device receives, via the communication link, an address modifying instruction and a second address sent by the master device to which it is connected.
S107, the slave device modifies the first address used by the slave device into a second address according to the address modification instruction.
For example, after receiving the address modifying instruction and the second address sent by the master device connected to the slave device through the communication link, the slave device modifies the first address currently used to the second address according to the address modifying instruction.
Optionally, when the slave device modifies the address to the second address according to the address modifying instruction, the slave device and/or the master device displays a corresponding address allocation success prompt. For example, an indicator light is arranged on a panel of the slave device, the indicator light blinks when the slave device applies for modifying the address, and the indicator light is lightened for 2 seconds to give a prompt when the address of the slave device is successfully modified. For another example, when the address of the slave device is successfully modified, a corresponding dialog box may be popped up on the display screen of the master device, and the dialog box may include characters such as "successful allocation" and/or a graphic such as "v". Through various prompting modes, a user can know the address allocation progress and the address allocation result of the slave device through observation so as to timely perform the next action, and therefore the address management efficiency of the slave device is improved.
According to the embodiment of the application, the address of the slave device is modified to be the first address existing in the protocol address resource pool of the master device, and the current address can be simply and directly used for representing the first address to apply for the slave device to allocate the address to the master device. By sending the first address to the master device, the master device can determine to assign a unique address to the slave device directly from the presence of the first address in the pool of protocol address resources. The master device obtains the second address from the unassigned address resource pool, so that the second address is ensured to be the unique address, and the addresses of the plurality of slave devices are prevented from being repeated after the addresses are assigned to the plurality of slave devices. The master device can accurately send an address modifying instruction and a second address to the slave device applying for address allocation based on the first address, and the slave device modifies the first address into the second address through the address modifying instruction, so that the slave device with the address modified into the first address can modify the address into the second address again, the unique second address in the unassigned address resource pool can be accurately allocated to the slave device, and then the master device can be ensured to allocate the unique address to each slave device, so that the slave device can be effectively and accurately managed.
It should be noted that, there may be only one address in the protocol address resource pool, and multiple addresses may also be included. Correspondingly, when only one address exists in the protocol address resource pool, the user can only trigger one slave device to generate an address application instruction at a time. For example, one slave device application address is triggered by toggling the dial switch of the slave device, and another slave device application address is triggered by toggling the dial switch of another slave device after the application is completed, and the like, so that the on-site operation is convenient, the addresses and positions corresponding to different slave devices are confirmed, and the follow-up maintenance and management of the slave devices are convenient.
When a plurality of different addresses exist in the protocol address resource pool, a user can trigger a plurality of slave devices to generate an address application instruction at the same time, and in this case, the difference of triggering modes can ensure that the first addresses modified by the plurality of slave devices after generating the address application instruction are different. For example, the trigger mode 1 may be to toggle one dial switch for applying an address at the same time, the trigger mode 2 may be to toggle two dial switches for applying an address at the same time, and the trigger mode 3 may be to toggle three dial switches for applying an address at the same time, when the protocol address resource pool includes three addresses of 0xff, 0xfd and 0xfc, as shown in fig. 1, the user may modify the address to 0xff after the slave device 01 generates an application address instruction through the trigger mode 1, modify the address to 0xfd after the slave device 02 generates an application address instruction through the trigger mode 2, and modify the address to 0xfc after the slave device 03 generates an application address instruction through the trigger mode 3, thereby enabling the master device to accurately allocate different addresses to different slave devices and improving the efficiency of allocating unique addresses to the slave devices by the master device.
Optionally, after S105, an address management method provided in the embodiment of the present application may further include: the master adds the second address to the allocated address resource pool set by the master, and deletes the second address from the unallocated address resource pool of the master.
It should be appreciated that the address resource pool of the master device includes: the address in the three address resource pools are different from each other and are used for managing the addresses of the slave devices. For example, the slave device sets the address of the slave device as a default address in a unified manner at the time of shipping, and the default address does not belong to any one of the protocol address resource pool, the unassigned address resource pool, and the assigned address resource pool.
For example, among various address resource pools set by the master device, the protocol address resource pool is used for storing addresses, such as a first address, determined by the master device and the slave device, for indicating that the slave device is in a state of applying for allocation of addresses to the master device. The unassigned address resource pool is used for storing the address set by the master device and unassigned for use by the slave device. The allocated address resource pool is used for storing addresses set by the master device and allocated to the slave devices for use. It will be appreciated that the addresses in the unassigned and allocated address resource pools are different from each other and are modified in response to changes in the addresses of the slave devices to synchronize the addresses in the master and allocated address resource pools with the address state of the slave devices so that the master device can accurately manage the slave devices.
Therefore, after the second address is sent to the slave device as the address to be modified by the slave device, the master device determines that the second address is allocated to the slave device for use, so that the second address is deleted from the unassigned address resource pool and added to the assigned address resource pool, and the address allocation situation of the slave device is synchronously updated.
According to the method and the device for managing the addresses in the unallocated address resource pool and the allocated address resource pool, the address in the unallocated address resource pool and the address in the allocated address resource pool can be managed by the master device in real time according to the address change of the slave device. After the master device sends an address modification instruction and a second address in the unassigned address resource pool to the slave device, the second address assigned to the slave device is timely deleted from the unassigned address resource pool, and the second address is added into the assigned address resource pool, so that the master device can synchronously manage the address assignment situation of the slave device, and the second address is ensured not to be repeated with the second address acquired this time when the second address is acquired from the unassigned address resource pool when the address is assigned to the slave device next time, thereby ensuring the uniqueness of the address assigned to the slave device by the master device, and enabling the master device to accurately manage the slave device.
Fig. 5 is a flowchart of another address management method provided in the embodiment of the present application, and as shown in fig. 5, when at least one slave device actively applies for resetting a currently used address to a master device, the another address management method provided in the embodiment of the present application may be as follows.
S201, any first slave device generates an application reset address instruction according to user trigger, and sends the application reset address instruction and a third address currently used by the first slave device to the master device.
For example, the first slave device may be a slave device that is currently using a default address or another slave device that is currently using an address in the master device's assigned address resource pool.
In this embodiment, the third address currently used by the first slave device may be the third address currently used when the first slave device sends the address resetting instruction.
For example, the slave device applying for the reset address may be at least one slave device to which the master device assigns an address, including the slave device to which the master device assigns the second address in the above embodiments of the present application, the slave device to which the master device obtains an address from the unassigned address resource pool and assigns to the slave device, the slave device to which the address is not assigned by the master device after shipping, or the slave device to which the address is changed to the default address after modification.
It will be appreciated that the addresses currently used by the slave devices may be managed by the master device, and therefore when the user chooses to reset the addresses of some of the slave devices to the default address, the slave devices that do not need to be reset, for example, the slave devices that are addressed to the default address, cannot be avoided. The user can choose to reset the addresses of a certain number of slave devices according to his own needs, for example, 32 breakers in a warehouse, which are used and replaced, since it cannot be determined which breakers are unused, when the user needs to take 20 breakers from them for application in another scenario, in which case the user may choose 10 used breakers and 10 unused breakers and choose to reset their addresses.
For example, the slave device sends a request for resetting the address command and a third address currently used by the slave device to the master device through a communication link connected to the master device according to the request for resetting the address command.
Optionally, the third address currently used may be an address allocated by the master device to the slave device after the slave device sends an address application instruction to the master device, for example, the second address may also be a default address when leaving the factory or after modifying the address of the slave device.
The user may trigger the slave device to generate an address application reset instruction by a dial switch on the slave device, or a button for applying for a reset address, or a touch screen by clicking a screen to apply for a reset address. For example, the user may trigger the slave device to generate the application reset address instruction by toggling the dial switch, may trigger the slave device to generate the application reset address instruction by pressing a button for applying for a reset address, and may trigger the slave device to generate the application reset address instruction by clicking the selected slave device on the touch screen and then selecting the reset address. The use requirements of different occasions are met through various triggering modes.
After any one of the first slave devices generates the reset address instruction according to the user trigger, another address management method provided in the embodiment of the present application further includes: s202, the slave device modifies the third address into a default address, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and a protocol address resource pool which are set by the master device.
It can be understood that after the user triggers the slave device to generate the address application resetting instruction, the slave device can complete resetting by modifying the address currently used by the slave device to the default address without consent of the master device.
Optionally, after the slave device modifies the currently used third address to the default address, the slave device sends an apply for reset address instruction and the third address to the master device, or after the slave device sends the apply for reset address instruction and the third address to the master device, the slave device modifies the currently used third address to the default address. The embodiments of the present application are not limited in this regard.
S203, the master device receives an address resetting application instruction sent by the slave device and a third address currently used by the slave device.
For example, the master device receives an application reset address instruction and a third address sent by the slave device with a third address of 0x02, namely: 0x02, or receiving an application reset address instruction and a third address sent from a device whose third address is a default address (e.g., 0x 01), for example: 0x01.
S204, the master device judges whether the third address is in the allocated address resource pool of the master device, if the third address is in the allocated address resource pool of the master device, the master device deletes the third address from the allocated address resource pool according to the address resetting instruction and adds the third address into the unallocated address resource pool.
Illustratively, the allocated address resource pool includes addresses 0x02-0x12, and the unallocated address resource pool includes addresses 0x13-0xfe.
For example, after the master device receives the address resetting application instruction and 0x02 sent by the slave device with the third address of 0x02, it determines that 0x02 is in the allocated address resource pool, deletes 0x02 from the allocated address resource pool, and adds 0x02 to the unallocated address resource pool. At this time, the addresses in the allocated address resource pool include 0x03 to 0x12, and the addresses in the unallocated address resource pool include 0x02 and 0x13 to 0xfe.
For another example, after receiving the address resetting request instruction and 0x01 sent by the slave device with the third address as the default address (for example, 0x 01), the master device determines that 0x01 is not in the allocated address resource pool, that is, determines that 0x01 of the slave device does not belong to the address allocated to the slave device after the master device acquires the address from the unallocated address resource pool and joins the address in the allocated address resource pool, so that the address currently used by the slave device does not need to be reset, that is, 0x01.
For convenience of understanding, a case where the third address of the slave device is a default address will be described in detail as follows: in the case where the addresses of the slave devices all require the master device to allocate, the states and addresses of the slave devices include three types: the address is not applied for the main equipment, and the address of the slave equipment is the default address when leaving the factory; the address has been allocated by the master device, at which time the address of the slave device is recorded in the master device's allocated address resource pool; in a state where an address is allocated to the master device, but the address has not been modified to the address to which the master device has allocated, at which point the address of the slave device is an address in the protocol address resource pool. And if the address of the slave device is the address in the protocol address resource pool or the default address, the address does not need to be reset. Therefore, only when the slave device applies for resetting the address, whether the address is the address in the allocated address resource pool is judged, and whether the slave device needs to reset the address can be determined. If the address of the slave device is the address in the allocated address resource pool, the slave device can confirm that the slave device needs to reset the address of the slave device, and if the address of the slave device is not in the allocated address resource pool, the slave device is not required to reset the address of the slave device.
In the embodiment of the application, after the slave device is triggered by the user and confirms that the slave device enters the application reset address state, the third address currently used by the slave device can be directly modified into the default address, so that the reset is completed, the reply of the master device is not required to be waited, and the address resetting efficiency of the slave device and the address management efficiency of the master device are improved. After confirming that the slave device enters the application reset address state, the slave device can send the third address and the application reset address instruction to the master device, and after confirming that the third address belongs to the allocated address resource pool, the master device synchronizes the address in the allocated address resource pool and the unallocated address resource pool set by the master device according to the application reset address instruction so as to ensure that the unique address can be allocated to the slave device when the slave device applies for allocation of the address, thereby ensuring that the address allocated by the master device between the slave devices is not repeated, and further ensuring that the master device can accurately manage the slave device.
Fig. 6 is a flowchart of another address management method provided in the embodiment of the present application, as shown in fig. 6, when at least one slave device actively applies for resetting a currently used address to a master device, the another address management method provided in the embodiment of the present application may include the steps S201, S203, S204 described above, and further includes, after S204:
S205, the master device generates a confirmation reset address instruction and sends the confirmation reset address instruction to the slave device so that the slave device modifies the third address.
For example, when the master device determines that the third address is in the allocated address resource pool of the master device, it determines that the slave device corresponding to the third address needs to reset the address, and then the master device generates a command for confirming the reset address, and based on the third address, sends the command for confirming the reset address to the slave device corresponding to the third address through the communication link connected to the slave device corresponding to the third address, so that the slave device corresponding to the third address resets the third address currently used by the slave device. The slave device corresponding to the third address may be the slave device to which the second address is allocated by the master device in the above embodiment or another slave device.
S206, the slave device receives a confirmation reset address instruction sent by the master device, and modifies the third address into a default address according to the confirmation reset address instruction, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and a protocol address resource pool which are set by the master device.
For example, since the default address is an address uniformly set at the time of shipment of the slave device, the address of the slave device is reset by modifying the address of the slave device to the address at the time of shipment. That is, after receiving the command for confirming the reset address through the communication link connected with the master device, the slave device determines to modify the currently used third address into the default address according to the command for confirming the reset address, so that the slave device successfully resets the third address.
According to the embodiment of the application, the slave device sends the application reset address instruction and the third address to the master device, so that the master device can determine whether the third address of the slave device needs to be reset according to the third address of the slave device, when the third address exists in the allocated address resource pool, the master device can confirm that the slave device needs to reset the address according to the application reset address instruction, so that the application reset address instruction is generated, the application reset address instruction is sent to the slave device, the slave device is controlled to modify the currently used third address into the default address, after judging, the application reset is confirmed, the slave device reset address which does not need to reset the address (namely, the current address is the default address) can be avoided, and the address is synchronized in the allocated address resource pool and the unallocated address resource pool which are set by the master device, so that the slave device can be allocated to the unique address when the slave device applies for allocation of the address later, the address allocated by the master device is ensured not to be repeated, and the master device can accurately manage the slave device.
Fig. 7 is a flowchart of still another address management method according to an embodiment of the present application. As shown in fig. 7, when the master device actively resets the address currently used by at least one slave device, still another address management method provided in the embodiments of the present application may be as follows.
S301, the master device generates a reset address instruction according to user trigger, and obtains the currently used addresses of the plurality of slave devices from the allocated address resource pool of the master device.
Alternatively, the master device may be provided with a selection button for selecting the slave device and a reset button for resetting the address, and after the user selects the slave device for which the address is desired by pressing the selection button, the reset button is pressed to trigger the master device to generate the reset address instruction of the slave device for which the address is desired, and the currently used use addresses of the slave devices for which the address is desired are respectively acquired.
Optionally, the master device may be provided with a touch screen, and after clicking the slave device with the desired address on the touch screen, the user clicks the option of selecting the desired address, so as to trigger the master device to generate the command of the desired address for resetting the slave device, and obtain the currently used address of the slave device with the desired address respectively.
It will be appreciated that the master device may choose to reset the addresses of the plurality of slave devices after selecting the plurality of slave devices to enable the master device to reset the addresses of the plurality of slave devices at once.
S302, the master device deletes the use addresses of the slave devices from the allocated address resource pool of the master device, and adds the use addresses to the unallocated address resource pool of the master device.
For example, after the master device obtains the currently used addresses of the plurality of slave devices from the allocated address resource pool set by the master device, according to a reset address instruction generated by the user triggering the master device, the use addresses of the plurality of slave devices are confirmed to be reset by the slave device, and then the respective use addresses of the plurality of slave devices are deleted from the allocated address resource pool of the master device and added to the unallocated address resource pool of the master device, so that the synchronous update of the address use condition of the slave device by the master device is realized.
S303, the master device generates a confirmation reset address instruction, and sends the confirmation reset address instruction to the plurality of slave devices based on the respective use addresses of the plurality of slave devices so as to enable the plurality of slave devices to reset the respective use addresses.
For example, after generating the confirm reset address instruction, the master device sends the confirm reset address instruction to the plurality of slave devices through communication links connected to the plurality of slave devices, respectively, based on the respective use addresses of the plurality of slave devices, thereby ensuring that the plurality of slave devices can successfully receive the reset address instruction sent by the master device.
S304, the slave device receives a confirmation reset address instruction sent by the master device, and modifies the currently used address of the slave device into a default address, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and a protocol address resource pool which are set by the master device.
For example, each slave device of the master device selecting the reset address receives a confirmation reset address instruction sent by the master device, and then each slave device receiving the confirmation reset address instruction modifies the currently used address of the slave device to a default address uniformly set when all slave devices leave the factory, so as to achieve the purpose of resetting the used address of the slave device.
According to the method and the device, the reset address instruction is triggered by selecting the plurality of slave devices at the master device side, and the currently used use addresses corresponding to the plurality of slave devices are obtained from the allocated address resource pool of the master device according to the reset address instruction, so that the reset address instruction can be sent to each slave device according to the use addresses corresponding to the plurality of slave devices, and then the use addresses corresponding to the slave devices can be reset according to the selection made by a user at the master device.
In summary, the address management method provided in the embodiment of the present application may be used to allocate a unique address to a slave device by a master device after the slave device leaves a factory and before the slave device is put into use, so as to facilitate accurate management of multiple slave devices according to the unique addresses in use. It can also be used for the need of accurately resetting one or more slave addresses due to the damage of the slave or the replacement of the slave when the master manages the addresses of the slave. By the above embodiment, the address management functions such as the allocation and the reset of the address of the slave device can be completed with a simple operation without requiring the programming capability, while ensuring the accuracy.
Fig. 8 is a schematic structural diagram of an address management apparatus applied to a master device according to an embodiment of the present application. As shown in fig. 8, the address management apparatus applied to a master device provided in this embodiment may include: a receiving module 701, a processing module 702 and a transmitting module 703.
The receiving module 701 is configured to receive a first address that is sent by a slave device and is modified by the slave device according to an address application instruction.
The processing module 702 is configured to determine whether the first address is in a protocol address resource pool set by the host device, generate an address modification instruction if the first address is in the protocol address resource pool, and obtain a second address in an unallocated address resource pool set by the host device.
A sending module 703, configured to send an address modifying instruction and the second address to the slave device, so that the slave device modifies the first address used by the slave device to the second address.
For example, the processing module 702 is configured to randomly select from a pool of unassigned address resources to obtain a second address; or selecting addresses according to the sequence from low to high of the serial numbers of the addresses in the unassigned address resource pool to obtain a second address; or selecting the addresses according to the sequence from high to low of the serial numbers of the addresses in the unassigned address resource pool to obtain the second address.
Optionally, the address management apparatus applied to a master device provided in this embodiment further includes: the resource pool management module 704 is configured to add the second address to the allocated address resource pool set by the master device, and delete the second address from the unallocated address resource pool of the master device.
Optionally, the receiving module 701 is further configured to receive an address application resetting instruction sent by any first slave device and a third address currently used by the first slave device.
Optionally, the processing module 702 is further configured to determine whether the third address is in the allocated address resource pool of the master device, delete the third address from the allocated address resource pool according to the address resetting instruction, and add the third address to the unallocated address resource pool if the third address is in the allocated address resource pool of the master device.
Optionally, the processing module 702 is further configured to obtain, from the allocated address resource pool of the master device, a currently used address of the plurality of slave devices according to a reset address instruction generated by triggering the master device by the user.
Optionally, the resource pool management module 704 is further configured to delete the usage addresses of the plurality of slave devices from the allocated address resource pool of the master device, and add the usage addresses to the unallocated address resource pool of the master device.
Optionally, the generating module 705 is further configured to generate a confirm reset address instruction, and the sending module 703 is further configured to send the confirm reset address instruction to the plurality of slave devices based on the respective usage addresses of the plurality of slave devices, so that the plurality of slave devices modify the respective usage addresses.
The specific functions and specific working processes of the receiving module 701, the processing module 702, the sending module 703, the resource pool management module 704 and the generating module 705 in this embodiment may refer to the processes of receiving, processing, sending, modifying an address and generating performed by the master device in the foregoing embodiment of the address management method, which are not described herein.
Fig. 9 is a schematic structural diagram of an address management apparatus applied to a slave device according to an embodiment of the present application. As shown in fig. 9, the address management apparatus applied to a slave device provided in this embodiment may include: an address modification module 801, an information transmission module 802, and an information reception module 803.
The address modification module 801 is configured to modify a current address of the slave device to a first address according to an address application instruction generated by triggering the slave device by a user.
The information sending module 802 is configured to send the first address to the master device.
The information receiving module 803 is configured to receive a modified address instruction and a second address sent by the master device, where the modified address instruction is generated by the master device after determining that the first address is in a protocol address resource pool set by the master device, and the second address is acquired by the master device in an unallocated address resource pool set by the master device.
The address modifying module 801 is further configured to modify the first address used to the second address according to the address modifying instruction.
Optionally, when at least one slave device actively applies for resetting the currently used address to the master device, the address management apparatus further includes an instruction generating module 804, configured to generate an address application resetting instruction according to the user trigger, and the information sending module 802 is further configured to send the address application resetting instruction and the third address currently used by the slave device to the master device.
Optionally, the address modification module 801 is further configured to modify the third address to a default address, where the default address does not belong to an allocated address resource pool, an unallocated address resource pool, and a protocol address resource pool set by the host.
Optionally, when the master device actively resets the address currently used by at least one slave device, the information receiving module 803 is further configured to receive an acknowledgement reset address instruction sent by the master device, and the address modifying module 801 is further configured to modify the address currently used by the slave device into a default address, where the default address does not belong to the allocated address resource pool, the unallocated address resource pool, and the protocol address resource pool set by the master device.
In summary, according to the address management method, the master device, the slave device and the address management apparatus described in the embodiments of the present application, the master device may manage addresses in the unassigned address resource pool and the assigned address resource pool in real time according to the address change of the slave device. After the master device sends an address modification instruction and a second address in the unassigned address resource pool to the slave device, the second address assigned to the slave device is timely deleted from the unassigned address resource pool, and the second address is added into the assigned address resource pool, so that the master device can synchronously manage the address assignment situation of the slave device, and the second address is ensured not to be repeated with the second address acquired this time when the second address is acquired from the unassigned address resource pool when the address is assigned to the slave device next time, thereby ensuring the uniqueness of the address assigned to the slave device by the master device, and enabling the master device to accurately manage the slave device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the system is used for executing the communication method provided by the embodiment of the method, and the technical principle and the technical effect are similar, and reference can be made to the corresponding process in the embodiment of the method, so that no further description is given here.
The embodiment of the application also provides a chip, which is used for storing and executing the instructions, and the steps executed by the main equipment in any method embodiment can be realized when the instructions are executed by the processor.
The embodiment of the application also provides a chip, which is used for storing and executing the instructions, and the instructions can realize the steps executed by the slave device in any method embodiment when being executed by the processor.
The embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps executed by the main device in any of the above method embodiments can be implemented.
The embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program can implement the steps executed by the slave device in any of the above method embodiments.
The embodiment of the application also provides a computer program product, when the computer program product runs on a terminal device, the terminal device executes the steps executed by the main device in any of the method embodiments.
The present application also provides a computer program product, which when run on a terminal device, performs the steps performed by the slave device in any of the above method embodiments.
Those skilled in the art will appreciate that the memory used in the embodiments provided herein may include high-speed random access memory, but may also include non-volatile memory (nonvolatile memory) or volatile memory, such as one or more magnetic storage devices, flash memory, or other nonvolatile solid state memory, for example, flash memory (flash memory), hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random access memory (random access memory, RAM), read-only memory (ROM), erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), programmable read-only memory (programmable read-only memory, PROM), magnetic memory, magnetic disk, optical disk, etc., the RAM may include static RAM or dynamic RAM.
Those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the present application and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (9)

1. An address management method, applied to a master device, comprising:
the master device receives a first address which is sent by the slave device and is modified by the slave device according to an address application instruction;
the master device judges whether the first address is in a protocol address resource pool set by the master device, if the first address is in the protocol address resource pool, an address modifying instruction is generated, and a second address in an unallocated address resource pool set by the master device is obtained;
the master device sends the address modifying instruction and the second address to the slave device so that the slave device modifies the first address used by the slave device into the second address;
The method further comprises the steps of:
the master device acquires the currently used addresses of a plurality of slave devices from an allocated address resource pool of the master device according to a reset address instruction generated by triggering the master device by a user;
the master device deletes the respective use addresses of the plurality of slave devices from the allocated address resource pool of the master device and adds the respective use addresses to the unallocated address resource pool of the master device;
the master device generates a confirmation reset address instruction, and sends the confirmation reset address instruction to the plurality of slave devices respectively based on the respective use addresses of the plurality of slave devices so as to enable the plurality of slave devices to modify the respective use addresses.
2. The method of claim 1, wherein the obtaining the second address in the unallocated address resource pool set by the master device comprises:
the master device randomly selects from the unassigned address resource pool to obtain the second address; or (b)
The master device selects addresses according to the sequence from low to high of the serial numbers of the addresses in the unassigned address resource pool to obtain the second address; or (b)
And the master equipment selects addresses according to the sequence from high to low of the sequence numbers of the addresses in the unassigned address resource pool so as to obtain the second address.
3. The method according to claim 1, wherein the method further comprises:
and the master device adds the second address to an allocated address resource pool set by the master device, and deletes the second address from the unallocated address resource pool of the master device.
4. The method according to claim 1, wherein the method further comprises:
the master device receives an address resetting application instruction sent by any first slave device and a third address currently used by the first slave device;
and the master device judges whether the third address is in the allocated address resource pool of the master device, if the third address is in the allocated address resource pool of the master device, the third address is deleted from the allocated address resource pool according to the address resetting application instruction and added into the unallocated address resource pool.
5. An address management method, applied to a slave device, the method comprising:
the slave device modifies the current address of the slave device into a first address according to an address application instruction generated by the slave device triggered by a user;
The slave device sends the first address to a master device;
the slave device receives a modified address instruction and a second address sent by the master device, wherein the modified address instruction is generated by the master device after judging that the first address is in a protocol address resource pool set by the master device, and the second address is acquired by the master device in an unallocated address resource pool set by the master device;
the slave device modifies the used first address into the second address according to the address modification instruction;
receiving a confirmation reset address instruction sent by a master device, wherein the confirmation reset address instruction is generated by the master device based on user triggering, and is used for instructing a plurality of slave devices to modify respective use addresses; the respective usage addresses of the plurality of slaves are deleted from the allocated address resource pool by the master and added to the unallocated address resource pool of the master.
6. The method of claim 5, wherein the method further comprises:
the slave device generates an application reset address instruction according to user trigger, and sends the application reset address instruction and a third address currently used by the slave device to the master device;
The slave device modifies the third address into a default address, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and the protocol address resource pool which are set by the master device.
7. The method of claim 5, wherein the method further comprises:
and the slave equipment receives a confirmation reset address instruction sent by the master equipment, and modifies the currently used address of the slave equipment into a default address, wherein the default address does not belong to an allocated address resource pool, an unallocated address resource pool and the protocol address resource pool which are set by the master equipment.
8. A master device, comprising: a memory, a processor, and instructions stored in the memory and executable on the processor, which when executed, implement the method of any one of claims 1 to 4.
9. A slave device, comprising: a memory, a processor, and instructions stored in the memory and executable on the processor, which when executed, implement the method of any one of claims 5 to 7.
CN202111682574.8A 2021-12-31 2021-12-31 Address management method, master device and slave device Active CN114301731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111682574.8A CN114301731B (en) 2021-12-31 2021-12-31 Address management method, master device and slave device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111682574.8A CN114301731B (en) 2021-12-31 2021-12-31 Address management method, master device and slave device

Publications (2)

Publication Number Publication Date
CN114301731A CN114301731A (en) 2022-04-08
CN114301731B true CN114301731B (en) 2023-12-22

Family

ID=80976456

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111682574.8A Active CN114301731B (en) 2021-12-31 2021-12-31 Address management method, master device and slave device

Country Status (1)

Country Link
CN (1) CN114301731B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780157A (en) * 2015-03-18 2015-07-15 上海动盟网络技术有限公司 Intelligent router and authentication management method based on intelligent router
CN106060187A (en) * 2016-05-26 2016-10-26 杭州华三通信技术有限公司 Address allocation methods and devices
CN108881505A (en) * 2018-05-30 2018-11-23 武汉高仕达电气有限公司 A kind of CAN bus node address distribution method and system
CN109698871A (en) * 2018-12-20 2019-04-30 京信通信系统(中国)有限公司 A kind of optical fiber distributed type access system and its management method
CN109936640A (en) * 2017-12-19 2019-06-25 苏州阿特斯阳光电力科技有限公司 From the address distribution method and device of node device
CN110505319A (en) * 2019-08-07 2019-11-26 金陵科技学院 A kind of RS485 is from device address auto-allocation method and system
CN111294416A (en) * 2020-01-16 2020-06-16 Oppo(重庆)智能科技有限公司 Method for obtaining IP address and related product
CN111654464A (en) * 2015-12-31 2020-09-11 华为技术有限公司 Access control method, authentication device and system
CN112291382A (en) * 2020-09-29 2021-01-29 新华三信息安全技术有限公司 IP address allocation method and device
CN112905508A (en) * 2021-02-01 2021-06-04 浙江中拓合控科技有限公司 Address allocation method, communication device and storage medium for serial communication equipment
CN113242170A (en) * 2021-05-21 2021-08-10 深圳易马达科技有限公司 Address allocation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6574906B2 (en) * 2015-09-29 2019-09-11 華為技術有限公司Huawei Technologies Co.,Ltd. Method, apparatus, and system for assigning IP address for master / slave network

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780157A (en) * 2015-03-18 2015-07-15 上海动盟网络技术有限公司 Intelligent router and authentication management method based on intelligent router
CN111654464A (en) * 2015-12-31 2020-09-11 华为技术有限公司 Access control method, authentication device and system
CN106060187A (en) * 2016-05-26 2016-10-26 杭州华三通信技术有限公司 Address allocation methods and devices
CN109936640A (en) * 2017-12-19 2019-06-25 苏州阿特斯阳光电力科技有限公司 From the address distribution method and device of node device
CN108881505A (en) * 2018-05-30 2018-11-23 武汉高仕达电气有限公司 A kind of CAN bus node address distribution method and system
CN109698871A (en) * 2018-12-20 2019-04-30 京信通信系统(中国)有限公司 A kind of optical fiber distributed type access system and its management method
CN110505319A (en) * 2019-08-07 2019-11-26 金陵科技学院 A kind of RS485 is from device address auto-allocation method and system
CN111294416A (en) * 2020-01-16 2020-06-16 Oppo(重庆)智能科技有限公司 Method for obtaining IP address and related product
CN112291382A (en) * 2020-09-29 2021-01-29 新华三信息安全技术有限公司 IP address allocation method and device
CN112905508A (en) * 2021-02-01 2021-06-04 浙江中拓合控科技有限公司 Address allocation method, communication device and storage medium for serial communication equipment
CN113242170A (en) * 2021-05-21 2021-08-10 深圳易马达科技有限公司 Address allocation method and device

Also Published As

Publication number Publication date
CN114301731A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN107566541B (en) Container network resource allocation method, system, storage medium and electronic device
CN107592367B (en) Resource sharing method and device for household appliances and computer readable storage medium
CN109906585B (en) Network slice management method, management unit and system
CN103516690B (en) A kind of business processing status information query method and device
CN112367711B (en) Resource allocation method, device and system for network slice
CN103458057A (en) Resource acquiring method, device and server
CN103297468A (en) Operation method for group resources and group server
CN107360633B (en) Pairing connection method and device of virtual reality system and virtual reality system
EP3177041A1 (en) Method for transmitting content between terminals through service control device link
CN112631780A (en) Resource scheduling method and device, storage medium and electronic equipment
CN103281236B (en) Electronic business card exchange method, device and system
CN114301731B (en) Address management method, master device and slave device
CN104426816B (en) A kind of virtual machine communication method and device
CN106797393B (en) Method for assigning actions to tags within a network, corresponding network and control device
CN106302093B (en) Communication method, system and server
CN111683159A (en) IP address allocation method, device, system and storage medium
CN102185881A (en) Household digital equipment wireless multi-protocol space sharing storage manager and method
US20150271775A1 (en) Method and Device for Deregistering Terminal Peripheral
CN111866856A (en) Mesh device control method and system, storage medium and electronic device
CN105245438A (en) Content sharing method, content sharing device and content sharing system
CN110611589B (en) Control method and device of regional control system and air conditioning system
CN114125725B (en) Broadcast message sending method, broadcast message receiving method, broadcast message sending device, broadcast message receiving device, and storage medium
CN110908293A (en) Shared electrical appliance control method and system based on NB-IOT
CN111209613A (en) Rapid design method and system of intelligent product
CN105188155A (en) Network connection method and terminal

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