CN116347266A - Data transmission method and energy storage device - Google Patents

Data transmission method and energy storage device Download PDF

Info

Publication number
CN116347266A
CN116347266A CN202310289717.1A CN202310289717A CN116347266A CN 116347266 A CN116347266 A CN 116347266A CN 202310289717 A CN202310289717 A CN 202310289717A CN 116347266 A CN116347266 A CN 116347266A
Authority
CN
China
Prior art keywords
data
data packet
full
incremental
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310289717.1A
Other languages
Chinese (zh)
Inventor
赵命华
吴东
陈熙
王雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ecoflow Technology Ltd
Original Assignee
Ecoflow Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ecoflow Technology Ltd filed Critical Ecoflow Technology Ltd
Priority to CN202310289717.1A priority Critical patent/CN116347266A/en
Publication of CN116347266A publication Critical patent/CN116347266A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2209/00Arrangements in telecontrol or telemetry systems
    • H04Q2209/80Arrangements in the sub-station, i.e. sensing device
    • H04Q2209/82Arrangements in the sub-station, i.e. sensing device where the sensing device takes the initiative of sending data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The application provides a data transmission method and energy storage equipment. The data transmission method comprises the following steps: after sending the full-quantity data packet to the host, comparing the full-quantity data packet in the current detection period with the historical full-quantity data packet and generating an incremental data packet; the full data packet comprises the acquired data received in the current detection period; the collected data is sent in each detection period after being electrified by the data collection unit; sending the incremental data packet to a host; and when a full data request sent by the host is received, sending the full data packet in the current detection period to the host, wherein the full data request is sent by the host when the incremental data packet is not received by the host beyond a first preset duration. The data transmission method provided by the application can improve the synchronism and the integrity in the data transmission process and simultaneously reduce the network data flow.

Description

