Data collection method, device, equipment and medium based on daisy chain communication
By initializing the single-unit sampling chip in daisy chain communication and periodic data reading, the problem of data acquisition failure after daisy chain communication failure is solved, and communication stability and data acquisition accuracy are improved.
Patent Information
- Application Number
- CN202211262119.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-10-14
AI Technical Summary
After a daisy chain communication fails, it cannot be restored to one-way communication, resulting in data acquisition failure.
By performing an initialization process on the monomer sampling chip in the daisy chain in the first communication direction, data is read periodically, and one-way or two-way reading operations are performed according to the reading method, and finally the chip is reset to complete data acquisition.
It realizes data acquisition after daisy chain communication failure, improves communication stability and data acquisition accuracy, and ensures improvement of user experience.
Smart Images

Figure CN115643160B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of battery management system controller (BMS), and in particular relates to a data acquisition method, device, equipment and medium based on daisy chain communication. Background Art
[0002] With the development of BMS (Battery Management System) technology, it has become a trend for the communication between the single sampling chips of the battery management system BMS to develop from CAN (Controller Area Network, CAN) communication to daisy chain communication. Compared with CAN communication, daisy chain communication has a huge cost advantage. However, since the communication mode of daisy chain communication is cascade communication, which is different from the broadcast communication of CAN communication, when a node in the daisy chain communication fails, all data of this node and subsequent nodes cannot be obtained.
[0003] The patent with application number 2021102072841 provides a ring daisy chain communication fault handling method for BMS, which mainly provides a fault handling method for converting from unidirectional communication to ring communication after a daisy chain communication fault occurs. This method solves the communication problem of the daisy chain harness from connection to disconnection, but does not solve the problem of data collection when the daisy chain communication is restored from ring communication to unidirectional communication. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the present invention provides a data acquisition method, device, equipment and medium based on daisy chain communication to solve the above-mentioned technical problems.
[0005] The present invention provides a data acquisition method based on daisy chain communication, the method comprising:
[0006] Performing an initialization process on a single sampling chip in the daisy chain in a first communication direction;
[0007] After executing the initialization process, periodically reading the data of the single sampling chip;
[0008] A reading method for reading the data by obtaining the current reading number every set data reading cycle, wherein the reading method includes unidirectional reading and bidirectional reading;
[0009] If the reading mode is unidirectional reading, continue to periodically read the data in the first communication direction;
[0010] If the reading mode is bidirectional reading, a data reading operation is performed on the single sampling chip in the first communication direction in the last cycle of the set data reading cycle;
[0011] Reset all single sampling chips, and perform an initialization process on the single sampling chips in the first communication direction;
[0012] After the initialization process is executed, the data of the single sampling chip is periodically read to complete the data collection.
[0013] In one embodiment of the present invention, before resetting all the single sampling chips, a chip code of the single sampling chip is read once in the first communication direction, and when the reading operation is normal, all the single sampling chips are reset.
[0014] In one embodiment of the present invention, the initialization process includes:
[0015] Configure the chip code of the single sampling chip;
[0016] Initialize the register of the single sampling chip.
[0017] In one embodiment of the present invention, the periodic reading of the data of the single sampling chip includes:
[0018] Configuring registers of the single sampling chip;
[0019] Read the data of the single sampling chip.
[0020] In one embodiment of the present invention, the method further includes:
[0021] Acquire a first configuration number of the chip code of the single sampling chip or / and a communication state of the single sampling chip when a chip code of the single sampling chip is read once in a first communication direction;
[0022] If the first configuration times exceeds the second set value, or the communication status of the single sampling chip is in a fault state, a communication fault handling process is executed for the single sampling chip.
[0023] In one embodiment of the present invention, the communication failure handling process includes:
[0024] reconfiguring the register of the single sampling chip, and obtaining a second configuration number of successful configurations of the register of the single sampling chip;
[0025] comparing the second configuration number with a third set value, and initializing a bidirectional daisy chain configuration when the second configuration number exceeds the third set value;
[0026] Obtaining the chip code of the single sampling chip, and determining whether the chip code of the single sampling chip is normal, if the chip code is normal, periodically reading the data of the single sampling chip; if the chip code is abnormal, executing the initialization process;
[0027] It is determined whether the initialization process is successfully executed. If the execution is successful, the data of the single sampling chip is periodically read; if the execution fails, the initialization process is re-executed at least once on the single sampling chip.
[0028] In one embodiment of the present invention, when the second configuration times do not exceed the third set value or when the number of times the initialization process is performed on the monomer sampling chip during the communication fault handling process does not exceed the fourth set value, the voltage information of the monomer sampling chip is the effective value of the voltage collected for the last time.
[0029] The present invention provides a data acquisition device based on daisy chain communication, the device comprising:
[0030] A first initialization module, used to perform an initialization process on a single sampling chip in the daisy chain in a first communication direction;
[0031] A first data acquisition module, used for periodically reading the data of the single sampling chip after executing the initialization process;
[0032] A reading mode acquisition module, used for acquiring a reading mode for reading the data at a current reading number every set data reading cycle, wherein the reading mode includes unidirectional reading and bidirectional reading;
[0033] A second data acquisition module, used for continuing to periodically read the data in the first communication direction when the reading mode is unidirectional reading;
[0034] A third data acquisition module, configured to perform a data reading operation on the single sampling chip in the first communication direction in the last cycle of a set data reading cycle when the reading mode is bidirectional reading;
[0035] A second initialization module is used to reset all the single sampling chips and perform an initialization process on the single sampling chips in the first communication direction;
[0036] The fourth data acquisition module is used to periodically read the data of the single sampling chip after executing the initialization process to complete the data acquisition.
[0037] The present invention provides an electronic device, comprising:
[0038] one or more processors;
[0039] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the steps of the above-mentioned data acquisition method based on daisy chain communication.
[0040] The present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is enabled to execute the steps of the above-mentioned data acquisition method based on daisy chain communication.
[0041] Beneficial effects of the present invention: A data acquisition method, device, equipment and medium based on daisy chain communication in the present invention, the method includes: performing an initialization process on a single sampling chip in a daisy chain in a first communication direction; after performing the initialization process, periodically reading the data of the single sampling chip; obtaining a reading mode of reading the data at the current reading number every set data reading cycle, the reading mode includes unidirectional reading and bidirectional reading; if the reading mode is unidirectional reading, the data is continued to be periodically read in the first communication direction; if the reading mode is bidirectional reading, an identity reading operation is performed on the single sampling chip in the first communication direction in the last cycle of the set data reading cycle; resetting all single sampling chips, performing an initialization process on the single sampling chip in the first communication direction; after performing the initialization process, periodically reading the data of the single sampling chip to complete the data acquisition. The present invention provides a data acquisition method after a problem occurs in the power-on process and the operation process of the daisy chain communication, and the method can be completed without the user's perception, while improving the stability and robustness of the daisy chain communication, it also improves the accuracy of data acquisition and the user's experience.
[0042] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0044] Figure 1 is a schematic diagram showing an implementation environment of a data acquisition method based on daisy chain communication according to an exemplary embodiment of the present application;
[0045] Figure 2is a flow chart of a data acquisition method based on daisy chain communication shown in an exemplary embodiment of the present application;
[0046] Figure 3 is a flow chart of a communication failure processing process shown in an exemplary embodiment of the present application;
[0047] Figure 4 is a flow chart of a data acquisition device based on daisy chain communication shown in an exemplary embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0050] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0051] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0052] Figure 1 Schematic diagram of an exemplary implementation environment of a data acquisition method based on daisy chain communication in this application. Figure 1 The implementation environment includes a main controller MCU110, a first daisy chain communication conversion chip 120, a second daisy chain communication conversion chip 130, and multiple single sampling chips 140. The main controller MCU110 and the single sampling chips 140 communicate with each other in a daisy chain manner.
[0053] The main controller MCU110 is used as the computing processor of the battery management system BMS to perform functions such as initialization, single-cell sampling chip configuration, single-cell sampling chip data reading, and communication fault diagnosis.
[0054] The first daisy chain communication conversion chip 120 and the second daisy chain communication conversion chip 130 complete the conversion between SPI (Serial Peripheral Interface, SPI) communication and daisy chain communication protocol, converting the SPI communication of the main controller MCU110 into daisy chain communication that can be recognized by the single sampling chip 140, and converting the daisy chain communication of the single sampling chip 140 into SPI communication that can be recognized by the main controller MCU110; the single sampling chip 140 performs data collection and message reply functions according to the instructions of the main controller MCU110.
[0055] n single sampling chips 140, used to execute data collection and message reply according to the instructions of the main controller MCU110; the N single sampling chips are single sampling chip 1, single sampling chip 2, ..., single sampling chip N-1 and single sampling chip N;
[0056] The main controller MCU110, the first daisy chain communication conversion chip 120, the monomer sampling chip 1, the monomer sampling chip 2, ..., the monomer sampling chip N-1 and the monomer sampling chip N and the second daisy chain communication conversion chip 130 are connected in sequence and connected end to end to form a ring daisy chain communication circuit, and the ring daisy chain communication circuit can realize bidirectional daisy chain communication and unidirectional daisy chain communication; in unidirectional daisy chain communication, the first daisy chain communication conversion chip 120 or the second daisy chain communication conversion chip 130 is started, and the main controller MCU110 and the first daisy chain communication conversion chip / the second daisy chain communication conversion chip are used to periodically read the monomer sampling chip data. In bidirectional daisy chain communication, the first daisy chain communication conversion chip 120 and the second daisy chain communication conversion chip 130 are both started, and the main controller MCU110 and the first daisy chain communication conversion chip 120 and the second daisy chain communication conversion chip 130 are used to periodically read the monomer sampling chip data.
[0057] It should be noted that the unidirectional daisy chain communication of the ring daisy chain communication circuit includes a first communication direction and a second communication direction. The first communication direction can be defined as a forward communication direction, and the second communication direction can be defined as a reverse communication direction.
[0058] like Figure 1As shown, the forward communication direction is main controller MCU→second daisy chain communication conversion chip→monomer sampling chip N→monomer sampling chip N-1→…→monomer sampling chip 2→monomer sampling chip 1; the reverse communication direction is main controller MCU→first daisy chain communication conversion chip→monomer sampling chip 1→monomer sampling chip 2→…→monomer sampling chip N-1→monomer sampling chip N.
[0059] exist Figure 1 In the embodiment, the main controller MCU110 performs an initialization process on the monomer sampling chip in the daisy chain in the first communication direction; after executing the initialization process, the data of the monomer sampling chip is periodically read; the reading method of the data is obtained every set data reading cycle to obtain the current reading number, and the reading method includes unidirectional reading and bidirectional reading; if the reading method is unidirectional reading, the data is continued to be periodically read in the first communication direction; if the reading method is bidirectional reading, the identity reading operation is performed once on the monomer sampling chip in the first communication direction in the last cycle of the set data reading cycle; all monomer sampling chips are reset, and the initialization process is performed on the monomer sampling chip in the first communication direction; after executing the initialization process, the data of the monomer sampling chip is periodically read to complete the data collection. The present invention provides a data collection method after a problem occurs in the daisy chain communication during the power-on process and the operation process. This method can be completed without the user's perception, and while improving the stability and robustness of the daisy chain communication, it also improves the accuracy of data collection and the user's experience.
[0060] The daisy chain communication failure during the power-on process includes two types of failures: a chip encoding failure in initializing and configuring a single sampling chip and a register failure in initializing all single sampling chips.
[0061] The daisy chain communication failure during operation refers to a failure that occurs when initialization is successful but when periodically reading data from a single sampling chip.
[0062] The daisy chain communication fault diagnosis includes chip code fault diagnosis of a single sampling chip and register fault diagnosis of a single sampling chip. The chip code fault diagnosis of a single sampling chip is to query the chip code value after writing the chip code value. If the chip code value is abnormal, there is a fault; the register fault diagnosis of the sampling chip is to query the write status return value after writing the register value. If the return fails, there is a fault.
[0063] The daisy chain communication fault recovery refers to the chip code fault recovery of the single sampling chip and the register fault recovery of the single sampling chip. The chip code fault recovery of the single sampling chip means that the normal chip code value can be queried after the chip code value is written, and the register fault recovery of the single sampling chip means that the write status is successfully queried after the register value is written.
[0064] It should be understood that Figure 1 The number of the single sampling chips in the embodiment is only for illustration. According to actual needs, any number of single sampling chips can be provided.
[0065] The embodiments of the present application respectively propose a data acquisition method based on daisy chain communication, a data acquisition device based on daisy chain communication, an electronic device, and a computer-readable storage medium, and these embodiments will be described in detail below.
[0066] See also Figure 2 , Figure 2 is a flowchart of a data acquisition method based on daisy chain communication shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is specifically executed by the terminal device 101 in the implementation environment. It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0067] See also Figure 2 , Figure 2 This is a flowchart of an exemplary data collection method based on daisy chain communication of the present application. The data collection method based on daisy chain communication includes at least steps S210 to S270, which are described in detail as follows:
[0068] Step S210, performing an initialization process on a single sampling chip in the daisy chain in a first communication direction;
[0069] Step S220, after executing the initialization process, periodically reading the data of the single sampling chip;
[0070] Step S230, obtaining the current reading times and reading the data in a reading mode every set data reading cycle, wherein the reading mode includes unidirectional reading and bidirectional reading;
[0071] Step S240, if the reading mode is unidirectional reading, continue to periodically read the data in the first communication direction;
[0072] Step S250, if the reading mode is bidirectional reading, then performing a data reading operation on the single sampling chip in the first communication direction in the last cycle of the set data reading cycle;
[0073] Step S260, resetting all the single sampling chips, and performing an initialization process on the single sampling chips in the first communication direction to complete data collection;
[0074] Step S270, after executing the initialization process, periodically reading the data of the single sampling chip to complete the data collection.
[0075] The present invention provides a data collection method after problems occur in daisy chain communication during power-on and operation. This method can be completed without user perception, which improves the stability and robustness of daisy chain communication while also improving the accuracy of data collection and user experience.
[0076] The following describes in detail the various steps of the data acquisition method based on daisy chain communication of this embodiment.
[0077] In step S210, an initialization process is performed on a single sampling chip in the daisy chain in a first communication direction.
[0078] The normal working mode process of daisy chain communication is: after the BMS is powered on, first configure the chip code (CID) of all single sampling chips, then initialize the registers of all single sampling chips to complete the initialization.
[0079] In one embodiment, the initialization process includes:
[0080] The chip code of the single sampling chip is configured; and the register of the single sampling chip is initialized.
[0081] It should be noted that after configuring the chip code of the single sampling chip, it is necessary to detect whether the chip codes of all the single sampling chips are configured successfully. If all are configured successfully, the registers of the single sampling chip are initialized and it is determined whether the registers of the single sampling chip are initialized successfully.
[0082] In one embodiment, the method further comprises:
[0083] Acquire a first configuration number of a chip code for configuring the single sampling chip;
[0084] Comparing the first configuration number with a second set value;
[0085] When the first configuration times exceeds the second set value, a communication fault handling process is executed on the single sampling chip.
[0086] The second setting value may be 3 times, that is, when the register initialization of the single sampling chip fails, the chip code of the single sampling chip is reconfigured. If the first configuration fails, the second configuration is performed. If the second configuration fails, the register of the single sampling chip is configured for the third time. If the third configuration still fails, the communication fault handling process is performed on the single sampling chip. In this embodiment, the second setting value is not limited to 3 times. Those skilled in the art can flexibly set the second setting value according to actual needs, and no further limitation is made here.
[0087] Step S220, after executing the initialization process, periodically reading the data of the single sampling chip;
[0088] It should be noted that after successfully initializing the registers of all monomer sampling chips, it is necessary to collect the data of the monomer sampling chip once and determine whether the collection is successful. If successful, the subsequent periodic data collection task of reading the data of the monomer sampling chip is executed. If the collection fails, it indicates that the communication status of the monomer collection chip is in a faulty state. At this time, it is necessary to execute the communication fault handling process for the monomer sampling chip.
[0089] In one embodiment, the periodic reading of the data of the single sampling chip includes:
[0090] Configure the register of the single sampling chip; read the data of the single sampling chip.
[0091] The task of periodically reading the data of the single sampling chip is completed by continuously configuring the register of the single sampling chip and reading the data of the single sampling chip in sequence.
[0092] See also Figure 3 , Figure 3 The following is a schematic diagram of the communication failure handling process shown in an exemplary embodiment of the present application. Figure 3 The communication failure handling process includes:
[0093] Step S310, reconfiguring the register of the single sampling chip, and obtaining a second configuration number of the register of the single sampling chip;
[0094] Step S320, comparing the second configuration times with a third set value, and when the second configuration times exceeds the third set value, initializing a bidirectional daisy chain configuration;
[0095] Step S330, obtaining the chip code of the single sampling chip, and determining whether the chip code of the single sampling chip is normal. If the chip code is normal, periodically reading the data of the single sampling chip; if the chip code is abnormal, executing the initialization process;
[0096] Step S340, determining whether the initialization process is successfully executed, if successfully executed, periodically reading the data of the single sampling chip; if failed, re-executing the initialization process for the single sampling chip at least once.
[0097] Specifically, when the first configuration times exceeds the second set value, or the communication state of the single sampling chip is in a fault state, the following steps are performed:
[0098] The register of the monomer sampling chip is reconfigured at least once; when the configuration is completed, it is determined whether the configuration of the register of the monomer sampling chip is successful. If it is unsuccessful, it can be considered that a communication failure has occurred, and then the register of the monomer sampling chip is reconfigured. If it is successful, the data of the monomer sampling chip is periodically read, wherein the data of the monomer acquisition chip is the effective value of the monomer voltage information. However, if the number of times the register of the monomer sampling chip is reconfigured exceeds the third set value, the bidirectional daisy chain configuration is initialized, wherein the third set value can be 10 times, that is, if the number of times the register of the monomer sampling chip is reconfigured exceeds 10 times, the bidirectional daisy chain configuration is initialized. It should be noted that in this embodiment, the third set value is not limited to 10 times, and those skilled in the art can flexibly set the third set value according to actual needs, and no further limitation is made here.
[0099] After completing the initialization of the bidirectional daisy chain configuration, detect whether the current single sampling chip has a chip code. If there is a chip code, determine whether the chip codes of all single sampling chips are normal. If the chip codes are all normal, clear the number of communication failures, and then enter the process of periodically reading the data of the single sampling chip; if the identity is abnormal, re-initialize the counter by 1, then wake up the single sampling chip through the daisy chain, reset the single sampling chip by software, and then execute the initialization process for the single sampling chip. If the initialization is successful, set the initialization state to 1, clear the re-initialization counter, and clear the communication timeout fault counter; if the initialization is unsuccessful, exit this initialization and perform a new round of initialization operation; if the number of re-initializations exceeds the fourth set value, it is confirmed that the single sampling chip has a communication failure, and the data acquisition task of the single sampling chip is closed at this time. Among them, the fourth set value is 30, that is, if the initialization is still unsuccessful after 30 times, it is confirmed that the single sampling chip has a communication failure. It should be noted that in this embodiment, the fourth set value is not limited to 30 times, and those skilled in the art can flexibly set the fourth set value according to actual needs, and no further limitation is made here.
[0100] It should also be noted that within the time limit of 10 attempts of the communication fault counter, the single cell voltage information sent to the application layer maintains the valid value of the last acquisition; when the communication fault counter is greater than 10 times, the bidirectional daisy chain configuration is initialized. A total of 30 attempts can be made to initialize the bidirectional daisy chain configuration. If more than 30 attempts are made, the single cell sampling chip is confirmed to have a communication fault and the single cell sampling chip data acquisition task is closed. After reporting the communication fault, the application layer performs a 1-minute power limit process and lowers the high voltage after 1 minute to prevent the battery from overcharging or over-discharging; within the 30 reinitialization times, the single cell voltage information sent to the application layer maintains the valid value of the last acquisition.
[0101] Step S230, obtaining the current reading times and reading the data in a reading mode every set data reading cycle, wherein the reading mode includes unidirectional reading and bidirectional reading; Step S240, if the reading mode is unidirectional reading, continuing to periodically read the data in the first communication direction; Step S250, if the reading mode is bidirectional reading, performing a data reading operation on the monomer sampling chip in the first communication direction in the last cycle of the set data reading cycle; Step S260, resetting all monomer sampling chips, and performing an initialization process on the monomer sampling chip in the first communication direction; Step S270, after executing the initialization process, periodically reading the data of the monomer sampling chip to complete the data collection.
[0102] After entering the data flow of periodically reading the single sampling chip, every 20 cycles, it is determined whether the current reading mode is a bidirectional reading mode. If it is a unidirectional reading mode, no processing is performed and the data of the single sampling chip is continued to be periodically read;
[0103] If it is determined to be a bidirectional reading mode, the identity identification of the single sampling chip is read forward once every 20 cycles. If the identity identification of all single sampling chips can be read normally, all single sampling chips are bidirectionally reset and the unidirectional initialization process is entered;
[0104] After resetting all the monomer sampling chips in both directions, the identity identification of the monomer sampling chip is forward configured, and then the register of the monomer sampling chip is initialized, and the data of the monomer sampling chip is forward read once; if the data of the monomer sampling chip can be read normally, the data of the monomer sampling chip is periodically read to complete the data collection of the monomer sampling chip.
[0105] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0106] Figure 4is a block diagram of a data acquisition device based on daisy chain communication shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.
[0107] like Figure 4 As shown, the present application provides a data acquisition device based on daisy chain communication, the device comprising:
[0108] A first initialization module 410, configured to perform an initialization process on a single sampling chip in the daisy chain in a first communication direction;
[0109] A first data acquisition module 420, configured to periodically read data of the single sampling chip after executing the initialization process;
[0110] A reading mode acquisition module 430, for acquiring a reading mode for reading the data at a current reading number of times every set data reading cycle, wherein the reading mode includes unidirectional reading and bidirectional reading;
[0111] A second data acquisition module 440, configured to continue to periodically read the data in the first communication direction when the reading mode is unidirectional reading;
[0112] A third data acquisition module 450 is used to perform a data reading operation on the single sampling chip in the first communication direction in the last cycle of the set data reading cycle when the reading mode is bidirectional reading;
[0113] A second initialization module 460 is used to reset all the single sampling chips and perform an initialization process on the single sampling chips in the first communication direction;
[0114] The fourth data acquisition module 470 is used to periodically read the data of the single sampling chip after executing the initialization process to complete the data acquisition.
[0115] It should be noted that the data acquisition device based on daisy chain communication provided in the above embodiment and the data acquisition method based on daisy chain communication provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the data acquisition device based on daisy chain communication provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0116] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the data acquisition method based on daisy chain communication provided in the above-mentioned embodiments.
[0117] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Figure 5 As shown, the computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM), such as executing the method described in the above embodiment. In the RAM, various programs and data required for system operation are also stored. The CPU, ROM and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0119] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that a computer program read therefrom is installed into the storage part as needed.
[0120] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing the process. Figure 2A computer program for the method shown. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the system of the present application are executed.
[0121] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0122] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0124] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the data acquisition method based on daisy chain communication as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0125] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data acquisition method based on daisy chain communication provided in each of the above embodiments.
[0126] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A data acquisition method based on daisy chain communication, characterized in that: The method comprises: Performing an initialization process on a single sampling chip in the daisy chain in a first communication direction; After executing the initialization process, periodically reading the data of the single sampling chip; A reading method for reading the data by obtaining the current reading number every set data reading cycle, wherein the reading method includes unidirectional reading and bidirectional reading; If the reading mode is unidirectional reading, continue to periodically read the data in the first communication direction; If the reading mode is bidirectional reading, then in the last cycle of the set data reading cycle, an identity reading operation is performed on the single sampling chip in the first communication direction; Reset all single sampling chips, and perform an initialization process on the single sampling chips in the first communication direction; After the initialization process is executed, the data of the single sampling chip is periodically read to complete the data collection.
2. The data acquisition method based on daisy chain communication according to claim 1, characterized in that: Before resetting all the single sampling chips, a chip code of the single sampling chip is read once in the first communication direction, and when the reading operation is normal, all the single sampling chips are reset.
3. The data acquisition method based on daisy chain communication according to claim 1, characterized in that: The initialization process includes: Configure the chip code of the single sampling chip; Initialize the register of the single sampling chip.
4. The data acquisition method based on daisy chain communication according to claim 1, characterized in that: The periodically reading the data of the single sampling chip includes: Configuring registers of the single sampling chip; Read the data of the single sampling chip.
5. The data acquisition method based on daisy chain communication according to claim 2, characterized in that: The method further comprises: Acquire a first configuration number of the chip code of the single sampling chip or / and a communication state of the single sampling chip when a chip code of the single sampling chip is read once in a first communication direction before periodically reading data of the single sampling chip; If the first configuration times exceeds a second set value, or the communication state of the single sampling chip is in a fault state, a communication fault handling process is executed for the single sampling chip.
6. The data acquisition method based on daisy chain communication according to claim 5, characterized in that: The communication failure handling process includes: Reconfiguring the register of the single sampling chip at least once, and recording the configuration number of the at least one configuration as a second configuration number; comparing the second configuration number with a third set value, and initializing a bidirectional daisy chain configuration when the second configuration number exceeds the third set value; Obtaining the chip code of the single sampling chip, and determining whether the chip code of the single sampling chip is normal, if the chip code is normal, periodically reading the data of the single sampling chip; if the chip code is abnormal, executing the initialization process; It is determined whether the initialization process is successfully executed. If the execution is successful, the data of the single sampling chip is periodically read; if the execution fails, the initialization process is re-executed at least once on the single sampling chip.
7. The data acquisition method based on daisy chain communication according to claim 6, characterized in that: When the second configuration times do not exceed the third set value or the number of initialization processes performed on the monomer sampling chip during the communication fault handling process does not exceed the fourth set value, the voltage information of the monomer sampling chip is the effective value of the voltage collected last time.
8. A data acquisition device based on daisy chain communication, characterized in that: The device comprises: A first initialization module, used to perform an initialization process on a single sampling chip in the daisy chain in a first communication direction; A first data acquisition module, used for periodically reading the data of the single sampling chip after executing the initialization process; A reading mode acquisition module, used for acquiring a reading mode for reading the data at a current reading number every set data reading cycle, wherein the reading mode includes unidirectional reading and bidirectional reading; A second data acquisition module, used for continuing to periodically read the data in the first communication direction when the reading mode is unidirectional reading; A third data acquisition module, configured to perform a data reading operation on the single sampling chip in the first communication direction in the last cycle of a set data reading cycle when the reading mode is bidirectional reading; A second initialization module is used to reset all the single sampling chips and perform an initialization process on the single sampling chips in the first communication direction; The fourth data acquisition module is used to periodically read the data of the single sampling chip after executing the initialization process to complete the data acquisition.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the steps of the data acquisition method based on daisy chain communication as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the steps of the data acquisition method based on daisy chain communication as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Annular daisy chain communication fault processing method of BMS
CN112953773A
Multi-node architecture with daisy chain communication link configurable to operate in unidirectional and bidirectional modes
US20060020740A1