CAN (Controller Area Network) communication ID (Identity) address allocation method and device based on power supply equipment

By obtaining a unique ID serial number from the power supply device and automatically allocating master and slave addresses using CAN communication and built-in security algorithms, the automation and security issues of power supply CAN communication ID address allocation in existing technologies are solved, thereby improving the networking efficiency and data transmission reliability of the power supply system.

CN121037342APending Publication Date: 2025-11-28ECU ELECTRONICS INDAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511338188.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing power supply CAN communication ID address allocation technology cannot automatically and securely achieve address allocation, resulting in high manual configuration costs, easy address conflicts and unauthorized device access, and the need to reorder when adding devices, which prolongs the networking time.

Method used

By obtaining the unique ID serial number of the power supply device at the factory, the master and slave devices are automatically assigned based on CAN communication. The built-in security algorithm generates a security key for authentication and address allocation, ensuring the security and reliability of communication.

Benefits of technology

It realizes automated CAN communication ID address allocation for power supply equipment, avoids manual configuration errors, prevents address conflicts and unauthorized device access, and improves networking efficiency and data transmission reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037342A_ABST
    Figure CN121037342A_ABST
Patent Text Reader

Abstract

The invention provides a CAN communication ID address allocation method and device based on power supply equipment, relates to the technical field of power supply intelligent management, and solves the technical problem that the existing power supply CAN communication ID address allocation technology cannot automatically and safely realize CAN communication ID address allocation. The method specifically comprises the following steps: acquiring unique ID serial numbers of a plurality of pieces of power supply equipment when leaving a factory; uploading a unique ID serial number of each power supply device based on CAN communication, and requesting ID address allocation of the CAN communication; comparing the unique ID serial numbers of the power supply devices, selecting the power supply device with the minimum unique ID serial number as a host, and taking the rest of the power supply devices as slaves; inputting the unique ID serial number of the slave into an automatic address allocation algorithm to obtain an address allocation instruction; and after the address allocation instruction is sent from the host to each slave, the slave performs CAN communication ID address allocation. The method is used for power supply CAN communication ID address allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent power management technology, and in particular to a method and apparatus for allocating CAN communication ID addresses based on power devices. Background Technology

[0002] Power supply CAN communication ID address allocation is a core prerequisite for the orderly collaborative communication of nodes in a power supply CAN network, ensuring the reliability of power system data transmission and networking efficiency. Existing power supply CAN communication ID address allocation technologies mostly rely on manual configuration of the ID addresses of each power node. Manual configuration not only increases labor costs and the risk of ID address conflicts due to operational errors, but also easily leads to unauthorized device access or interference from invalid commands due to the lack of authentication. Furthermore, the lack of dynamic fault tolerance between the master and slave devices will cause the ID allocation function of the entire CAN network to stagnate when the master device loses connection. When a new device is added, all nodes need to be reordered and IDs reassigned, significantly extending the networking time. Therefore, existing power supply CAN communication ID address allocation technologies have the technical problem of not being able to automatically and securely implement CAN communication ID address allocation. Summary of the Invention

[0003] This application provides a method and apparatus for allocating CAN communication ID addresses based on power supply equipment, which solves the technical problem that existing power supply CAN communication ID address allocation technologies cannot automatically and securely implement CAN communication ID address allocation.

[0004] To achieve the above objectives, this application adopts the following technical solution: Firstly, a method for allocating CAN communication ID addresses based on power supply devices is provided, comprising: obtaining the unique ID serial number of multiple power supply devices at the time of manufacture; the multiple power supply devices being deployed in the same CAN network; the unique ID serial number serving as the unique identification code of the power supply device; after the multiple power supply devices are powered on, uploading the unique ID serial number of each power supply device via CAN communication and requesting CAN communication ID address allocation; comparing the unique ID serial numbers of each power supply device, selecting the power supply device with the smallest unique ID serial number as the master, and the remaining power supply devices as slaves; obtaining the address allocation instruction from the slave's unique ID serial number input address automatic allocation algorithm; the address automatic allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch; the authentication branch is used to obtain a security key based on the slave's unique ID serial number using a built-in security algorithm in the power supply software, and the CAN communication ID address allocation branch is used to determine the CAN communication ID address allocation signal based on the unique ID serial number order; the address allocation instruction includes the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation.

[0005] In conjunction with the first aspect mentioned above, one possible implementation involves obtaining the unique ID serial number of multiple power supply devices at the time of manufacture, including: generating a unique ID serial number for each power supply device before it leaves the factory based on power health management technology; and storing the unique ID serial number in the internal storage unit of each power supply device.

[0006] In conjunction with the first aspect above, in one possible implementation, the unique ID sequence number of each power supply device is uploaded based on CAN communication, and a request for CAN communication ID address allocation is made. This includes: broadcasting the unique ID sequence number of each power supply device based on CAN communication, while each power supply device receives the unique ID sequence number broadcast by other power supply devices in the CAN network; after each power supply device receives the unique ID sequence number of other power supply devices, it sends a request for CAN communication ID allocation signal to request CAN communication ID address allocation.

[0007] In conjunction with the first aspect mentioned above, in one possible implementation, the security key is obtained based on the unique ID sequence number of the slave device using the built-in security algorithm of the power supply software. This includes: reading the unique ID sequence number of the slave device from the internal storage unit of the slave device; calculating the initial security key using the software-preset key and the unique ID sequence number based on the HMAC-SHA256 message authentication code; and formatting the initial security key based on the data field length limit of the CAN bus transmission to obtain the security key.

[0008] In conjunction with the first aspect above, in one possible implementation, the CAN communication ID address allocation signal is determined based on the unique ID sequence number, including: allocating the CAN communication ID address based on the size of each slave's unique ID sequence number; and encapsulating the slave's unique ID sequence number and the corresponding CAN communication ID address into a CAN communication ID address allocation signal.

[0009] In conjunction with the first aspect mentioned above, in one possible implementation, after the address allocation command is sent from the master to each slave, the slave performs CAN communication ID address allocation, including: at each slave, inputting its own unique ID sequence number into the power supply software's built-in security algorithm to obtain a local verification key; comparing the local verification key with the security key in the address allocation command; if the comparison matches, the address allocation command is deemed valid, and the CAN communication ID address allocation signal in the address allocation command is stored; if the comparison does not match, the address allocation command is deemed invalid; and using the stored CAN communication ID address allocation signal received by each slave to perform CAN communication ID address allocation.

[0010] In conjunction with the first aspect mentioned above, in one possible implementation, after allocating CAN communication ID addresses using the CAN communication ID address allocation signals received and stored by each slave device, the method further includes: if a new power supply device joins and requests address allocation, obtaining the unique ID sequence number of the new power supply device based on the CAN network; inputting the unique ID sequence number of the new power supply device into the power supply software's built-in security algorithm to obtain the new device's security key; if the new device's security key matches the new device's local verification key, then using the host to allocate a CAN communication ID address to the new power supply, without re-sorting and allocating based on the unique ID sequence number.