Data transmission method and energy storage device
Technical Field
The present disclosure relates to the field of data transmission, and in particular, to a data transmission method and an energy storage device.
Background
In the field of data acquisition and synchronization, when the acquired data content and data structure are relatively fixed, in order to save network data traffic, incremental data transmission methods are generally adopted. In this way, when the network fluctuates, a problem of data non-synchronization due to incremental data packet loss may occur.
In order to solve the problem, the related art actively sends a data request packet to the terminal from the cloud, each request packet has a corresponding identifier, and after receiving the request packet from the cloud, the terminal sends corresponding incremental data to the cloud, and stores the incremental data and the corresponding identifier locally. When the incremental data is lost, namely the cloud end does not receive the response data corresponding to the identifier of the request packet, the cloud end sends the data request packet to the terminal again by using the same identifier. After receiving the data request packet, the terminal firstly judges whether the identifier on the data request packet is a history identifier. If the identifier on the data request packet is a history identifier, the terminal sends history incremental data corresponding to the identifier to the cloud. If the identifier on the data request packet is not the history identifier, the terminal sends new incremental data to the cloud. However, in this way, on one hand, the terminal needs to store all the history incremental data and the history identifier, and when receiving the data request packet of the cloud, the terminal traverses and inquires the history identifier data, which definitely occupies the storage resources in the terminal, reduces the data transmission speed, and increases the possibility of data transmission errors; on the other hand, the cloud end consumes more network data traffic because the cloud end needs to send a data request packet before acquiring the incremental data.
Disclosure of Invention
In order to solve the above problems, the present application provides a data transmission method and an energy storage device, which can reduce data traffic and probability of data transmission errors.
The first aspect of the present application provides a data transmission method applied to a slave, and the slave establishes a communication connection with a host. The data transmission method comprises the following steps: after sending the full-quantity data packet to the host, comparing the full-quantity data packet in the current detection period with the historical full-quantity data packet and generating an incremental data packet; the full data packet comprises the acquired data received in the current detection period; the collected data is sent in each detection period after being electrified by the data collection unit; sending the incremental data packet to a host; and when a full data request sent by the host is received, sending the full data packet in the current detection period to the host, wherein the full data request is sent by the host when the incremental data packet is not received by the host beyond a first preset duration.
In one embodiment, comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet includes: receiving the collected data sent by each data collection unit, and combining all the collected data to form a full data packet; comparing the currently received full data packet with the historical full data packet of the previous detection period to determine incremental data; and generating an incremental data packet according to the incremental data.
In one embodiment, comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet further comprises: and forming an incremental data packet by the determined incremental data marking sequence codes, wherein a plurality of sequence codes generated in different detection periods accord with a preset rule, and the sequence codes are used for identifying the incremental data packets in different detection periods.
In one embodiment, when the number of data acquisition units is multiple, comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet includes: receiving collected data sent by a data collection unit as a full data packet of the data collection unit; comparing the current full data packet of the data acquisition unit with the historical full data packet of the previous detection period to determine incremental data of the data acquisition unit; and generating an incremental data packet corresponding to the data acquisition unit according to the incremental data of the data acquisition unit.
In one embodiment, comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet further comprises: marking the identification codes and the sequence codes of the incremental data of the data acquisition units to form an incremental data packet of the data acquisition units, wherein the identification codes of the incremental data packets generated by the same data acquisition unit are the same, and the sequence codes of the incremental data packets of different detection periods of the same data acquisition unit accord with a preset rule; the sequence code is used for identifying the incremental data packets of different detection periods, and the identification code is used for identifying the incremental data packets of different data acquisition units.
In one embodiment, the data transmission method further includes: storing the current full data packet and clearing the full data packet of the last detection period.
In an embodiment, the data transmission method further includes: when the acquired data is not received within a second preset time interval from the last time of receiving the acquired data, determining that the incremental data is empty; and generating an increment data packet with the payload being empty and sending the increment data packet to the host.
The second aspect of the present application further provides a data transmission method applied to a host, including: after receiving the full data packet sent by the slave at any moment, entering an incremental receiving state; in an incremental receiving state, receiving an incremental data packet sent by a slave machine, and when the incremental data packet is not received beyond a first preset duration, sending a full data request to the slave machine and entering a full receiving state; in the full-amount reception state, after receiving the full-amount packet transmitted from the slave, the system enters the incremental reception state.
In one embodiment, when the incremental data packet is further marked with a sequence code, the data transmission method further includes: acquiring a sequence code on each incremental data packet; and when the sequence codes on the received adjacent two incremental data packets do not meet the preset rule, sending a full-quantity data request to the slave machine, and entering a full-quantity receiving state.
The third aspect of the present application also provides an energy storage device, and the energy storage device acts as a slave to establish a communication connection with a host. The energy storage device comprises a battery pack, a processor, a memory, a plurality of functional modules and corresponding data acquisition units. Each data acquisition unit is used for acquiring working data of the corresponding functional module to generate acquisition data. The data acquisition unit is in communication with the processor. The memory is configured to store one or more programs that, when executed by the processor, cause the energy storage device to implement a data transmission method as described in any of the above for use with a slave.
The fourth aspect of the present application also provides an electronic device, which is in communication connection with an energy storage device as a host. The electronic device includes a memory and a processor. The memory is for storing one or more programs that, when executed by the processor, cause the electronic device to implement a data transmission method as described in any of the above as applied to a host.
According to the data transmission method, on one hand, after the full-quantity data packet is sent to the host for the first time, the slave actively sends the incremental data packet, so that the slave can actively send the incremental data packet to the host without the need of the host to send an incremental data request, and the data flow is reduced while the instant synchronization of the data is realized. On the other hand, after the full-volume data packet is sent to the whole host for the first time, when the slave receives the full-volume data request of the host, the slave sends the full-volume data packet at the current moment to the host, so that the integrity of data in the data transmission process of the slave and the host can be ensured, and the possibility of data transmission errors is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
fig. 1 is a schematic diagram of an implementation environment of a data transmission method according to an embodiment of the present application.
Fig. 2 is a flowchart of a data transmission method applied to a slave according to an embodiment of the present application.
Fig. 3 is a schematic diagram illustrating the substeps of step S210 in an embodiment of the present application.
Fig. 4 is a schematic diagram illustrating the substeps of step S210 in another embodiment of the present application.
Fig. 5 is a flowchart of a data transmission method applied to a host according to an embodiment of the present application.
Fig. 6 is a functional block diagram of an energy storage device and a functional block diagram of an electronic device according to an embodiment of the present application.
Description of the main reference signs
10- slaves 110, 210, 410, 510-processor 20-master
310. 420 data acquisition unit 40 energy storage device 430 functional modules 440, 520 memory
450-Battery pack 4501-cell
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments.
It is noted that when one component is considered to be "connected" to another component, it may be directly connected to the other component or intervening components may also be present. When an element is referred to as being "disposed" on another element, it can be directly on the other element or intervening elements may also be present. The terms "top," "bottom," "upper," "lower," "left," "right," "front," "rear," and the like are used herein for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
Reference to "a plurality" in this application means two or more than two. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., a and/or B may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
In the field of data acquisition and synchronization, when the acquired data content and data structure are relatively fixed, in order to save network data traffic, incremental data transmission methods are generally adopted. In this way, when the network fluctuates, a problem of data non-synchronization due to incremental data packet loss may occur.
In order to solve the problem, the related art actively sends a data request packet to the terminal from the cloud, each request packet has a corresponding identifier, and after receiving the request packet from the cloud, the terminal sends corresponding incremental data to the cloud, and stores the incremental data and the corresponding identifier locally. When the incremental data is lost, namely the cloud end does not receive the response data corresponding to the identifier of the request packet, the cloud end sends the data request packet to the terminal again by using the same identifier. After receiving the data request packet, the terminal firstly judges whether the identifier on the data request packet is a history identifier. If the identifier on the data request packet is a history identifier, the terminal sends history incremental data corresponding to the identifier to the cloud. If the identifier on the data request packet is not the history identifier, the terminal sends new incremental data to the cloud. However, in this way, on one hand, the terminal needs to store all the history incremental data and the history identifier, and when receiving the data request packet of the cloud, the terminal traverses and inquires the history identifier data, which definitely occupies the storage resources in the terminal, reduces the data transmission speed, and increases the possibility of data transmission errors; on the other hand, the cloud end consumes more network traffic because the cloud end needs to send a data request packet before acquiring the incremental data.
Based on the above, the application provides a data transmission method, an energy storage device, an apparatus, an electronic device and a computer readable storage medium, so as to reduce data traffic and data transmission error probability.
Referring to fig. 1, fig. 1 is a schematic view of an implementation environment of a data transmission method according to an embodiment of the present application. The implementation environment includes a slave 10 and a master 20. The slave 10 and the master 20 establish a wired or wireless communication connection in advance. The slave is configured to generate a full data packet or an incremental data packet according to the received collected data, and send the full data packet or the incremental data packet to the host 20.
The slave 10 includes a processor 110 and the master 20 includes a processor 210. The processor 110 is communicatively connected (i.e., includes a wired connection and a wireless connection) to a plurality of data acquisition units 310, and each data acquisition unit 310 is configured to acquire acquisition data and transmit the acquired acquisition data to the processor 110. The processor 110 is configured to receive, process, and send the collected data to the host 20 to generate incremental data packets or full data packets. The processor 210 in the master 20 determines whether a data packet loss occurs according to the received incremental data packet, and when the processor 210 confirms that the data packet loss occurs, transmits a full request to the slave 10. It should be appreciated that, in some embodiments, after the host 20 receives the incremental data packet or the full data packet, the host may also issue corresponding data or control instructions to the slave 10, which is not described herein.
It is appreciated that in some embodiments, the processor 110 and the data acquisition units 310 are located on the same electronic device. And the data acquisition unit 310 is used for acquiring the working data of different modules on the electronic device to generate acquisition data, and transmitting the acquisition data to the processor 110. As such, the processor 110 transmits incremental data packets or full data packets generated from the collected data to the host 20. Specifically, the slave 10 may be an energy storage device, a self-moving device, or other device capable of operational data collection.
In other embodiments, the slave 10 may be a first electronic device in a communication system. The communication system further comprises a number of second electronic devices. The first electronic equipment is a host in the communication system, and the second electronic equipment is a slave in the communication system. And the processor 110 is disposed on the first electronic device. The data collection units 120 are respectively disposed on the first electronic device and the second electronic devices. In this way, the plurality of data collection units 120 collect the working data of the first electronic device and the plurality of second electronic devices respectively, so as to generate a plurality of sets of collected data and send the sets of collected data to the processor 110. In particular, the communication system may be a communication system consisting of several electronic devices, for example a communication system consisting of several energy storage devices. The communication system may also be an intelligent home system composed of energy storage devices, refrigerators, air conditioners, televisions and other electronic devices, which is not limited in this application.
It is understood that the host 20 may be a device that supports data reception, such as an energy storage device, a smart phone, a car computer, a tablet computer, a notebook computer, or a wearable device. The host 20 may be a server, for example, a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing a cloud service, a cloud database, cloud computing, cloud functions, cloud storage, a network service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network ), and basic cloud computing service such as big data and an artificial intelligence platform, which are not limited herein.
Understandably, the slave 10 may communicate in parallel by serial communication means in wired communication, such as a controller area network (Controller Area Network, CAN) bus; or at least one of 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), 5G (fifth generation mobile information technology), wi-Fi, bluetooth, etc. in the wireless communication, communicates with the data acquisition unit 310 and the host 20, which is not limited in this application.
Referring to fig. 2, fig. 2 is a flow chart of a data transmission method according to an embodiment of the present application. The data transmission method is applied to the slave 10 and can be executed by the processor 110 on the slave 10. The data transmission method comprises the following steps:
step S210: after sending the full-quantity data packet to the host, comparing the full-quantity data packet in the current detection period with the historical full-quantity data packet and generating an incremental data packet; the full data packet comprises the acquired data received in the current detection period; the collected data is sent in each detection period after being electrified by the data collection unit.
Understandably, after the data acquisition unit is powered on, the data acquisition unit acquires working data of the correspondingly connected device to be detected, so as to generate a heartbeat packet comprising the acquired data. The data acquisition unit also sends acquired data to the processor in a manner of reporting the heartbeat packet.
The detection period refers to the time interval of reporting the heartbeat packet by all the data acquisition units in two adjacent rounds. That is, all data acquisition units connected with the processor of the slave machine finish reporting the heartbeat packet in each detection period. For example, when a serial communication mode is adopted between the processor of the slave and the data acquisition units, all the data acquisition units report heartbeat packets in sequence in the same detection period; when the parallel communication mode is adopted between the processor of the slave machine and the data acquisition units, all the data acquisition units can synchronously report the heartbeat packet in the same detection period. Understandably, the duration of the detection period can be adjusted according to actual requirements.
And the processor of the slave generates a full data packet and an incremental data packet according to the received acquisition data. The slave also includes a memory, and the historical full data packet can be cached in a preset area in the memory. The historical full data packet is generated in the last detection period by the processor. When the processor of the slave receives the acquired data in the current detection period, the acquired data is compared with the historical full data packet in the memory to obtain new data, and an incremental data packet is generated according to the new data.
The processor of the slave also generates and stores the full data packet according to the acquired data received in the current detection period, and clears the full data packet generated in the last detection period. It can be understood that when the slave machine and the data acquisition unit are just powered on, the historical full data packet can be the full data packet stored when the slave machine is powered on last time; the historical full data packet may also be a data packet with a null payload.
It is understood that the acquired data generated by the different data acquisition units may be the same type (or the same format) of data, or may be different types (or different formats) of acquired data. For example, the collected data may be resource occupation data, CPU usage data, or memory usage data; in other embodiments, the collected data may also be data for determining that a communication connection exists between the electronic device and the receiving device in the event that there is no change in data between the front and rear detection periods; in other embodiments, the collected data may also be a battery data type or a signal data type, which generally transmits data with higher frequency when the electronic device is in an idle state or an operating state; in other embodiments, the collected data may also be data that varies between the previous and subsequent detection periods, such as percentage change in remaining battery power, change in status of the positioning signal, etc.
Understandably, prior to performing step S210, the slave 10 has established a communication connection with the master 20. Thus, after the slave 10 establishes a communication connection with the master 20, the slave can send data to the master, and the slave 10 first sends a full amount of data packets to the master.
Step S220: and sending the incremental data packet to the host.
In the present application, after receiving the full data packet, the host enters the incremental receiving state. In step S220, after the slave sends the full data packet, the slave actively sends the incremental data packet to the host without the host sending the incremental data request in advance. In some embodiments, the slave may periodically send incremental data packets to the master. And when no new data is added in comparison with the historical full-amount data packet according to the acquired data reported by the data acquisition unit, sending an increment data packet with an empty payload to the host.
Step S230: and when a full data request sent by the host is received, sending the full data packet in the current detection period to the host, wherein the full data request is sent by the host when the incremental data packet is not received by the host beyond a first preset duration.
It will be appreciated that in some embodiments, when the host does not receive the incremental data packet beyond the first preset duration, it may be that a network anomaly or other error occurs, resulting in a packet loss, and at this time, the host sends a full data request to the slave and switches to the full reception state. It will be appreciated that after the host enters the full reception state, reception of the incremental data packets is suspended, but the full data packets may be received.
After receiving the full data request, the slave stops sending the incremental data packet in the current detection period, and generates the full data packet according to the acquired data received in the current detection period, so as to send the full data packet to the host. After receiving the full data packet, the host enters the incremental receiving state again. It will be appreciated that after entering the incremental receive state, the host pauses the receipt of the full amount of packets, but may receive the incremental packets.
And after the slave machine sends the full data packet again, the slave machine continues to send the increment data packet in the next adjacent detection period to the master machine. In this way, even if the slave device loses data packets during the data transmission process, the data between the slave device and the master device can be synchronized again by executing step S230.
In summary, according to the data transmission method provided by the application, on one hand, after a full-amount data packet is sent to a host for the first time, the slave actively sends the incremental data packet without the need of the host to send an incremental data request, and under normal conditions, only the slave performs unidirectional communication without the need of the slave to frequently send the full-amount data packet, so that the data flow can be greatly reduced while the data synchronization between the host and the slave is realized; on the other hand, when the slave machine receives the full data request sent by the host machine, network abnormality can be quickly identified, and the full data packet in the current detection period is sent to the host machine, so that the data synchronization between the host machine and the slave machine is ensured to be instant, the data integrity in the data transmission process of the slave machine and the host machine is improved, and the probability of data transmission errors is reduced.
With continued reference to fig. 3, in some embodiments, step S210 includes:
step S310: and receiving the collected data sent by each data collection unit, and combining all the collected data to form a full data packet.
In step S310, the processor of the slave receives the collected data sent by each data collection unit in the same detection period, and combines and packages all the collected data into a full data packet. In some embodiments, the packed full data packet is also marked with a full data tag. Thus, when the slave sends the full data packet to the host, the host can confirm that the received data packet is the full data packet according to the full data flag.
Step S320: the currently received full data packet is compared with the historical full data packet of the previous detection period to determine incremental data.
It is understood that the historical full data packet is the full data packet formed by combining and packaging all collected data received by the processor of the slave in the last detection period. The incremental data is acquired data or updated acquired data newly acquired by each data acquisition unit in the current detection period.
Step S330: and generating an incremental data packet according to the incremental data.
In step S330, the processor of the slave performs a packing process on the incremental data to generate an incremental data packet. Correspondingly, the incremental data packet is also marked with an incremental data tag. Thus, when the slave machine transmits the incremental data packet to the host machine, the host machine can confirm that the received data packet is the incremental data packet according to the incremental data mark.
Thus, by executing steps S310 to S330, the slave does not need to store each incremental data packet and does not need to occupy excessive memory space. Moreover, the slave can uniformly package the incremental data in each detection period into an incremental data packet and send the incremental data packet to the host, so that the network data flow is further saved.
In some embodiments, step S210 further comprises:
and forming an incremental data packet for the determined incremental data marking sequence codes, wherein a plurality of sequence codes generated in different detection periods accord with a preset rule. The sequence code is used to identify incremental data packets of different detection periods. That is, the sequence code is a sequence identifier, and the sequence identifier is used to indicate the sequence between incremental data packets generated in different detection periods.
In some embodiments, the slaves may use positive integers as the order identifier, with the order of the sequence code being the earlier the smaller the number. Thus, the preset rule may be a sequence code marked in the incremental data packet generated in the current detection period, and 1 is added to the value of the sequence code marked in the incremental data packet generated in the previous detection period. In some embodiments, the slaves may also use other ordered character sets as sequential identifications, such as english letters, or roman characters, etc.
It is to be appreciated that the preset rule may also be a deformation based on an ordered character set, for example, in some embodiments, the preset rule may also be s=t×k+p, where S is the sequence code of the current detection period, T is the sequence code of the last detection period, and K and P may be preset parameters. The present application does not limit the sequence identifier and the preset rule.
Understandably, the host computer may calculate the verification sequence code in advance based on a preset rule. And when the host receives the incremental data packet, whether the verification sequence code of the current detection period is consistent with the sequence code on the received incremental data packet can be judged. When the host judges that the verification sequence code is consistent with the sequence code on the received incremental data packet, the host judges that no data packet loss occurs in the data transmission process; when the host judges that the verification sequence code is inconsistent with the sequence code on the received incremental data packet, the host judges that the data packet is lost in the data transmission process, switches from the incremental receiving state to the full-quantity receiving state, and sends a full-quantity data request to the slave.
Further, when the slave receives the full data request, the slave clears the sequence code of the current increment data packet. And after the slave machine sends the full data packet again, marking the sequence code by the increment data packet generated in each detection period according to a preset rule.
It can be understood that the sequence code is marked on the incremental data packet, so that the host can further conveniently judge whether the data packet loss occurs, and the synchronization and the integrity of the data transmission between the slave and the host are guaranteed.
With continued reference to fig. 4, in other embodiments, when the data acquisition units are plural, step S210 may include:
step S410: and receiving the acquired data sent by the data acquisition unit as a full data packet of the data acquisition unit.
In this embodiment, the full data packet is the collected data received by the corresponding data collection unit in the current detection period. And the full data packet is also marked with a full data tag. Each full data packet is also marked with a marking code for marking the full data packet of the different data acquisition units. Thus, after the slave machine establishes communication connection with the host machine and when the slave machine receives the full data request, the slave machine transmits the full data packet corresponding to each data acquisition unit to the host machine. The host can confirm the corresponding full data package of the data acquisition unit according to the full data mark and the mark code on the full data package.
Step S420: comparing the current full data packet of the data acquisition unit with the historical full data packet at the previous moment to determine the incremental data of the data acquisition unit.
In step S420, the historical full data packet is the collected data received by the corresponding data collection unit in the last detection period. The incremental data is acquired data or updated acquired data newly acquired by the corresponding data acquisition unit in the current detection period.
Step S430: and generating an incremental data packet corresponding to the data acquisition unit according to the incremental data of the data acquisition unit.
In step S430, the processor of the slave performs a packing process on the incremental data corresponding to each data unit to generate an incremental data packet. Correspondingly, the incremental data packet in step S430 is also marked with an incremental data flag. Thus, when the slave machine transmits the incremental data packet to the host machine, the host machine can confirm that the received data packet is the incremental data packet according to the incremental data mark.
Thus, by executing steps S410 to S430, the slave does not need to store each incremental data packet, does not need to occupy excessive memory space, and can package the incremental data acquired by the corresponding data acquisition unit into incremental data packets respectively in each detection period and send the incremental data packets to the host. Therefore, the host can confirm the working condition of the device to be detected correspondingly connected with the data acquisition unit according to the received incremental data packet, and can facilitate the follow-up implementation of more accurate control or maintenance of the device to be detected.
In some embodiments, step S210 further comprises:
the incremental data of the data acquisition unit is marked with an identification code and a sequence code to form an incremental data packet of the data acquisition unit. The identification codes of the incremental data packets generated by the same data acquisition unit are the same, and the sequence codes of the incremental data packets at different moments of the same data acquisition unit accord with a preset rule. It is understood that the sequence code is used to identify incremental data packets at different times and the identification code is used to identify incremental data packets for different data acquisition units.
It is understood that the sequence code in this embodiment and the sequence code in the previous embodiment may satisfy the same predetermined rule, and will not be described herein again.
Likewise, when the slave receives the full data request, the slave clears the sequence code of the current incremental data packet. And after the slave machine sends the full data packet again, marking the sequence code by the increment data packet generated in each detection period according to a preset rule.
It is understood that the sequence code, the tag code, the identification code, the full data tag, the incremental data tag, etc. may be integer data including a predetermined number of bits on the corresponding data packet. It is understood that in some embodiments, the tag code in step S410 may also be replaced with an identification code.
It can be understood that the sequence code and the identification code are marked on the incremental data packet corresponding to the data acquisition unit, so that on one hand, the host can conveniently judge whether the data packet loss occurs or not, and the synchronization and the integrity of the data transmission between the slave and the host are ensured; on the other hand, the host computer can conveniently confirm the working condition of the device to be detected, which is connected with each data acquisition unit, and the independent control of each device to be detected is facilitated.
In some embodiments, step S210 further comprises:
when the acquired data is not received in the second preset time period, determining that the incremental data is empty;
and generating an increment data packet with the payload being empty and sending the increment data packet to the host.
The second preset time period is smaller than the first preset time period. It will be appreciated that under normal conditions, the data acquisition unit periodically reports heartbeat packets to the processor of the slave. Therefore, when the processor of the slave machine does not receive the acquired data within a second preset time interval from the last time of receiving the acquired data, the processor of the slave machine may have errors in the corresponding data acquisition unit and/or the device to be detected connected with the data acquisition unit. In this manner, the processor determines that the delta data is null and generates delta data packets with null payloads for transmission to the host to preferentially ensure proper communication with the host. In some embodiments, the slave may also send out a corresponding error alert message to repair errors of the data acquisition unit and its corresponding device to be detected.
Understandably, when the slave receives the collected data reported by the data collecting unit again, the slave generates again an incremental data packet with the incremental data and sends the incremental data packet to the master. Thus, by executing the steps, when the data acquisition unit is in error, the steps of disconnecting and reestablishing the communication connection between the slave and the host can be reduced.
It is understood that the above-mentioned steps are applicable to the data transmission methods as mentioned in the embodiments of fig. 3 and 4.
Still referring to fig. 5, another embodiment of the present application further provides a data transmission method, which is applicable to a host and executed by a processor of the host. The data transmission method comprises the following steps:
step S510: and after receiving the full data packet sent by the slave at any time, entering an incremental receiving state.
After entering the incremental receiving state, the host pauses receiving the full data packet, but can receive the incremental data packet.
Step S520: and in the incremental receiving state, receiving an incremental data packet sent by the slave machine, and when the incremental data packet is not received beyond a first preset time period, sending a full-quantity data request to the slave machine, and entering a full-quantity receiving state.
It will be appreciated that after the host enters the full reception state, reception of the incremental data packets is suspended, but the full data packets may be received.
Step S530: in the full-amount reception state, after receiving the full-amount packet transmitted from the slave, the system enters the incremental reception state.
In some embodiments, when the incremental data packet is marked with a sequence code, the data transmission method further comprises:
acquiring a sequence code on each incremental data packet;
and when the sequence codes on the received adjacent two incremental data packets do not meet the preset rule, sending a full-quantity data request to the slave machine, and entering a full-quantity receiving state.
It will be appreciated that, for the specific operation of the host, please refer to the specific parts of the host above, and the detailed description is omitted here.
With continued reference to fig. 6, an embodiment of the present application further provides an energy storage device 40 and an electronic device 50. The energy storage device 40 serves as a slave, the electronic device 50 serves as a master, and the energy storage device 40 and the electronic device 50 establish a communication connection for transmitting data and/or control instructions to each other.
Specifically, the energy storage device 40 includes a processor 410, a battery pack 450, a memory 440, a plurality of functional modules 430, and a corresponding data acquisition unit 420. Each data acquisition unit 420 is configured to acquire working data of a corresponding functional module 430 to generate acquisition data. The data acquisition unit 420 is communicatively coupled to the processor 410. The memory 440 is configured to store one or more programs that, when executed by the processor 410, cause the energy storage device 40 to implement a data transmission method as described in any of the above for use with a slave. Please refer to the above for specific execution, and detailed description is omitted here.
In some embodiments, the plurality of functional modules 430 may include a battery management system (Battery Management System, BMS) module, a power conversion module, and the like. As such, the collected data may include, but is not limited to, battery voltage, battery current, state of charge-discharge switching tube and battery output power, input and output of power conversion mode, etc.
It is appreciated that the battery pack 450 includes at least one cell 4501. And the battery pack 450 may be used to power electronics within the energy storage device 40, for example, the battery pack 450 may power the processor 410, the number of functional modules 430, and the like. In some embodiments, energy storage device 40 may receive power to charge battery pack 450, and energy storage device 40 may also power external powered devices through battery pack 450.
The electronic device 50 includes a processor 510 and a memory 520. The memory 520 is configured to store one or more programs that, when executed by the processor 510, cause the electronic device 50 to implement a data transmission method as described in any of the above for use with a host. Please refer to the above for specific execution, and detailed description is omitted here.
It should be understood that the electronic device 50 may be an electronic device supporting data reception, or may be an independent physical server, a server cluster formed by a plurality of physical servers, or a distributed system, or may be a cloud server, which is not limited in this application. When the electronic device 50 is a cloud server, the energy storage device 40 is beneficial to realizing remote control of the energy storage device 40 or facilitating maintenance of the energy storage device 40 by reporting the full data packet and the incremental data packet to the cloud server.
The present application also provides a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a data transmission method as in the above technical solutions. The computer readable medium may take the form of a portable compact disc read only memory (CD-ROM) and include program code that can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product described above may take the form of any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Furthermore, the above-described drawings are only schematic illustrations of processes included in the method according to the exemplary embodiment of the present invention, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
In addition, those of ordinary skill in the art will recognize that the above embodiments are presented for purposes of illustration only and are not intended to be limiting, and that suitable modifications and variations of the above embodiments are within the scope of the disclosure of the present application.

