Address allocation method, electronic device, multi-device system, and storage medium
By disabling the address allocation function of other parallel ports except the first parallel port in the multi-device system, it is ensured that the master device can accurately allocate addresses to the slave devices, solving the problem of low address allocation accuracy in the multi-device system and improving Improve the orderliness and efficiency of address allocation.
Patent Information
- Application Number
- PCT/CN2024/083146
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-29
- Filing Date
- 2024-03-22
- Publication Date
- 2024-10-03
AI Technical Summary
In a multi-device system, the master device cannot accurately allocate addresses to multiple slave devices. When multiple slave devices are connected at the same time, the accuracy of address allocation decreases.
By disabling the address allocation function of other parallel ports except the first parallel port, when the first parallel port receives an address allocation request, it sends an address allocation instruction to it, and enables it after receiving the address configuration completion instruction. Address allocation function for other parallel ports.
This ensures the orderliness and accuracy of address allocation, prevents the address allocated by the master device for a slave device from being received by other slave devices, and improves the address allocation efficiency of a multi-device system.
Smart Images

Figure CN2024083146_03102024_PF_FP_ABST
Abstract
Description
Address allocation method, electronic device, multi-device system and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2023, with application number 202310363084.4 and invention name “Address allocation method, multi-device system and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of new energy technology, and in particular to an address allocation method, electronic equipment, a multi-device system, and a storage medium. Background Art
[0004] The statements herein merely provide background information related to the present application and do not necessarily constitute exemplary techniques.
[0005] In a master-slave architecture, such as a multi-device system for energy storage devices (such as battery packs), the master device uses the same communication bus to communicate with multiple slave devices. When the master device detects a slave device connected, it assigns an address to the connected slave device. However, if multiple slave devices are connected to the master device simultaneously, the master device may be unable to accurately assign addresses to the multiple connected slave devices.
[0006] Summary of the Invention
[0007] According to various embodiments of the present application, an address allocation method, an electronic device, a multi-device system, and a storage medium are provided.
[0008] An embodiment of the present application provides an address allocation method, which is applied to a master device of a multi-device system, wherein the master device is connected to a slave device through a parallel port; the slave device is connected to the master device or other slave devices through a parallel port; the method includes: when an address allocation request is received through a first parallel port, disabling the address allocation function of other parallel ports other than the first parallel port; the first parallel port is any parallel port of the master device; sending an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request; when an address configuration completion instruction is received through the first parallel port, enabling the address allocation function of other parallel ports other than the first parallel port.
[0009] An embodiment of the present application also provides an address allocation device, which runs on a master device of a multi-device system, wherein the master device is connected to a slave device through a parallel port; the slave device is connected to the master device or other slave devices through a parallel port; the method includes: a disabling unit, configured to disable the address allocation function of other parallel ports other than the first parallel port when an address allocation request is received through the first parallel port; the first parallel port is any parallel port of the master device; a sending unit, configured to send an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request; a control unit, configured to enable the address allocation function of other parallel ports other than the first parallel port when an address configuration completion instruction is received through the first parallel port.
[0010] An embodiment of the present application also provides an electronic device, serving as a master device, comprising: a parallel port configured to connect to a slave device; a memory storing computer-readable instructions; and a processor executing the computer-readable instructions stored in the memory to implement the address allocation method.
[0011] An embodiment of the present application also provides a multi-device system, which includes multiple electronic devices; the multiple electronic devices are configured with a master device and a slave device; the master device is connected to the slave device through a parallel port; the slave device is connected to the master device or other slave devices through a parallel port; wherein the master device executes to implement the address allocation method.
[0012] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the address allocation method.
[0013] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments or exemplary technologies of the present application, the following briefly introduces the drawings required for use in the description of the embodiments or exemplary technologies. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, without paying any creative work, they can also obtain drawings of other embodiments based on these drawings.
[0015] FIG1 is an application scenario diagram of an address allocation method provided in one embodiment of the present application.
[0016] FIG2 is a flowchart of an address allocation method provided in one embodiment of the present application.
[0017] FIG3 is a schematic diagram of a parallel port in a master device provided in one embodiment of the present application.
[0018] FIG4 is a schematic diagram of slave device address numbering provided in one embodiment of the present application.
[0019] FIG5 is a flowchart of an address allocation method provided in another embodiment of the present application.
[0020] FIG6 is a flowchart of an address allocation method provided in another embodiment of the present application.
[0021] FIG7 is a functional module diagram of an address allocation device provided in one embodiment of the present application.
[0022] FIG8 is a schematic structural diagram of an electronic device for implementing an address allocation method according to one embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the objectives, technical solutions and advantages of this application clearer, this application is described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0025] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner. The following embodiments and features in the embodiments may be combined with each other unless there is a conflict.
[0026] In a master-slave architecture, such as a multi-device system of energy storage devices (such as battery packs), the master device uses the same communication bus to communicate with multiple slave devices. When the master device of the multi-device system detects that a slave device is connected, it will assign an address to the connected slave device. However, when multiple slave devices are connected to the master device at the same time, the address allocation instruction sent by the master device will be received by all slave devices connected to the communication bus. At this time, it is impossible to confirm which slave device the address allocation instruction is specifically for, which will cause the master device to be unable to accurately assign addresses to the multiple connected slave devices. The following is an application scenario of an address allocation method provided in an embodiment of the present application, described in conjunction with Figure 1.
[0027] As shown in Figure 1, a multi-device system 100 includes a master device 10 and at least one slave device (e.g., slave device A1, slave device A2, ..., slave device An, slave device B1, slave device B2, ..., slave device Bn in Figure 1). The master device 10 is configured with multiple parallel ports, and the master device 10 is connected to at least one slave device via the parallel ports. A slave device can also be connected to the master device 10 or another slave device via the parallel ports. Slave devices are connected to the master device 10 in a cascaded manner. When the master device 10 detects a slave device connected to the multi-device system 100, it assigns an address to the connected slave device.
[0028] As shown in Figure 1, the master device 10 in the multi-device system 100 is connected to two slave device links. Since the control logic of the two slave device links is consistent, for ease of description, the embodiment of the present application is described using one slave device link. Specifically, the master device 10 starts the parallel port a0. When the slave device A1 detects that the master device 10 outputs a signal through the parallel port a0, the slave device A1 will feedback a signal to the master device 10. At this time, the master device 10 determines that the parallel port a0 is connected to the slave device A1, and then the master device 10 will assign an address to the slave device A1. After the slave device A1 completes the address assignment, the slave device A1 outputs a signal through its own parallel port a1. When the slave device A2 detects the output signal sent by the slave device A1 through the parallel port a1, the slave device A2 will feedback a signal to the slave device A1. When the slave device A1 detects the feedback signal, the slave device A1 will notify the master device 10 that the slave device A2 is connected to the multi-device system 100, and the master device 10 will assign an address to the slave device A2.
[0029] When master device 10 simultaneously detects feedback signals from slave devices A1 and B1, the address assigned by master device 10 will be received by both slave devices A1 and B1. Similarly, if slave devices A1, A2, B1, and B2 have all been assigned addresses, and slave devices A3 and B3 are simultaneously connected to multi-device system 100, slave devices A2 and B2 will simultaneously feed back information about the connected slave devices to master device 10. At this point, the address assigned by master device 10 will also be received by both slave devices A3 and B3 simultaneously, making it impossible for master device 10 to assign addresses to the slave devices in an orderly manner, resulting in low address allocation accuracy.
[0030] Based on the above problems, the present invention provides an address allocation method, which enables the master device to allocate addresses to the slave devices in an orderly manner and ensures the accuracy of the address allocation. The address allocation method will be described below with reference to the flowchart shown in FIG2 .
[0031] In the embodiments of the present application, both the master device and the slave device can be energy storage devices. The energy storage device can be a battery pack with only storage or discharge functions, or a mobile energy storage device with power conversion functions. For example, the energy storage device can also be used in autonomous vehicles such as automotive equipment, lawn mowing equipment, sweeping equipment, mine clearance equipment, and cruise control equipment. This is not a limitation.
[0032] FIG2 is a flowchart of an address allocation method according to an embodiment of the present application. The address allocation method is applied to a master device (e.g., master device 10 in FIG1 ), which may be an electronic device such as an energy storage device. The order of the steps in the flowchart may be changed, and some steps may be omitted, depending on different requirements.
[0033] S201 , when an address allocation request is received through a first parallel port, disabling address allocation functions of other parallel ports except the first parallel port; the first parallel port is any parallel port of a master device.
[0034] In at least one embodiment of the present application, an address allocation request may be triggered when a slave device is connected to any parallel port of a master device. An address allocation request may also be triggered when a slave device to which an address has been assigned is connected to another slave device. Parallel ports other than the first parallel port may include parallel ports connected to slave devices with unassigned addresses and parallel ports not connected to any slave devices.
[0035] In one embodiment, after the master device disables the address allocation function for parallel ports other than the first parallel port, the other parallel ports (e.g., port 03 in FIG3 ) can still connect to new slave devices. However, port 03 will not send address allocation instructions to the connected slave device C0, nor will it respond to address allocation requests from slave device C0. In one embodiment, after disabling the address allocation function, the parallel ports can still perform other functions, such as charging and discharging. By disabling the address allocation function for parallel ports other than the first parallel port, the address assigned by the master device to the slave device of the first parallel port can be prevented from being received by other slave devices, thereby improving the orderliness of address allocation.
[0036] In another embodiment, the master device disables all parallel ports other than the first parallel port. When the master device disables all parallel ports other than the first parallel port, all functions of the other parallel ports are disabled. Even if a new slave device is connected, the new slave device only has a physical connection to the parallel port, not an electrical connection. That is, no communication or power transmission occurs between the two. Therefore, the slave device connected to the parallel port cannot receive the address assigned by the master device to the first parallel port. In one embodiment, disabling a parallel port may simply disable the address allocation function of the parallel port, i.e., simply prohibiting the parallel port from sending address allocation instructions to connected slave devices or refusing to respond to address allocation requests from connected slave devices. By disabling all parallel ports other than the first parallel port, the master device can avoid receiving address allocation requests from other parallel ports other than the first parallel port when assigning addresses to slave devices connected to the first parallel port. This prevents the master device from receiving address allocation requests from other parallel ports when assigning addresses to slave devices connected to the first parallel port. This prevents the disordered address allocation caused by the simultaneous connection of multiple slave devices, thereby improving the accuracy of address allocation.
[0037] In another embodiment, the master device disables parallel ports other than the first parallel port that are not connected to slave devices, and sends a disable instruction to parallel ports other than the first parallel port that are connected to slave devices. The disable instruction is configured to instruct the device connected to a slave device with an unassigned address to disable the corresponding parallel port. The device connected to a slave device with an unassigned address can be the master device itself or a slave device. That is, when disabling the address allocation function of parallel ports other than the first parallel port, it will be determined based on the situation of the connected slave device. Specifically, when a parallel port of a master device or a slave device is not connected to a slave device, the parallel port can be directly disabled. When a slave device that has not been assigned an address is connected to a master device or a slave device, the corresponding parallel port will also be disabled.
[0038] The parallel ports in the master device provided in the embodiment of the present application are illustrated in conjunction with Figure 3. As shown in Figure 3, the parallel ports of the master device 10 include port 01, port 02, port 03, and port 04. Port 02 is not connected to any slave device. Port 03 is connected to the slave device C0 with an unassigned address. Port 04 is connected to the slave device C1 with an assigned address, and the slave device C1 is connected to the slave device C2 with an unassigned address. Assuming that the first parallel port is port 01, when the master device 10 receives an address allocation request through port 01, it sends a disable instruction to port 02, port 03, and port 04, and sends the disable instruction to the corresponding slave devices C0 and C1 through port 03 and port 04. The disable instruction is configured to instruct the master device 10 to disable port 02 and port 03 and to instruct the slave device C1 to disable its own parallel port connected to the slave device C2, thereby disabling the address allocation function of other parallel ports other than port 01.
[0039] Since other parallel ports that are not connected to slave devices and other parallel ports connected to slave devices with unassigned addresses are disabled, the slave devices on the corresponding parallel ports cannot detect the signals output by the master device or the slave devices at the upper level. Therefore, it is possible to prevent the address assigned by the master device to the slave device of the first parallel port (for example, port 01) from being received by other slave devices with unassigned addresses, so that the master device can assign addresses to the slave devices in an orderly manner.
[0040] In at least one embodiment of the present application, if the slave device C1 is connected to a slave device with an unassigned address, the master device determines that the slave device C1 has completed disabling the corresponding parallel port when receiving a response signal from the slave device C1 to the disable command.
[0041] S202: Send an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request.
[0042] In at least one embodiment of the present application, the slave device that sends the address allocation request can be a slave device directly connected to the master device (for example, the newly added slave device in Figure 3), or it can be a slave device connected to a slave device with an assigned address, such as slave device C2 in Figure 3.
[0043] In at least one embodiment of the present application, the master device determines the port address of the first parallel port, and determines the hierarchical relationship of the slave device that sends the address allocation request in the multi-device system, and further allocates an address to the slave device that sends the address allocation request based on the port address and the hierarchical relationship.
[0044] The slave device address numbering provided in the embodiment of the present application is illustrated in conjunction with Figure 4. As shown in Figure 4, it is assumed that the master device includes a first port and a second port. The first port is connected to slave device D1, slave device D2, ..., slave device Dn in sequence. The second port is connected to slave device E1. If the port address of the first port is 10x, since the level of slave device D1 in the multi-device system is 1, the address number of the master device for slave device D1 can be 101. Since the level of slave device D2 in the multi-device system is 2, the address number of the master device for slave device D2 can be 102, and so on. Correspondingly, the port address of the second port can be 20x, since the level of slave device E1 in the multi-device system is 1, the address number of the master device for slave device E1 can be 201.
[0045] By combining the port address and the hierarchical relationship to assign addresses to slave devices, the rationality of address allocation can be improved. In this embodiment, different address combinations are configured for different parallel ports of the master device, which facilitates the distinction and management of slave devices of different parallel ports and is conducive to improving the control efficiency of the slave devices.
[0046] S203 : When an address configuration completion instruction is received through the first parallel port, enable address allocation functions of other parallel ports except the first parallel port.
[0047] In at least one embodiment of the present application, after the master device enables the address allocation function of other parallel ports except the first parallel port, all parallel ports are restored to normal functions, can receive address allocation requests from newly connected slave devices, and transmit the address allocation instructions generated by the master device to the corresponding slave devices.
[0048] By using the above-mentioned address allocation method, when the first parallel port receives an address allocation request, by disabling the address allocation function of other parallel ports except the first parallel port, it is possible to prevent the address allocated by the master device to the slave device that sends the address allocation request from being received by other slave devices, thereby improving the orderliness of address allocation and thus improving the accuracy of address allocation.
[0049] FIG5 is a flowchart of an address allocation method according to another embodiment of the present application. This address allocation method is applied to a master device (e.g., master device 10 in FIG1 ), which may be an electronic device such as an energy storage device. As shown in FIG5 , the address allocation method may include the following steps S501-S505. Depending on different requirements, the order of the steps in this flowchart may be changed, and some steps may be omitted.
[0050] S501 : After receiving an address allocation request through a first parallel port, obtain the status of a master device.
[0051] In at least one embodiment of the present application, the state of the master device includes an address allocation state and a non-address allocation state. This state can be read using a corresponding state identifier. For example, when the state identifier is a first preset value, it indicates that the master device is in an address allocation state, while when it is a second preset value, it indicates that the master device is not in an address allocation state, i.e., a non-address allocation state. It is understood that the corresponding state can also be determined based on all current execution states of the master device, such as when the address allocation function is disabled or address allocation is being performed, it is determined to be an address allocation state, otherwise it is determined to be a non-address allocation state.
[0052] S502: Detect whether the master device is in an address allocation state.
[0053] In at least one embodiment of the present application, the specific value of the aforementioned status identifier can be used to detect whether the master device has assigned an address to the slave device. If the status identifier is detected to be a first preset value, it is determined that the master device is in the address assignment state, and step S506 is executed. If it is determined that the master device is in the non-address assignment state, step S503 is executed.
[0054] S503 : When the master device is not in the address allocation state, respond to the address allocation request, enter the address allocation state and execute the address allocation function of disabling the other parallel ports except the first parallel port.
[0055] After entering the address allocation state, the value corresponding to the state is updated to a first preset value to indicate that the address allocation state is currently in effect. The address allocation state can include two phases: a disabling phase and an executing phase. The disabling phase disables the address allocation function for all parallel ports other than the first parallel port. If no parallel ports other than the first parallel port exist, the disabling phase does not need to be entered. The executing phase corresponds to S504.
[0056] S504: Send an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request.
[0057] S505 , when an address configuration completion instruction is received through the first parallel port, the address allocation function of other parallel ports except the first parallel port is enabled, and the address allocation state is exited.
[0058] When exiting the address allocation state, the state flag is updated to a second preset value to indicate that the master device is not currently in the address allocation state.
[0059] The details of steps S503 to S505 can be found in the detailed description of steps S201 to S203 in FIG. 2 above, and will not be repeated here.
[0060] Before responding to an address allocation request, this embodiment first checks the master device's status and responds only if it determines the master device is not in the address allocation state. Furthermore, when performing address allocation in response to the address allocation request, this embodiment enters the address allocation state. During this time, the master device does not send addresses to parallel ports other than the first parallel port, effectively preventing addresses generated by the master device from being received by multiple slave devices.
[0061] S506: When the master device is in the address allocation state, it does not respond to the address allocation request.
[0062] In at least one embodiment of the present application, when the master device is in the address allocation state, even if a new slave device is connected, the master device will not respond to the address allocation request issued by the slave device, but will wait until the previous address allocation is completed and exit the address allocation state before continuing to respond to the address allocation request.
[0063] As shown in Figure 6, it is a flowchart of the address allocation method provided by another embodiment of the present application. The address allocation method is applied to a master device (e.g., master device 10 in Figure 1). The master device can be an electronic device, such as an energy storage device. As shown in Figure 6, the address allocation method may include the following steps S601-S604. Depending on different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0064] S601 : When a new hardware presence signal is received through the first parallel port, it is determined that an address allocation request is received through the first parallel port.
[0065] The reception of the hardware presence signal is described in conjunction with Figure 3. As shown in Figure 3, slave device C1 is connected to slave device C2. Slave device C1 will output a signal to slave device C2, and slave device C2 will output a feedback signal after receiving the signal. When slave device C1 receives the feedback signal, and the value of the feedback signal is a valid value (such as a preset high level or low level), slave device C1 confirms that it has received the presence signal from slave device C2 and sends it to master device 10. Master device 10 receives the hardware presence signal through port 04. When slave device C0 is newly connected through port 03, it is determined that port 03 has received the new hardware presence signal.
[0066] S602 , disable the address allocation function of other parallel ports except the first parallel port; the first parallel port is any parallel port of the master device.
[0067] S603: Send an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request.
[0068] S604 : When an address configuration completion instruction is received through the first parallel port, enable address allocation functions of other parallel ports except the first parallel port.
[0069] The details of steps S602 to S604 can be found in the detailed description of steps S201 to S203 in FIG. 2 , and will not be repeated here.
[0070] When a new hardware presence signal is received, the embodiment of the present application determines that an address allocation request has been received, thereby triggering the master device to allocate an address to the feedback slave device of the hardware presence signal, thereby improving the timeliness of address allocation.
[0071] As shown in Figure 7, it is a functional module diagram of the address allocation device provided in an embodiment of the present application. The address allocation device 11 runs on the master device of a multi-device system. The master device is connected to the slave device through the parallel port. The slave device is connected to the master device or other slave devices through the parallel port. The address allocation device 11 includes a disabling unit 110, a sending unit 111, a control unit 112, an acquisition unit 113, a response unit 114, an exit unit 115 and a determination unit 116. The module / unit referred to in this application refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and can perform fixed functions, which are stored in the memory.
[0072] The disabling unit 110 is configured to, upon receiving an address allocation request via the first parallel port, disable the address allocation function of all parallel ports other than the first parallel port. The first parallel port is any parallel port of a master device. The sending unit 111 is configured to send an address allocation instruction to the first parallel port. The address allocation instruction is configured to allocate an address to the slave device that sent the address allocation request. The control unit 112 is configured to, upon receiving an address configuration completion instruction via the first parallel port, enable the address allocation function of all parallel ports other than the first parallel port.
[0073] Furthermore, the acquisition unit 113 is configured to acquire the status of the master device. The response unit 114 is configured to respond to an address allocation request when the master device is not in the address allocation state, enter the address allocation state, and execute the steps of disabling the address allocation function for all parallel ports other than the first parallel port. The response unit 114 is also configured not to respond to an address allocation request when the master device is in the address allocation state.
[0074] Furthermore, the exit unit 115 is configured to exit the address allocation state when receiving an address configuration completion instruction through the first parallel port.
[0075] Further, the determining unit 116 is configured to determine that an address allocation request is received through the first parallel port when a new hardware presence signal is received through the first parallel port.
[0076] For details about the functions of each module / unit, please refer to the detailed description of Figure 2 above, which will not be repeated here.
[0077] It can be seen from the above technical solution that when the first parallel port receives an address allocation request, the embodiment of the present application can prevent the address allocated by the master device to the slave device that sends the address allocation request from being received by other slave devices by disabling the address allocation function of other parallel ports other than the first parallel port, thereby improving the orderliness of address allocation and thus improving the accuracy of address allocation.
[0078] As shown in FIG8 , it is a schematic diagram of the structure of an electronic device for implementing the address allocation method provided in an embodiment of the present application.
[0079] In one embodiment of the present application, the electronic device 10 includes, but is not limited to, a parallel port 14, a memory 12, a processor 13, and computer-readable instructions, such as an address allocation program, stored in the memory 12 and executable on the processor 13. The parallel port 14 is configured to connect to a slave device.
[0080] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 10 and does not constitute a limitation on the electronic device 10. The electronic device 10 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 10 may also include input and output devices, network access devices, buses, etc.
[0081] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. The processor 13 is the computing core and control center of the electronic device 10. It utilizes various interfaces and lines to connect various parts of the entire electronic device 10 and executes the operating system of the electronic device 10 as well as various installed applications and program codes.
[0082] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, one or more of which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing a specific function, and the computer-readable instruction segments are configured to describe the execution process of the computer-readable instructions in the electronic device 10. For example, the computer-readable instructions may be divided into a disabling unit 110, a sending unit 111, a control unit 112, an acquiring unit 113, a responding unit 114, an exiting unit 115, and a determining unit 116.
[0083] The memory 12 can be configured to store computer-readable instructions and / or modules. The processor 13 implements various functions of the electronic device 10 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created based on the use of the electronic device. The memory 12 can include non-volatile and volatile memories, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other storage devices.
[0084] The memory 12 may be an external memory and / or an internal memory of the electronic device 10. Furthermore, the memory 12 may be a physical memory, such as a memory stick, a TF card (Trans-flash Card), and the like.
[0085] If the modules / units integrated in the electronic device 10 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete them through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of the above-mentioned method embodiments can be implemented.
[0086] Computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable files, or some intermediate form. Computer-readable media may include any entity or device capable of carrying computer-readable instruction codes, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), and random access memory (RAM).
[0087] 2-6 , the memory 12 in the electronic device 10 stores computer-readable instructions, and the processor 13 can execute the computer-readable instructions stored in the memory 12 to implement the address allocation method shown in FIG. 2 .
[0088] Specifically, the specific implementation method of the processor 13 for the above-mentioned computer-readable instructions can refer to the description of the relevant steps in the corresponding embodiments of Figures 2-6, which will not be repeated here.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is merely a logical function division, and other division methods may be used in actual implementation.
[0090] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.
[0091] In addition, the functional modules in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0092] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.
[0093] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices may also be implemented by a single unit or device through software or hardware. Terms such as first and second are used to indicate names and do not imply any particular order.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. An address allocation method, applied to a master device of a multi-device system, wherein the master device is connected to a slave device via a parallel port; The slave device is connected to the master device or other slave devices via a parallel port; the method comprises: When an address allocation request is received through a first parallel port, disabling address allocation functions of other parallel ports except the first parallel port; the first parallel port is any parallel port of the master device; Sending an address allocation instruction to the first parallel port; the address allocation instruction is configured to allocate an address to the slave device that sends the address allocation request; When an address configuration completion instruction is received through the first parallel port, address allocation functions of other parallel ports except the first parallel port are enabled.
2. The method according to claim 1, wherein: The disabling of the address allocation function of other parallel ports except the first parallel port includes: Disable other parallel ports except the first parallel port.
3. The method according to claim 1, wherein: The disabling of the address allocation function of other parallel ports except the first parallel port includes: disabling other parallel ports other than the first parallel port that are not connected to a slave device; A disabling instruction is sent to other parallel ports connected to slave devices except the first parallel port; the disabling instruction is configured to instruct the device connected to the slave device with an unassigned address to disable the corresponding parallel port.
4. The method according to claim 1, wherein: After the step of receiving the address allocation request through the first parallel port, the method further includes: Obtaining the status of the master device; When the master device is not in the address allocation state, it responds to the address allocation request, enters the address allocation state and executes the step of disabling the address allocation function of other parallel ports except the first parallel port.
5. The method according to claim 4, wherein: The method further comprises: When an address configuration completion instruction is received through the first parallel port, the address allocation state is exited.
6. The method according to claim 1, wherein: The method further comprises: When the master device is in the address allocation state, it does not respond to the address allocation request.
7. The method according to claim 1, wherein: The method further comprises: When a new hardware presence signal is received through the first parallel port, it is determined that the address allocation request is received through the first parallel port.
8. An electronic device, serving as a master device, comprising: The parallel port is configured to connect to the slave device; a memory storing computer-readable instructions; and A processor executes the computer-readable instructions stored in the memory to implement the address allocation method according to any one of claims 1 to 7.
9. A multi-device system, comprising a plurality of electronic devices; the plurality of electronic devices are configured with a master device and a slave device; The master device is connected to the slave device via a parallel port; the slave device is connected to the master device or other slave devices via a parallel port; in, The master device executes the address allocation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are executed by a processor in an electronic device to implement the address allocation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Address allocation system, device and method
CN102253906A
Device and method for addressing a slave unit
CN102498444A
Bus address allocation system based on cascade father node gating and a communication method
CN109656849A
Bus address allocation and communication method based on cascade father node gating
CN111400215A
Method for automatically distributing device communication addresses
CN113794785A