[0011] In conjunction with the first aspect mentioned above, in one possible implementation, after the address allocation command is sent from the master to each slave, and the slave performs CAN communication ID address allocation, the method further includes: periodically sending a periodic ID address detection command to the CAN network using the master; the periodic ID address detection command contains the unique ID sequence number of all power devices; if each slave does not receive the periodic ID address detection command within a time threshold, the power device with the smallest unique ID sequence number other than the master is selected as the new master.

[0012] Secondly, a CAN communication ID address allocation device based on power supply devices is provided, comprising: a communication unit and a processing unit; the communication unit is used to obtain the unique ID serial number of multiple power supply devices at the time of manufacture; the processing unit is used to, after the multiple power supply devices are powered on, upload the unique ID serial number of each power supply device based on CAN communication and request CAN communication ID address allocation; compare the unique ID serial numbers of each power supply device, select the power supply device with the smallest unique ID serial number as the master, and the remaining power supply devices as slaves; obtain the address allocation instruction from the slave unique ID serial number input address automatic allocation algorithm; the address automatic allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch; the authentication branch is used to obtain a security key based on the slave unique ID serial number according to the built-in security algorithm of the power supply software, and the CAN communication ID address allocation branch is used to determine the CAN communication ID address allocation signal based on the unique ID serial number order; the address allocation instruction includes the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation.

[0013] Thirdly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a power-based CAN communication ID address allocation device, cause the power-based CAN communication ID address allocation device to perform the method described in the first aspect and any possible implementation thereof.

[0014] Fourthly, this application provides a CAN communication ID address allocation device based on a power supply device, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is used to execute the instructions to implement the method described in the first aspect and any possible implementation thereof. This CAN communication ID address allocation device based on a power supply device can be an electronic device or a chip within an electronic device.

[0015] Fifthly, this application provides a CAN communication ID address allocation system based on power supply devices, including: a power supply device and a CAN communication ID address allocation device based on the power supply device; wherein, the power supply device is used to provide a unique ID serial number; the CAN communication ID address allocation device based on the power supply device is used to obtain the unique ID serial number of multiple power supply devices at the time of manufacture; after multiple power supply devices are powered on, the unique ID serial number of each power supply device is uploaded based on CAN communication to request CAN communication ID address allocation; the unique ID serial numbers of each power supply device are compared, and the power supply device with the smallest unique ID serial number is selected as the master, and the remaining power supply devices are as slaves; the address allocation instruction is obtained from the slave unique ID serial number input address automatic allocation algorithm; the address automatic allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch; the authentication branch is used to obtain a security key based on the slave unique ID serial number according to the built-in security algorithm of the power supply software, and the CAN communication ID address allocation branch is used to determine the CAN communication ID address allocation signal based on the unique ID serial number order; the address allocation instruction includes the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation.

[0016] In a sixth aspect, this application provides a computer program product containing instructions that, when run on a CAN communication ID address allocation device based on a power supply device, causes the CAN communication ID address allocation device based on a power supply device to perform the methods described in the first aspect and any possible implementation thereof.

[0017] This application provides a method and apparatus for allocating CAN communication ID addresses based on power supply devices. It automatically selects the host and allocates CAN communication ID addresses based on the unique ID serial number fixed at the factory, eliminating the need for manual configuration and avoiding ID address conflicts and increased labor costs caused by human error. Simultaneously, through the authentication branch in the automatic address allocation algorithm, a security key is generated from the unique ID serial number based on the power supply software's built-in security algorithm to achieve identity verification, effectively blocking unauthorized device access and invalid command interference. Ultimately, it ensures orderly collaborative communication among power supply nodes within the CAN network, solving the problem that existing technologies cannot automatically and securely allocate CAN communication ID addresses, and improving the networking efficiency and data transmission reliability of the power supply system.

[0018] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0019] Figure 1 A system architecture diagram of a CAN communication ID address allocation system based on a power supply device is provided for embodiments of this application; Figure 2 A system architecture diagram of another CAN communication ID address allocation system based on power supply equipment provided in this application embodiment; Figure 3 A flowchart illustrating a CAN communication ID address allocation method based on a power supply device, provided in an embodiment of this application; Figure 4 A flowchart illustrating another CAN communication ID address allocation method based on a power supply device provided in this application embodiment; Figure 5 A flowchart illustrating another CAN communication ID address allocation method based on a power supply device provided in this application embodiment; Figure 6 A flowchart illustrating another CAN communication ID address allocation method based on a power supply device provided in this application embodiment; Figure 7 A flowchart illustrating another CAN communication ID address allocation method based on a power supply device provided in this application embodiment; Figure 8 A schematic diagram of a CAN communication ID address allocation device based on a power supply device is provided in an embodiment of this application. Figure 9 This is a schematic diagram of the hardware structure of a CAN communication ID address allocation device based on a power supply device, provided in an embodiment of this application. Detailed Implementation

[0020] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0021] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0022] The CAN communication ID address allocation method based on power supply devices provided in this application embodiment can be applied to, for example... Figure 1 The CAN communication ID address allocation system based on the power supply device shown includes: a power supply device 101 and a CAN communication ID address allocation device 102 based on the power supply device.

[0023] The system includes a power supply device 101 for providing a unique ID serial number; a CAN communication ID address allocation device 102 for obtaining the unique ID serial number of multiple power supplies at the time of manufacture; after powering on multiple power supplies, the unique ID serial number of each power supply device is uploaded via CAN communication, requesting CAN communication ID address allocation; the unique ID serial numbers of each power supply device are compared, and the power supply device with the smallest unique ID serial number is selected as the master, with the remaining power supplies as slaves; an address allocation instruction is obtained from the slave's unique ID serial number input address automatic allocation algorithm; the address automatic allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch; the authentication branch is used to obtain a security key based on the slave's unique ID serial number using the power supply software's built-in security algorithm, and the CAN communication ID address allocation branch is used to determine the CAN communication ID address allocation signal based on the unique ID serial number order; the address allocation instruction includes the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation.

[0024] As an example, such as Figure 2As shown, the power supply device reads the unique ID serial number fixed at the factory from its internal storage unit; then, upon power-up, the power supply device initiates a power-up request for CAN ID allocation and transmits the request information containing its own unique ID serial number via CAN communication; based on the power supply device's CAN communication ID address allocation device obtaining the unique ID serial numbers of multiple power supply devices, it selects the power supply device with the smallest unique ID serial number as the master, and the remaining power supply devices as slaves; the master executes the core function of ID address allocation and simultaneously sends periodic signals to the system to ensure the communication timing of the CAN network, while the slaves respond to the master's ID address allocation action; finally, each power supply device completes its own CAN communication ID address allocation according to the address allocation instructions issued by the master, thereby realizing orderly communication within the CAN network.