Claims (10)

1. A data transmission method applied to a slave, wherein the slave establishes a communication connection with a host, the data transmission method comprising:
after sending the full-volume data packet to the host, comparing the full-volume data packet in the current detection period with the historical full-volume data packet and generating an incremental data packet; wherein the full data packet comprises the acquired data received in the current detection period; the acquired data are sent in each detection period after being electrified by the data acquisition unit;
Sending the incremental data packet to the host;
and when a full-volume data request sent by the host is received, sending the full-volume data packet in the current detection period to the host, wherein the full-volume data request is sent by the host when the incremental data packet is not received by the host beyond a first preset duration.
2. The data transmission method of claim 1, wherein comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet comprises:
receiving the collected data sent by each data collection unit, and combining all the collected data to form a full data packet;
comparing the currently received full data packet with the historical full data packet of the last detection period to determine incremental data;
and generating the increment data packet according to the increment data.
3. The data transmission method of claim 2, wherein comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet further comprises:
and forming the incremental data packet by the determined incremental data marking sequence codes, wherein a plurality of sequence codes generated in different detection periods accord with a preset rule, and the sequence codes are used for identifying the incremental data packet in different detection periods.
4. The data transmission method of claim 1, wherein the data acquisition units are a plurality of; the comparing the full data packet in the current detection period with the historical full data packet and generating an incremental data packet comprises the following steps:
receiving the collected data sent by the data collection unit as the full data packet of the data collection unit;
comparing the current full-volume data packet of the data acquisition unit with the historical full-volume data packet of the last detection period to determine incremental data of the data acquisition unit;
and generating an incremental data packet corresponding to the data acquisition unit according to the incremental data of the data acquisition unit.
5. The data transmission method of claim 4, wherein comparing the full data packet in the current detection period with the historical full data packet and generating the incremental data packet further comprises:
marking an identification code and a sequence code for incremental data of the data acquisition units to form an incremental data packet of the data acquisition units, wherein the identification codes of the incremental data packets generated by the same data acquisition unit are the same, and the sequence codes of the incremental data packets of different detection periods of the same data acquisition unit accord with a preset rule; the sequence code is used for identifying the incremental data packets with different detection periods, and the identification code is used for identifying the incremental data packets of different data acquisition units.
6. The data transmission method according to any one of claims 2 to 5, wherein the method further comprises:
storing the current full data packet and clearing the full data packet of the last detection period.
7. The data transmission method according to any one of claims 1 to 5, characterized in that the data transmission method further comprises:
when the acquired data is not received in the second preset time period, determining that the incremental data is empty;
and generating the increment data packet with the empty payload and sending the increment data packet to the host.
8. A data transmission method applied to a host, wherein the host establishes a communication connection with a slave, the data transmission method comprising:
after receiving the full data packet sent by the slave at any moment, entering an incremental receiving state;
in the incremental receiving state, receiving an incremental data packet sent by the slave machine, and when the incremental data packet is not received in a first preset time period, sending a full data request to the slave machine, and entering a full receiving state;
and in the full-quantity receiving state, after receiving the full-quantity data packet sent by the slave, entering the incremental receiving state.
9. The data transmission method of claim 8, wherein the incremental data packets are marked with a sequence code, the method further comprising:
acquiring the sequence code on each incremental data packet;
and when the sequence codes on the two adjacent incremental data packets do not meet the preset rule, sending the full-quantity data request to the slave machine, and entering a full-quantity receiving state.
10. An energy storage device for use as a slave in establishing a communication connection with a host, the energy storage device comprising a battery pack, a processor, a memory, a plurality of functional modules, and corresponding data acquisition units, each data acquisition unit for acquiring operational data of a corresponding functional module to generate acquired data, the data acquisition units being in communication with the processor, the memory for storing one or more programs which when executed by the processor cause the energy storage device to implement the data transmission method of any one of claims 1 to 7.
CN202310289717.1A 2023-03-16 2023-03-16 Data transmission method and energy storage device Pending CN116347266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310289717.1A CN116347266A (en) 2023-03-16 2023-03-16 Data transmission method and energy storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310289717.1A CN116347266A (en) 2023-03-16 2023-03-16 Data transmission method and energy storage device

