WO2024050752A1 - Multi-controller system, coding method, electronic device, and storage medium - Google Patents

Multi-controller system, coding method, electronic device, and storage medium Download PDF

Info

Publication number
WO2024050752A1
WO2024050752A1 PCT/CN2022/117776 CN2022117776W WO2024050752A1 WO 2024050752 A1 WO2024050752 A1 WO 2024050752A1 CN 2022117776 W CN2022117776 W CN 2022117776W WO 2024050752 A1 WO2024050752 A1 WO 2024050752A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
slave
slave controller
encoding
hard
Prior art date
Application number
PCT/CN2022/117776
Other languages
French (fr)
Chinese (zh)
Inventor
林龙珍
陈绍岩
刘帝平
Original Assignee
宁德时代新能源科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宁德时代新能源科技股份有限公司 filed Critical 宁德时代新能源科技股份有限公司
Priority to PCT/CN2022/117776 priority Critical patent/WO2024050752A1/en
Publication of WO2024050752A1 publication Critical patent/WO2024050752A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing

Definitions

  • the present application relates to the technical field of controller systems, and in particular to a multi-controller system, an encoding method, an electronic device and a storage medium.
  • Multi-controller systems are widely used in battery management, energy storage management and other technical fields.
  • Multi-controller systems usually include a master controller and multi-level slave controllers.
  • Each level of slave controller includes at least one slave controller.
  • Each slave controller is configured with two hard wires, the wiring harness cost is high, and more IO detection resources are required.
  • Embodiments of the present application provide a multi-controller system, a coding method for a multi-controller system, an electronic device and a computer-readable storage medium, which can solve the problem of many hard wires configured from the controller in related technologies. , the problem of higher wiring harness cost and more IO detection resources required.
  • a multi-controller system including a main controller and at least one branch connected to the main controller; the branch includes at least one pair of slave controllers connected in sequence;
  • the pair of slave controllers includes a first slave controller and a second slave controller connected by a hard line;
  • the main controller communicates with each of the slave controllers through a bus.
  • the first slave controller and the second slave controller of the slave controller pair are connected through a hard wire, which reduces the number of hard wires required in the multi-controller system and reduces the wiring harness cost. It reduces the cost, reduces the required IO detection resources, and solves the problems in related technologies that the slave controller configures more hard wires, the wiring harness cost is higher, and the required IO detection resources are more.
  • the hard wire connecting the first slave controller and the second slave controller in the same pair of slave controllers is a wake-up line used to transmit a wake-up signal
  • the master controller is connected to the first slave controller of the first pair of slave controllers through a hard-wired coding line;
  • Each slave controller pair in the at least one branch is connected through a hard-wired coding line
  • the hardwired code lines are used to transmit coded signals.
  • the wake-up line is used to transmit the wake-up signal, so that the first slave controller can wake up the second slave controller through the wake-up line and complete the hard-wire identification of the second slave controller, so that the main controller can recognize the hard-wire identification of the second slave controller.
  • Two slave controllers perform encoding.
  • a coding method for a multi-controller system which is applied to the above-mentioned multi-controller system; the method includes:
  • the at least one branch includes a first branch, and the master controller or the encoded slave controller in the first branch performs hard-wire identification on the uncoded slave controller that is hard-wired;
  • the master controller encodes the unencoded slave controllers recognized by the hardwire over the bus.
  • the encoding method provided by the embodiment of the present application can realize automatic encoding, effectively avoid encoding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the encoding error rate caused by the manual setting encoding method in related technologies. High and manual workload.
  • the method further includes:
  • the encoded slave controller completes hardwire recognition of the hardwired slave controller and enters a silent state
  • the step of returning to the main controller to encode the uncoded slave controllers identified by hard wires through the bus is performed cyclically until the main controller determines that all the slave controllers in the first branch that need to be encoded are Until the coding is completed, automatic coding of the current branch is realized, effectively avoiding coding errors, improving the reliability of the multi-controller system, and reducing manual workload.
  • the master controller determines that all slave controllers that need to be encoded in the first branch have completed encoding, including:
  • the master controller performs hard-wire identification on the slave controllers connected to itself through hard wires, including:
  • the main controller sends a coding start instruction through the bus, and all the first slave controllers enter coding mode;
  • the master controller sends a coding signal to the connected first slave controller through a hard-wired coding line, so that the connected first slave controller is hard-wired after receiving the coding signal.
  • the main controller performs hard-wire identification on the first slave controller, thereby facilitating the main controller to encode the first slave controller after hard-wire identification.
  • the master controller encodes the unencoded slave controllers identified by hardwire through the bus, including:
  • the master controller generates a coded address and sends the coded address through the bus to the hardwired identified slave controller;
  • the hard-wired identified slave controller writes the encoded address into its own storage space.
  • the master controller encodes the hard-wired identified slave controller through the bus, thereby ensuring a one-to-one correspondence between the slave controller and the encoded address.
  • the master controller encodes the uncoded slave controller recognized by the hardwire through the bus, further comprising:
  • the slave controller recognized by the hard wire sends its own coded address to the master controller
  • the main controller determines whether the received coded address is consistent with the coded address generated by itself;
  • the main controller determines whether encoding is successful, thereby ensuring high encoding accuracy.
  • the method further includes:
  • the main controller does not receive an encoding address that is consistent with the encoding address generated by itself when the preset time period or the preset number of retransmissions is reached, the encoding operation ends. Re-executing the step of sending the encoding address when encoding is unsuccessful can improve the encoding success rate.
  • the first slave controller and the second slave controller in the same pair of slave controllers are connected through a wake-up line;
  • the encoded slave controller performs hardwire identification on the next slave controller connected to itself through a hardwire, including:
  • the encoded slave controller If the encoded slave controller is the first slave controller, the encoded first slave controller wakes up the second slave controller connected to itself through the wake-up line when the encoding is completed and reaches the preset delay time. The awakened second slave controller becomes the hardwired recognized slave controller;
  • the coded slave controller is a second slave controller
  • the coded second slave controller will send a coded signal to the next first slave controller connected to itself through a hard-wired coding line after a preset period of time. , making the next first slave controller become the slave controller recognized by hardwire. Identifying the slave controller through hard wires facilitates the master controller to perform encoding operations on the slave controllers identified through hard wires, thereby improving the coding accuracy.
  • the method before the encoded slave controller performs hardwire identification on the next slave controller to which it is connected through a hardwire, the method further includes:
  • the main controller sends a coding success confirmation instruction
  • the encoded slave controller After the encoded slave controller receives the encoding success confirmation instruction, it sends an encoding success feedback signal to the master controller;
  • the main controller receives the feedback signal and updates the current encoding address.
  • the main controller After receiving the feedback signal, the main controller updates the current encoding address, further improving the encoding accuracy and effectively avoiding miscoding.
  • an electronic device which is characterized in that it includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the program to Coding methods that implement any of the above.
  • the electronic device of the embodiment of the present application can implement any of the above coding methods, can realize automatic coding, effectively avoid coding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the manual problem in related technologies. Defects such as high coding error rate and heavy manual workload caused by setting the coding method.
  • a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement any of the above encoding methods.
  • the computer-readable storage medium of the embodiment of the present application can realize any of the above encoding methods, can realize automatic encoding, effectively avoid encoding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the problems of related technologies.
  • the manual coding method used in the system results in high coding error rate and heavy manual workload.
  • FIG. 1 is a structural block diagram of a multi-controller system according to an embodiment of the present application.
  • FIG. 2 is a structural block diagram of a multi-controller system of another example of an embodiment of the present application.
  • Figure 3 is a flow chart of a coding method for a multi-controller system according to some embodiments of the present application.
  • Figure 4 is a flow chart of a coding method for a multi-controller system in other embodiments of the present application.
  • Figure 5 is a flow chart of the coding method of a multi-controller system according to a specific example of this application.
  • Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application.
  • Figure 7 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application.
  • Multi-controller systems are widely used in battery management, energy storage management and other technical fields.
  • Multi-controller systems usually include a master controller and a multi-level slave controller.
  • Each level of slave controller includes at least one slave controller.
  • the main controller and each slave controller can communicate through the bus.
  • each slave controller is configured with two hard wires, which requires higher wiring harness costs and requires more IO detection resources.
  • Multi-controller systems can be applied to battery management systems (Battery Management Systems, BMS) or energy storage management systems, for example.
  • BMS Battery Management Systems
  • BMS is used to intelligently manage and maintain each battery unit, monitor the status of the battery, prevent battery overcharge and over-discharge, and extend the service life of the battery.
  • a master controller and multiple slave controllers are usually included, and each slave controller is used to monitor one or more battery cells.
  • Each slave controller is equipped with two hard wires. The cost of the wiring harness is high and it requires a lot of IO detection resources.
  • the energy storage management system can be used for power system energy storage management, which can realize the energy storage and discharge function of the power system and ensure the large-scale development of clean energy and the safe and economical operation of the power grid.
  • the multiple slave controllers in the energy storage management system may include, for example, slave controller A BMS and slave controller B DCDC.
  • Each slave controller is configured with two hard wires.
  • the wiring harness cost is high and requires more IO detection resources. Due to the large number of hard wires , resulting in high complexity of data transmission through hard wires, prone to data transmission errors, and reducing the reliability of multi-controller systems.
  • the multi-controller system includes a main controller and at least one branch connected to the main controller; each branch includes a controller connected in turn. At least one slave controller pair; the slave controller pair includes a first slave controller and a second slave controller connected through a hard line; the master controller communicates with each slave controller through a bus.
  • Hard wires can be wires, such as wires made of copper or aluminum, or wires made of silver wire, etc.
  • the first slave controller and the second slave controller of the slave controller pair are connected through a hard wire, which reduces the number of hard wires required in the multi-controller system and reduces the wiring harness cost. It reduces the cost, reduces the required IO detection resources, and solves the problems in related technologies that the slave controller configures more hard wires, the wiring harness cost is higher, and the required IO detection resources are more.
  • the hard wire connecting the first slave controller and the second slave controller in the same slave controller pair is a wake-up line used to transmit the wake-up signal.
  • the master controller is connected to the first slave controller of the first slave controller pair by hard-wired coding lines.
  • the slave controller pairs in each branch are connected through hard-wired coding lines; specifically, among the two slave controller pairs connected through hard wires, the second slave controller in the previous slave controller pair It is connected to the first slave controller in the subsequent slave controller pair through a hard-wired encoding line; the hard-wired encoding line is used to transmit encoding signals.
  • the wake-up line is used to transmit the wake-up signal, so that the first slave controller can wake up the second slave controller through the wake-up line and complete the hard-wire identification of the second slave controller, so that the main controller can recognize the hard-wire identification of the second slave controller.
  • Two slave controllers perform encoding.
  • the multi-controller system may include a main controller and a branch connected to the main controller.
  • the multi-controller system may include a main controller and two or more branches respectively connected to the main controller.
  • the master controller can communicate with each slave controller through the CAN bus.
  • CAN is the abbreviation of Controller Area Network, and CAN bus is a field bus.
  • the first slave controller is represented by A m and the second slave controller is represented by B m , 1 ⁇ m ⁇ n.
  • the first slave controller and the second slave controller in the same slave controller pair have the same index.
  • the encoded signal is a high-level signal.
  • the branch includes multiple slave controllers A (labeled A 1 , A 2 , A 3 ,..., An respectively) and Multiple slave controllers B (labeled respectively as B 1 , B 2 , B 3 ,..., B n ) are connected to each other through wake-up lines (referred to as wake-up lines).
  • Controller A and slave controller B have a one-to-one correspondence and have a wake-up relationship.
  • the master controller and the first slave controller A are connected through a hard-wired coding line (referred to as the coding line).
  • the master controller is connected to the first slave controller A 1 through a coding line, and the slave controller A m is connected to the slave controller B m through a wake-up line.
  • a m can wake up B m through hard wire, and the slave controller B m is connected to the slave controller B m .
  • Device A (m+1) is connected via a coding line.
  • the master controller and the slave controller are connected in the same CAN network, and coding is implemented through CAN bus communication.
  • the multi-controller system includes multiple branches, and each branch is connected to a main controller.
  • Each branch can include one or multiple pairs of slave controllers connected in sequence.
  • the slave controllers A 1 , A 2 , A 3 ,..., An are respectively connected to the master controller through coding lines.
  • two slave controllers of the same slave controller pair are connected with two hard wires: a wake-up line and a coding line.
  • a large number of hard wires are used, resulting in higher wiring harness costs and consuming more IO detection resources. many.
  • two slave controllers in the same slave controller pair are connected through only one wake-up line, which reduces the number of required hard wires, reduces the cost of the wiring harness, and reduces the number of required IO detection resources.
  • the encoding method provided by the embodiment of the present application is to perform hard-wiring on the slave controller connected to the current branch by the master controller or the encoded slave controller in the current branch.
  • the master controller codes the uncoded slave controllers recognized by hard wires through the bus, thereby enabling automatic coding, effectively avoiding coding errors, improving the reliability of the multi-controller system, reducing manual workload, and overcoming the This method overcomes the defects of high coding error rate and heavy manual workload caused by manually setting the coding method in related technologies.
  • Another embodiment of the present application provides a coding method for a multi-controller system, which can be applied to the multi-controller system in any of the above embodiments.
  • the encoding method includes steps S10 and S20:
  • the branches in the multi-controller system include the first branch.
  • the master controller or the encoded slave controller in the first branch performs hard-wire identification on the hard-wired uncoded slave controller.
  • the first branch is the current branch.
  • the master controller or the encoded slave controller in the current branch performs hard-wire identification of the slave controller to which it is connected through hard wires.
  • the master controller performs hard-wire identification on the slave controllers connected to itself through hard wires, including: the master controller sends a coding start instruction through the bus, and all first slave controllers in the multi-controller system Enter the encoding mode; the master controller sends an encoding signal to the connected first slave controller through a hard-wired encoding line, so that the connected first slave controller is hard-wired after receiving the encoding signal.
  • each branch in the multi-controller system includes at least one slave controller pair connected in sequence, and the slave controller pair includes a first slave controller and a second slave controller connected through a hard line.
  • the master controller sends an encoding start instruction through the bus, and all first slave controllers in the multi-controller system enter the encoding mode after receiving the encoding start instruction.
  • Hard wire identification means that the encoding line or wake-up line connected to the current controller can recognize that the controller needs to be encoded after there is a signal input. Other controllers that have no signal input do not need to be encoded.
  • the main controller performs hard-wire identification on the first slave controller, thereby facilitating the main controller to encode the first slave controller after hard-wire identification.
  • the encoding line is connected to the encoding pin of the controller
  • the wake-up line is connected to the wake-up pin of the controller
  • the encoding pin and the wake-up pin are different pins.
  • the first slave controller in the same slave controller pair sends a wake-up signal to the second slave controller through the wake-up line.
  • the second slave controller is awakened, and the master controller can be awakened.
  • the second slave controller performs encoding.
  • the first master controller sends a wake-up signal through the wake-up line to wake up the second slave controller, and no subsequent coding operation is performed.
  • the master controller encodes the uncoded slave controller recognized by the hard wire through the bus.
  • the master controller encodes the unencoded slave controller recognized by the hardwire through the bus, which may include: the master controller generates an encoding address, and sends the encoded address to the slave controller identified by the hardwire through the bus. ; The slave controller recognized by the hardwire writes the encoded address into its own storage space. The master controller encodes the hard-wired identified slave controller through the bus, thereby ensuring a one-to-one correspondence between the slave controller and the encoded address.
  • the master controller generates the encoding address 001 for the slave controller A1, sends the encoding address 001 to the slave controller A1 recognized by the hard wire through the bus, and the slave controller A1 recognized by the hard wire writes the encoding address 001 into its own storage space.
  • the encoded address of the slave controller is unique, and the slave controller can be accurately identified through the encoded address.
  • the encoding method may also include:
  • the encoded slave controller completes hardwire recognition of the hardwired slave controller and enters a silent state.
  • the encoded slave controller completes hardwire identification of the next slave controller connected to itself through a hardwire and then enters a silent state.
  • the first slave controller and the second slave controller in the same slave controller pair, the first slave controller and the second slave controller are connected through a wake-up line, and the encoded first slave controller sends a signal to the connected slave controller through the wake-up line.
  • the second slave controller sends a wake-up signal to wake up the second slave controller, that is, the hard-wire identification of the second slave controller is completed, and then the first slave controller enters a silent state.
  • the encoded second slave controller sends a high-level signal to the first slave controller in the next slave controller pair to which it is connected through the encoding line.
  • the first slave controller receives the high-level signal and is Hardwire recognition occurs and then the second slave controller enters a silent state. After the encoded slave controller enters the silent state, it no longer participates in the encoding process of the entire multi-controller system in the current encoding cycle.
  • step S40 Return to step S20 for loop execution until the master controller determines that the slave controllers that need to be encoded in the first branch have completed encoding, thereby realizing automatic encoding of the current branch, effectively avoiding encoding errors, and improving multi-controller efficiency.
  • the reliability of the system reduces manual workload.
  • the encoded slave controller in the current branch After the master controller completes the hard-wire identification and encoding operations for the slave controllers connected to itself, the encoded slave controller in the current branch performs hard-wire identification and coding for the slave controllers connected to itself through hard wires, that is, subsequent The hard-wire identification operations are all performed by the slave controller on the next slave controller connected to itself, so steps S20 and S30 are executed in a loop until all slave controllers that need to be encoded in the current branch complete the encoding, that is, the current branch is completed. The encoding of the branch.
  • the above steps of encoding a branch are used for each branch in turn to complete the slave control that needs to be encoded in the branch.
  • the encoding of the device For example, first encode the branch where A1 is located through the above-mentioned branch encoding steps. After the branch encoding is completed, the branch where A2 is located is encoded, and so on, until all branches are encoded.
  • the master controller determines that the slave controllers in the first branch that need to be encoded have completed encoding, including: determining whether the number of generated encoding addresses is equal to the predetermined number of slave controllers that need to be encoded in the first branch. Set the number; if equal, it is determined that the slave controllers in the first branch that need to be encoded have all been encoded; otherwise, it is determined that they have not been completed, so that an accurate judgment on whether the current branch has been encoded can be achieved to avoid missing some slave controllers. encoder operation.
  • the main controller accumulates a count of the encoded addresses it generates. If the preset number of slave controllers that need to be encoded in the current branch is m, and when the master controller determines that the number of generated encoding addresses reaches m, it is determined that all the slave controllers that need to be encoded in the current branch have completed encoding. If the number of generated encoding addresses is less than m, it is determined that the current branch has not completed encoding.
  • the master controller encodes the uncoded slave controller recognized by the hardwire through the bus, which may also include: the slave controller recognized by the hardwire sends its own encoding address to the master controller. ; The main controller determines whether the received encoding address is consistent with the encoding address generated by itself; if the received encoding address is consistent with the encoding address generated by itself, it is determined that the encoding is successful. The main controller determines whether encoding is successful, thereby ensuring high encoding accuracy.
  • the slave controller A 1 that is hardwired will send the encoding address 001 written in its own storage space to the master controller.
  • the master controller will compare the received encoding address with the encoding address generated for the slave controller A 1 Compare, and when the two are consistent, it is determined that the encoding is successful, otherwise it means that the encoding of A1 is unsuccessful.
  • the encoding method may also include:
  • the step of sending the coded address to the slave controller recognized by the hard wire is re-executed; if the master controller does not receive the code when the preset time is reached or the preset number of retransmissions is reached.
  • the encoding operation ends. Re-executing the step of sending the encoding address when encoding is unsuccessful can improve the encoding success rate.
  • the master controller When the encoding address received by the main controller is inconsistent with the encoding address generated by itself, it means that the encoding is unsuccessful. For example, if the encoding address sent by A1 received by the main controller is 002, and the encoding address generated by the main controller is A1 The encoding address is 001, and the two are inconsistent, indicating that the encoding was unsuccessful. After determining that the encoding was unsuccessful, the master controller resends the encoding address to the slave controller identified by the hardwire.
  • the encoding success is still not determined within the preset time period, such as 2s, 3s or 4s, or the number of retransmissions reaches the preset number of retransmissions, such as 5, 6 or 8 times, etc., it indicates that there may be a fault within the multi-controller system. , it is necessary to end the encoding operation at this time to avoid wasting resources caused by repeatedly performing the operation of resending the encoding address.
  • the preset duration and the preset number of retransmissions can be set according to actual application needs.
  • the first slave controller and the second slave controller in the same slave controller pair are connected through a wake-up line; the encoded slave controller performs a hard call on the next slave controller to which it is connected through a hard wire.
  • Line identification including: if the encoded slave controller is the first slave controller, the encoded first slave controller wakes up the second slave controller connected to itself through the wake-up line when the encoding is completed and reaches the preset delay time. The awakened second slave controller becomes the slave controller recognized by the hardwire; if the encoded slave controller is the second slave controller, the encoded second slave controller passes through the hardware after a preset period of time.
  • the line coding line sends a coding signal to the next first slave controller connected to itself, so that the next first slave controller becomes a slave controller recognized by the hard line. Identifying the slave controller through hard wires facilitates the master controller to perform encoding operations on the slave controllers identified through hard wires, thereby improving the coding accuracy.
  • a slave controller pair includes a slave controller A m and a slave controller B m connected through a wake-up line.
  • the encoded Am reaches a preset delay time after the encoding is completed (the preset delay time may be, for example, (1s, 1.5s or 2s, which can be set according to actual needs), wake up the B m connected to itself through the wake-up line, and the awakened B m becomes the slave controller recognized by the hard wire; the encoded slave controller B m sends a coding signal to the next first slave controller A (m+1) connected to itself through a hard-wired coding line, so that A (m+1) becomes a slave controller recognized by the hard wire.
  • Setting the preset delay length can reserve enough time to ensure that the master controller updates the coding address, thereby avoiding miscoding of the awakened second slave controller.
  • the encoding method before the encoded slave controller performs hardwire identification on the next slave controller to which it is connected through a hardwire, the encoding method further includes:
  • the main controller sends a coding success confirmation command; after encoding, the slave controller receives the coding success confirmation command and sends a coding success feedback signal to the main controller; the main controller receives the feedback signal and updates the current coding address. After receiving the feedback signal, the main controller updates the current encoding address, further improving the encoding accuracy and effectively avoiding miscoding.
  • the way to update the current encoding address is usually to add 1 to the current encoding address. For example, if the current encoding address is 001, then the main controller will add 1 to the current encoding address 001 to get 002 after receiving the encoding success feedback signal, and update 001 with the new encoding address 002.
  • the coding of slave controllers in related technologies is achieved through manual settings, which is prone to coding errors and requires a large amount of manual labor.
  • the coding method of the embodiment of the present application can realize automatic coding, improve coding accuracy and reliability, and reduce the amount of manual labor. .
  • a specific example of coding method for a multi-controller system includes the following steps:
  • Step 1 The main controller sends the encoding start command through the CAN bus, and all slave controllers A enter the encoding mode;
  • Step 2 The master controller pulls the encoding line high and sends the encoding address.
  • the slave controller A that is not pulled high remains silent;
  • Step 3 The pulled-up slave controller writes the received encoding address. After confirming that the written encoding address is consistent with the expected address, the master controller sends a encoding success signal;
  • Step 4 After receiving the encoding success signal, slave controller A feedbacks that the encoding is completed, and delays wake-up of slave controller B for 1 second (the delayed wake-up is to ensure that the encoding address of the master controller has been +1, thereby preventing slave controller B from being Error coding), then controller A ends the coding operation and enters a silent state;
  • Step 5 If the main controller confirms that the encoding address is inconsistent with the expected address, it will resend the encoding instruction and encoding address and make a timeout judgment. If the correct encoding address is not received after the set time, it will determine that the encoding failed and exit the encoding process;
  • Step 6 After the master controller receives the encoding completion instruction from slave controller A, it automatically encodes the address +1 and sends it to the slave controller;
  • Step 7 After the slave controller B wakes up, it writes the encoding address.
  • the master controller confirms that the encoding address is consistent with the expected address, then it is determined that the encoding is sent successfully;
  • Step 8 After successfully receiving the encoding from controller B, it will feedback that the encoding is completed and pull up the encoding line of the next slave controller A;
  • the master controller pulls the encoding line of the first slave controller A 1 high (pulling the encoding line high means inputting a high level signal to A 1 through the encoding line), and sends the ID through the CAN bus ( ID (encoding address) encodes A 1. After A 1 is encoded, it wakes up the slave controller B 1. The master controller sends the ID to B 1 to encode through CAN. After B 1 is encoded, it pulls the A 2 encoding line of the controller high. , the main controller sends the ID to A 2 code through CAN, and so on.
  • the main controller starts the encoding process and sends encoding instructions.
  • slave controller A After receiving the encoding instructions, slave controller A enters the encoding mode; the master controller pulls up the encoding of slave controller A.
  • the pulled-up slave controller A receives the encoding address, writes the encoding address into its own storage space, and then sends the written encoding address to the master controller; the master controller compares the encoding address with the expected address (the expected address is the encoding address generated by the master controller) to determine whether they are consistent; if they are inconsistent, resend the encoding address; if they are consistent, send a confirmation encoding success instruction to slave controller A; slave control After receiving the confirmation encoding success command, controller A confirms whether the encoding is successful; if the encoding is unsuccessful, slave controller A receives the encoding address resent from the main controller and rewrites it into its own storage space; if the encoding is successful, slave controller A The master controller feeds back the instruction to complete the encoding, wakes up the slave controller B after a delay of 1 second, then exits encoding and enters a silent state; after receiving the instruction to complete the encoding
  • This coding method can realize automatic coding, effectively avoid coding errors, improve coding accuracy, improve the reliability of multi-controller systems, reduce manual workload, and overcome the coding error rate caused by manual setting of coding methods in related technologies. High and manual workload.
  • Another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor executes the program to implement The encoding method of the multi-controller system in any of the above embodiments.
  • the electronic device 10 may include: a processor 100, a memory 101, a bus 102 and a communication interface 103.
  • the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102; the memory 101 stores information that can be stored in the processor.
  • a computer program running on the computer 100 When the processor 100 runs the computer program, the method provided by any of the foregoing embodiments of the application is executed.
  • the memory 101 may include high-speed random access memory (RAM: Random Access Memory), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • the communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
  • the bus 102 may be an ISA bus, a PCI bus, an EISA bus, etc.
  • the bus can be divided into address bus, data bus, control bus, etc.
  • the memory 101 is used to store a program, and the processor 100 executes the program after receiving the execution instruction.
  • the method disclosed in any of the embodiments of the present application can be applied to the processor 100 or implemented by the processor 100 .
  • the processor 100 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 100 .
  • the above-mentioned processor 100 can be a general-purpose processor, which can include a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it can also be a digital signal processor (DSP), a dedicated integrated processor Circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASICs dedicated integrated processor Circuits
  • FPGAs off-the-shelf programmable gate arrays
  • Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 101.
  • the processor 100 reads the information in the memory 101 and completes the steps of the above method in combination with its hardware.
  • the electronic device provided by the embodiments of the present application and the method provided by the embodiments of the present application are based on the same inventive concept, and have the same beneficial effects as the methods adopted, run or implemented.
  • Another embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the encoding method of the multi-controller system in any of the above embodiments.
  • the computer-readable storage medium shown is an optical disk 20, on which a computer program (ie, a program product) is stored.
  • a computer program ie, a program product
  • the computer program When the computer program is run by a processor, it will execute any of the foregoing embodiments. method.
  • examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other optical and magnetic storage media will not be described in detail here.
  • the computer-readable storage medium provided by the above-mentioned embodiments of the present application is based on the same inventive concept as the method provided by the embodiments of the present application, and has the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the functions 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.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes a number of instructions. It is used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Programmable Controllers (AREA)

Abstract

Embodiments of the present application provide a multi-controller system, a coding method, an electronic device, and a storage medium. The multi-controller system comprises a master controller and at least one branch connected to the master controller; the branch comprises at least one slave controller pair connected in sequence; the slave controller pair comprises a first slave controller and a second slave controller which are connected by means of one hard wire; the master controller is separately communicationally connected to each slave controller by means of a bus. In the multi-controller system provided in the embodiments of the present application, the first slave controller and the second slave controller of the slave controller pair are connected by means of one hard wire, such that the number of hard wires required in the multi-controller system is reduced, the wire harness cost is reduced, and the required IO detection resources are reduced. The present application solves the problems in the related art that more hard wires are configured in a slave controller, the wire harness cost is higher, and more IO detection resources are required.

Description

多控制器系统、编码方法、电子设备及存储介质Multi-controller systems, encoding methods, electronic devices and storage media 技术领域Technical field
本申请涉及控制器系统技术领域,特别是涉及一种多控制器系统、编码方法、电子设备及存储介质。The present application relates to the technical field of controller systems, and in particular to a multi-controller system, an encoding method, an electronic device and a storage medium.
背景技术Background technique
多控制器系统广泛应用于电池管理、储能管理等技术领域,多控制器系统通常包括主控制器和多级从控制器,每一级从控制器包括至少一个从控制器。每个从控制器配置两根硬线,线束成本较高,所需要的IO检测资源较多。Multi-controller systems are widely used in battery management, energy storage management and other technical fields. Multi-controller systems usually include a master controller and multi-level slave controllers. Each level of slave controller includes at least one slave controller. Each slave controller is configured with two hard wires, the wiring harness cost is high, and more IO detection resources are required.
发明内容Contents of the invention
本申请实施例提供了一种多控制器系统、一种多控制器系统的编码方法、一种电子设备及一种计算机可读存储介质,能够解决相关技术中从控制器所配置硬线较多、线束成本较高以及所需要的IO检测资源较多的问题。Embodiments of the present application provide a multi-controller system, a coding method for a multi-controller system, an electronic device and a computer-readable storage medium, which can solve the problem of many hard wires configured from the controller in related technologies. , the problem of higher wiring harness cost and more IO detection resources required.
第一方面,提供了一种多控制器系统,包括主控制器以及与所述主控制器连接的至少一条支路;所述支路包括依次连接的至少一个从控制器对;In a first aspect, a multi-controller system is provided, including a main controller and at least one branch connected to the main controller; the branch includes at least one pair of slave controllers connected in sequence;
所述从控制器对包括通过一条硬线连接的第一从控制器和第二从控制器;The pair of slave controllers includes a first slave controller and a second slave controller connected by a hard line;
所述主控制器通过总线分别与各所述从控制器通讯连接。The main controller communicates with each of the slave controllers through a bus.
本申请实施例提供的多控制器系统,从控制器对的第一从控制器和第二从控制器通过一条硬线连接,减少了多控制器系统中所需硬线的数量,降低了线束成本,减少了所需要的IO检测资源,解决了相关技术中从控制器所配置硬线较多、线束成本较高以及所需要的IO检测资源较多的问题。In the multi-controller system provided by the embodiment of the present application, the first slave controller and the second slave controller of the slave controller pair are connected through a hard wire, which reduces the number of hard wires required in the multi-controller system and reduces the wiring harness cost. It reduces the cost, reduces the required IO detection resources, and solves the problems in related technologies that the slave controller configures more hard wires, the wiring harness cost is higher, and the required IO detection resources are more.
在一种实现方式中,同一所述从控制器对中连接第一从控制器和第二从控制器的硬线为用于传输唤醒信号的唤醒线;In one implementation, the hard wire connecting the first slave controller and the second slave controller in the same pair of slave controllers is a wake-up line used to transmit a wake-up signal;
所述主控制器与第一个所述从控制器对的第一从控制器通过硬线编码线相连接;The master controller is connected to the first slave controller of the first pair of slave controllers through a hard-wired coding line;
所述至少一条支路中的各从控制器对之间通过硬线编码线相连接;Each slave controller pair in the at least one branch is connected through a hard-wired coding line;
所述硬线编码线用于传输编码信号。The hardwired code lines are used to transmit coded signals.
唤醒线用于传输唤醒信号,从而能够实现第一从控制器通过唤醒线唤醒第二从控制器,完成对第二从控制器的硬线识别,以便于主控制器对硬线识别后的第二从控制器进行编码。The wake-up line is used to transmit the wake-up signal, so that the first slave controller can wake up the second slave controller through the wake-up line and complete the hard-wire identification of the second slave controller, so that the main controller can recognize the hard-wire identification of the second slave controller. Two slave controllers perform encoding.
第二方面,提供了一种多控制器系统的编码方法,应用于上述的多控制器系统;所述方法包括:In a second aspect, a coding method for a multi-controller system is provided, which is applied to the above-mentioned multi-controller system; the method includes:
所述至少一条支路包括第一支路,所述主控制器或所述第一支路中编码后的从控制器对硬线连接的未编码的从控制器进行硬线识别;The at least one branch includes a first branch, and the master controller or the encoded slave controller in the first branch performs hard-wire identification on the uncoded slave controller that is hard-wired;
所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码。The master controller encodes the unencoded slave controllers recognized by the hardwire over the bus.
本申请实施例提供的编码方法,能够实现自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量,克服了相关技术中采用手动设置编码方式导致的编码出错率高、人工工作量大的缺陷。The encoding method provided by the embodiment of the present application can realize automatic encoding, effectively avoid encoding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the encoding error rate caused by the manual setting encoding method in related technologies. High and manual workload.
在一种实现方式中,所述方法还包括:In one implementation, the method further includes:
所述编码后的从控制器对硬线连接的从控制器完成硬线识别后进入静默状态;The encoded slave controller completes hardwire recognition of the hardwired slave controller and enters a silent state;
返回所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码的步骤循环执行,直至所述主控制器确定所述第一支路中需要编码的从控制器均编码完成为止,从而实现了对当前支路的自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量。The step of returning to the main controller to encode the uncoded slave controllers identified by hard wires through the bus is performed cyclically until the main controller determines that all the slave controllers in the first branch that need to be encoded are Until the coding is completed, automatic coding of the current branch is realized, effectively avoiding coding errors, improving the reliability of the multi-controller system, and reducing manual workload.
在一种实现方式中,所述主控制器确定所述第一支路中需要编码的从控制器均编码完成,包括:In one implementation, the master controller determines that all slave controllers that need to be encoded in the first branch have completed encoding, including:
确定所生成的编码地址的数量是否等于所述第一支路中需要编码的从控制器的预设数量;Determine whether the number of generated encoding addresses is equal to the preset number of slave controllers that need to be encoded in the first branch;
若等于,则确定所述第一支路中需要编码的从控制器均编码完成;否则,确定未完成,从而能够实现对当前支路是否完成编码的准确判断,避免遗漏对某些从控制器的编码操作。If equal, it is determined that the slave controllers in the first branch that need to be encoded have all been encoded; otherwise, it is determined that they have not been completed, thereby enabling an accurate judgment on whether the current branch has completed encoding and avoiding missing certain slave controllers. encoding operation.
在一种实现方式中,所述主控制器对自身通过硬线所连接的从控制器进行硬线识别,包括:In one implementation, the master controller performs hard-wire identification on the slave controllers connected to itself through hard wires, including:
所述主控制器通过总线发送编码开始指令,所有所述第一从控制器进入编码模式;The main controller sends a coding start instruction through the bus, and all the first slave controllers enter coding mode;
所述主控制器通过硬线编码线向所连接的第一从控制器发送编码信号,以使所连接的第一从控制器在接收到所述编码信号后被硬线识别。主控制器对第一从控制器进行硬线识别,从而便于主控制器对硬线识别后的第一从控制器进行编码。The master controller sends a coding signal to the connected first slave controller through a hard-wired coding line, so that the connected first slave controller is hard-wired after receiving the coding signal. The main controller performs hard-wire identification on the first slave controller, thereby facilitating the main controller to encode the first slave controller after hard-wire identification.
在一种实现方式中,所述主控制器通过所述总线对被硬线识别的未编码的 从控制器进行编码,包括:In one implementation, the master controller encodes the unencoded slave controllers identified by hardwire through the bus, including:
所述主控制器生成编码地址,通过所述总线向所述被硬线识别的从控制器发送所述编码地址;The master controller generates a coded address and sends the coded address through the bus to the hardwired identified slave controller;
所述被硬线识别的从控制器将所述编码地址写入自身存储空间内。主控制器通过总线对硬线识别的从控制器进行编码,从而确保从控制器与编码地址的一一对应关系。The hard-wired identified slave controller writes the encoded address into its own storage space. The master controller encodes the hard-wired identified slave controller through the bus, thereby ensuring a one-to-one correspondence between the slave controller and the encoded address.
在一种实现方式中,所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码,还包括:In one implementation, the master controller encodes the uncoded slave controller recognized by the hardwire through the bus, further comprising:
所述被硬线识别的从控制器将写入自身的编码地址发送给所述主控制器;The slave controller recognized by the hard wire sends its own coded address to the master controller;
所述主控制器确定接收到的编码地址与自身所生成的编码地址是否一致;The main controller determines whether the received coded address is consistent with the coded address generated by itself;
若所述接收到的编码地址与所述自身生成的编码地址一致,则确定编码成功。主控制器确定编码是否成功,从而能够确保较高的编码准确率。If the received encoding address is consistent with the self-generated encoding address, it is determined that the encoding is successful. The main controller determines whether encoding is successful, thereby ensuring high encoding accuracy.
在一种实现方式中,所述方法还包括:In one implementation, the method further includes:
若所述接收到的编码地址与所述自身生成的编码地址不一致,则重新执行所述向所述被硬线识别的从控制器发送所述编码地址的步骤;If the received coded address is inconsistent with the self-generated coded address, re-execute the step of sending the coded address to the slave controller identified by the hardwire;
若达到预设时长或达到预设重发次数时所述主控制器未收到与所述自身生成的编码地址相一致的编码地址,则结束编码操作。在编码不成功时重新执行发送编码地址的步骤,能够提高编码成功率。If the main controller does not receive an encoding address that is consistent with the encoding address generated by itself when the preset time period or the preset number of retransmissions is reached, the encoding operation ends. Re-executing the step of sending the encoding address when encoding is unsuccessful can improve the encoding success rate.
在一种实现方式中,同一所述从控制器对中的第一从控制器和第二从控制器通过唤醒线连接;In one implementation, the first slave controller and the second slave controller in the same pair of slave controllers are connected through a wake-up line;
所述编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别,包括:The encoded slave controller performs hardwire identification on the next slave controller connected to itself through a hardwire, including:
若所述编码后的从控制器为第一从控制器,则编码后的第一从控制器在编码完成达到预设延时时长时通过唤醒线唤醒自身所连接的第二从控制器,被唤醒的第二从控制器成为被硬线识别的从控制器;If the encoded slave controller is the first slave controller, the encoded first slave controller wakes up the second slave controller connected to itself through the wake-up line when the encoding is completed and reaches the preset delay time. The awakened second slave controller becomes the hardwired recognized slave controller;
若所述编码后的从控制器为第二从控制器,则编码后的第二从控制器在预设时长后通过硬线编码线向自身所连接的下一个第一从控制器发送编码信号,使所述下一个第一从控制器成为被硬线识别的从控制器。通过硬线识别从控制器,有利于主控制器对硬线识别的从控制器进行编码操作,提高了编码准确率。If the coded slave controller is a second slave controller, the coded second slave controller will send a coded signal to the next first slave controller connected to itself through a hard-wired coding line after a preset period of time. , making the next first slave controller become the slave controller recognized by hardwire. Identifying the slave controller through hard wires facilitates the master controller to perform encoding operations on the slave controllers identified through hard wires, thereby improving the coding accuracy.
在一种实现方式中,所述编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别之前,所述方法还包括:In one implementation, before the encoded slave controller performs hardwire identification on the next slave controller to which it is connected through a hardwire, the method further includes:
所述主控制器发送编码成功确认指令;The main controller sends a coding success confirmation instruction;
所述编码后的从控制器接收到所述编码成功确认指令后,向所述主控制器发送编码成功反馈信号;After the encoded slave controller receives the encoding success confirmation instruction, it sends an encoding success feedback signal to the master controller;
所述主控制器接收到所述反馈信号,更新当前的编码地址。The main controller receives the feedback signal and updates the current encoding address.
主控制器接收到反馈信号后更新当前的编码地址,进一步提高了编码准确率,有效避免误编码。After receiving the feedback signal, the main controller updates the current encoding address, further improving the encoding accuracy and effectively avoiding miscoding.
第三方面,提供了一种电子设备,其特征在于,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序,以实现上述任一项的编码方法。In a third aspect, an electronic device is provided, which is characterized in that it includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the program to Coding methods that implement any of the above.
本申请实施例的电子设备能够实现上述任一项的编码方法,能够实现自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量,克服了相关技术中采用手动设置编码方式导致的编码出错率高、人工工作量大的缺陷。The electronic device of the embodiment of the present application can implement any of the above coding methods, can realize automatic coding, effectively avoid coding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the manual problem in related technologies. Defects such as high coding error rate and heavy manual workload caused by setting the coding method.
第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行,以实现上述任一项的编码方法。In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement any of the above encoding methods.
本申请实施例的计算机可读存储介质能够实现上述任一项的编码方法,能够实现自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量,克服了相关技术中采用手动设置编码方式导致的编码出错率高、人工工作量大的缺陷。The computer-readable storage medium of the embodiment of the present application can realize any of the above encoding methods, can realize automatic encoding, effectively avoid encoding errors, improve the reliability of the multi-controller system, reduce the manual workload, and overcome the problems of related technologies. The manual coding method used in the system results in high coding error rate and heavy manual workload.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the drawings required to be used in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. Those of ordinary skill in the art can also obtain other drawings based on the drawings without exerting creative efforts.
图1是本申请实施例一个示例的多控制器系统的结构框图。FIG. 1 is a structural block diagram of a multi-controller system according to an embodiment of the present application.
图2是本申请实施例另一示例的多控制器系统的结构框图。FIG. 2 is a structural block diagram of a multi-controller system of another example of an embodiment of the present application.
图3是本申请一些实施方式的多控制器系统的编码方法流程图。Figure 3 is a flow chart of a coding method for a multi-controller system according to some embodiments of the present application.
图4是本申请另一些实施方式的多控制器系统的编码方法流程图。Figure 4 is a flow chart of a coding method for a multi-controller system in other embodiments of the present application.
图5是本申请一个具体示例的多控制器系统的编码方法流程图。Figure 5 is a flow chart of the coding method of a multi-controller system according to a specific example of this application.
图6是本申请实施例一个实施例的电子设备的结构框图。Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application.
图7是本申请实施例一个实施例的计算机可读存储介质的示意图。Figure 7 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请的实施方式作进一步详细描述。以下实施例的详细描述和附图用于示例性地说明本申请的原理,但不能用来限制本申请的范围,即本申请不限于所描述的实施例。The embodiments of the present application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of the present application, but cannot be used to limit the scope of the present application, that is, the present application is not limited to the described embodiments.
在本申请的描述中,需要说明的是,除非另有说明,“多个”的含义是两个以上;术语“上”、“下”、“左”、“右”、“内”、“外”等指示的方位或位置关系仅是为了便于描述本申请和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请的限制。此外,术语“第一”、“第二”、“第三”等仅用于描述目的,而不能理解为指示或暗示相对重要性。“垂直”并不是严格意义上的垂直,而是在误差允许范围之内。“平行”并不是严格意义上的平行,而是在误差允许范围之内。In the description of this application, it should be noted that, unless otherwise stated, "plurality" means more than two; the terms "upper", "lower", "left", "right", "inside", " The orientation or positional relationship indicated such as "outside" is only for the convenience of describing the present application and simplifying the description. It does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present application. Application restrictions. Furthermore, the terms "first," "second," "third," etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. "Vertical" is not vertical in the strict sense, but within the allowable error range. "Parallel" is not parallel in the strict sense, but within the allowable error range.
下述描述中出现的方位词均为图中示出的方向,并不是对本申请的具体结构进行限定。在本申请的描述中,还需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的普通技术人员而言,可视具体情况理解上述术语在本申请中的具体含义。The directional words appearing in the following description are the directions shown in the figures and do not limit the specific structure of the present application. In the description of this application, it should also be noted that, unless otherwise clearly stated and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense. For example, it can be a fixed connection or a removable connection. Detachable connection, or integral connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in this application may be understood based on specific circumstances.
在相关技术中,多控制器系统广泛应用于电池管理、储能管理等技术领域,多控制器系统通常包括主控制器和多级从控制器,每一级从控制器包括至少一个从控制器,主控制器和各从控制器之间可以通过总线进行通讯。另外,每个从控制器配置两根硬线,线束成本较高,所需要的IO检测资源较多。In related technologies, multi-controller systems are widely used in battery management, energy storage management and other technical fields. Multi-controller systems usually include a master controller and a multi-level slave controller. Each level of slave controller includes at least one slave controller. , the main controller and each slave controller can communicate through the bus. In addition, each slave controller is configured with two hard wires, which requires higher wiring harness costs and requires more IO detection resources.
多控制器系统例如可以应用于电池管理系统(Battery Management System,BMS)或储能管理系统等。其中,BMS用于智能化管理及维护各个电池单元,监控电池的状态,防止电池过充电和过放电,延长电池的使用寿命。在电池管理系统中,通常包括主控制器和多个从控制器,每一从控制器用于监控一个或多个电池单元。电池管理系统中通常存在多级从控制器,每个从控制器配置两根硬线,线束成本较高,所需要的IO检测资源较多。储能管理系统可以用于电力系统储能管理,能够实现电力系统的能量储放功能,保障清洁能源大规模发展以及电网安全经济运行。储能管理系统中的多个从控制器例如可以包括从控制器A BMS和从控制器B DCDC等。Multi-controller systems can be applied to battery management systems (Battery Management Systems, BMS) or energy storage management systems, for example. Among them, BMS is used to intelligently manage and maintain each battery unit, monitor the status of the battery, prevent battery overcharge and over-discharge, and extend the service life of the battery. In a battery management system, a master controller and multiple slave controllers are usually included, and each slave controller is used to monitor one or more battery cells. There are usually multi-level slave controllers in the battery management system. Each slave controller is equipped with two hard wires. The cost of the wiring harness is high and it requires a lot of IO detection resources. The energy storage management system can be used for power system energy storage management, which can realize the energy storage and discharge function of the power system and ensure the large-scale development of clean energy and the safe and economical operation of the power grid. The multiple slave controllers in the energy storage management system may include, for example, slave controller A BMS and slave controller B DCDC.
多控制器系统中的多个从控制器通常被设置为多个级别,每个从控制器配置两根硬线,线束成本较高,需要的IO检测资源较多,且由于硬线数量较多,导致数据通过硬线传输的复杂程度较高,容易出现数据传输错误,降低了多控制器系统的可靠性。Multiple slave controllers in a multi-controller system are usually set to multiple levels. Each slave controller is configured with two hard wires. The wiring harness cost is high and requires more IO detection resources. Due to the large number of hard wires , resulting in high complexity of data transmission through hard wires, prone to data transmission errors, and reducing the reliability of multi-controller systems.
针对相关技术中的缺陷,本申请的一个实施例提供了一种多控制器系统,该多控制器系统包括主控制器以及与主控制器连接的至少一条支路;每条支路包括依次连接的至少一个从控制器对;从控制器对包括通过一条硬线连接的第一从控制器和第二从控制器;主控制器通过总线分别与各从控制器通讯连接。In order to solve the deficiencies in the related art, one embodiment of the present application provides a multi-controller system. The multi-controller system includes a main controller and at least one branch connected to the main controller; each branch includes a controller connected in turn. At least one slave controller pair; the slave controller pair includes a first slave controller and a second slave controller connected through a hard line; the master controller communicates with each slave controller through a bus.
硬线可以为导线,例如由铜或铝制成的导线,或者用银线制成的导线等。Hard wires can be wires, such as wires made of copper or aluminum, or wires made of silver wire, etc.
本申请实施例提供的多控制器系统,从控制器对的第一从控制器和第二从控制器通过一条硬线连接,减少了多控制器系统中所需硬线的数量,降低了线束成本,减少了所需要的IO检测资源,解决了相关技术中从控制器所配置硬线较多、线束成本较高以及所需要的IO检测资源较多的问题。In the multi-controller system provided by the embodiment of the present application, the first slave controller and the second slave controller of the slave controller pair are connected through a hard wire, which reduces the number of hard wires required in the multi-controller system and reduces the wiring harness cost. It reduces the cost, reduces the required IO detection resources, and solves the problems in related technologies that the slave controller configures more hard wires, the wiring harness cost is higher, and the required IO detection resources are more.
在一些实施方式中,同一从控制器对中连接第一从控制器和第二从控制器的硬线为用于传输唤醒信号的唤醒线。主控制器与第一个从控制器对的第一从控制器通过硬线编码线相连接。每一条支路中的各从控制器对之间通过硬线编码线相连接;具体地,通过硬线连接的两个从控制器对中,前一从控制器对中的第二从控制器与后一从控制器对中的第一从控制器通过硬线编码线相连接;硬线编码线用于传输编码信号。In some embodiments, the hard wire connecting the first slave controller and the second slave controller in the same slave controller pair is a wake-up line used to transmit the wake-up signal. The master controller is connected to the first slave controller of the first slave controller pair by hard-wired coding lines. The slave controller pairs in each branch are connected through hard-wired coding lines; specifically, among the two slave controller pairs connected through hard wires, the second slave controller in the previous slave controller pair It is connected to the first slave controller in the subsequent slave controller pair through a hard-wired encoding line; the hard-wired encoding line is used to transmit encoding signals.
唤醒线用于传输唤醒信号,从而能够实现第一从控制器通过唤醒线唤醒第二从控制器,完成对第二从控制器的硬线识别,以便于主控制器对硬线识别后的第二从控制器进行编码。The wake-up line is used to transmit the wake-up signal, so that the first slave controller can wake up the second slave controller through the wake-up line and complete the hard-wire identification of the second slave controller, so that the main controller can recognize the hard-wire identification of the second slave controller. Two slave controllers perform encoding.
具体地,如图1所示,该多控制器系统可以包括主控制器以及与该主控制器连接的一条支路。如图2所示,该多控制器系统可以包括主控制器以及与该主控制器分别连接的两条以及两条以上的支路。主控制器可以通过CAN总线分别与各从控制器通讯连接。CAN是控制器域网(Controller Area Network)的简称,CAN总线是一种现场总线。第一从控制器表示为A m,第二从控制器表示为B m,1≤m≤n。同一从控制器对中的第一从控制器和第二从控制器的下标相同。编码信号是一种高电平信号。 Specifically, as shown in Figure 1, the multi-controller system may include a main controller and a branch connected to the main controller. As shown in Figure 2, the multi-controller system may include a main controller and two or more branches respectively connected to the main controller. The master controller can communicate with each slave controller through the CAN bus. CAN is the abbreviation of Controller Area Network, and CAN bus is a field bus. The first slave controller is represented by A m and the second slave controller is represented by B m , 1≤m≤n. The first slave controller and the second slave controller in the same slave controller pair have the same index. The encoded signal is a high-level signal.
在图1所示的示例中,该多控制器系统中只有一条支路,该支路包括多个从控制器A(分别标记为A 1、A 2、A 3、……、A n)以及多个从控制器B(分别标记为B 1、B 2、B 3、……、B n),从控制器A与对应的从控制器B之间通过唤醒线(简称唤醒线)连接,从控制器A和从控制器B一一对应且存在唤醒关系,主控制器与第一个从控制器A之间通过硬线编码线(简称编码线)连接。 In the example shown in Figure 1, there is only one branch in the multi-controller system, and the branch includes multiple slave controllers A (labeled A 1 , A 2 , A 3 ,..., An respectively) and Multiple slave controllers B (labeled respectively as B 1 , B 2 , B 3 ,..., B n ) are connected to each other through wake-up lines (referred to as wake-up lines). Controller A and slave controller B have a one-to-one correspondence and have a wake-up relationship. The master controller and the first slave controller A are connected through a hard-wired coding line (referred to as the coding line).
主控制器与第一个从控制器A 1通过编码线连接,从控制器A m与从控制器B m通过唤醒线连接,A m可以硬线唤醒B m,从控制器B m与从控制器A (m+1)通过编码线连接。主控制器与从控制器连接在同一个CAN网络中,通过CAN总线通讯实现编码。 The master controller is connected to the first slave controller A 1 through a coding line, and the slave controller A m is connected to the slave controller B m through a wake-up line. A m can wake up B m through hard wire, and the slave controller B m is connected to the slave controller B m . Device A (m+1) is connected via a coding line. The master controller and the slave controller are connected in the same CAN network, and coding is implemented through CAN bus communication.
在图2所示的示例中,该多控制器系统包括多条支路,每条支路均与主控制器相连接。每条支路可以包括一个或者依次连接的多个从控制器对。从控制器A 1、A 2、A 3、……、A n分别通过编码线与主控制器相连接。 In the example shown in Figure 2, the multi-controller system includes multiple branches, and each branch is connected to a main controller. Each branch can include one or multiple pairs of slave controllers connected in sequence. The slave controllers A 1 , A 2 , A 3 ,..., An are respectively connected to the master controller through coding lines.
相关技术中,同一从控制器对的两个从控制器之间连接有唤醒线和编码线两条硬线,用到的硬线数量较多,导致线束成本较高,耗费的IO检测资源较多。本申请实施例的多控制器系统中,同一从控制器对中的两个从控制器只通过一条唤醒线相连接,减少了所需硬线数量,降低了线束成本,并且减少了所需要的IO检测资源。In the related technology, two slave controllers of the same slave controller pair are connected with two hard wires: a wake-up line and a coding line. A large number of hard wires are used, resulting in higher wiring harness costs and consuming more IO detection resources. many. In the multi-controller system of the embodiment of the present application, two slave controllers in the same slave controller pair are connected through only one wake-up line, which reduces the number of required hard wires, reduces the cost of the wiring harness, and reduces the number of required IO detection resources.
随着在多控制器系统的多个控制器之间传送的数据量的不断增长,在管理电池单元的控制器之间需要进行可靠且高速的数据传输,对各从控制器的准确编码尤为重要。相关技术中通常采用手动设置编码方式对从控制器进行编码,导致编码出错率高、人工工作量大。针对相关技术中存在的问题,本申请实施例提供的编码方法,针对当前支路,主控制器或当前支路中编码后的从控制器对自身通过硬线所连接的从控制器进行硬线识别,主控制器通过总线对被硬线识别的未编码的从控制器进行编码,从而能够实现自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量,克服了相关技术中采用手动设置编码方式导致的编码出错率高、人工工作量大的缺陷。As the amount of data transferred between multiple controllers in a multi-controller system continues to grow, reliable and high-speed data transmission is required between controllers managing battery cells, and accurate encoding of each slave controller is particularly important. . In related technologies, manual setting of coding methods is usually used to code slave controllers, resulting in high coding error rates and heavy manual workload. In order to solve the problems existing in the related technology, the encoding method provided by the embodiment of the present application is to perform hard-wiring on the slave controller connected to the current branch by the master controller or the encoded slave controller in the current branch. Recognition, the master controller codes the uncoded slave controllers recognized by hard wires through the bus, thereby enabling automatic coding, effectively avoiding coding errors, improving the reliability of the multi-controller system, reducing manual workload, and overcoming the This method overcomes the defects of high coding error rate and heavy manual workload caused by manually setting the coding method in related technologies.
本申请的另一个实施例提供了一种多控制器系统的编码方法,应用于上述任一实施方式的多控制器系统。如图3所示,在一些实施方式中,该编码方法包括步骤S10和S20:Another embodiment of the present application provides a coding method for a multi-controller system, which can be applied to the multi-controller system in any of the above embodiments. As shown in Figure 3, in some implementations, the encoding method includes steps S10 and S20:
S10、该多控制器系统中的支路包括第一支路,主控制器或第一支路中编码后的从控制器对硬线连接的未编码的从控制器进行硬线识别。S10. The branches in the multi-controller system include the first branch. The master controller or the encoded slave controller in the first branch performs hard-wire identification on the hard-wired uncoded slave controller.
具体地,第一支路即当前支路,针对当前支路,主控制器或当前支路中编码后的从控制器对自身通过硬线所连接的从控制器进行硬线识别。Specifically, the first branch is the current branch. For the current branch, the master controller or the encoded slave controller in the current branch performs hard-wire identification of the slave controller to which it is connected through hard wires.
在一些实施方式中,主控制器对自身通过硬线所连接的从控制器进行硬线识别,包括:主控制器通过总线发送编码开始指令,该多控制器系统中的所有第一从控制器进入编码模式;主控制器通过硬线编码线向所连接的第一从控制器发送编码信号,以使所连接的第一从控制器在接收到编码信号后被硬线识别。In some embodiments, the master controller performs hard-wire identification on the slave controllers connected to itself through hard wires, including: the master controller sends a coding start instruction through the bus, and all first slave controllers in the multi-controller system Enter the encoding mode; the master controller sends an encoding signal to the connected first slave controller through a hard-wired encoding line, so that the connected first slave controller is hard-wired after receiving the encoding signal.
具体地,该多控制器系统中的每条支路包括依次连接的至少一个从控制器对,从控制器对包括通过一条硬线连接的第一从控制器和第二从控制器。主控制器通过总线发送编码开始指令,该多控制器系统中的所有第一从控制器接收到编码开始指令后进入编码模式。Specifically, each branch in the multi-controller system includes at least one slave controller pair connected in sequence, and the slave controller pair includes a first slave controller and a second slave controller connected through a hard line. The master controller sends an encoding start instruction through the bus, and all first slave controllers in the multi-controller system enter the encoding mode after receiving the encoding start instruction.
硬线识别是指当前控制器连接的编码线或唤醒线在有信号输入后即能识别到该控制器需要进行编码,其他控制器没有信号输入的则不需要进行编码。主控制器对第一从控制器进行硬线识别,从而便于主控制器对硬线识别后的第一从控制器进行编码。Hard wire identification means that the encoding line or wake-up line connected to the current controller can recognize that the controller needs to be encoded after there is a signal input. Other controllers that have no signal input do not need to be encoded. The main controller performs hard-wire identification on the first slave controller, thereby facilitating the main controller to encode the first slave controller after hard-wire identification.
在一些示例中,编码线连接的是控制器的编码管脚,唤醒线连接的是控制器的唤醒管脚,编码管脚和唤醒管脚是不同的管脚。在多控制器系统的编码状态下,同一从控制器对中的第一从控制器通过唤醒线发送唤醒信号给第二从控制器,第二从控制器被唤醒,主控制器可以对被唤醒的第二从控制器进行编码。在多控制器系统处于非编码状态时,第一主控制器通过唤醒线发送唤醒信号唤醒第二从控制器,后续不进行编码操作。In some examples, the encoding line is connected to the encoding pin of the controller, the wake-up line is connected to the wake-up pin of the controller, and the encoding pin and the wake-up pin are different pins. In the encoding state of a multi-controller system, the first slave controller in the same slave controller pair sends a wake-up signal to the second slave controller through the wake-up line. The second slave controller is awakened, and the master controller can be awakened. The second slave controller performs encoding. When the multi-controller system is in a non-coding state, the first master controller sends a wake-up signal through the wake-up line to wake up the second slave controller, and no subsequent coding operation is performed.
S20、主控制器通过总线对被硬线识别的未编码的从控制器进行编码。S20. The master controller encodes the uncoded slave controller recognized by the hard wire through the bus.
在一些实施方式中,主控制器通过总线对被硬线识别的未编码的从控制器进行编码,可以包括:主控制器生成编码地址,通过总线向被硬线识别的从控制器发送编码地址;被硬线识别的从控制器将编码地址写入自身存储空间内。主控制器通过总线对硬线识别的从控制器进行编码,从而确保从控制器与编码地址的一一对应关系。In some embodiments, the master controller encodes the unencoded slave controller recognized by the hardwire through the bus, which may include: the master controller generates an encoding address, and sends the encoded address to the slave controller identified by the hardwire through the bus. ;The slave controller recognized by the hardwire writes the encoded address into its own storage space. The master controller encodes the hard-wired identified slave controller through the bus, thereby ensuring a one-to-one correspondence between the slave controller and the encoded address.
例如,主控制器给从控制器A1生成编码地址001,通过总线向被硬线识别的从控制器A1发送编码地址001,被硬线识别的从控制器A1将编码地址001写入自身存储空间内。从控制器的编码地址是唯一的,通过编码地址能够实现对从控制器的准确识别。For example, the master controller generates the encoding address 001 for the slave controller A1, sends the encoding address 001 to the slave controller A1 recognized by the hard wire through the bus, and the slave controller A1 recognized by the hard wire writes the encoding address 001 into its own storage space. Inside. The encoded address of the slave controller is unique, and the slave controller can be accurately identified through the encoded address.
在一些实施方式中,如图4所示,该编码方法还可以包括:In some implementations, as shown in Figure 4, the encoding method may also include:
S30、编码后的从控制器对硬线连接的从控制器完成硬线识别后进入静默状态。S30. The encoded slave controller completes hardwire recognition of the hardwired slave controller and enters a silent state.
具体地,编码后的从控制器对自身通过硬线所连接的下一从控制器完成硬线识别后进入静默状态。同一从控制器对中的第一从控制器和第二从控制器,第一从控制器与第二从控制器通过唤醒线连接,编码后的第一从控制器通过唤醒线向所连接的第二从控制器发送唤醒信号,唤醒第二从控制器,即完成第二从控制器的硬线识别,然后第一从控制器即进入静默状态。编码后的第二从控制器通过编码线向自身所连接的下一个从控制器对中的第一从控制器发送高电平信号,该第一从控制器接收到该高电平信号之后被硬线识别,然后该第二从控制器进入静默状态。编码后的从控制器进入静默状态之后,不再参与整个多控制器系统在当前编码周期内的编码过程。Specifically, the encoded slave controller completes hardwire identification of the next slave controller connected to itself through a hardwire and then enters a silent state. The first slave controller and the second slave controller in the same slave controller pair, the first slave controller and the second slave controller are connected through a wake-up line, and the encoded first slave controller sends a signal to the connected slave controller through the wake-up line. The second slave controller sends a wake-up signal to wake up the second slave controller, that is, the hard-wire identification of the second slave controller is completed, and then the first slave controller enters a silent state. The encoded second slave controller sends a high-level signal to the first slave controller in the next slave controller pair to which it is connected through the encoding line. The first slave controller receives the high-level signal and is Hardwire recognition occurs and then the second slave controller enters a silent state. After the encoded slave controller enters the silent state, it no longer participates in the encoding process of the entire multi-controller system in the current encoding cycle.
S40、返回步骤S20循环执行,直至主控制器确定第一支路中需要编码的从控制器均编码完成为止,从而实现了对当前支路的自动编码,有效避免编码出错,提高了多控制器系统的可靠性,降低了人工工作量。S40. Return to step S20 for loop execution until the master controller determines that the slave controllers that need to be encoded in the first branch have completed encoding, thereby realizing automatic encoding of the current branch, effectively avoiding encoding errors, and improving multi-controller efficiency. The reliability of the system reduces manual workload.
在主控制器对自身所连接的从控制器完成硬线识别和编码的操作之后,当前支路中编码后的从控制器对自身通过硬线所连接的从控制器进行硬线识别,即后续的硬线识别操作均为从控制器对自身所连接的下一从控制器所执行,因此循环执行步骤S20和S30,直至当前支路中需要编码的从控制器均完成编码,即完成对当前支路的编码。After the master controller completes the hard-wire identification and encoding operations for the slave controllers connected to itself, the encoded slave controller in the current branch performs hard-wire identification and coding for the slave controllers connected to itself through hard wires, that is, subsequent The hard-wire identification operations are all performed by the slave controller on the next slave controller connected to itself, so steps S20 and S30 are executed in a loop until all slave controllers that need to be encoded in the current branch complete the encoding, that is, the current branch is completed. The encoding of the branch.
如图2所示的多控制器系统,当多控制器系统中存在多条支路时,依次针对每条支路采用上述对一条支路进行编码的步骤完成该支路中需要编码的从控制器的编码。例如,首先通过上述的支路编码步骤对A1所在的支路进行编码,该支路编码完成后再对A2所在的支路进行编码,以此类推,直至对所有支路均完成编码。As shown in Figure 2, in the multi-controller system, when there are multiple branches in the multi-controller system, the above steps of encoding a branch are used for each branch in turn to complete the slave control that needs to be encoded in the branch. The encoding of the device. For example, first encode the branch where A1 is located through the above-mentioned branch encoding steps. After the branch encoding is completed, the branch where A2 is located is encoded, and so on, until all branches are encoded.
在一些实施方式中,主控制器确定第一支路中需要编码的从控制器均编码完成,包括:确定所生成的编码地址的数量是否等于第一支路中需要编码的从控制器的预设数量;若等于,则确定第一支路中需要编码的从控制器均编码完成;否则,确定未完成,从而能够实现对当前支路是否完成编码的准确判断,避免遗漏对某些从控 制器的编码操作。In some embodiments, the master controller determines that the slave controllers in the first branch that need to be encoded have completed encoding, including: determining whether the number of generated encoding addresses is equal to the predetermined number of slave controllers that need to be encoded in the first branch. Set the number; if equal, it is determined that the slave controllers in the first branch that need to be encoded have all been encoded; otherwise, it is determined that they have not been completed, so that an accurate judgment on whether the current branch has been encoded can be achieved to avoid missing some slave controllers. encoder operation.
示例性地,主控制器对自身所生成的编码地址进行累计计数。若当前支路中需要进行编码的从控制器的预设数量为m,主控制器确定所生成的编码地址的数量达到m时,即确定当前支路中需要编码的从控制器均完成编码,若所生成的编码地址的数量小于m,则确定当前支路尚未完成编码。Illustratively, the main controller accumulates a count of the encoded addresses it generates. If the preset number of slave controllers that need to be encoded in the current branch is m, and when the master controller determines that the number of generated encoding addresses reaches m, it is determined that all the slave controllers that need to be encoded in the current branch have completed encoding. If the number of generated encoding addresses is less than m, it is determined that the current branch has not completed encoding.
在一些实施方式中,主控制器通过总线对被硬线识别的未编码的从控制器进行编码,还可以包括:被硬线识别的从控制器将写入自身的编码地址发送给主控制器;主控制器确定接收到的编码地址与自身所生成的编码地址是否一致;若接收到的编码地址与自身生成的编码地址一致,则确定编码成功。主控制器确定编码是否成功,从而能够确保较高的编码准确率。In some embodiments, the master controller encodes the uncoded slave controller recognized by the hardwire through the bus, which may also include: the slave controller recognized by the hardwire sends its own encoding address to the master controller. ;The main controller determines whether the received encoding address is consistent with the encoding address generated by itself; if the received encoding address is consistent with the encoding address generated by itself, it is determined that the encoding is successful. The main controller determines whether encoding is successful, thereby ensuring high encoding accuracy.
例如,被硬线识别的从控制器A 1将写入自身存储空间内的编码地址001发送给主控制器,主控制器将接收到的该编码地址与给从控制器A 1所生成编码地址进行比对,当二者一致时确定编码成功,否则说明A 1编码不成功。 For example, the slave controller A 1 that is hardwired will send the encoding address 001 written in its own storage space to the master controller. The master controller will compare the received encoding address with the encoding address generated for the slave controller A 1 Compare, and when the two are consistent, it is determined that the encoding is successful, otherwise it means that the encoding of A1 is unsuccessful.
在一些实施方式中,该编码方法还可以包括:In some implementations, the encoding method may also include:
若接收到的编码地址与自身生成的编码地址不一致,则重新执行向被硬线识别的从控制器发送编码地址的步骤;若达到预设时长或达到预设重发次数时主控制器未收到与自身生成的编码地址相一致的编码地址,则结束编码操作。在编码不成功时重新执行发送编码地址的步骤,能够提高编码成功率。If the received coded address is inconsistent with the coded address generated by itself, the step of sending the coded address to the slave controller recognized by the hard wire is re-executed; if the master controller does not receive the code when the preset time is reached or the preset number of retransmissions is reached. When the encoding address consistent with the encoding address generated by itself is reached, the encoding operation ends. Re-executing the step of sending the encoding address when encoding is unsuccessful can improve the encoding success rate.
当主控制器接收到的编码地址与自身生成的编码地址不一致时,说明编码不成功,例如,若主控制器接收到的A 1所发送的编码地址为002,而主控制器为A1所生成的编码地址为001,二者不一致,说明编码不成功。在确定编码不成功后,主控制器重新向被硬线识别的从控制器发送编码地址。 When the encoding address received by the main controller is inconsistent with the encoding address generated by itself, it means that the encoding is unsuccessful. For example, if the encoding address sent by A1 received by the main controller is 002, and the encoding address generated by the main controller is A1 The encoding address is 001, and the two are inconsistent, indicating that the encoding was unsuccessful. After determining that the encoding was unsuccessful, the master controller resends the encoding address to the slave controller identified by the hardwire.
在预设时长例如2s、3s或4s内仍未确定编码成功,或者重发次数达到了预设重发次数例如5次、6次或8次等,则说明多控制器系统内部可能出现了故障,此时需要结束编码操作,避免重复执行重发送编码地址操作造成资源浪费。预设时长和预设重发次数可以根据实际应用需要进行设定。If the encoding success is still not determined within the preset time period, such as 2s, 3s or 4s, or the number of retransmissions reaches the preset number of retransmissions, such as 5, 6 or 8 times, etc., it indicates that there may be a fault within the multi-controller system. , it is necessary to end the encoding operation at this time to avoid wasting resources caused by repeatedly performing the operation of resending the encoding address. The preset duration and the preset number of retransmissions can be set according to actual application needs.
在一些实施方式中,同一从控制器对中的第一从控制器和第二从控制器通过唤醒线连接;编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别,包括:若编码后的从控制器为第一从控制器,则编码后的第一从控制器在编码完成达到预设延时时长时通过唤醒线唤醒自身所连接的第二从控制器,被唤醒的第二从控制器成为被硬线识别的从控制器;若编码后的从控制器为第二从控制器,则编码后的第二从控制器在预设时长后通过硬线编码线向自身所连接的下一个第一从控制器发送编码信号,使下一个第一从控制器成为被硬线识别的从控制器。通过硬线识别从控制器,有利于主控制器对硬线识别的从控制器进行编码操作,提高了编码准确率。In some embodiments, the first slave controller and the second slave controller in the same slave controller pair are connected through a wake-up line; the encoded slave controller performs a hard call on the next slave controller to which it is connected through a hard wire. Line identification, including: if the encoded slave controller is the first slave controller, the encoded first slave controller wakes up the second slave controller connected to itself through the wake-up line when the encoding is completed and reaches the preset delay time. The awakened second slave controller becomes the slave controller recognized by the hardwire; if the encoded slave controller is the second slave controller, the encoded second slave controller passes through the hardware after a preset period of time. The line coding line sends a coding signal to the next first slave controller connected to itself, so that the next first slave controller becomes a slave controller recognized by the hard line. Identifying the slave controller through hard wires facilitates the master controller to perform encoding operations on the slave controllers identified through hard wires, thereby improving the coding accuracy.
示例性地,在一个从控制器对中包括通过唤醒线连接的从控制器A m和从控 制器B m,编码后的Am在编码完成达到预设延时时长(预设延时时长例如可以为1s、1.5s或2s,具体可以根据实际需要进行设定)时通过唤醒线唤醒自身所连接的B m,被唤醒的B m成为被硬线识别的从控制器;编码后的从控制器B m通过硬线编码线向自身所连接的下一个第一从控制器A (m+1)发送编码信号,使A (m+1)成为被硬线识别的从控制器。设定预设延时时长能够预留出足够时长以确保主控制器更新编码地址,从而避免对被唤醒的第二从控制器的误编码。 For example, a slave controller pair includes a slave controller A m and a slave controller B m connected through a wake-up line. The encoded Am reaches a preset delay time after the encoding is completed (the preset delay time may be, for example, (1s, 1.5s or 2s, which can be set according to actual needs), wake up the B m connected to itself through the wake-up line, and the awakened B m becomes the slave controller recognized by the hard wire; the encoded slave controller B m sends a coding signal to the next first slave controller A (m+1) connected to itself through a hard-wired coding line, so that A (m+1) becomes a slave controller recognized by the hard wire. Setting the preset delay length can reserve enough time to ensure that the master controller updates the coding address, thereby avoiding miscoding of the awakened second slave controller.
在一些实施方式中,编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别之前,该编码方法还包括:In some embodiments, before the encoded slave controller performs hardwire identification on the next slave controller to which it is connected through a hardwire, the encoding method further includes:
主控制器发送编码成功确认指令;编码后的从控制器接收到编码成功确认指令后,向主控制器发送编码成功反馈信号;主控制器接收到反馈信号,更新当前的编码地址。主控制器接收到反馈信号后更新当前的编码地址,进一步提高了编码准确率,有效避免误编码。The main controller sends a coding success confirmation command; after encoding, the slave controller receives the coding success confirmation command and sends a coding success feedback signal to the main controller; the main controller receives the feedback signal and updates the current coding address. After receiving the feedback signal, the main controller updates the current encoding address, further improving the encoding accuracy and effectively avoiding miscoding.
更新当前的编码地址的方式通常为将当前的编码地址加1。例如,当前的编码地址为001,则主控制器接收到编码成功反馈信号之后将当前的编码地址001加1得到002,利用新的编码地址002更新001。The way to update the current encoding address is usually to add 1 to the current encoding address. For example, if the current encoding address is 001, then the main controller will add 1 to the current encoding address 001 to get 002 after receiving the encoding success feedback signal, and update 001 with the new encoding address 002.
相关技术的从控制器编码是通过手动设置实现的,容易出现编码错误,人工劳动量大,本申请实施例的编码方法能够实现自动编码,提高了编码准确度和可靠性,降低了人工劳动量。The coding of slave controllers in related technologies is achieved through manual settings, which is prone to coding errors and requires a large amount of manual labor. The coding method of the embodiment of the present application can realize automatic coding, improve coding accuracy and reliability, and reduce the amount of manual labor. .
一个具体示例的多控制器系统的编码方法,包括以下步骤:A specific example of coding method for a multi-controller system includes the following steps:
步骤1、主控制器通过CAN总线发送编码开始指令,所有从控制器A进入编码模式;Step 1. The main controller sends the encoding start command through the CAN bus, and all slave controllers A enter the encoding mode;
步骤2、主控制器拉高编码线并发送编码地址,未被拉高的从控制器A保持静默状态;Step 2. The master controller pulls the encoding line high and sends the encoding address. The slave controller A that is not pulled high remains silent;
步骤3、被拉高的从控制器写入接收到的编码地址,主控制器在确认已写入的编码地址与期望地址一致后,发送编码成功信号;Step 3. The pulled-up slave controller writes the received encoding address. After confirming that the written encoding address is consistent with the expected address, the master controller sends a encoding success signal;
步骤4、从控制器A收到编码成功信号后反馈编码完成,延时1秒唤醒从控制器B(延时唤醒是为了确保主控制器的编码地址已经+1,从而避免从控制器B被误编码),随后从控制器A结束编码操作并进入静默状态;Step 4. After receiving the encoding success signal, slave controller A feedbacks that the encoding is completed, and delays wake-up of slave controller B for 1 second (the delayed wake-up is to ensure that the encoding address of the master controller has been +1, thereby preventing slave controller B from being Error coding), then controller A ends the coding operation and enters a silent state;
步骤5、如果主控制器确认编码地址与期望地址不一致,则重新发送编码指令和编码地址,进行超时判断,如果超过设置时间还未收到正确编码地址,则确定编码失败,退出编码流程;Step 5. If the main controller confirms that the encoding address is inconsistent with the expected address, it will resend the encoding instruction and encoding address and make a timeout judgment. If the correct encoding address is not received after the set time, it will determine that the encoding failed and exit the encoding process;
步骤6、主控制器收到来自从控制器A的编码完成指令后,自动编码地址+1并发给从控制器;Step 6. After the master controller receives the encoding completion instruction from slave controller A, it automatically encodes the address +1 and sends it to the slave controller;
步骤7、从控制器B被唤醒后将编码地址写入,主控制器确认编码地址与 期望地址一致,则确定编码发送成功;Step 7. After the slave controller B wakes up, it writes the encoding address. The master controller confirms that the encoding address is consistent with the expected address, then it is determined that the encoding is sent successfully;
步骤8、从控制器B收到编码成功后反馈编码完成并拉高下一个从控制器A的编码线;Step 8. After successfully receiving the encoding from controller B, it will feedback that the encoding is completed and pull up the encoding line of the next slave controller A;
重复流程步骤3到步骤步骤8,直至主控制器判断所生成的编码地址的数量等于所需要编码的从控制器数量为止,则结束编码操作,退出编码流程。Repeat process steps 3 to 8 until the master controller determines that the number of generated encoding addresses is equal to the number of slave controllers that need to be encoded, then the encoding operation ends and the encoding process exits.
在本示例的编码方法中,主控制器将第一个从控制器A 1的编码线拉高(拉高编码线即通过编码线向A 1输入高电平信号),通过CAN总线发送ID(ID即编码地址)给A 1编码,A 1编码完成后唤醒从控制器B 1,主控制器通过CAN发送ID给B 1编码,B 1编码完成后将从控制器的A 2编码线拉高,主控制器通过CAN发送ID给A 2编码,以此类推。 In the encoding method of this example, the master controller pulls the encoding line of the first slave controller A 1 high (pulling the encoding line high means inputting a high level signal to A 1 through the encoding line), and sends the ID through the CAN bus ( ID (encoding address) encodes A 1. After A 1 is encoded, it wakes up the slave controller B 1. The master controller sends the ID to B 1 to encode through CAN. After B 1 is encoded, it pulls the A 2 encoding line of the controller high. , the main controller sends the ID to A 2 code through CAN, and so on.
参考图5所示,在一个具体示例的编码方法中,主控制器开启编码流程,发送编码指令,从控制器A接收到编码指令后进入编码模式;主控制器拉高从控制器A的编码线,然后发送编码地址;被拉高的从控制器A收到编码地址,将编码地址写入自身存储空间,然后将写入的编码地址发送给主控制器;主控制器将编码地址与期望地址(期望地址即主控制器生成的编码地址)进行比较,确定二者是否一致;若二者不一致则重新发送编码地址,若二者一致则向从控制器A发送确认编码成功指令;从控制器A接收到确认编码成功指令后确认编码是否成功;若编码不成功,则从控制器A接收主控制器重新发送的编码地址并重新写入自身存储空间;若编码成功则从控制器A向主控制器反馈编码完成的指令,延时1秒后唤醒从控制器B,然后退出编码并进入静默状态;主控制器收到编码完成的指令后更新当前的编码地址,并发送给被唤醒的从控制器B,从而开始对从控制器B进行编码;对从控制器B进行编码的过程可以参考对从控制器A进行编码的过程,此处不再赘述;当从控制器B被编码完成之后,拉高下一个从控制器A,然后退出编码并进入静默状态;当主控制器检测到所生成的编码地址数量等于所需要编码的从控制器数量时结束编码。Referring to Figure 5, in a specific example of the encoding method, the main controller starts the encoding process and sends encoding instructions. After receiving the encoding instructions, slave controller A enters the encoding mode; the master controller pulls up the encoding of slave controller A. line, and then sends the encoding address; the pulled-up slave controller A receives the encoding address, writes the encoding address into its own storage space, and then sends the written encoding address to the master controller; the master controller compares the encoding address with the expected address (the expected address is the encoding address generated by the master controller) to determine whether they are consistent; if they are inconsistent, resend the encoding address; if they are consistent, send a confirmation encoding success instruction to slave controller A; slave control After receiving the confirmation encoding success command, controller A confirms whether the encoding is successful; if the encoding is unsuccessful, slave controller A receives the encoding address resent from the main controller and rewrites it into its own storage space; if the encoding is successful, slave controller A The master controller feeds back the instruction to complete the encoding, wakes up the slave controller B after a delay of 1 second, then exits encoding and enters a silent state; after receiving the instruction to complete the encoding, the master controller updates the current encoding address and sends it to the awakened From controller B, start encoding slave controller B; the process of encoding slave controller B can refer to the process of encoding slave controller A, which will not be described again here; when slave controller B is encoded, After that, pull up the next slave controller A, then exit encoding and enter a silent state; end encoding when the master controller detects that the number of generated encoding addresses is equal to the number of slave controllers that need to be encoded.
多个从控制器A或多个从控制器B之间硬件相同,容易混淆,在对从控制器完成硬线识别后,通过CAN对硬线识别的从控制器进行编码,并写入ID(ID即编码地址),确保了ID与控制器之间一一对应的关系。Multiple slave controllers A or multiple slave controllers B have the same hardware and are easily confused. After completing the hard-wired identification of the slave controller, encode the hard-wired identified slave controller through CAN and write the ID ( ID is the coded address), ensuring a one-to-one correspondence between the ID and the controller.
该编码方法能够实现自动编码,有效避免编码出错,提高了编码准确率,提高了多控制器系统的可靠性,降低了人工工作量,克服了相关技术中采用手动设置编码方式导致的编码出错率高、人工工作量大的缺陷。This coding method can realize automatic coding, effectively avoid coding errors, improve coding accuracy, improve the reliability of multi-controller systems, reduce manual workload, and overcome the coding error rate caused by manual setting of coding methods in related technologies. High and manual workload.
本申请的另一个实施例提供了一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序,以实现上述任一实施方式的多控制器系统的编码方法。Another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor executes the program to implement The encoding method of the multi-controller system in any of the above embodiments.
如图6所示,电子设备10可以包括:处理器100,存储器101,总线102和通信接口103,处理器100、通信接口103和存储器101通过总线102连接;存储器 101中存储有可在处理器100上运行的计算机程序,处理器100运行该计算机程序时执行本申请前述任一实施方式所提供的方法。As shown in Figure 6, the electronic device 10 may include: a processor 100, a memory 101, a bus 102 and a communication interface 103. The processor 100, the communication interface 103 and the memory 101 are connected through the bus 102; the memory 101 stores information that can be stored in the processor. A computer program running on the computer 100. When the processor 100 runs the computer program, the method provided by any of the foregoing embodiments of the application is executed.
其中,存储器101可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还可以包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口103(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网、广域网、本地网、城域网等。Among them, the memory 101 may include high-speed random access memory (RAM: Random Access Memory), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
总线102可以是ISA总线、PCI总线或EISA总线等。总线可以分为地址总线、数据总线、控制总线等。其中,存储器101用于存储程序,处理器100在接收到执行指令后,执行该程序,前述本申请实施例任一实施方式揭示的方法可以应用于处理器100中,或者由处理器100实现。The bus 102 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. The memory 101 is used to store a program, and the processor 100 executes the program after receiving the execution instruction. The method disclosed in any of the embodiments of the present application can be applied to the processor 100 or implemented by the processor 100 .
处理器100可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器100中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器100可以是通用处理器,可以包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器101,处理器100读取存储器101中的信息,结合其硬件完成上述方法的步骤。The processor 100 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 100 . The above-mentioned processor 100 can be a general-purpose processor, which can include a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it can also be a digital signal processor (DSP), a dedicated integrated processor Circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory 101. The processor 100 reads the information in the memory 101 and completes the steps of the above method in combination with its hardware.
本申请实施例提供的电子设备与本申请实施例提供的方法出于相同的发明构思,具有与其采用、运行或实现的方法相同的有益效果。The electronic device provided by the embodiments of the present application and the method provided by the embodiments of the present application are based on the same inventive concept, and have the same beneficial effects as the methods adopted, run or implemented.
本申请的另一个实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行,以实现上述任一实施方式的多控制器系统的编码方法。Another embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the encoding method of the multi-controller system in any of the above embodiments.
参考图7所示,其示出的计算机可读存储介质为光盘20,其上存储有计算机程序(即程序产品),该计算机程序在被处理器运行时,会执行前述任意实施方式所提供的方法。Referring to Figure 7, the computer-readable storage medium shown is an optical disk 20, on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, it will execute any of the foregoing embodiments. method.
需要说明的是,计算机可读存储介质的例子还可以包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他光学、磁性存储介质,在此不再一一赘述。It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory. Memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media will not be described in detail here.
本申请的上述实施例提供的计算机可读存储介质与本申请实施例提供的方法出于相同的发明构思,具有与其存储的应用程序所采用、运行或实现的方法相同的 有益效果。The computer-readable storage medium provided by the above-mentioned embodiments of the present application is based on the same inventive concept as the method provided by the embodiments of the present application, and has the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。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 only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者技术方案的部分可以以软件产品的形式体现出来,计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions 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 technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions. It is used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims (13)

  1. 一种多控制器系统,其特征在于,包括主控制器以及与所述主控制器连接的至少一条支路;所述至少一条支路包括依次连接的至少一个从控制器对;A multi-controller system, characterized in that it includes a main controller and at least one branch connected to the main controller; the at least one branch includes at least one pair of slave controllers connected in sequence;
    所述从控制器对包括通过一条硬线连接的第一从控制器和第二从控制器;The pair of slave controllers includes a first slave controller and a second slave controller connected by a hard line;
    所述主控制器通过总线分别与各所述从控制器通讯连接。The main controller communicates with each of the slave controllers through a bus.
  2. 根据权利要求1所述的多控制器系统,其特征在于,同一所述从控制器对中连接第一从控制器和第二从控制器的硬线为用于传输唤醒信号的唤醒线;The multi-controller system according to claim 1, wherein the hard wire connecting the first slave controller and the second slave controller in the same pair of slave controllers is a wake-up line used to transmit a wake-up signal;
    所述主控制器与第一个所述从控制器对的第一从控制器通过硬线编码线相连接;The master controller is connected to the first slave controller of the first pair of slave controllers through a hard-wired coding line;
    所述至少一条支路中的各从控制器对之间通过硬线编码线相连接;Each slave controller pair in the at least one branch is connected through a hard-wired coding line;
    所述硬线编码线用于传输编码信号。The hardwired code lines are used to transmit coded signals.
  3. 一种多控制器系统的编码方法,其特征在于,应用于权利要求1或2所述的多控制器系统;所述方法包括:A coding method for a multi-controller system, characterized in that it is applied to the multi-controller system according to claim 1 or 2; the method includes:
    所述至少一条支路包括第一支路,所述主控制器或所述第一支路中编码后的从控制器对硬线连接的未编码的从控制器进行硬线识别;The at least one branch includes a first branch, and the master controller or the encoded slave controller in the first branch performs hard-wire identification on the uncoded slave controller that is hard-wired;
    所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码。The master controller encodes the unencoded slave controllers recognized by the hardwire over the bus.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, further comprising:
    所述编码后的从控制器对硬线连接的从控制器完成硬线识别后进入静默状态;The encoded slave controller completes hardwire recognition of the hardwired slave controller and enters a silent state;
    返回所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码的步骤循环执行,直至所述主控制器确定所述第一支路中需要编码的从控制器均编码完成为止。The step of returning to the main controller to encode the uncoded slave controllers identified by hard wires through the bus is performed cyclically until the main controller determines that all the slave controllers in the first branch that need to be encoded are until coding is completed.
  5. 根据权利要求4所述的方法,其特征在于,所述主控制器确定所述第一支路中需要编码的从控制器均编码完成,包括:The method according to claim 4, characterized in that the master controller determines that all slave controllers that need to be encoded in the first branch have completed encoding, including:
    确定所生成的编码地址的数量是否等于所述第一支路中需要编码的从控制器的预设数量;Determine whether the number of generated encoding addresses is equal to the preset number of slave controllers that need to be encoded in the first branch;
    若等于,则确定所述第一支路中需要编码的从控制器均编码完成;否则,确定未完成。If equal, it is determined that all the slave controllers that need to be coded in the first branch have been coded; otherwise, it is determined that the code has not been completed.
  6. 根据权利要求3所述的方法,其特征在于,所述主控制器对硬线连接的未编码的从控制器进行硬线识别,包括:The method according to claim 3, characterized in that the master controller performs hard-wire identification on the hard-wired unencoded slave controller, including:
    所述主控制器通过总线发送编码开始指令,所有所述第一从控制器进入编码模式;The main controller sends a coding start instruction through the bus, and all the first slave controllers enter coding mode;
    所述主控制器通过硬线编码线向所连接的第一从控制器发送编码信号,以使所连接的第一从控制器在接收到所述编码信号后被硬线识别。The master controller sends a coding signal to the connected first slave controller through a hard-wired coding line, so that the connected first slave controller is hard-wired after receiving the coding signal.
  7. 根据权利要求3所述的方法,其特征在于,所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码,包括:The method of claim 3, wherein the master controller encodes the unencoded slave controller identified by hard wire through the bus, including:
    所述主控制器生成编码地址,通过所述总线向所述被硬线识别的从控制器发送所述编码地址;The master controller generates a coded address and sends the coded address through the bus to the hardwired identified slave controller;
    所述被硬线识别的从控制器将所述编码地址写入自身存储空间内。The hard-wired identified slave controller writes the encoded address into its own storage space.
  8. 根据权利要求8所述的方法,其特征在于,所述主控制器通过所述总线对被硬线识别的未编码的从控制器进行编码,还包括:The method of claim 8, wherein the master controller encodes the unencoded slave controller identified by hard wire through the bus, further comprising:
    所述被硬线识别的从控制器将写入自身的编码地址发送给所述主控制器;The slave controller recognized by the hard wire sends its own coded address to the master controller;
    所述主控制器确定接收到的编码地址与自身所生成的编码地址是否一致;The main controller determines whether the received coded address is consistent with the coded address generated by itself;
    若所述接收到的编码地址与所述自身生成的编码地址一致,则确定编码成功。If the received encoding address is consistent with the self-generated encoding address, it is determined that the encoding is successful.
  9. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9, further comprising:
    若所述接收到的编码地址与所述自身生成的编码地址不一致,则重新执行所述向所述被硬线识别的从控制器发送所述编码地址的步骤;If the received coded address is inconsistent with the self-generated coded address, re-execute the step of sending the coded address to the slave controller identified by the hardwire;
    若达到预设时长或达到预设重发次数时所述主控制器未收到与所述自身生成的编码地址相一致的编码地址,则结束编码操作。If the main controller does not receive an encoding address that is consistent with the encoding address generated by itself when the preset time period or the preset number of retransmissions is reached, the encoding operation ends.
  10. 根据权利要求4所述的方法,其特征在于,同一所述从控制器对中连接第一从控制器和第二从控制器的硬线为用于传输唤醒信号的唤醒线;The method according to claim 4, characterized in that the hard wire connecting the first slave controller and the second slave controller in the same pair of slave controllers is a wake-up line used to transmit a wake-up signal;
    所述编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别,包括:The encoded slave controller performs hardwire identification on the next slave controller connected to itself through a hardwire, including:
    若所述编码后的从控制器为第一从控制器,则编码后的第一从控制器在编码完成达到预设延时时长时通过唤醒线唤醒自身所连接的第二从控制器,被唤醒的第二从控制器成为被硬线识别的从控制器;If the encoded slave controller is the first slave controller, the encoded first slave controller wakes up the second slave controller connected to itself through the wake-up line when the encoding is completed and reaches the preset delay time. The awakened second slave controller becomes the hardwired recognized slave controller;
    若所述编码后的从控制器为第二从控制器,则编码后的第二从控制器在预设时长后通过硬线编码线向自身所连接的下一个第一从控制器发送编码信号,使所述下一个第一从控制器成为被硬线识别的从控制器。If the coded slave controller is a second slave controller, the coded second slave controller will send a coded signal to the next first slave controller connected to itself through a hard-wired coding line after a preset period of time. , making the next first slave controller become the slave controller recognized by hardwire.
  11. 根据权利要求4所述的方法,其特征在于,所述编码后的从控制器对自身通过硬线所连接的下一从控制器进行硬线识别之前,所述方法还包括:The method according to claim 4, characterized in that, before the encoded slave controller performs hard-wire identification on the next slave controller to which it is connected through a hard-wire, the method further includes:
    所述主控制器发送编码成功确认指令;The main controller sends a coding success confirmation instruction;
    所述编码后的从控制器接收到所述编码成功确认指令后,向所述主控制器发送编码成功反馈信号;After the encoded slave controller receives the encoding success confirmation instruction, it sends an encoding success feedback signal to the master controller;
    所述主控制器接收到所述反馈信号,更新当前的编码地址。The main controller receives the feedback signal and updates the current encoding address.
  12. 一种电子设备,其特征在于,包括存储器、处理器及存储在所述存储器上并可 在所述处理器上运行的计算机程序,所述处理器执行所述程序,以实现如权利要求3-12中任一所述的方法。An electronic device, characterized in that it includes a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the program to implement claims 3- The method described in any one of 12.
  13. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行,以实现如权利要求3-12中任一所述的方法。A computer-readable storage medium with a computer program stored thereon, characterized in that the program is executed by a processor to implement the method as claimed in any one of claims 3-12.
PCT/CN2022/117776 2022-09-08 2022-09-08 Multi-controller system, coding method, electronic device, and storage medium WO2024050752A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/117776 WO2024050752A1 (en) 2022-09-08 2022-09-08 Multi-controller system, coding method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/117776 WO2024050752A1 (en) 2022-09-08 2022-09-08 Multi-controller system, coding method, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2024050752A1 true WO2024050752A1 (en) 2024-03-14

Family

ID=90192654

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/117776 WO2024050752A1 (en) 2022-09-08 2022-09-08 Multi-controller system, coding method, electronic device, and storage medium

Country Status (1)

Country Link
WO (1) WO2024050752A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110138044A1 (en) * 2009-12-03 2011-06-09 International Business Machines Corporation Wake on local area network signalling in a multi-root i/o virtualization
CN112486740A (en) * 2020-11-27 2021-03-12 苏州浪潮智能科技有限公司 Master-slave relationship confirmation method and system among multiple controllers and related device
CN114115177A (en) * 2021-11-09 2022-03-01 联合汽车电子有限公司 Multi-controller system and encoding method thereof
CN114844742A (en) * 2022-07-04 2022-08-02 广东采日能源科技有限公司 Battery management system and control method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110138044A1 (en) * 2009-12-03 2011-06-09 International Business Machines Corporation Wake on local area network signalling in a multi-root i/o virtualization
CN112486740A (en) * 2020-11-27 2021-03-12 苏州浪潮智能科技有限公司 Master-slave relationship confirmation method and system among multiple controllers and related device
CN114115177A (en) * 2021-11-09 2022-03-01 联合汽车电子有限公司 Multi-controller system and encoding method thereof
CN114844742A (en) * 2022-07-04 2022-08-02 广东采日能源科技有限公司 Battery management system and control method thereof

Similar Documents

Publication Publication Date Title
WO2019136595A1 (en) Method for handling i2c bus deadlock, electronic device, and communication system
CN103268243B (en) A kind of performance element on the spot remote online upgrade-system of chain type current transformer
CN111104272B (en) CAN bus controller testing method based on RX and TX
CN113037889A (en) Slave machine address allocation method for energy storage battery management system
WO2024050752A1 (en) Multi-controller system, coding method, electronic device, and storage medium
CN109511275A (en) A kind of numerical control system and its data transmission method based on field programmable gate array
CN103793344B (en) The method and system of processing data collision
CN111509308A (en) Control method, device and system for coding of daughter board of battery management system
CN112579506A (en) BIOS and BMC communication method, BIOS, BMC and server
WO2017190482A1 (en) Data storage method for electronic control system of vehicle, and electronic control system
CN101848062A (en) Analogue quantity output module based on MVB (Multifunction Vehicle Bus) interface and MVB device
CN111556114A (en) Information interaction method and device and server
CN112433968B (en) Controller sharing synchronization method and device
CN109347490A (en) One kind decoding core master control set for correcting data error ECC
CN101217444B (en) Network control method based on CAN bus
CN109327832B (en) Single-type multi-terminal low-power-consumption wireless transmission system and transmission method thereof
CN111819039B (en) Robot control method, apparatus and readable storage medium
US11307552B2 (en) Method for modifying a configuration and industrial plant system
CN111578489A (en) EEPROM chip data reading method, control system, air conditioner and storage medium
CN111008092A (en) Welding machine communication management method and welding machine
CN107534496B (en) Intra-body communication device, intra-body communication method, and program
CN110687854A (en) PA bus controller and PA bus control system
CN113650498B (en) Power-on method and device of electric vehicle, electric vehicle and storage medium
WO2024050750A1 (en) Anomaly identification method for battery management systems, apparatus, electronic device, and medium
CN213876702U (en) Real-time updating coding type flash memory

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22957724

Country of ref document: EP

Kind code of ref document: A1