[0025] To address the technical problem that existing power supply CAN communication ID address allocation technologies cannot automatically and securely implement CAN communication ID address allocation, this application provides a CAN communication ID address allocation method based on power supply devices. The method includes: obtaining unique ID serial numbers of multiple power supply devices at the time of manufacture; after powering on the multiple power supply devices, uploading the unique ID serial numbers of each power supply device via CAN communication to request CAN communication ID address allocation; comparing the unique ID serial numbers of each power supply device, selecting the power supply device with the smallest unique ID serial number as the master, and the remaining power supply devices as slaves; obtaining the address allocation instruction from the slave unique ID serial number input address automatic allocation algorithm; and sending the address allocation instruction from the master to each slave. After the slave device sends the data, it performs CAN communication ID address allocation. Based on this, it can automatically complete the master device selection and CAN communication ID address allocation using the unique ID serial number fixed at the factory, eliminating the need for manual configuration and avoiding ID address conflicts and increased labor costs caused by human error. At the same time, through the authentication branch in the address automatic allocation algorithm, a security key is generated from the unique ID serial number based on the power supply software's built-in security algorithm to achieve identity verification, effectively blocking unauthorized device access and invalid command interference. Ultimately, it ensures orderly collaborative communication among power supply nodes in the CAN network, solving the problem that existing technologies cannot automatically and securely achieve CAN communication ID address allocation, and improving the networking efficiency and data transmission reliability of the power supply system.

[0026] Figure 3 A flowchart illustrating the CAN communication ID address allocation method based on power supply devices provided in this application embodiment is shown below. Figure 3 As shown, the method includes: Step 301: The CAN communication ID address allocation device based on the power supply equipment obtains the unique ID serial number of multiple power supply equipment at the time of manufacture.

[0027] Among them, the unique ID serial number is a unique identification code generated before the power supply equipment leaves the factory.

[0028] In this embodiment, the generation of the unique ID serial number can be combined with power health management technology, integrating information such as production batch, hardware identification, and check bit, and the length can be flexibly set; the unique ID serial number is fixed in the internal storage unit of each power device, and the storage unit is selected to adapt to the power working environment (such as industrial-grade EEPROM for high temperature and vibration scenarios), and the reading method supports the device MCU to call through the internal bus, adapting to different types of power devices such as aviation and industrial, avoiding the limitations of a single generation or storage method.

[0029] It should be noted that the unique ID serial number must have its write access locked after leaving the factory to prevent malicious tampering that could lead to identity confusion. At the same time, a read interface must be reserved to ensure that the ID can be stably obtained after the device is powered on.

[0030] As an example, when aviation power supplies leave the factory, a unique 32-bit ID serial number is generated by the health management system, which includes the production batch (first 8 bits), chip ID segment (middle 12 bits), and check bits (last 4 bits). This ID is then stored in an industrial-grade EEPROM. After the device is powered on, the MCU can read this ID via the I2C bus.

[0031] Based on the above steps, unique and reliable basic data is provided for subsequent device identification, master / slave selection and security verification, avoiding network chaos caused by duplicate identities.

[0032] Step 302: After multiple power devices are powered on, the CAN communication ID address allocation device based on power devices uploads the unique ID sequence number of each power device based on CAN communication and requests CAN communication ID address allocation.

[0033] Among them, "upload based on CAN communication" refers to the device broadcasting its own unique ID through the CAN bus and receiving IDs broadcast by other devices; "request CAN communication ID address allocation" refers to the device sending an allocation request signal containing its own ID to the CAN bus after collecting all IDs.

[0034] In this application embodiment, the upload strategy can be adjusted according to the scenario. For example, a small network (≤10 devices) uses a 1-second interval and 3 consecutive broadcasts, while a large network (>10 devices) uses time-division broadcasting with a 0.5-second delay based on ID segments to avoid bus congestion. The request signal can be encapsulated as a CAN standard frame, with its own unique ID in the data field. At the same time, the device needs to temporarily store all received IDs, support reconnection after disconnection and re-collection, and adapt to CAN2.0A / B and CANFD protocols.

[0035] As an example, after the six aviation power supplies are powered on, each power supply broadcasts a 32-bit unique ID three times at 1-second intervals, while simultaneously receiving broadcast IDs from other power supplies. After collecting all six IDs, each power supply sends an ID allocation request signal containing its own ID and the IDs of other power supply devices to the CAN bus.

[0036] Based on the above steps, the automatic aggregation and allocation request triggering of multiple device IDs can be realized without manual intervention, providing a complete ID dataset for subsequent master-slave selection and improving the degree of network automation.

[0037] Step 303: The CAN communication ID address allocation device based on the power supply device compares the unique ID serial numbers of each power supply device, selects the power supply device with the smallest unique ID serial number as the master, and the remaining power supply devices as slaves.

[0038] In this CAN network, the master node is the core node responsible for ID allocation and status monitoring, while the slave node is the node that accepts the master node's scheduling and obtains the CAN ID. The master and slave roles are automatically determined through ID comparison to ensure that the master node is unique within the network.

[0039] It should be noted that the comparison results need to be broadcast as a host confirmation frame via the CAN bus. After all devices receive the frame, they should send back a confirmation response to ensure consensus among the master and slave roles across the network and prevent cognitive biases among local devices.

[0040] As an example, the IDs of the eight aviation power supplies are temporarily stored as 0008, 0002, 0005, 0001, 0007, 0003, 0006, and 0004. After comparison, the power supply with ID 0001 determines that it has the smallest ID and broadcasts a confirmation frame of "Master ID: 0001". The other seven devices receive the frame and send a "response" signal to confirm that they are slaves.

[0041] Based on the above steps, the master-slave selection is completed automatically, avoiding the tediousness and errors of manual designation, and ensuring that the master-slave roles are unique and recognized by the entire network.

[0042] Step 304: The CAN communication ID address allocation device based on the power supply equipment obtains the address allocation instruction from the slave unique ID serial number input address automatic allocation algorithm.

[0043] The automatic address allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch. The address allocation instruction is structured data containing the slave ID, security key, and allocated CAN ID, used for slave authentication and ID configuration.

[0044] In this embodiment, the slave unique ID input address automatic allocation algorithm outputs a security key through the authentication branch, obtains the CAN communication ID address allocation signal through the CAN communication ID address allocation branch, and then encapsulates the slave unique ID serial number, security key, and CAN communication ID address allocation signal into an address allocation instruction.

[0045] Based on the above steps, the automatic calculation and secure encapsulation of the slave CAN ID command are realized, balancing security and flexibility, avoiding unauthorized device access and ID allocation conflicts, and providing reliable commands for subsequent slave configuration.

[0046] Step 305: After the CAN communication ID address allocation device based on the power supply equipment sends the address allocation command from the master to each slave, the slave performs CAN communication ID address allocation.

[0047] The slave CAN communication ID address allocation is the process by which the slave verifies the validity of the command, writes the allocated CAN ID into its own storage unit, and updates the communication configuration.