Publications (1)

Publication Number Publication Date
CN116347266A true CN116347266A (en) 2023-06-27

Family

ID=86894403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310289717.1A Pending CN116347266A (en) 2023-03-16 2023-03-16 Data transmission method and energy storage device

Country Status (1)

Country Link
CN (1) CN116347266A (en)

Similar Documents

Publication Publication Date Title
CN111818136B (en) Data processing method, device, electronic equipment and computer readable medium
EP4307634A1 (en) Feature engineering programming method and apparatus
CN110995859A (en) Intelligent transformer substation supporting platform system based on ubiquitous Internet of things
CN111478965A (en) Method, device and system for processing device shadow
CN110035446B (en) Heartbeat data sending method and device, electronic equipment and readable medium
CN106657397A (en) Internet of Vehicles based on MQTT protocol
CN115864661A (en) Remote monitoring method for operating data of power equipment
CN103457748A (en) Data transmission method, system and device
US9781010B2 (en) Managing remote devices
CN115001897A (en) Communication method and device, electronic equipment and automatic driving vehicle
CN106953809B (en) 485 time-sharing communication-based equipment resource acquisition method
CN111935310A (en) Data reporting system and data reporting method applied to terminal of Internet of things
EP3373608B1 (en) Method and apparatus for acquiring resources
US20220224995A1 (en) Method for reading fluid meters
CN113162942A (en) Method for forwarding self-adaptive protocol
CN108924207A (en) Terminal device and its system file update method, system and computer storage medium
Zheng et al. A Cloud-Edge Collaboration Framework for Power Internet of Things Based on 5G networks
CN109639545B (en) Lightweight bus arrangement method of multi-satellite measurement and control platform system
CN112463413A (en) Method and system for station terminal data interaction
CN110048865B (en) Bus data transmission method and device, electronic equipment and storage medium
CN116347266A (en) Data transmission method and energy storage device
CN107171915B (en) Communication protocol changing method and device
CN112637370B (en) Data processing method, device, equipment and storage medium
CN114679472A (en) Communication system, method, apparatus, storage medium, and electronic device
EP3038390B1 (en) Processing method and apparatus for signaling tracing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination