Controller coding method and device, electronic equipment, storage medium and system
By using the automated encoding method in a multi-controller system, the second controller automatically encodes after receiving the encoding instruction enable signal, solving the problem of low encoding efficiency in the prior art and realizing a more efficient and accurate encoding process.
Patent Information
- Application Number
- CN202311633170.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
The existing multi-controller system needs to manually encode multiple second controllers one by one before operation, resulting in inefficient encoding.
In the wake-up cascade network, the second controller automatically encodes after receiving the encoding instruction enable signal of the first controller and returns the encoding result to the first controller, thereby realizing automatic encoding.
It improves coding efficiency, reduces the error rate of manual coding, and can be automated, reducing the need for manual intervention.
Smart Images

Figure CN120073102A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of battery control, and more particularly, to a controller encoding method, apparatus, electronic device, storage medium, and system. Background Art
[0002] In a battery management system, there is a design circuit with multiple controllers cooperating for control, that is, a multi-controller system, which mainly includes a first controller and multiple second controllers, and the first controller is used to control each second controller to perform corresponding operations such as battery detection, battery management, battery information query, etc.
[0003] Currently, before the multi-controller system runs, it is necessary to first encode multiple second controllers so that the first controller can identify each second controller, and then the first controller can control each second controller to perform corresponding operations. The existing encoding method requires manual encoding of each second controller one by one and then writing it into each second controller correspondingly. This encoding method has the problem of low encoding efficiency. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a controller encoding method, apparatus, electronic device, storage medium, and system to improve the encoding efficiency.
[0005] In a first aspect, the embodiments of the present application provide a controller encoding method, including:
[0006] After receiving the wake-up signal from the previous controller in the wake-up cascade network, the second controller maintains the wake-up state, and the wake-up cascade network is a network formed by cascading multiple second controllers behind the first controller through wake-up lines;
[0007] When the second controller receives the encoding instruction enable signal from the first controller and has not completed encoding itself, it encodes based on the encoding instruction enable signal and returns the encoding result to the first controller.
[0008] In the embodiments of the present application, after the second controller is woken up by the previous controller through the wake-up line, it can receive the encoding instruction enable signal sent by the first-level control, and, when it has not completed encoding itself, it encodes based on the encoding instruction enable signal. Compared with the traditional manual encoding method, the controller encoding method provided by the embodiments of the present application can improve the encoding efficiency.
[0009] In any embodiment, the encoding instruction enable signal includes the current maximum encoding identifier; the second controller encodes based on the encoding instruction enable signal and sends the encoding result to the first controller through the communication line, including:
[0010] The second controller determines the target encoding identifier based on the current maximum encoding identifier;
[0011] The second controller sends the encoding result to the first controller based on the target encoding identifier.
[0012] In the embodiments of the present application, the secondary encoder can perform automatic encoding based on the received current maximum encoding, and then send the encoding result to the first controller, which improves the encoding accuracy to a certain extent.
[0013] In any embodiment, after sending the encoding result to the first controller, the method further includes:
[0014] The second controller receives the confirmation encoding instruction sent by the first controller; the confirmation encoding instruction includes the current maximum encoding identifier; wherein, the confirmation encoding instruction is sent by the first controller to the second controller after the encoding result is verified to be passed.
[0015] Store the current maximum encoding identifier.
[0016] In the embodiments of the present application, after the first controller verifies that the encoding result is passed, it sends a confirmation encoding instruction to the second controller, which improves the encoding accuracy.
[0017] In any embodiment, the method further includes:
[0018] When the second controller receives the encoding instruction enable signal sent by the first controller and has completed its own encoding, the second controller does not enter the encoding state and wakes up the next second controller through the wake-up line.
[0019] In the embodiments of the present application, when the second controller receives the encoding instruction enable signal and has completed its own encoding, the second controller no longer enters the encoding state, but wakes up the next second controller, so that the next second controller encodes according to its own situation or continues to wake up the next one, reducing the possibility of repeated encoding of the second controller.
[0020] In any embodiment, the second controller is connected to the first controller through the wake-up line. When the second controller receives the encoding instruction enable signal sent by the first controller and has not completed its own encoding, it encodes based on the encoding instruction enable signal, including:
[0021] When the second controller receives the encoding instruction enable signal sent by the first controller and has not completed its own encoding, it pulls down the wake-up output.
[0022] If the wake-up input of the second controller exists after a preset time period, it encodes based on the encoding instruction enable signal.
[0023] In the embodiment of the present application, when the second controller connected to the first controller via the wake-up line starts encoding after receiving the encoding instruction enable signal, it first puts the subsequent other second controllers into sleep, and then the second controllers are awakened and encoded one by one, so as to enable orderly encoding.
[0024] In any embodiment, the method further includes:
[0025] The second controller receives the encoding completion instruction sent by the first controller, and the encoding completion instruction includes the maximum encoding;
[0026] If the own encoding identifier of the second controller is equal to the maximum encoding, the second controller exits the encoding state and completes the encoding.
[0027] In the embodiment of the present application, after the second controller receives the encoding completion instruction sent by the first controller and determines that its own encoding is equal to the maximum encoding in the encoding completion instruction, it exits the encoding state, so as to reduce the probability of missing the encoding of the second controller.
[0028] In a second aspect, the embodiment of the present application provides another controller encoding method, including:
[0029] The first controller wakes up the second controller connected to the first controller via the wake-up line;
[0030] The first controller sends an encoding instruction enable signal to the second controller, so that the second controller encodes based on the encoding instruction enable signal when it receives the encoding instruction enable signal and its own encoding is not completed;
[0031] The first controller receives the encoding result sent by the second controller.
[0032] In the embodiment of the present application, the first controller wakes up the second controller connected via the wake-up line, and then sends an encoding instruction enable signal to the awakened second controller, so that the second controller encodes when it receives the encoding instruction enable signal and its own encoding is not completed. Compared with the traditional manual encoding, the encoding method provided in the embodiment of the present application improves the encoding efficiency.
[0033] In any embodiment, before the first controller sends the encoding instruction enable signal to the second controller, the method further includes:
[0034] The first controller obtains the actual number of the second controllers;
[0035] If the actual number does not match the pre-configured number stored in the first controller, the step of the first controller sending the encoding instruction enable signal to the second controller is executed.
[0036] In the embodiment of the present application, when the first controller determines that the actual number of the second controllers does not match the pre-configured number, encoding is triggered, saving manual inspection and reducing the probability of missed encoding.
[0037] In any embodiment, after the first controller receives the encoding result sent by the second controller, the method further includes:
[0038] Verify the validity of the encoding result;
[0039] If the verification passes, update the current maximum encoding and send a confirmation encoding instruction to the second controller, where the confirmation encoding instruction includes the current maximum encoding.
[0040] In the embodiment of the present application, by verifying the validity of the encoding result, the probability of encoding errors is reduced.
[0041] In any embodiment, the method further includes:
[0042] If the current maximum encoding is greater than or equal to the pre-configured number stored in the first controller, it is determined that the encoding is completed;
[0043] Send an encoding completion instruction to the second controller.
[0044] In the embodiment of the present application, it is determined that the encoding is completed based on the current maximum encoding and the pre-configured number, so as to reduce the possibility of omission.
[0045] In a third aspect, an embodiment of the present application provides a control encoding device, including:
[0046] A first wake-up module, configured to maintain a wake-up state after receiving a wake-up signal from the previous controller in the wake-up cascade network, where the wake-up cascade network is a network formed by cascading a plurality of second controllers through a wake-up line after the first controller;
[0047] An encoding module, configured to perform encoding based on the encoding instruction enable signal and return an encoding result to the first controller when receiving the encoding instruction enable signal of the first controller and not completing encoding itself.
[0048] In a fourth aspect, an embodiment of the present application provides another control encoding device, including:
[0049] A second wake-up module, configured to wake up the second controller connected to the first controller through a wake-up line;
[0050] A signal sending module, configured to send an encoding instruction enable signal to the second controller, so that the second controller performs encoding based on the encoding instruction enable signal when receiving the instruction enable signal and not completing encoding itself.
[0051] A receiving module, configured to receive the encoded result sent by the second controller.
[0052] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus, where
[0053] the processor and the memory communicate with each other through the bus;
[0054] the memory stores program instructions executable by the processor, and the processor can execute the methods of the first aspect or the second aspect by invoking the program instructions.
[0055] In a sixth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, including:
[0056] the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods of the first aspect or the second aspect.
[0057] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or can be understood by implementing the embodiments of the present application. The objectives and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written specification, claims, and drawings. Description of the Drawings
[0058] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0059] Figure 1 A schematic diagram of a multi-level control system structure provided by an embodiment of the present application;
[0060] Figure 2 A schematic diagram of the flow of a controller encoding method provided by an embodiment of the present application;
[0061] Figure 3 Another schematic diagram of the flow of a controller encoding method provided by an embodiment of the present application;
[0062] Figure 4 A schematic diagram of another traditional multi-level control system structure;
[0063] Figure 5 Another schematic diagram of the flow of a control encoding method provided by an embodiment of the present application;
[0064] Figure 6 Structural schematic diagram of a control coding device provided by an embodiment of the present application;
[0065] Figure 7 Another structural schematic diagram of a control coding device provided by an embodiment of the present application;
[0066] Figure 8 Structural schematic diagram of an electronic device entity provided by an embodiment of the present application. Detailed implementation manners
[0067] The embodiments of the technical solution of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solution of the present application more clearly, and therefore are only examples and cannot be used to limit the protection scope of the present application.
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above drawings are intended to cover non-exclusive inclusion.
[0069] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality" is more than two, unless otherwise specifically defined.
[0070] Referring to "embodiments" herein means that the specific features, structures or characteristics described in connection with the embodiments may be included in at least one embodiment of the present application. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0071] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the front and rear associated objects.
[0072] In the description of the embodiments of the present application, the term "a plurality" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0073] In the description of the embodiments of the present application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the embodiments of the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the embodiments of the present application.
[0074] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific situations.
[0075] Currently, when there is a first controller and multiple second controllers in a battery test system, in order to facilitate the first controller to control the multiple second controllers, each second controller needs to be encoded so that the first controller can perform ID identification on each second controller. The method of manually encoding each second controller one by one has low encoding efficiency and is prone to errors. To solve this problem, the embodiments of the present application provide a controller encoding method, which realizes the automatic encoding of the second controllers one by one according to the cascading relationship through software and hardware cooperation, improving the encoding efficiency.
[0076] A controller encoding method provided by the embodiments of the present application can be applied to a multi-level control system, such as Figure 1As shown in the figure. Among them, the multi-level control system includes a first controller 101 and multiple second controllers 102. The first controller 101 is connected to each second controller 102 through a communication line, and the first controller 101 is connected to one of the second controllers 102 through a wake-up line. The second controllers 102 are cascaded through the wake-up line. Among them, the first controller 101 is a primary controller, which can broadcast messages to multiple second controllers 102 through the communication line. It can be understood that the second controller 102 is a secondary controller; the message can be an instruction, information, etc. For the convenience of description, the second controller 102 connected to the first controller 101 through the wake-up line is used as the first second controller 102, and the other second controllers cascaded through the wake-up line are sorted in sequence. The first second controller 102 is woken up by the first controller 101, and the other second controllers 102 are all woken up by the previous second controller 102. During encoding, the unencoded second controllers are in the sleep state, and the encoded and encoding second controllers 102 are in the wake-up state. The second controllers 102 are woken up and encoded one by one according to the cascade order. That is, during encoding, the first controller 101 wakes up the first second controller 102, and then the first controller 101 sends an encoding instruction enable signal to the first second controller 102 through the communication line. After the first second controller 102 determines that encoding is required, it starts encoding. After completing the encoding, the first second controller 102 wakes up the second second controller 102 through the wake-up line. After the second second controller 102 receives the encoding instruction enable signal and determines that encoding is required, it starts encoding, and so on, until the last second controller completes the encoding.
[0077] Figure 2 As shown in the figure, it is a schematic flowchart of a controller encoding method provided by an embodiment of the present application. Figure 2 As shown in the figure, the method includes:
[0078] Step 201: After the second controller receives the wake-up signal from the previous controller in the wake-up cascade network, it maintains the wake-up state. The wake-up cascade network is a network formed by cascading multiple second controllers through a wake-up line after the first controller.
[0079] Step 202: When the second controller receives the encoding instruction enable signal from the first controller and has not completed encoding itself, it encodes based on the encoding instruction enable signal and returns the encoding result to the first controller.
[0080] In a specific implementation process, the wake-up cascade network refers to a network formed by cascading a primary control and multiple second controllers through a wake-up line. For details, please refer to Figure 1A network formed by components other than communication lines in the system. It can be understood that multiple wake-up cascade networks may be included in the system. For example, the first controller can cascade a group of second controllers through one wake-up line and another group of second controllers through another wake-up line. The second controller refers to any one of the multiple second controllers. It can be the first second controller cascaded with the first controller through the wake-up line or other second controllers. When it is the first second controller, it is woken up by first-level control; when it is other second controllers, it is woken up by the previous cascaded second controller. It should be noted that the second controllers cascaded after the woken second controller are in the sleep state at the current time.
[0081] The first controller can broadcast an encoded instruction enable signal to the second controller through the communication line. When the woken second controller receives the encoded instruction enable signal, it can determine whether it is in an uncoded state. If it is in an uncoded state, it can perform encoding based on the encoding enable signal. After encoding is completed, it returns the encoding result to the first controller. It can be understood that each second controller stores an identifier indicating whether it has been encoded. For example, "0" can be used to represent uncoded and "1" can be used to represent encoded. Of course, the identifier used to characterize the encoding state of the second controller can also be others, such as "1" represents uncoded and "2" represents encoded, etc.
[0082] In the embodiment of the present application, after the second controller is woken up by the previous controller through the wake-up line, it can receive the encoded instruction enable signal sent by the first-level control. And, when it has not completed encoding itself, it performs encoding based on the encoded instruction enable signal. Compared with the traditional manual encoding method, the controller encoding method provided by the embodiment of the present application can improve the encoding efficiency.
[0083] Based on the above embodiments, the encoded instruction enable signal includes the current maximum encoding identifier; the second controller performs encoding based on the encoded instruction enable signal and sends the encoding result to the first controller through the communication line, including:
[0084] The second controller determines the target encoding identifier based on the current maximum encoding identifier;
[0085] The second controller sends the encoding result to the first controller based on the target encoding identifier.
[0086] In the specific implementation process, after receiving the encoding instruction enable signal sent by the first controller, the second controller can parse the encoding instruction enable signal to obtain the current maximum encoding identifier. Here, the current maximum encoding identifier refers to the maximum identifier that has been encoded currently. For example, if the second controller encodes one by one and the encoding identifiers are incremented, and each second controller adds 1 to the encoding identifier of the previous second controller during encoding, then the first controller sends the current maximum encoding identifier to the second controller, enabling the second controller to determine the target encoding identifier. Here, the target encoding identifier refers to the encoding identifier of the second controller that is currently encoding. It can be understood that when determining the target encoding identifier, encoding can be performed according to a preset encoding rule, and the encoding rule can be set according to actual requirements. For example, it can be adding 1 to the current maximum encoding identifier, or adding 2, etc.
[0087] After the second controller determines its own target encoding identifier, it sends an encoding result to the first controller, where the encoding result includes whether the encoding is successful, and in the case of successful encoding, it also includes the target encoding identifier obtained after the second controller encodes.
[0088] In the embodiment of the present application, the secondary encoder can perform automatic encoding based on the received current maximum encoding, and then send an encoding result to the first controller, which improves the encoding accuracy to a certain extent.
[0089] Based on the above embodiment, after sending the encoding result to the first controller, the method further includes:
[0090] The second controller receives the confirmation encoding instruction sent by the first controller; the confirmation encoding instruction includes the current maximum encoding identifier; where the confirmation encoding instruction is sent by the first controller after verifying the encoding result;
[0091] Store the current maximum encoding identifier.
[0092] In the specific implementation process, after receiving the encoding result sent by the second controller, the first controller can perform validity verification on the target encoding identifier in the encoding result, that is, verify whether the target encoding identifier conforms to the preset encoding rule. If it conforms, it sends a confirmation encoding instruction to the second controller. The purpose of the first controller sending the confirmation encoding instruction is to inform the second controller that the target encoding identifier conforms to the preset encoding rule and is available. After receiving the confirmation encoding instruction, the second controller stores the current maximum encoding identifier in the confirmation encoding instruction as its own encoding identifier. It can be understood that the current maximum encoding identifier received by this second controller is the target encoding identifier obtained after its own encoding.
[0093] In the embodiment of the present application, after the first controller verifies the encoding result and passes, it sends a confirmation encoding instruction to the second controller, which improves the encoding accuracy.
[0094] Based on the above embodiment, the method further includes:
[0095] When the second controller receives the encoding instruction enable signal sent by the first controller and has completed its own encoding, it wakes up the next second controller in the wake-up cascade network through the wake-up line.
[0096] In the specific implementation process, the first controller may send the encoding instruction enable signal repeatedly. To reduce the probability of the second controller encoding repeatedly, after the second controller receives the encoding instruction enable signal sent by the first controller, it determines whether it has completed encoding. If it has completed encoding, the second controller does not enter the encoding state but wakes up the next second controller through the wake-up line. After the next second controller is woken up, its working process is the same as that of the previous second controller, which will not be elaborated here.
[0097] In the embodiment of the present application, when the second controller receives the encoding instruction enable signal and has completed its own encoding, the second controller no longer enters the encoding state but wakes up the next second controller, so that the next second controller encodes according to its own situation or continues to wake up the next one, reducing the possibility of the second controller encoding repeatedly.
[0098] Based on the above embodiment, the second controller is connected to the first controller through the wake-up line. When the second controller receives the encoding instruction enable signal sent by the first controller and has not completed its own encoding, it encodes based on the encoding instruction enable signal, including:
[0099] When the second controller receives the encoding instruction enable signal sent by the first controller and has not completed its own encoding, it pulls down the wake-up output;
[0100] If the wake-up input of the second controller exists after a preset time period, it encodes based on the encoding instruction enable signal.
[0101] In the specific implementation process, for the convenience of description, the second controller connected to the first controller is called the first second controller. When the first second controller receives the encoding instruction enable signal sent by the first controller and has not completed its own encoding, it enters the encoding state. At this time, it pulls down the wake-up output. The purpose of pulling down the wake-up output is to put all subsequent second controllers into the sleep state.
[0102] After a preset duration, if all the second controllers determine that their corresponding wake-up inputs exist, they perform encoding according to the encoding instruction enable signal; otherwise, the second controllers enter the sleep state. It can be understood that the wake-up output of the previous second controller is the wake-up input of the next second controller.
[0103] In practical applications, after the system is powered on, the first controller and each second controller are initialized. After the first controller completes the initialization, it wakes up the first second controller through the wake-up line, and the first second controller then wakes up the next second controller through the wake-up line, and so on until all the second controllers are woken up. After waking up all the second controllers, the first controller can obtain the number of second controllers connected to it. The first controller determines whether to encode the secondary encoder based on the actual number of second controllers and the pre-configured number. When encoding is required, it sends an encoding instruction enable signal to the second controllers. After receiving the encoding instruction enable signal, if the first second controller determines that it needs to enter the encoding state, it enters the encoding state, and pulls down the wake-up output to put the subsequent second controllers to sleep and starts encoding. After the first second controller completes encoding, it wakes up the next second controller. The operation method of the next second controller after being woken up is the same as that of the previous second controller, which will not be elaborated here.
[0104] In the embodiment of the present application, when the second controller connected to the first controller through the wake-up line starts encoding after receiving the encoding instruction enable signal, it first puts the subsequent other second controllers to sleep, and then the second controllers are woken up and encoded one by one, so as to enable orderly encoding.
[0105] Based on the above embodiment, the method further includes:
[0106] The second controller receives the encoding completion instruction sent by the first controller, and the encoding completion instruction includes the maximum encoding;
[0107] If the self-encoding identifier of the second controller is equal to the maximum encoding, the second controller exits the encoding state and completes encoding.
[0108] In a specific implementation process, after the first controller finishes the encoding judgment, it sends an encoding completion instruction to the second controller. The role of the encoding completion instruction is to inform the second controller that the encoding has been completed and make it exit the encoding state. The encoding completion instruction carries the maximum encoding. It can be understood that the maximum encoding refers to the target encoding identifier sent by the last second controller received by the first controller. After receiving the encoding completion instruction sent by the first controller, the second controller compares the maximum encoding in the encoding completion instruction with its own encoding identifier. If the maximum encoding is equal to its own encoding identifier, it determines that the encoding is completed, and this second controller exits the encoding state. If the own encoding of the second controller is not equal to the maximum encoding, it means that there are still second controllers behind that have not performed encoding. This second controller exits the encoding state and wakes up the next second controller.
[0109] In the embodiment of the present application, after the second controller receives the encoding completion instruction sent by the first controller and determines that its own encoding is equal to the maximum encoding in the encoding completion instruction, it exits the encoding state, so as to reduce the probability of missing the encoding of the second controller.
[0110] Figure 3 Another schematic flowchart of the controller encoding method provided by the embodiment of the present application is shown in Figure 3 as follows. This method includes:
[0111] Step 301: The first controller wakes up the second controller connected to the first controller through the wake-up line;
[0112] Step 302: The first controller sends an encoding instruction enable signal to the second controller, so that the second controller performs encoding based on the encoding instruction enable signal when it receives the encoding instruction enable signal and its own encoding is not completed;
[0113] Step 303: The first controller receives the encoding result sent by the second controller.
[0114] In a specific implementation process, after the first controller completes the initialization, it wakes up the first second controller, making the second controller in a wake-up state.
[0115] After the first controller determines that the first second controller needs to be encoded, it sends an encoding instruction enable signal to the second controller. After receiving the encoding instruction enable signal, the first second controller performs subsequent operations related to encoding. For specific details, please refer to the above embodiments and will not be elaborated here.
[0116] After the first second controller completes the encoding, it sends the encoding result to the first controller, where the encoding result includes the target encoding identifier of the first second controller itself.
[0117] In an embodiment of the present application, the first controller wakes up the second controller connected via a wake-up line, and then sends an encoding instruction enable signal to the awakened second controller, so that the second controller performs encoding when it receives the encoding instruction enable signal and has not completed encoding itself. Compared with traditional manual encoding, the encoding method provided in the embodiment of the present application improves the encoding efficiency.
[0118] Based on the above embodiment, before the first controller sends an encoding instruction enable signal to the second controller, the method further includes:
[0119] The first controller obtains the actual number of second controllers;
[0120] If the actual number does not match the pre-configured number stored in the first controller, then perform the step of the first controller sending an encoding instruction enable signal to the second controller.
[0121] In a specific implementation process, the actual number of second controllers refers to the real number of second controllers connected to the first controller. The first controller also stores the number of second controllers pre-configured through software. During actual operation, the second controller may malfunction or a new second controller may be temporarily connected. In this case, the pre-configured number of second controllers in the first controller is different from the actual number of second controllers. In order for the first controller to accurately control the second controller, it is necessary to encode the second controller. Therefore, the first controller actively initiates an encoding instruction enable signal to enable the second controller to perform encoding. In addition, for the case where a second controller is replaced, the first controller also needs to re-initiate an encoding instruction enable signal for encoding. It can be understood that the encoding of the newly replaced second controller is an initial encoding, which is not in the encodings of each second controller stored in the first controller. Therefore, the first controller can determine whether the pre-configured number of second controllers in the first controller is the same as the actual number of second controllers by receiving the encodings of how many stored second controllers.
[0122] In the embodiment of the present application, encoding is triggered when the first controller determines that the actual number of the second controller does not match the pre-configured number, saving manual inspection and reducing the probability of missed encoding.
[0123] After the first controller receives the encoding result sent by the second controller, the method further includes:
[0124] Verify the validity of the encoding result;
[0125] If the verification passes, then update the current maximum encoding and send a confirmation encoding instruction to the second controller, where the confirmation encoding instruction includes the current maximum encoding.
[0126] In a specific implementation process, after the second controller completes the encoding, it sends the target encoding identifier containing the second controller to the first controller, and the first controller verifies the validity of the encoding result to verify the correctness of the target encoding identifier of the second controller. Specifically, it can be determined whether the target encoding identifier is encoded according to a preset encoding rule. If so, the verification is passed, otherwise the verification fails.
[0127] If the verification is successful, the first controller updates the current maximum code, uses the target code identifier in the encoding result as the current maximum code, and sends a confirmation encoding instruction to the second controller to inform the second controller that the target code identifier is available.
[0128] In case of verification failure, the second controller needs to start encoding again from the first second controller.
[0129] The embodiment of the present application reduces the probability of coding errors by verifying the validity of the coding results.
[0130] Based on the above embodiment, the method further includes:
[0131] If the current maximum encoding is greater than or equal to the pre-configured number stored in the first controller, determining that the encoding is complete;
[0132] Send an encoding completion instruction to the second controller.
[0133] In the specific implementation process, the first controller determines whether the current maximum encoding is greater than or equal to the number pre-configured in the first-level control. If so, it means that the encoding of all second controllers is completed, and the first controller sends a coding completion instruction to the second controller. Otherwise, the first controller returns to the state of monitoring whether the encoding result sent by the second controller is received.
[0134] The embodiment of the present application determines the coding completion by comparing the current maximum coding with the pre-configured quantity to reduce the possibility of omission.
[0135] Figure 4 It is another schematic diagram of the structure of a traditional multi-level control system. Figure 4 As shown, the system includes three signal lines: communication line, wake-up line and encoding drive line. The primary controller is connected to each secondary controller through the communication line, the primary controller is connected to one of the secondary controllers through the wake-up line and the encoding drive line, and the secondary controllers are cascaded through the wake-up line and the encoding drive line. Figure 4 It can be seen that the wiring between the primary controller and the secondary controller in the system is complex and costly.
[0136] Figure 5Another schematic diagram of a control encoding method provided by an embodiment of the present application is as follows Figure 5 as shown Figure 5 It shows that a first controller performs signaling interaction with a second controller. In practical applications, when each second controller performs encoding, it needs to execute Figure 5 the steps performed by the second controller in
[0137] Step 501: The first controller wakes up the first and second controllers and obtains the actual number of second controllers.
[0138] Step 502: Determine whether the pre-configured number of second controllers matches the actual number. If the configured number of second controllers matches the actual number, subsequent steps may not be executed; if not, execute Step 503.
[0139] Step 503: The first controller sends an encoding instruction enable signal to the second controller, and then executes Step 504. It can be understood that the first controller starts to monitor whether it receives an encoding result.
[0140] Step 504: Determine whether it has not been encoded itself; after the second controller receives the encoding instruction enable signal, if it is in an unencoded state, execute Step 505; otherwise, execute Step 506.
[0141] Step 505: Enter the encoding state and pull down the wake-up output; execute Step 507.
[0142] Step 506: Do not enter the encoding state and wake up the next second controller;
[0143] Step 507: Detect whether the wake-up input exists; if it exists, execute Step 509, otherwise execute Step 508.
[0144] Step 508: Sleep;
[0145] Step 509: Send the encoding result; the second controller determines its own target encoding identifier based on the current maximum encoding in the encoding instruction enable signal, and sends the encoding result including the target encoding identifier to the first controller, and then executes Step 510 and Step 513.
[0146] Step 510: Whether the first controller receives the encoding result; if the first controller receives the encoding result, execute Step 511, if not, it remains in the continuous monitoring state. It can be understood that a timeout duration can be set in advance. If the encoding result is not received within the timeout duration, it is considered that the encoding times out, and re-encoding or alarming can be performed.
[0147] Step 511: Confirm the validity of the target coding identifier; after receiving the coding result, the first controller verifies the validity of the target coding identifier in the coding result. If the verification passes, step 512 is executed; otherwise, re-coding is performed.
[0148] Step 512: Send a confirmation coding instruction; the first controller sends a confirmation coding instruction to the second controller, and then executes step 513 and step 515.
[0149] Step 513: Whether to receive the confirmation coding instruction; after receiving the confirmation coding instruction, the second controller uses the current maximum coding in the confirmation coding instruction as its own coding identifier and executes step 514.
[0150] Step 514: Store the coding identifier; the second controller stores its own coding identifier.
[0151] Step 515: The current maximum coding identifier is greater than or equal to the configured quantity; the first controller determines whether the current maximum coding identifier is greater than or equal to the configured quantity. If it is greater than or equal to, step 516 is executed; otherwise, step 510 is executed.
[0152] Step 516: Coding completed; the first controller considers the coding completed and ends the process.
[0153] Step 517: Send a coding completion instruction to the second controller; the first controller sends a coding completion instruction to the second controller and then executes step 518.
[0154] Step 518: Whether its own coding is equal to the maximum coding identifier; the second controller determines whether its own coding is equal to the maximum coding identifier to determine whether it is the last second controller. If they are equal, step 519 is executed; otherwise, step 520 is executed.
[0155] Step 519: Exit the coding state; the second controller exits the coding state and ends the process.
[0156] Step 520: Exit the coding state and wake up the next second controller. It can be understood that the purpose of step 518 is to enable the second controller to determine whether it is the last one. If not, the next second controller is woken up.
[0157] Compared with the traditional multi-level control system, the multi-level control system proposed in the embodiment of the present application reduces the complexity of the multi-level control system circuit while realizing the coding of the second controller, thereby reducing the cost.
[0158] Figure 6A schematic structural diagram of a control coding device provided by an embodiment of this application. This device can be a module, a program segment, or code on an electronic device. It should be understood that this device corresponds to the above Figure 2 method embodiment and can execute Figure 2 each step involved in the method embodiment. The specific functions of this device can be seen in the above description. To avoid repetition, the detailed description is appropriately omitted here. The device includes: a first wake-up module 601 and a coding module 602, where:
[0159] The first wake-up module 601 is used to maintain the wake-up state after receiving the wake-up signal from the previous controller in the wake-up cascade network. The wake-up cascade network is a network formed by cascading multiple second controllers through wake-up lines after the first controller;
[0160] The coding module 602 is used to perform coding based on the coding instruction enable signal and return the coding result to the first controller when it receives the coding instruction enable signal from the first controller and has not completed coding itself.
[0161] Based on the above embodiment, the coding instruction enable signal includes the current maximum coding identifier; specifically, the coding module 602 is used for:
[0162] Determining the target coding identifier based on the current maximum coding identifier;
[0163] Sending the coding result to the first controller based on the target coding identifier.
[0164] Based on the above embodiment, the device further includes an identifier storage module, which is used for:
[0165] Receiving the confirmation coding instruction sent by the first controller; the confirmation coding instruction includes the current maximum coding identifier; wherein, the confirmation coding instruction is sent by the first controller to the second controller after verifying the coding result;
[0166] Storing the current maximum coding identifier.
[0167] Based on the above embodiment, the coding module 602 is further used for:
[0168] When receiving the coding instruction enable signal sent by the first controller and having completed coding itself, waking up the next second controller in the wake-up cascade network through the wake-up line.
[0169] Based on the above embodiment, the second controller is connected to the first controller through the wake-up line. Specifically, the coding module 602 is used for:
[0170] When receiving the encoding instruction enabling signal from the first controller and not having completed encoding itself, pull down the wake-up output.
[0171] If the wake-up input of the second controller exists after a preset duration, perform encoding based on the encoding instruction enabling signal.
[0172] Based on the above embodiments, the device further includes a first encoding completion module for:
[0173] Receive the encoding completion instruction sent by the first controller, where the encoding completion instruction includes the maximum encoding.
[0174] If the self-encoding identifier of the second controller is equal to the maximum encoding, the second controller exits the encoding state and completes encoding.
[0175] Figure 7 Another structural schematic diagram of the control encoding device provided by the embodiments of the present application. The device can be a module, program segment, or code on an electronic device. It should be understood that the device corresponds to the above Figure 3 method embodiments and can execute Figure 3 each step involved in the method embodiments. The specific functions of the device can be referred to the above description. To avoid repetition, the detailed description is appropriately omitted here. The device includes: a second wake-up module 701, a signal sending module 702, and a receiving module 703, where:
[0176] The second wake-up module 701 is used to wake up the second controller connected to the first controller through the wake-up line.
[0177] The signal sending module 702 is used to send an encoding instruction enabling signal to the second controller, so that the second controller performs encoding based on the encoding instruction enabling signal when receiving the instruction enabling signal and not having completed encoding itself.
[0178] The receiving module 703 is used to receive the encoding result sent by the second controller.
[0179] Based on the above embodiments, the device further includes an encoding initiation module for:
[0180] Obtain the actual number of second controllers.
[0181] If the actual number does not match the pre-configured number stored in the first controller, execute the steps corresponding to the second wake-up module 701.
[0182] Based on the above embodiments, the device further includes a verification module for:
[0183] Verify the validity of the encoding result.
[0184] If the verification passes, update the current maximum code, and send a confirmation code instruction to the second controller, where the confirmation code instruction includes the current maximum code.
[0185] Based on the above embodiments, the device further includes a second coding completion module, which is used for:
[0186] If the current maximum code is greater than or equal to the pre-configured quantity stored in the first controller, it is determined that the coding is completed;
[0187] Send a coding completion instruction to the second controller.
[0188] Figure 8 Schematic diagram of the entity structure of the electronic device provided by the embodiment of the present application, as Figure 8 shown, the electronic device includes: a processor 801, a memory 802, and a bus 803; wherein,
[0189] The processor 801 and the memory 802 communicate with each other through the bus 803;
[0190] The processor 801 is used to call program instructions in the memory 802 to execute the methods provided by the above method embodiments. For example, when the battery device is the second controller, its method includes: after receiving the wake-up signal of the previous controller in the wake-up cascade network, the second controller maintains the wake-up state, and the wake-up cascade network is a network formed by cascading multiple second controllers through a wake-up line after the first controller; when the second controller receives the coding instruction enable signal of the first controller and has not completed coding itself, it performs coding based on the coding instruction enable signal and returns a coding result to the first controller.
[0191] If the electronic device is the first controller, its method includes: the first controller wakes up the second controller connected to the first controller through a wake-up line; the first controller sends a coding instruction enable signal to the second controller, so that when the second controller receives the coding instruction enable signal and has not completed coding itself, it performs coding based on the coding instruction enable signal; the first controller receives the coding result sent by the second controller.
[0192] The processor 801 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 801 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0193] The memory 802 may include, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), etc.
[0194] This embodiment discloses a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided in the above method embodiments. For example, it includes: after receiving a wake-up signal from the previous controller in the wake-up cascade network, the second controller maintains a wake-up state. The wake-up cascade network is a network formed by cascading multiple second controllers through wake-up lines after the first controller; when the second controller receives an encoding instruction enable signal from the first controller and has not completed encoding itself, it performs encoding based on the encoding instruction enable signal and returns an encoding result to the first controller. Or,
[0195] The first controller wakes up the second controller connected to the first controller through a wake-up line; the first controller sends an encoding instruction enable signal to the second controller so that when the second controller receives the encoding instruction enable signal and has not completed encoding itself, it performs encoding based on the encoding instruction enable signal; the first controller receives the encoding result sent by the second controller.
[0196] This embodiment provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to execute the methods provided in the above method embodiments. For example, the methods include: after receiving a wake-up signal from the previous controller in the wake-up cascade network, the second controller maintains a wake-up state, where the wake-up cascade network is a network formed by cascading a plurality of second controllers through wake-up lines after the first controller; when the second controller receives an encoding instruction enable signal from the first controller and has not completed encoding itself, it performs encoding based on the encoding instruction enable signal and returns an encoding result to the first controller. Or,
[0197] The first controller wakes up the second controller connected to the first controller through a wake-up line; the first controller sends an encoding instruction enable signal to the second controller so that the second controller performs encoding based on the encoding instruction enable signal when it receives the encoding instruction enable signal and has not completed encoding itself; the first controller receives the encoding result sent by the second controller.
[0198] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical or other form.
[0199] In addition, the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or 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.
[0200] Furthermore, the functional modules in each embodiment of this application can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0201] In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0202] The above are only the embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A controller encoding method, characterized in that, it includes: After receiving the wake-up signal from the previous controller in the wake-up cascade network, the second controller maintains the wake-up state. The wake-up cascade network is a network formed by cascading multiple second controllers through wake-up lines after the first controller; When the second controller receives the encoding instruction enable signal from the first controller and has not completed encoding itself, it encodes based on the encoding instruction enable signal and returns the encoding result to the first controller.
2. The method according to claim 1, characterized in that, The encoding instruction enable signal includes the current maximum encoding identifier; the encoding based on the encoding instruction enable signal and returning the encoding result to the first controller includes: The second controller determines the target encoding identifier based on the current maximum encoding identifier; The second controller sends the encoding result to the first controller based on the target encoding identifier.
3. The method according to claim 1, characterized in that, After sending the encoding result to the first controller, the method further includes: The second controller receives the confirmation encoding instruction sent by the first controller; the confirmation encoding instruction includes the current maximum encoding identifier; wherein, the confirmation encoding instruction is sent by the first controller to the second controller after the encoding result is verified; Store the current maximum encoding identifier.
4. The method according to claim 1, characterized in that, The method further includes: When the second controller receives the encoding instruction enable signal sent by the first controller and has completed encoding itself, the second controller wakes up the next second controller in the wake-up cascade network through the wake-up line.
5. The method according to claim 1, characterized in that, The second controller is connected to the first controller through the wake-up line. When the second controller receives the encoding instruction enable signal from the first controller and has not completed encoding itself, the encoding based on the encoding instruction enable signal includes: When the second controller receives the encoding instruction enable signal from the first controller and has not completed encoding itself, it pulls down the wake-up output; If the wake-up input of the second controller exists after a preset time, it encodes based on the encoding instruction enable signal.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: The second controller receives the encoding completion instruction sent by the first controller, and the encoding completion instruction includes the maximum encoding; If the self-encoding identifier of the second controller is equal to the maximum encoding, the second controller exits the encoding state and completes encoding.
7. A controller encoding method, characterized in that, it includes: The first controller wakes up the second controller connected to the first controller through the wake-up line; The first controller sends an encoding instruction enable signal to the second controller, so that when the second controller receives the encoding instruction enable signal and has not completed encoding itself, it encodes based on the encoding instruction enable signal; The first controller receives the encoding result sent by the second controller.
8. The method according to claim 7, wherein, before the first controller sends an encoding instruction enable signal to the second controller, the method further includes: the first controller obtains the actual number of second controllers; if the actual number does not match the pre-configured number stored in the first controller, then perform the step of the first controller sending an encoding instruction enable signal to the second controller.
9. The method according to claim 7 or 8, wherein, after the first controller receives the encoding result sent by the second controller, the method further includes: verifying the validity of the encoding result; if the verification passes, then update the current maximum encoding and send an acknowledgement encoding instruction to the second controller, the acknowledgement encoding instruction including the current maximum encoding.
10. The method according to claim 9, wherein, the method further includes: if the current maximum encoding is greater than or equal to the pre-configured number stored in the first controller, then determine that encoding is complete; send an encoding completion instruction to the second controller.
11. A control encoding device, wherein, comprising: a first wake-up module, configured to maintain a wake-up state after receiving a wake-up signal from the previous controller in the wake-up cascade network, the wake-up cascade network being a network formed by cascading a plurality of second controllers after the first controller through wake-up lines; an encoding module, configured to perform encoding based on the encoding instruction enable signal and return an encoding result to the first controller when receiving the encoding instruction enable signal from the first controller and not having completed encoding itself.
12. A control encoding device, wherein, comprising: a second wake-up module, configured to wake up the second controller connected to the first controller through a wake-up line; a signal sending module, configured to send an encoding instruction enable signal to the second controller, so that the second controller performs encoding based on the encoding instruction enable signal when receiving the encoding instruction enable signal and not having completed encoding itself; a receiving module, configured to receive the encoding result sent by the second controller.
13. An electronic device, wherein, comprising: a processor, a memory and a bus, wherein, the processor and the memory communicate with each other through the bus; the memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1-10 by invoking the program instructions.
14. A non-transitory computer-readable storage medium, wherein, the non-transitory computer-readable storage medium stores computer instructions, and when the computer instructions are run by the computer, the computer executes the method according to any one of claims 1-10.
15. A controller encoding system, wherein, comprising a first controller and a plurality of second controls; The first controller is respectively connected to each of the second controllers through communication lines, and the first controller is connected to one of the second controllers through a wake-up line; the multiple second controllers are cascaded through the wake-up line; The second controller is configured to execute the method according to any one of claims 1-6; The first controller is configured to execute the method according to any one of 7-10.