[0048] In this embodiment, when the CAN communication ID address allocation device for power supply equipment sends an address allocation command to a slave device, it can select a sending strategy based on the functional importance of the slave device in the CAN network. For critical slave devices (such as the core power supply module in a power system), a "unicast + acknowledgment" mode is adopted, that is, the device control host sends a command to the slave device individually and waits for the feedback of the reception result. For ordinary slave devices (such as the auxiliary power supply module in a power system), a "multicast + batch acknowledgment" mode is adopted, that is, the device control host sends commands to multiple ordinary slave devices of the same type simultaneously and receives batch acknowledgment feedback. At the same time, the device will preset the verification logic of the slave device. After receiving the command, the slave device first completes its own ID matching and then completes the key comparison. If the dual verification is successful, the slave device writes the CAN ID into the EEPROM according to the device logic and sends a successful allocation signal back to the device. If the verification fails, the slave device sends a verification failure signal to the device, and the device control host resends the address allocation command to the slave device, adapting to different communication reliability requirements in scenarios such as aviation power supplies.

[0049] Based on the above steps, the slave CAN ID is automatically configured without manual input, ensuring ID uniqueness and communication validity, and completing the automatic networking of multi-device CAN networks, greatly improving deployment efficiency.

[0050] Based on the above technical solution, the unique factory ID serial number of the power supply is used as the identification basis. After power-on, the ID is automatically uploaded and an allocation request is initiated through CAN communication. The host is determined by ID comparison to avoid manual assignment. An automatic address allocation algorithm is used to generate an allocation instruction containing a security key. Then, the instruction is sent with a strategy adapted to aviation scenarios to complete slave verification and ID configuration. The entire process realizes the automated allocation of aviation power supply CAN communication IDs. This avoids the labor costs and ID conflict risks of manual configuration, and prevents unauthorized device access through unique ID and security key verification. At the same time, it flexibly adapts to the differentiated reliability requirements of core and auxiliary equipment in aviation power supply systems, ensuring efficient and secure networking of aviation power supply CAN networks. This solves the technical problem that existing power supply CAN communication ID address allocation technologies cannot automatically and securely realize CAN communication ID address allocation.

[0051] In one possible implementation, combining the above... Figure 3 ,like Figure 4 As shown, the process of obtaining the security key based on the unique ID serial number of the slave device using the built-in security algorithm of the power supply software in step 304 can be specifically implemented through the following steps 401-403: Step 401: The CAN communication ID address allocation device based on the power supply equipment reads the unique ID sequence number of the slave device from the internal storage unit of the slave device.

[0052] Among them, the slave internal storage unit is a hardware unit with a unique ID serial number that is fixed at the factory. The unique ID serial number is 32-bit or 64-bit structured data, which is associated with the slave production information and hardware identifier.

[0053] In this embodiment, the CAN communication ID address allocation device based on the power supply device first sends an ID read command to the slave device via the CAN bus. After the slave device responds with a read permission acknowledgment, it then accesses the slave device's internal storage unit via an I2C or SPI communication link. The device supports adaptation to different types of storage units, and a check bit is added during the read process to ensure that the unique ID sequence number obtained is free from transmission errors.

[0054] As an example, in an aviation power CAN network, the device sends an ID read command containing the device identifier to the slave device (ID: 0002). After the slave device responds, the device reads the 32-bit unique ID sequence number (0x12345678) stored in its EEPROM via the I2C link and confirms that the data is correct through CRC16 verification.

[0055] Based on the above steps, the device can accurately obtain the unique ID sequence number of the slave device, providing accurate basic data for subsequent security key calculation and avoiding subsequent security verification failure due to ID reading errors.

[0056] Step 402: The CAN communication ID address allocation device based on the power supply device calculates the initial security key using the software-preset key and the unique ID sequence number based on the HMAC-SHA256 message authentication code.

[0057] Among them, HMAC-SHA256 message authentication code is a security verification algorithm based on hash algorithm, which can generate a 256-bit (32-byte) hash value; the software preset key is a secret key that is jointly fixed by the device and the slave device at the factory, and only the device and the corresponding slave device know it, ensuring the uniqueness and confidentiality of the key.

[0058] In this embodiment, the CAN communication ID address allocation device based on the power supply equipment calls the built-in HMAC-SHA256 algorithm module. First, it concatenates the 256-bit binary key of the software-preset key with the unique ID serial number of the slave device, such as 32-bit hexadecimal data, and then performs a hash operation according to the algorithm rules to obtain the initial security key. The device will encrypt and store the intermediate data during the operation process to prevent the leakage of the key or intermediate results, adapt to the high security requirements of the power supply to prevent illegal tampering, and support the periodic update of the preset key through the encrypted channel.

[0059] As an example, the CAN communication ID address allocation device based on power supply equipment uses the HMAC-SHA256 algorithm to concatenate the preset key (0xABCDEF1234567890...) with the slave's unique ID (0x12345678) to calculate a 256-bit initial security key (0x9876543210FEDCBA...), and then stores this key in the encryption register.

[0060] Based on the above steps, the initial security key generated by the device is unique and highly secure, which can effectively prevent unauthorized devices from forging keys to access the CAN network and provide a reliable basis for subsequent authentication.

[0061] Step 403: The CAN communication ID address allocation device based on the power supply device performs format processing on the initial security key based on the data field length limit of the CAN bus transmission to obtain the security key.

[0062] Among them, the CAN bus data field length limit refers to the transmission limit of a maximum of 8 bytes for the data field of the CAN standard frame (ISO11898-2) and a maximum of 64 bytes for the CAN extended frame. Format processing refers to the truncation, compression or segmentation of the 256-bit initial security key to make it conform to the transmission length requirements.

[0063] In this embodiment, the CAN communication ID address allocation device based on the power supply device first identifies the frame type of the current CAN bus (standard frame or extended frame). If it is a standard frame, the device will extract the first 8 bytes of the initial security key and add a 1-byte CRC check bit. If it is an extended frame, the device can retain 32 bytes (256 bits) of the initial key without compression. During the processing, the device will verify the uniqueness of the processed key to avoid key conflicts between different slave devices and adapt to the frame type selection requirements of the aviation power supply CAN network.

[0064] As an example, if the CAN bus uses a standard frame (8 bytes of data field), the device extracts the first 8 bytes of the 256-bit initial security key (0x9876543210FEDCBA) and calculates the CRC check bit 0x5A, finally obtaining a security key containing 9 bytes of check bits.

[0065] Based on the above steps, the security key is adapted to the CAN bus transmission limit, ensuring that the key can be sent normally to the slave device through the bus and avoiding transmission failure due to exceeding the length limit.

[0066] In one possible implementation, combining the above... Figure 3 ,like Figure 4 As shown, the process of determining the CAN communication ID address allocation signal based on the unique ID sequence number in step 304 above can be specifically implemented through the following steps 404-405: Step 404: The CAN communication ID address allocation device based on the power supply equipment allocates CAN communication ID addresses based on the size of the unique ID sequence number of each slave device.

[0067] The CAN communication ID address is the address used by the slave device for communication identification in the CAN network. The allocation logic is based on the numerical value of the slave device's unique ID sequence number to ensure that the allocation result is ordered and unique.

[0068] In this embodiment, the CAN communication ID address allocation device based on the power supply device first sorts the unique ID serial numbers of all slave devices in ascending order, and then allocates consecutive or corresponding CAN ID addresses to the sorted slave devices from a preset CAN ID address range (such as 0x01-0xFF commonly used in aviation power supplies). For example, the slave device with the smallest serial number is allocated the smallest available CAN ID. At the same time, the device avoids reserved IDs in the network (such as 0x00 being a broadcast ID) to prevent address conflicts. The device supports fine-tuning the allocation order according to the functional priority of the slave devices to adapt to the functional differences of aviation power supplies.

[0069] Based on the above steps, the device achieves orderly and unique allocation of CAN communication ID addresses, avoiding the risk of address conflicts caused by manual allocation, while adapting to the functional priority requirements of aviation power supplies and facilitating network management.

[0070] Step 405: The CAN communication ID address allocation device based on the power supply equipment encapsulates the slave unique ID serial number and the corresponding CAN communication ID address into a CAN communication ID address allocation signal.

[0071] The CAN communication ID address allocation signal is structured CAN frame data generated by the device, which includes fields such as the slave's unique ID sequence number, the corresponding CAN communication ID address, and data check bits, ensuring that the slave can accurately parse its own corresponding CAN ID address.

[0072] In this embodiment, the CAN communication ID address allocation device based on the power supply equipment encapsulates the signal in a fixed format, such as a frame header + slave unique ID sequence number + CAN communication ID address + check bit structure. The frame header is fixed as 0xAA (identified as allocation signal), and the check bit uses XOR check. The device can select standard frame or extended frame encapsulation according to the CAN bus type. After encapsulation, the signal integrity is checked to ensure no data loss, which meets the high accuracy requirements of aviation power supply CAN communication.

[0073] As an example, the device encapsulates and assigns signals to the slave device (unique ID: 0002, CAN ID: 0x02), with the structure being frame header 0xAA + slave ID 0x00000002 + CAN ID 0x0002 + check bit 0x55. After being encapsulated into a standard CAN frame, it is sent to the CAN bus.

[0074] Based on the above steps, the structured allocation signal generated by the device can ensure that the slave device accurately identifies its corresponding CANID address, reduce data ambiguity during transmission, and improve the accuracy and efficiency of address allocation.

[0075] Based on the above technical solution, by reading the unique ID serial number fixed by the aviation power supply slave device, generating a high-security initial key based on the HMAC-SHA256 algorithm, processing the key according to the length of the CAN bus data field, allocating a unique CAN communication ID address in an orderly manner according to the ID, and encapsulating the structured allocation signal to ensure accurate parsing, the entire process not only provides a secure and reliable identity verification foundation for the allocation of aviation power supply CAN communication ID, but also avoids the risks of address conflicts and transmission exceeding limits, realizing the automated and secure processing of CAN communication ID from identity verification to address configuration.

[0076] In one possible implementation, combining the above... Figure 3 ,like Figure 5 As shown, the process of step 305 above can be specifically implemented through the following steps 501-503: Step 501: The CAN communication ID address allocation device of the power supply equipment inputs its unique ID serial number into the built-in security algorithm of the power supply software to obtain the local verification key at each slave unit.

[0077] The local verification key is security verification data generated by the slave device based on its own unique ID serial number, and it originates from the same source as the security key generated by the host.

[0078] In this embodiment, the CAN communication ID address allocation device based on the power supply device first controls each slave device to read the unique ID serial number in its own internal storage unit, and then calls the built-in security algorithm of the power supply software preset by the slave device to concatenate the unique ID serial number with the slave device's preset key and calculate to generate a local verification key that is consistent with the host's security key format. During the process, the device monitors the algorithm's running status to ensure that there is no data leakage or calculation error.

[0079] Based on the above steps, a local verification key for identity verification is generated for the slave device, providing a reliable basis for judging the validity of subsequent address allocation instructions.

[0080] Step 502: The CAN communication ID address allocation device based on the power supply device compares the local verification key with the security key in the address allocation instruction. If the comparison matches, the address allocation instruction is deemed valid, and the CAN communication ID address allocation signal in the address allocation instruction is retained; if the comparison does not match, the address allocation instruction is deemed invalid.

[0081] Among them, the security key in the address allocation instruction is the key generated by the host based on the unique ID sequence number of the slave in steps 402-403, and the CAN communication ID address allocation signal is structured data containing the corresponding CAN ID of the slave. Comparison is the core link to verify the legality of the source of the instruction.

[0082] In this embodiment, the CAN communication ID address allocation device based on the power supply device controls each slave device to extract the security key from the address allocation instruction and compare it with its own generated local verification key byte by byte. If all bytes are consistent, the device determines that the instruction is valid and controls the slave device to store the CAN communication ID address allocation signal in the temporary storage area. If there is a difference of 1 byte or more, the device determines that the instruction is invalid, controls the slave device to send an invalid instruction feedback to the master device, requests retransmission, and records the exception log at the same time.

[0083] It should be noted that the comparison process must be completed locally on the slave device to avoid leakage of the key due to transmission via the CAN bus, and the abnormal feedback must carry the slave device ID to facilitate the master device in locating the problematic device.

[0084] Based on the above steps, the device filters illegal or tampered address allocation instructions by comparing keys, preventing unauthorized devices from obtaining the CAN ID and ensuring the communication security of the aviation power CAN network.

[0085] Step 503: The CAN communication ID address allocation device based on the power supply equipment uses the CAN communication ID address allocation signal stored in the slave device to allocate the CAN communication ID address.

[0086] The CAN communication ID address allocation is the process of writing the CAN ID from the allocation signal into the slave communication module configuration register, ensuring that the slave device subsequently participates in CAN network communication through this ID.

[0087] In this embodiment, the CAN communication ID address allocation device based on the power supply device controls each slave device to read the stored CAN communication ID address allocation signal from the temporary storage area, parse out the corresponding CAN ID, and write it into the ID configuration register of the slave device's CAN communication module. At the same time, the device controls the slave device to send an ID configuration completion feedback signal and detects the status of the slave device's communication module to confirm that the new ID has taken effect, thus adapting to the plug-and-play automation requirements of the power supply device.

[0088] Based on the above steps, the device achieves automated configuration of the slave CAN communication ID without manual intervention, avoiding address conflicts or configuration errors, and improving the networking efficiency of the aviation power CAN network.

[0089] Based on the above technical solution, the device controls the slave device to generate a local verification key, compare the key to verify the legality of the address allocation command, and parse the signal to complete the CAN ID configuration. This not only prevents illegal commands from accessing the device through dual verification of "unique ID + security key", but also realizes the automatic configuration of the slave device's CAN ID, avoiding errors and security risks caused by manual configuration.

[0090] In one possible implementation, combining the above... Figure 5 ,like Figure 6 As shown, after allocating CAN communication ID addresses using the CAN communication ID address allocation signals stored in the slave devices, the method also includes the process of adding a new power supply device for address allocation. This can be specifically implemented through the following steps 601-602: Step 601: When a new power device joins the CAN communication ID address allocation device based on the power device, it obtains the unique ID serial number of the new power device based on the CAN network.

[0091] Among them, the unique ID serial number of the new power supply device is a unique identifier of the new device when it leaves the factory and is fixed in its internal storage unit. The request address allocation refers to the CAN frame containing its own ID request field sent to the CAN network after the new device is powered on.

[0092] In this embodiment, the CAN communication ID address allocation device based on the power supply device monitors the CAN network data frames in real time. When a frame containing the "address allocation request" identifier (such as a frame header of 0xBB) is detected, the control host receives the frame and extracts the unique ID sequence number of the new power supply device. The device verifies the ID format and validity, and supports new devices to initiate requests when the CAN network load is ≤70%, thus avoiding bus congestion.

[0093] It should be noted that after the device obtains the ID, it needs to be temporarily stored in the host's local idle ID record table, and the new device status is marked as "pending verification" to prevent identity confusion caused by duplicate IDs with existing devices.

[0094] As an example, after the new aviation power supply is powered on, it sends a request frame to the CAN network with a frame header of 0xBB and a data field containing a 32-bit unique ID (0x1A2B3C4D). After the device detects the frame, the control host receives and extracts the ID, verifies and confirms that it is a compliant aviation power supply ID, and temporarily stores it in the list to be verified.

[0095] Based on the above steps, the initial identification of the new power supply device is achieved, providing unique and compliant basic data for subsequent security verification and address allocation.

[0096] Step 602: The CAN communication ID address allocation device based on the power supply device inputs the unique ID sequence number of the new power supply device into the built-in security algorithm of the power supply software to obtain the security key of the new device. If the security key of the new device is consistent with the local verification key of the new device, the host will be used to allocate a CAN communication ID address to the new power supply, and the allocation will not be reordered according to the unique ID sequence number.

[0097] Among them, the new device local verification key is the verification data generated by the new device based on its own unique ID serial number and through the built-in security algorithm of the power software; no reordering and allocation means that the host allocates the address from the preset idle CAN ID pool to avoid interfering with the networked devices.

[0098] In this embodiment, the CAN communication ID address allocation device based on the power supply device first calls the built-in security algorithm of the host power software to concatenate the unique ID sequence number of the new device with the host's preset key to calculate the security key of the new device; then, it controls the new device to generate a local verification key and upload it to the host. The device compares the two for consistency. If they match, it selects the smallest available CAN ID from the idle ID pool maintained by the host (e.g., if the maximum ID of the existing device is 0x04, then 0x05 is allocated), encapsulates it into an allocation instruction, and sends it to the new device; if they do not match, the device refuses to allocate and records the key mismatch exception log.

[0099] Based on the above steps, the device ensures the security of new device access while avoiding the reordering of existing network device IDs, thus significantly reducing the time required for new device networking.

[0100] Based on the above technical solution, the device obtains the unique ID of the new aviation power supply, completes key comparison using the security algorithm of the authentication technology, and then allocates an address from the idle ID pool without reordering the existing devices. This ensures the security of the new device access and avoids the interruption or reorganization of the existing CAN network due to the addition of the new device, thus achieving efficient expansion of the aviation power supply CAN network.

[0101] In one possible implementation, combining the above... Figure 3 ,like Figure 7 As shown, after the address allocation command is sent from the master to each slave, and the slave performs CAN communication ID address allocation, the method also includes the process of the master sending periodic signals to ensure the timing stability of CAN communication between the master and the slave. This can be specifically achieved through the following steps 701-702: Step 701: The CAN communication ID address allocation device based on the power supply equipment periodically sends periodic ID address detection commands to the CAN network using the host.

[0102] The periodic ID address detection command is a CAN frame sent by the master at fixed intervals to confirm the online status and communication timing of the slave device. The periodic ID address detection command contains the unique ID sequence number of all power devices.

[0103] In this embodiment, the CAN communication ID address allocation device based on the power supply equipment controls the host to generate a periodic ID address detection command according to the preset period (e.g., every 1 minute) in the referenced file. The command frame adopts the CAN standard frame structure, and the data field sequentially encapsulates the unique ID sequence number of all power supply equipment in the entire network and a 1-byte check bit. The device monitors the host's transmission status. If the bus is congested and the transmission fails, a retry mechanism is triggered, and the device retransmits once every 10 seconds, up to a maximum of 3 times, to meet the timing stability requirements of the aviation power supply CAN network.

[0104] Based on the above steps, the device ensures stable communication timing between the master and slave devices through periodic detection commands, allowing the slave device to confirm the online status of the master device in real time.

[0105] Step 702: If each slave device fails to receive the periodic ID address detection command within a time threshold, the power device with the smallest unique ID sequence number (excluding the master device) is selected as the new master device.

[0106] The time threshold is the preset duration for determining disconnection.

[0107] In this embodiment, the CAN communication ID address allocation device based on the power supply equipment controls each slave device to start the timing module. The timing starts from the time of receiving the last periodic detection command. If the timing exceeds the time threshold and no new command is received, the slave device automatically triggers the master disconnection judgment. The device then controls each slave device to compare its own unique ID sequence number with other slave devices (excluding the original master ID), selects the slave device with the smallest sequence number as the new master, generates a new master confirmation frame and broadcasts it to the CAN network. Other slave devices receive the frame and send back a confirmation response, thus completing the master switchover.

[0108] As an example, in an aviation power CAN network, if the original master unit (ID: 0x12345678) loses connection and none of the slave units receive a detection command for more than 3 minutes, the device controls the slave units to compare IDs (0x1A2B3C4D, 0x5E6F7G8H, etc.) and selects the one with the smallest ID, 0x1A2B3C4D, as the new master unit. After the new master unit broadcasts an acknowledgment frame, all slave units respond, completing the handover.

[0109] Based on the above steps, dynamic fault tolerance of the host is achieved, preventing the entire CAN network communication from stopping due to the loss of connection of the original host.

[0110] Based on the above scheme, the device controls the host to periodically send detection commands containing the entire network ID, ensuring stable communication timing between the host and slave devices. If the host loses connection, the device selects a new host according to the rule of having the smallest ID other than the original host, achieving dynamic fault tolerance. The entire process avoids CAN network timing chaos and prevents network paralysis caused by the failure of the original host, improving the reliability and fault resistance of the power supply CAN network.

[0111] The above primarily describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as a CAN communication ID address allocation device based on a power supply device, includes at least one of the hardware structures and software modules corresponding to each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0112] This application embodiment can divide the CAN communication ID address allocation device based on the power supply device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0113] When using integrated units, Figure 8 A possible structural schematic diagram of the CAN communication ID address allocation device based on power supply device (referred to as CAN communication ID address allocation device 80 based on power supply device) involved in the above embodiments is shown. The CAN communication ID address allocation device 80 based on power supply device includes a processing unit 801 and a communication unit 802, and may also include a storage unit 803. Figure 8 The structural diagram shown can be used to illustrate the structure of the CAN communication ID address allocation device based on power supply equipment involved in the above embodiments.

[0114] when Figure 8 The schematic diagram shown illustrates the structure of the CAN communication ID address allocation device based on the power supply device involved in the above embodiments. The processing unit 801 is used to control and manage the operation of the CAN communication ID address allocation device based on the power supply device, the communication unit 802 is used for the CAN communication ID address allocation device based on the power supply device to communicate with other devices, and the storage unit 803 is used to store the program code and data of the CAN communication ID address allocation device based on the power supply device.

[0115] For example, communication unit 802 is used to obtain the unique ID serial number of multiple power supply devices when they leave the factory; The processing unit 801 is used to, after multiple power supply devices are powered on, upload the unique ID sequence number of each power supply device based on CAN communication and request CAN communication ID address allocation; compare the unique ID sequence numbers of each power supply device, select the power supply device with the smallest unique ID sequence number as the master, and the remaining power supply devices as slaves; obtain the address allocation instruction from the slave's unique ID sequence number input address automatic allocation algorithm; the address automatic allocation algorithm includes an authentication branch and a CAN communication ID address allocation branch; the authentication branch is used to obtain a security key based on the slave's unique ID sequence number using the power supply software's built-in security algorithm, and the CAN communication ID address allocation branch is used to determine the CAN communication ID address allocation signal based on the unique ID sequence number order; the address allocation instruction includes the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation.

[0116] In one possible implementation, the processing unit 801 is further configured to obtain the unique ID serial number of multiple power devices at the time of manufacture, including: generating a unique ID serial number for each power device before it leaves the factory based on power health management technology; and storing the unique ID serial number in the internal storage unit of each power device.

[0117] In one possible implementation, the processing unit 801 is further configured to upload the unique ID sequence number of each power supply device based on CAN communication and request CAN communication ID address allocation, including: broadcasting the unique ID sequence number of each power supply device based on CAN communication, while each power supply device receives the unique ID sequence number broadcast by other power supply devices in the CAN network; after each power supply device receives the unique ID sequence number of other power supply devices, it sends a CAN communication ID allocation request signal to request CAN communication ID address allocation.

[0118] In one possible implementation, the processing unit 801 is further configured to obtain a security key based on the slave's unique ID sequence number using a security algorithm built into the power supply software, including: reading the slave's unique ID sequence number from the slave's internal storage unit; calculating an initial security key based on the HMAC-SHA256 message authentication code using a software-preset key and the unique ID sequence number; and formatting the initial security key based on the data field length limit of the CAN bus transmission to obtain the security key.

[0119] In one possible implementation, the processing unit 801 is further configured to determine the CAN communication ID address allocation signal based on the unique ID sequence number, including: allocating the CAN communication ID address based on the size of the unique ID sequence number of each slave device; and encapsulating the slave device's unique ID sequence number and the corresponding CAN communication ID address into a CAN communication ID address allocation signal.

[0120] In one possible implementation, the processing unit 801 is further configured to send the address allocation instruction from the master to each slave, and then the slave performs CAN communication ID address allocation, including: at each slave, inputting its own unique ID serial number into the built-in security algorithm of the power supply software to obtain a local verification key; comparing the local verification key with the security key in the address allocation instruction; if the comparison is consistent, the address allocation instruction is determined to be valid, and the CAN communication ID address allocation signal in the address allocation instruction is stored; if the comparison is inconsistent, the address allocation instruction is determined to be invalid; and using the stored CAN communication ID address allocation signal received by each slave to perform CAN communication ID address allocation.

[0121] In one possible implementation, the processing unit 801 is further configured to, after performing CAN communication ID address allocation using the CAN communication ID address allocation signals received and stored by each slave device, further include: if a new power supply device joins and requests address allocation, obtaining the unique ID sequence number of the new power supply device based on the CAN network; inputting the unique ID sequence number of the new power supply device into the power supply software's built-in security algorithm to obtain the new device's security key; if the new device's security key matches the new device's local verification key, then using the host to allocate a CAN communication ID address to the new power supply, without re-sorting and allocating based on the unique ID sequence number.

[0122] In one possible implementation, the processing unit 801 is further configured to, after the address allocation instruction is sent from the master to each slave, and the slave performs CAN communication ID address allocation, further include: periodically sending a periodic ID address detection command to the CAN network using the master; the periodic ID address detection command contains the unique ID sequence number of all power devices; if each slave does not receive the periodic ID address detection command within a time threshold, the power device with the smallest unique ID sequence number other than the master is selected as the new master.

[0123] The processing unit 801 can be a processor or a controller, and the communication unit 802 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 803 can be a memory. When the CAN communication ID address allocation device 80 based on the power supply device is a chip, the processing unit 801 can be a processor or a controller, and the communication unit 802 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 803 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.)).

[0124] The communication unit can also be called a transceiver unit. The antenna and control circuit with transceiver functions in the CAN communication ID address allocation device 80 based on the power supply device can be considered as the communication unit 802 of the CAN communication ID address allocation device 80 based on the power supply device, and the processor with processing functions can be considered as the processing unit 801 of the CAN communication ID address allocation device 80 based on the power supply device. Optionally, the device in the communication unit 802 used to implement the receiving function can be considered as a communication unit. The communication unit is used to execute the receiving steps in the embodiments of this application, and the communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 802 used to implement the transmitting function can be considered as a transmitting unit. The transmitting unit is used to execute the transmitting steps in the embodiments of this application, and the transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.

[0125] Figure 8 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0126] Figure 8 The units in the process can also be called modules; for example, a processing unit can be called a processing module.

[0127] This application embodiment also provides a hardware structure diagram of a CAN communication ID address allocation device based on a power supply device (denoted as CAN communication ID address allocation device 90 based on a power supply device), see [link to relevant documentation]. Figure 9 The CAN communication ID address allocation device 90 based on the power supply device includes a processor 901, and optionally, a memory 902 connected to the processor 901.

[0128] In the first possible implementation, see Figure 9The CAN communication ID address allocation device 90 based on the power supply device also includes a transceiver 903. The processor 901, memory 902, and transceiver 903 are connected via a bus. The transceiver 903 is used to communicate with other devices or communication networks. Optionally, the transceiver 903 may include a transmitter and a receiver. The device in the transceiver 903 that implements the receiving function can be considered as a receiver, which is used to perform the receiving steps in the embodiments of this application. The device in the transceiver 903 that implements the transmitting function can be considered as a transmitter, which is used to perform the transmitting steps in the embodiments of this application.

[0129] Based on the first possible implementation method Figure 9 The structural diagram shown can be used to illustrate the structure of the CAN communication ID address allocation device based on power supply equipment involved in the above embodiments.

[0130] in, Figure 9 The diagram can also illustrate the system chip in the CAN communication ID address allocation device based on the power supply device. In this case, the actions performed by the aforementioned CAN communication ID address allocation device based on the power supply device can be implemented by this system chip. The specific actions performed can be found above and will not be repeated here.

[0131] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.

[0132] The processor in this application may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., which are various computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor may be a separate semiconductor chip or integrated with other circuits into a single semiconductor chip. For example, it may be integrated with other circuits (such as encoding / decoding circuits, hardware acceleration circuits, or various bus and interface circuits) to form a System-on-a-Chip (SoC), or it may be integrated as a built-in processor within an ASIC. The ASIC with the integrated processor may be packaged separately or together with other circuits. In addition to the cores for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), or logic circuits that implement dedicated logic operations.

[0133] The memory in the embodiments of this application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; or electrically erasable programmable-only memory (EEPROM). In some scenarios, the memory may also be compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0134] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0135] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0136] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.

[0137] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0138] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0139] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A method for allocating a CAN communication ID address based on a power supply device, characterized by, The application relates to a method for automatically assigning CAN communication ID addresses to multiple power supply devices. The method comprises the following steps: obtaining unique ID serial numbers of the multiple power supply devices when the power supply devices are shipped; the multiple power supply devices are power supply devices deployed in the same CAN network; the unique ID serial numbers are used as unique identification codes of the power supply devices; after the multiple power supply devices are powered on, the unique ID serial numbers of the power supply devices are uploaded based on CAN communication, and CAN communication ID address allocation is requested; the unique ID serial numbers of the power supply devices are compared, and a power supply device with the smallest unique ID serial number is selected as a master, and the rest of the power supply devices are selected as slaves; a unique ID serial number of a slave is input into an address automatic allocation algorithm to obtain an address allocation instruction; the address automatic allocation algorithm comprises an identity authentication branch and a CAN communication ID address allocation branch; the identity authentication branch is used for obtaining a security key based on a power supply software built-in security algorithm according to the unique ID serial number of the slave; the CAN communication ID address allocation branch is used for determining a CAN communication ID address allocation signal based on the sequence of the unique ID serial numbers; and the address allocation instruction comprises the security key and the CAN communication ID address allocation signal; 2. The method of claim 1, wherein, after the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation. The method for obtaining the unique ID serial numbers of the multiple power supply devices when the power supply devices are shipped comprises the following steps: generating the unique ID serial numbers before the power supply devices are shipped based on power supply health management technology; 3. The method of claim 1, wherein, the unique ID serial numbers are fixed in internal storage units of the power supply devices. The method for uploading the unique ID serial numbers of the power supply devices based on CAN communication and requesting CAN communication ID address allocation comprises the following steps: broadcasting the unique ID serial numbers of the power supply devices based on CAN communication, and meanwhile, each power supply device receives the unique ID serial numbers broadcast by other power supply devices in the CAN network; 4. The method of claim 1, wherein, after each power supply device receives the unique ID serial numbers of the other power supply devices, a CAN communication ID allocation signal is sent to request CAN communication ID address allocation. The method for obtaining a security key based on a power supply software built-in security algorithm according to the unique ID serial number of the slave comprises the following steps: reading the unique ID serial number of the slave in the internal storage unit of the slave; calculating an initial security key based on an HMAC-SHA256 message authentication code by using a software preset key and the unique ID serial number; 5. The method of claim 1, wherein, performing format processing on the initial security key based on the length limitation of a data field of CAN bus transmission to obtain a security key. The method for determining a CAN communication ID address allocation signal based on the sequence of the unique ID serial numbers comprises the following steps: allocating CAN communication ID addresses based on the sizes of the unique ID serial numbers of the slaves; 6. The method of claim 1, wherein, the unique ID serial number of the slave and the corresponding CAN communication ID address are encapsulated into the CAN communication ID address allocation signal. After the address allocation instruction is sent from the master to each slave, the slave performs CAN communication ID address allocation, which comprises the following steps: at each slave, a local verification key is obtained by inputting the unique ID serial number of the slave into a power supply software built-in security algorithm; comparing the local check key with the security key in the address allocation instruction, if the comparison is consistent, determining that the address allocation instruction is valid, and retaining the CAN communication ID address allocation signal in the address allocation instruction; if the comparison is inconsistent, determining that the address allocation instruction is invalid; allocating CAN communication ID addresses by using the retained CAN communication ID address allocation signal received by each slave.

7. The method of claim 6, wherein, After the CAN communication ID addresses are allocated by using the retained CAN communication ID address allocation signal received by each slave, the method further comprises: if a new power supply device requests address allocation, obtaining a unique ID sequence number of the new power supply device based on the CAN network; inputting the unique ID sequence number of the new power supply device into a security algorithm built in power supply software to obtain a new device security key; if the new device security key is consistent with a local check key of the new device, allocating a CAN communication ID address for the new power supply device by using the master, and no longer reordering and allocating based on the unique ID sequence number.

8. The method of claim 1, wherein, After the address allocation instruction is sent by the master to each slave, and after the CAN communication ID addresses are allocated by the slave, the method further comprises: periodically sending a periodic ID address detection command to the CAN network by using the master; the periodic ID address detection command contains unique ID sequence numbers of all power supply devices; if each slave does not receive the periodic ID address detection command for more than a time threshold, selecting a power supply device with the smallest unique ID sequence number except the master as a new master.

9. A power supply apparatus-based CAN communication ID address assignment device, characterized by comprising: The device comprises a communication unit and a processing unit. The communication unit is configured to obtain unique ID sequence numbers of a plurality of power supply devices when the power supply devices are shipped. The processing unit is configured to, after the plurality of power supply devices are powered on, request CAN communication ID address allocation based on CAN communication of the unique ID sequence numbers of the power supply devices; compare the unique ID sequence numbers of the power supply devices, select a power supply device with the smallest unique ID sequence number as a master, and select the remaining power supply devices as slaves; input the unique ID sequence numbers of the slaves into an address automatic allocation algorithm to obtain an address allocation instruction; the address automatic allocation algorithm comprises an identity authentication branch and a CAN communication ID address allocation branch; the identity authentication branch is configured to obtain a security key based on a security algorithm built in power supply software according to the unique ID sequence number of the slave, and the CAN communication ID address allocation branch is configured to determine a CAN communication ID address allocation signal based on the order of the unique ID sequence numbers; the address allocation instruction contains the security key and the CAN communication ID address allocation signal; after the address allocation instruction is sent by the master to each slave, the slave allocates CAN communication ID addresses.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, when the instructions run on the CAN communication ID address allocation device based on power supply devices, the CAN communication ID address allocation device based on power supply devices executes the method in any one of claims 1-8.