Loop equipment address coding method and device, equipment and storage medium
Through the automated loop device address encoding method, errors and time waste caused by manual address setting in the fire alarm controller system are solved, and efficient and accurate address allocation is achieved.
Patent Information
- Application Number
- CN202411841787.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-02-14
AI Technical Summary
In the existing fire alarm controller system, the loop equipment address needs to be set manually, resulting in errors and waste time when the project volume is large.
A loop device address encoding method is provided. By receiving scanning commands sent by the fire alarm controller, the device scanning is automatically completed, the recoded device is detected, and the address allocation is performed according to the preset total address pool, and a new address is automatically assigned to each device.
There is no need to manually set the address, which improves the efficiency and time of setting the device address and reduces the error rate, and is suitable for large-scale engineering sites.
Smart Images

Figure CN119449772A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fire alarm controllers, and in particular to a loop device address coding method, device, equipment and storage medium. Background Art
[0002] The fire alarm controller is an alarm control device in the automatic fire alarm system that can receive, process and transmit fault and fire alarm signals from detection points, send out sound and light alarm signals, and display and record the location and time of the fire. At present, the bus-type fire alarm controller is more commonly used. The main board is controlled by a microcontroller and uses a two-wire bus, that is, two lines. The power line and the signal line are combined into two lines, which can complete power supply and data transmission at the same time. Generally, the two-wire bus is realized through a loop board.
[0003] The traditional fire alarm controller system sets the address of the loop device by means of a handheld encoder or a dip switch, or manually sets the address of the specified loop device through the controller software. The above methods have a high error rate, resulting in duplicate addresses of loop devices. Once duplicated, the system will malfunction. It is difficult to find duplicated devices on the project site, and it is necessary to find out which duplicated devices need to have their addresses modified. When the project is large, there are thousands of loop devices, and it is very time-consuming to encode the devices.
[0004] Therefore, it is urgent to propose a loop device address coding method, device, equipment and storage medium to solve the technical problem that the address of the loop device in the fire alarm controller system in the prior art needs to be manually set, which is not only prone to errors but also wastes time when the project volume is relatively large. Summary of the invention
[0005] In view of this, it is necessary to provide a loop device address coding method, device, equipment and storage medium to solve the technical problem that the address of the loop device in the fire alarm controller system in the prior art needs to be set manually, which is not only prone to errors but also wastes time when the project volume is relatively large.
[0006] In order to solve the above problem, the present invention provides a loop device address encoding method, comprising: When receiving a scan command sent by the fire alarm controller, perform a device scan according to the scan command to obtain information of all online devices; Perform duplicate code detection based on all online device information to determine a device allocation mode; When the device allocation mode is the full-loop device allocation mode, all online device information is allocated addresses according to a preset total address pool to obtain a new address for each online device; When the device allocation mode is the re-encoding device allocation mode, addresses are allocated to the re-encoding devices in all the online device information according to a preset total address pool to obtain a new address for each re-encoding device.
[0007] In a possible implementation, the information of all online devices includes an original address of each online device; and determining the device allocation mode according to the information of all online devices includes: Determine whether there is a device with a duplicate address based on all original addresses of all online devices in the all online device information; If yes, determining that the device allocation mode is a re-coding device allocation mode; If not, it is determined that the device allocation mode is a full-loop device allocation mode.
[0008] In a possible implementation, allocating addresses to all online device information according to a preset total address pool to obtain a new address for each online device includes: Sorting devices according to the original address of each online device to obtain a loop device sequence; An address is allocated to each online device according to the preset total address pool and the loop device sequence to obtain a new address for each online device.
[0009] In a possible implementation, allocating an address to each online device according to the preset total address pool and the loop device sequence to obtain a new address for each online device includes: Determine an initial address according to the preset total address pool; Starting from the initial address in the preset total address pool, addresses are allocated to the online devices in the loop device sequence one by one in an address incrementing manner to obtain a new address for each online device.
[0010] In a possible implementation, allocating addresses to the re-encoding devices in the online device information according to the preset total address pool to obtain a new address for each re-encoding device includes: Filter all the online device information to obtain all the duplicate code devices; Obtaining an unused address pool according to the preset total address pool and the information of all online devices; Allocate addresses to all the re-encoding devices according to the unused address pool to obtain a new address for each re-encoding device.
[0011] In a possible implementation, obtaining an unused address pool according to the preset total address pool and the information of all online devices includes: Analyze and process all online device information according to the preset total address pool to obtain all non-repetitive and used addresses; The preset total address pool is screened according to all the addresses to obtain an unused address pool.
[0012] In a possible implementation, the information of all online devices includes the type and SN number of each online device; the address allocation for all re-coding devices according to the unused address pool to obtain a new address for each re-coding device includes: Sort all the re-coding devices according to the type and the SN number to obtain a re-coding device sequence; According to the size of the addresses in the unused address pool, the addresses are allocated to the re-encoding devices in the re-encoding device sequence in sequence in an address increment manner to obtain a new address for each re-encoding device.
[0013] On the other hand, the present invention also provides a loop device address encoding device, comprising: A command receiving module is used to scan the equipment according to the scanning command when receiving the scanning command sent by the fire alarm controller, so as to obtain the information of all online equipment; A mode determination module, used to perform duplicate code detection based on all online device information and determine a device allocation mode; A loop address allocation module, used for allocating addresses to all online device information according to a preset total address pool to obtain a new address for each online device when the device allocation mode is a full loop device allocation mode; The re-code address allocation module is used to allocate addresses to the re-code devices in the online device information according to a preset total address pool when the device allocation mode is the re-code device allocation mode, so as to obtain a new address for each re-code device.
[0014] On the other hand, an embodiment of the present invention discloses an embedded system device, including: a mainboard processor, a memory, a display, a button, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the various steps of the above-mentioned loop device address encoding method embodiment are implemented.
[0015] The beneficial effects of the present invention are as follows: when a scanning command sent by a fire alarm controller is received, a device scan is performed according to the scanning command to obtain all online device information, thereby automatically completing the device scan and obtaining all online device information; further, duplicate code detection is performed based on all online device information to determine the device allocation mode, and when the device allocation mode is a full-loop device allocation mode, addresses are allocated to all online device information based on a preset total address pool to obtain a new address for each online device; when the device allocation mode is a duplicate code device allocation mode, addresses are allocated to all duplicate code devices in the online device information based on a preset total address pool to obtain a new address for each duplicate code device; thereby, corresponding addresses can be allocated to devices according to different device allocation modes without manual setting, thereby improving the efficiency and time of device address setting and reducing the error rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic flow chart of an embodiment of a loop device address encoding method provided by the present invention; Figure 2 A schematic diagram of the structure of an embodiment of a loop device of a fire alarm system provided by the present invention; Figure 3 For the present invention Figure 1 A schematic flow chart of an embodiment of step S102; Figure 4 For the present invention Figure 1 A schematic flow chart of an embodiment of step S104; Figure 5 A schematic diagram of the structure of an embodiment of the loop device address encoding device provided by the present invention; Figure 6 A schematic structural diagram of an embodiment of an embedded system device provided by the present invention. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0018] like Figure 1 As shown, a specific embodiment of the present invention discloses a loop device address encoding method, including: S101, when receiving a scan command sent by a fire alarm controller, perform a device scan according to the scan command to obtain information of all online devices; S102, performing duplicate code detection based on all online device information to determine the device allocation mode; S103, when the device allocation mode is the full-loop device allocation mode, allocating addresses to all online device information according to a preset total address pool to obtain a new address for each online device; S104. When the device allocation mode is the re-encoding device allocation mode, addresses are allocated to the re-encoding devices in all online device information according to a preset total address pool to obtain a new address for each re-encoding device.
[0019] It should be understood that the loop board is a board installed on the fire alarm controller, which is used to detect the status of each loop in the system and to alarm in time when the loop fails. The loop board monitors and controls fire detection, fire sprinkler, sound and light alarm and other equipment by connecting detectors or modules and other equipment, and is an important part of the fire protection system. The loop board can realize the bus loop (alarm linkage bus), each loop supports a certain number of address points, can connect a certain number of loop devices, encode according to the address, and each loop device occupies an address point. Various detectors (smoke fire detectors or heat fire detectors), manual alarm buttons, fire alarm buttons, modules, and sound and light alarms with address coding can be connected in parallel to the bus loop board. By increasing the number of loop boards, the capacity of the controller can be expanded. In the fire alarm system, each loop device has a unique address code in the system through the location of the loop board and the address point of the loop board where it is located. When a fire occurs, the alarm signal of the fire triggering device is fed back to the fire alarm controller through the bus. The controller identifies the loop number and address point of the alarm device through this loop device, sends out a control signal according to the set control logic, and sends out control instructions to the output module device or coded sound and light alarm of the specified loop and address point to realize the system function.
[0020] In a specific embodiment of the present invention, in a fire alarm system, the loop device is connected to the loop board in parallel, and the loop board is connected to the loop device, such as a common Figure 2 There are 6 types of module devices shown. Figure 2The fire alarm controller in the system may include a mainboard card, and may also display output and control output through key input and touch screen input. The fire alarm controller may be connected to loop boards 1-N, and each loop board may be connected to devices such as smoke fire sensors, temperature fire sensors, manual alarm buttons, fire alarm buttons, input and output modules, and sound and light alarms. A preset total address pool may be set according to actual conditions. When performing the embodiment of the present invention, the preset total address pool may be obtained. The fire alarm controller may send a scan command to the loop board. When the loop board receives the scan command sent by the fire alarm controller, it may scan the devices under the loop, and then return the obtained online device information to the fire alarm controller. The fire alarm controller may obtain the online device information of each loop board, and then obtain all online device information. Then, the fire alarm controller may perform re-code detection on all online device information, and determine the device allocation mode. When the device allocation mode is the full loop device allocation mode, all online device information may be allocated addresses through the addresses in the preset total address pool, so that each online device may obtain a new allocated address. When the device allocation mode is the re-code device allocation mode, addresses of re-code devices in all online device information can be allocated through a preset total address pool, so that each re-code device can obtain a new allocated address.
[0021] Compared with the prior art, the present embodiment provides that when a scan command sent by a fire alarm controller is received, a device scan is performed according to the scan command to obtain all online device information, thereby automatically completing the device scan and obtaining all online device information; further, a duplicate code detection is performed based on all online device information to determine the device allocation mode. When the device allocation mode is a full-loop device allocation mode, addresses are allocated to all online device information based on a preset total address pool to obtain a new address for each online device; when the device allocation mode is a duplicate code device allocation mode, addresses are allocated to all duplicate code devices in the online device information based on a preset total address pool to obtain a new address for each duplicate code device; thereby, corresponding addresses can be allocated to devices according to different device allocation modes without manual setting, thereby improving the efficiency and time of device address setting and reducing the error rate.
[0022] In some embodiments of the present invention, all online device information includes the original address of each online device; Figure 3 As shown, step S102 includes: S301, judging whether there is a device with a duplicate address according to all original addresses of all online devices in all online device information; S302: If yes, determine that the device allocation mode is a re-coding device allocation mode; S303: If not, determine that the device allocation mode is the full-loop device allocation mode.
[0023] In a specific embodiment of the present invention, after obtaining all online device information, all original addresses of all online devices in all online device information can be analyzed to determine whether there is a duplicate address device. If so, the device allocation mode can be determined to be the duplicate address device allocation mode. If not, the device allocation mode can be determined to be the full-loop device allocation mode, wherein the algorithm uses a hash table algorithm to determine whether there are devices with duplicate addresses among all online devices. If there are duplicate address devices, they are screened out and used for the duplicate address device allocation mode.
[0024] In some embodiments of the present invention, step S103 includes: Sort the devices according to the original address of each online device to obtain the loop device sequence; An address is allocated to each online device according to a preset total address pool and a loop device sequence to obtain a new address for each online device.
[0025] In a specific embodiment of the present invention, when the device allocation mode is a full-loop device allocation mode, all online devices can be sorted in ascending order according to all original addresses of all online devices in all online device information to obtain a loop device sequence, and then an address can be allocated to each online device according to the arrangement order of the addresses in the preset total address pool and the loop device sequence, so that a new address for each online device can be obtained.
[0026] In some embodiments of the present invention, allocating an address to each online device according to a preset total address pool and a loop device sequence to obtain a new address for each online device includes: Determine the initial address based on the preset total address pool; Starting from the initial address in the preset total address pool, the addresses of the online devices in the loop device sequence are allocated one by one in an address increment manner to obtain a new address for each online device.
[0027] In a specific embodiment of the present invention, the initial address in the preset total address pool can be determined according to actual conditions. The initial address can be the first address that needs to be assigned an address, so that starting from the initial address, the online devices in the loop device sequence can be assigned addresses one by one in an address incrementing manner according to the order of the online devices in the loop device sequence, and a new address for each online device can be obtained. For example, the preset total address pool can be 1-225. When the initial address is 1, it can be determined that the first online device in the loop device sequence is assigned from 1, then the new address of the first online device is 1, and the addresses are assigned by adding 1 in sequence, then the new address of the second online device is 2, and so on, until the last online device. Among them, after the fire alarm controller receives all the online device information, it can send a write address command to the loop board, and the loop board automatically rewrites the new addresses of the scanned online devices in batches.
[0028] In some embodiments of the present invention, Figure 4 As shown, step S104 includes: S401, filter all online device information to obtain all duplicate code devices; S402, obtaining an unused address pool according to a preset total address pool and information of all online devices; S403, allocating addresses to all re-coding devices according to the unused address pool to obtain a new address for each re-coding device.
[0029] In a specific embodiment of the present invention, when the device allocation mode is a duplicate code device allocation mode, the original address of each online device in all online device information can be filtered through an address filtering algorithm to obtain all duplicate code devices. The specific processing process of the address filtering algorithm can be: the addresses in the preset total address pool can be analyzed with the original addresses of all online device information to obtain an unused address pool, and then the addresses of all duplicate code devices can be allocated one by one through the unused address pool to obtain a new address for each duplicate code device.
[0030] In some embodiments of the present invention, step S402 includes: Analyze and process all online device information according to the preset total address pool to obtain all unique and used addresses; The preset total address pool is screened according to all addresses to obtain an unused address pool.
[0031] In a specific embodiment of the present invention, the addresses in the preset total address pool can be matched and analyzed with all the original addresses of all online device information to obtain all the non-repetitive addresses in the preset total address pool that are already in use. Then, all the addresses in the preset total address pool can be screened to obtain unused addresses, that is, an unused address pool can be obtained.
[0032] In some embodiments of the present invention, all online device information includes the type and SN number of each online device; step S403 includes: Sort all re-coded devices according to type and SN number to obtain a re-coded device sequence; According to the size of the addresses in the unused address pool, the addresses are allocated to the re-coding devices in the re-coding device sequence in sequence in an address incrementing manner to obtain a new address for each re-coding device.
[0033] In a specific embodiment of the present invention, all online device information may include the type and SN number of each online device. All re-coded devices can be sorted from small to large by type and SN number to obtain a re-coded device sequence. Then, addresses can be allocated to devices in the re-coded device sequence in ascending order according to the size of the addresses in the unused address pool, so that each re-coded device can obtain a new address. After the fire alarm controller receives all the online device information, it can send a write address command to the loop board, and the loop board automatically rewrites the new addresses of the scanned online devices in batches.
[0034] The controller interface of the embodiment of the present invention can scan the loop device and then view the scanning results. Based on the above two different modes, the controller automatically addresses the loop device after software processing and sends write address commands in batches to achieve the effect of setting the address.
[0035] In order to better implement the loop device address encoding method in the embodiment of the present invention, based on the loop device address encoding method, the embodiment of the present invention also provides a loop device address encoding device, such as Figure 5 As shown, the loop device address encoding device 500 includes: The command receiving module 501 is used to scan the equipment according to the scanning command when receiving the scanning command sent by the fire alarm controller, and obtain the information of all online equipment; Mode determination module 502, used to perform duplicate code detection based on all online device information and determine the device allocation mode; The loop address allocation module 503 is used to allocate addresses to all online device information according to a preset total address pool to obtain a new address for each online device when the device allocation mode is the full loop device allocation mode; The re-code address allocation module 504 is used to allocate addresses to the re-code devices in all online device information according to a preset total address pool when the device allocation mode is the re-code device allocation mode, and obtain a new address for each re-code device.
[0036] The loop device address encoding apparatus 500 provided in the above embodiment can implement the technical solution described in the above loop device address encoding method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above loop device address encoding method embodiment, which will not be repeated here.
[0037] like Figure 6 As shown, the present invention also provides an embedded system device 600. The embedded system device 600 includes a mainboard processor 601, a memory 602 and a display 603. Figure 6 Only some components of the embedded system device 600 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0038] In some embodiments, the memory 602 may be an internal storage unit of the embedded system device 600, such as a hard disk or memory of the embedded system device 600. In other embodiments, the memory 602 may also be an external storage device of the embedded system device 600, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the embedded system device 600.
[0039] Furthermore, the memory 602 may include both an internal storage unit of the embedded system device 600 and an external storage device. The memory 602 is used to store application software installed in the embedded system device 600 and various data.
[0040] In some embodiments, the motherboard processor 601 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 602, such as the loop device address encoding method of the present invention.
[0041] In some embodiments, the display 603 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 603 is used to display information of the embedded system device 600 and to display a visual user interface. The components 601-603 of the embedded system device 600 communicate with each other through a system bus.
[0042] In some embodiments of the present invention, when the motherboard processor 601 executes the loop device address encoding program in the memory 602, the following steps may be implemented: When receiving the scan command sent by the fire alarm controller, perform device scan according to the scan command to obtain all online device information; Perform duplicate code detection based on all online device information to determine the device allocation mode; When the device allocation mode is the full-loop device allocation mode, all online device information is allocated addresses according to the preset total address pool to obtain a new address for each online device; When the device allocation mode is the re-encoding device allocation mode, addresses are allocated to the re-encoding devices in all online device information according to the preset total address pool to obtain a new address for each re-encoding device.
[0043] It should be understood that: when the mainboard processor 601 executes the loop device address encoding program in the memory 602, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0044] The loop device address encoding method, apparatus, device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A loop device address encoding method, characterized in that: include: When receiving a scan command sent by the fire alarm controller, perform a device scan according to the scan command to obtain information of all online devices; Perform duplicate code detection based on all online device information to determine a device allocation mode; When the device allocation mode is the full-loop device allocation mode, all online device information is allocated addresses according to a preset total address pool to obtain a new address for each online device; When the device allocation mode is the re-encoding device allocation mode, addresses are allocated to the re-encoding devices in all the online device information according to a preset total address pool to obtain a new address for each re-encoding device.
2. The loop device address encoding method according to claim 1, characterized in that: The information of all online devices includes the original address of each online device; and determining the device allocation mode according to the information of all online devices includes: Determine whether there is a device with a duplicate address based on all original addresses of all online devices in the all online device information; If yes, determining that the device allocation mode is a re-coding device allocation mode; If not, it is determined that the device allocation mode is a full-loop device allocation mode.
3. The loop device address encoding method according to claim 2, characterized in that: The step of allocating addresses to all online device information according to a preset total address pool to obtain a new address for each online device includes: Sorting devices according to the original address of each online device to obtain a loop device sequence; An address is allocated to each online device according to the preset total address pool and the loop device sequence to obtain a new address for each online device.
4. The loop device address encoding method according to claim 3, characterized in that: The allocating an address to each online device according to the preset total address pool and the loop device sequence to obtain a new address for each online device includes: Determine an initial address according to the preset total address pool; Starting from the initial address in the preset total address pool, addresses are allocated to the online devices in the loop device sequence one by one in an address incrementing manner to obtain a new address for each online device.
5. The loop device address encoding method according to claim 1, characterized in that: The step of allocating addresses to the re-coding devices in the online device information according to the preset total address pool to obtain a new address for each re-coding device includes: Filter all the online device information to obtain all the duplicate code devices; Obtaining an unused address pool according to the preset total address pool and the information of all online devices; Allocate addresses for all the re-encoding devices according to the unused address pool to obtain a new address for each re-encoding device.
6. The loop device address encoding method according to claim 5, characterized in that: The obtaining of an unused address pool according to the preset total address pool and the information of all online devices includes: Analyze and process all online device information according to the preset total address pool to obtain all non-repetitive and used addresses; The preset total address pool is screened according to all the addresses to obtain an unused address pool.
7. The loop device address encoding method according to claim 5, characterized in that: The information of all online devices includes the type and SN number of each online device; the address allocation for all re-coding devices according to the unused address pool to obtain a new address for each re-coding device includes: Sort all the re-coding devices according to the type and the SN number to obtain a re-coding device sequence; According to the size of the addresses in the unused address pool, the addresses are allocated to the re-encoding devices in the re-encoding device sequence in sequence in an address increment manner to obtain a new address for each re-encoding device.
8. A loop device address encoding device, characterized in that: include: A command receiving module is used to scan the equipment according to the scanning command when receiving the scanning command sent by the fire alarm controller, so as to obtain the information of all online equipment; A mode determination module, used to perform duplicate code detection based on all online device information and determine a device allocation mode; A loop address allocation module, used for allocating addresses to all online device information according to a preset total address pool to obtain a new address for each online device when the device allocation mode is a full loop device allocation mode; The re-code address allocation module is used to allocate addresses to the re-code devices in the online device information according to a preset total address pool when the device allocation mode is the re-code device allocation mode, so as to obtain a new address for each re-code device.
9. An embedded system device, characterized in that: include: A mainboard processor, a memory, a display, a button, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the loop device address encoding method as described in any one of claims 1-7.