Data acquisition method, electronic equipment and photovoltaic power generation system

By storing the communication hop number of slave devices in the Internet of Things system and performing batch data acquisition based on this information, the problems of low data acquisition efficiency and high energy consumption in the prior art are solved, and more efficient data acquisition and energy consumption reduction are achieved.

CN120050220AActive Publication Date: 2025-05-27SUZHOU HEGUANG TONGYAO INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510268513.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-05-27
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

The existing IoT systems have low communication efficiency, long time consumption, and high slave energy consumption during data acquisition.

Method used

The master device stores the communication hop number of each slave device, traverses all communication hop numbers, and collects batch data for the slave devices corresponding to each communication hop number. During each set of data acquisition, the data acquisition downlink message is broadcast based on the current communication hop number broadcast, so that the slave device determines the sending time of the data acquisition uplink message based on the MAC address and the reporting interval time in the downlink message.

Benefits of technology

Improves the communication efficiency of data acquisition, reduces the overall acquisition time, and reduces the energy consumption of slave devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050220A_ABST
    Figure CN120050220A_ABST
Patent Text Reader

Abstract

The invention provides a data acquisition method, electronic equipment and a photovoltaic power generation system, and relates to the field of data acquisition. The communication hop count of each slave device is stored in the master device, the communication hop count represents the number of times that data acquisition uplink messages of the slave devices need to be forwarded to the master device, and the method comprises the steps that the master device traverses all the communication hop counts, a group of data acquisition is carried out on the slave devices corresponding to each communication hop count, and in the acquisition process of each group of data, each group of data is transmitted to the slave device; and at least broadcasting and sending a data acquisition downlink message once based on the current communication hop count, so that each slave device receiving the data acquisition downlink message determines whether a data acquisition uplink message of the slave device is sent or not and responds to the sending moment according to information carried in the downlink message. In this way, batch collection is carried out based on different communication hops, and compared with a traditional method that collection is carried out on the slave devices one by one through the maximum communication hops, communication efficiency is improved and energy consumption is reduced on the premise that communication reliability is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data collection, and in particular to a data collection method, electronic equipment and a photovoltaic power generation system. Background Art

[0002] Many current IoT systems involve data collection. The commonly used collection method is: the master device uses the maximum number of communication hops to actively send data collection downlink messages to all collected devices one by one. After each collected device receives its corresponding data request, it sends a data collection uplink message. However, the overall efficiency of this collection is low and time-consuming. Summary of the invention

[0003] The purpose of the present invention is to provide a data collection method, an electronic device and a photovoltaic power generation system to improve the communication efficiency of data collection, reduce the overall time of data collection, and reduce the energy consumption of the slave device.

[0004] The embodiments of the present invention can be implemented as follows:

[0005] In a first aspect, the present invention provides a data collection method, which is applied to a master device, wherein the master device is in communication connection with at least one slave device; the master device stores the communication hop count of each slave device, and the communication hop count of the slave device represents the number of forwarding times required for a data collection uplink message of the slave device to reach the master device; the method comprises:

[0006] Traverse all communication hops and collect a set of data from the slave device corresponding to each communication hop;

[0007] In each group of data collection process, the data collection downlink message is broadcast and sent at least once based on the current communication hop number, so that each slave device that receives the data collection downlink message can determine whether to send its own data collection uplink message and the response sending time according to the MAC address carried in the data collection downlink message and the reporting interval time.

[0008] Optionally, the communication hop count of each slave device is determined in the following manner:

[0009] Acquire a list to be updated, the list to be updated including the MAC address of each slave device for which the number of communication hops has not been determined;

[0010] The data acquisition downlink message is broadcasted and sent at least once based on the to-be-updated list, so as to determine the communication hop number of each slave device according to the data acquisition uplink message responded by each slave device.

[0011] Optionally, the step of broadcasting and sending the data acquisition downlink message at least once based on the to-be-updated list to determine the number of communication hops of each slave device according to the data acquisition uplink message responded by each slave device includes:

[0012] Initialize the current communication hop count of the master device to a first preset value;

[0013] According to the list to be updated, the current communication hop count of the master device and the corresponding reporting interval and the preset collection period, the data collection downlink message is broadcasted at least once, and after each broadcast, when a data collection uplink message in response to any slave device is received, its communication hop count is determined, and the list to be updated is updated;

[0014] If it is not determined that the number of slave devices with the communication hop count is not 0 and the current communication hop count of the master device does not meet the preset stop condition, updating the current communication hop count of the master device;

[0015] Continue to execute the step of broadcasting and sending the data acquisition downlink message at least once according to the list to be updated, the current communication hop number of the master device and the corresponding reporting interval time and the preset collection period, until the number of slave devices whose communication hop number is not determined is 0 or the current communication hop number of the master device meets the preset stop condition, and obtain the communication hop number of each slave device.

[0016] Optionally, the step of broadcasting and sending the data acquisition downlink message at least once according to the list to be updated, the current communication hop count of the master device and the preset acquisition cycle, and determining its communication hop count when receiving a data acquisition uplink message responded by any slave device after each broadcast, and updating the list to be updated includes:

[0017] According to the current communication hop count of the master device and its corresponding reporting interval time and the collection period, all MAC addresses in the to-be-updated list are grouped to obtain at least one to-be-updated sub-list; the to-be-updated sub-list includes at least one MAC address of a target to-be-updated slave device;

[0018] Take the first sublist to be updated as the target sublist to be updated;

[0019] Generate the data acquisition downlink message based on the target to-be-updated sublist, the current communication hop count of the master device and its corresponding reporting interval time, and broadcast and send the data acquisition downlink message, so that each slave device that receives the data acquisition downlink message determines whether to send its own data acquisition uplink message and the response sending time based on the data acquisition downlink message, wherein each target to-be-updated slave device responds to the master device with the data acquisition uplink message at the response sending time determined by itself;

[0020] When receiving a data acquisition uplink message responded by any of the target to-be-updated slave devices, determining the communication hop number of the target to-be-updated slave device based on the data acquisition uplink message, and deleting the MAC address of the target to-be-updated slave device from the to-be-updated list;

[0021] If the target sublist to be updated is not the last sublist to be updated, then after waiting for the collection cycle from the moment the data collection downlink message is broadcast, the next sublist to be updated is used as the new target sublist to be updated, and the steps of generating the data collection downlink message based on the target sublist to be updated, the current number of communication hops of the main device and its corresponding reporting interval time, and broadcasting the data collection downlink message are continued until the target sublist to be updated is the last sublist to be updated.

[0022] Optionally, the step of grouping all MAC addresses in the to-be-updated list according to the current communication hop count of the master device and its corresponding reporting interval and the collection period to obtain at least one to-be-updated sub-list includes:

[0023] Searching for the reporting interval time corresponding to the current communication hop count of the master device from a preset relationship mapping table; the relationship mapping table includes the reporting interval time corresponding to each of a plurality of different hop counts;

[0024] The result obtained by dividing the collection period by the reporting interval corresponding to the current communication hop number of the master device is rounded down to obtain the number of slave devices that can be updated this time;

[0025] Based on the number of slave devices that can be updated this time, all MAC addresses in the list to be updated are grouped to obtain at least one sub-list to be updated.

[0026] Optionally, the method further includes:

[0027] In each group of data collection process, after a period of time from the broadcast transmission, it is determined whether there is any unresponsive slave device in this broadcast transmission; the unresponsive slave device is a slave device in the list of target slave devices to be collected contained in the data collection downlink message sent by this broadcast, which fails to send the data collection uplink message to the master device within a period of time after the master device broadcasts and sends it; if so, the communication hop count of each unresponsive slave device is updated according to preset rules.

[0028] Optionally, the method further includes: in each group of data collection process, when a data collection uplink message is received, updating the communication hop count of the corresponding slave device according to information in the data collection uplink message.

[0029] Optionally, the step of updating the communication hop count of the corresponding slave device according to the information in the data acquisition uplink message includes:

[0030] Determine the number of forwarding times of the data collection uplink message according to the information carried in the data collection uplink message; judge whether the communication hop number of the corresponding slave device is consistent with the forwarding number; if not, modify the communication hop number of the corresponding slave device to the forwarding number.

[0031] Optionally, the step of traversing all communication hops and collecting a set of data from the slave device corresponding to each communication hop includes:

[0032] Initialize the current communication hop count of the master device to a second preset value;

[0033] Filter out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and perform a group of data collection on all the slave devices to be collected by broadcasting and sending the data collection downlink message at least once;

[0034] If the current communication hop number of the master device is not equal to the preset stop threshold, then after adding 1 to the current communication hop number of the master device, continue to execute the steps of screening out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and perform a group of data collection on all the slave devices to be collected by broadcasting the data collection downlink message at least once, until the current communication hop number of the master device is equal to the preset stop threshold.

[0035] Optionally, the step of screening out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and performing a group of data collection on all the slave devices to be collected by broadcasting and sending the data collection downlink message at least once, includes:

[0036] Filter out the MAC address of each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device from the MAC addresses of all slave devices, and obtain a list to be collected;

[0037] According to the to-be-collected list, the current communication hop count of the master device and its corresponding reporting interval time and the collection period, the data collection downlink message is broadcasted and sent at least once to obtain the data collection uplink message responded by each to-be-collected slave device.

[0038] Optionally, the step of broadcasting and sending the data acquisition downlink message at least once according to the list to be acquired, the current communication hop number of the master device and the acquisition cycle to obtain the data acquisition uplink message responded by each slave device to be acquired includes:

[0039] According to the current communication hop count of the master device and its corresponding reporting interval time and the collection period, all MAC addresses in the list to be collected are grouped to obtain at least one sub-list to be collected; the sub-list to be collected includes the MAC address of at least one target slave device to be collected;

[0040] Take the first list of items to be collected as the target list of items to be collected;

[0041] Generate the data acquisition downlink message based on the target to-be-collected sub-list, the current communication hop count of the master device and its corresponding reporting interval time, and broadcast and send the data acquisition downlink message, so that each slave device that receives the data acquisition downlink message determines whether to send and the response sending time based on the data acquisition downlink message, wherein each target to-be-collected slave device sends the data acquisition uplink message to the master device at the response sending time determined by itself;

[0042] When receiving a data acquisition uplink message responded by any of the target slave devices to be acquired, deleting the MAC address of the target slave device to be acquired from the list to be acquired;

[0043] If the target sub-list to be collected is not the last sub-list to be collected, then after waiting for the collection cycle from the moment when the data collection downlink message is broadcast, the next sub-list to be collected is used as the new target sub-list to be collected, and the steps of generating the data collection downlink message based on the target sub-list to be collected, the current communication hop number of the main device and its corresponding reporting interval time, and broadcasting and sending the data collection downlink message are continued until the target sub-list to be collected is the last sub-list to be collected.

[0044] Optionally, the step of grouping all MAC addresses in the to-be-collected list according to the current communication hop count of the master device and its corresponding reporting interval and the collection period to obtain at least one to-be-collected sub-list includes:

[0045] Searching for the reporting interval time corresponding to the current communication hop count of the master device from a preset relationship mapping table; the relationship mapping table includes the reporting interval time corresponding to each of a plurality of different hop counts;

[0046] The result obtained by dividing the collection period by the reporting interval corresponding to the current communication hop number of the master device is rounded down to obtain the number of slave devices that can be collected this time;

[0047] Based on the number of slave devices that can be collected this time, all MAC addresses in the list to be collected are grouped to obtain at least one sub-list to be collected.

[0048] In a second aspect, the present invention further provides a data acquisition method, which is applied to a slave device, wherein the slave device is communicatively connected to a master device; the method comprises:

[0049] When receiving the data acquisition downlink message broadcasted by the master device, it determines whether to send its own data acquisition uplink message and the time to send the response according to the MAC address and reporting interval carried in the data acquisition downlink message.

[0050] Optionally, the step of determining whether to send its own data collection uplink message and the response sending time according to the MAC address and reporting interval carried in the data collection downlink message includes:

[0051] When receiving the data collection downlink message, the response sending time analyzes the data collection downlink message to obtain the reporting interval time and the MAC address list;

[0052] If the MAC address list includes its own MAC address, it is determined that its own data collection uplink message needs to be sent;

[0053] The arrangement number of the own MAC address in the MAC address list is multiplied by the reporting interval to obtain the waiting time; wherein, the time after the waiting time from the moment of receiving the data collection downlink message is the response sending time;

[0054] The data collection uplink message is generated based on its own MAC address and reported data, and the data collection uplink message is sent to the master device at the response sending time.

[0055] In a third aspect, the present invention further provides an electronic device, comprising: a memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the data collection method as described in the first aspect or the second aspect.

[0056] In a fourth aspect, the present invention further provides a photovoltaic power generation system, comprising a master device and a plurality of slave devices communicatively connected to the master device, wherein the master device executes the data collection method as described in the first aspect, and the slave device executes the data collection method as described in the second aspect, so as to realize data collection of the master device from each slave device; the master device is a data concentrator in the photovoltaic power generation system, and the slave device is any one of an intelligent switch, an intelligent optimizer, and a photovoltaic component with communication function in the photovoltaic power generation system.

[0057] Compared with the prior art, the embodiment of the present invention provides a data collection method, an electronic device and a photovoltaic power generation system. The master device stores the communication hop count of each slave device. The communication hop count represents the number of forwarding times that the data collection uplink message of the slave device needs to go through to reach the master device. The method is as follows: the master device traverses all communication hop counts, and performs a group of data collection based on the slave device corresponding to each communication hop count. In each group of data collection process, the master device broadcasts and sends a data collection downlink message at least once based on the current communication hop count of the master device, so that each slave device that receives the data collection downlink message determines whether its own data collection uplink message is sent and the response sending time according to the information carried in the downlink message. In this way, batch collection is performed based on different communication hop counts. Compared with the traditional method of using the maximum communication hop count to collect data from slave devices one by one, the communication efficiency is improved and the energy consumption is reduced while ensuring reliable communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 One of the flow charts of a data collection method provided by an embodiment of the present invention.

[0060] Figure 2 The second flowchart of a data collection method provided by an embodiment of the present invention.

[0061] Figure 3 The third flowchart of a data collection method provided by an embodiment of the present invention.

[0062] Figure 4 A fourth flow chart of a data collection method provided in an embodiment of the present invention.

[0063] Figure 5 A fifth flow chart of a data collection method provided in an embodiment of the present invention.

[0064] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0066] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0068] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0069] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0070] Here, the key words or key terms involved in the present invention are first introduced:

[0071] 1. Flooding: A simple routing algorithm whose core idea is to copy and send received data packets to all possible connection paths until the data packets reach the destination. The main problem is that a large number of duplicate data packets will be generated, occupying channel resources and having low efficiency. In order to solve this problem, a parameter "remaining hop count" is generally added to the data packet. When a data packet is forwarded once by flooding, the "remaining hop count" is reduced by 1. When the "remaining hop count" is reduced to 0, it will no longer be forwarded.

[0072] 2. Common IoT systems consist of the following parts:

[0073] (1) Cloud platform: A platform that manages all devices in the system and the data they collect.

[0074] (2) Master device: collects data from slave devices and reports the collected data to the cloud platform.

[0075] (3) Slave equipment: In the field of photovoltaic power generation technology, it refers to intelligent switch, intelligent optimizer or photovoltaic module with communication function.

[0076] (4) Communication module: The communication module for sending and receiving messages between the concentrator and the slave device, which can be a wireless module or a power line carrier module;

[0077] In a photovoltaic power generation system, slave devices will collect parameters such as voltage, current, and temperature of photovoltaic modules in real time. The master device (usually a data concentrator) periodically and actively collects data from the slave devices, and uploads the data to the cloud platform after aggregation, thereby achieving refined management of photovoltaic power stations.

[0078] The present invention relates to an Internet of Things system, which includes a master device and a plurality of slave devices that are communicatively connected to the master device. Any slave device may be directly connected to the master device, or indirectly connected via at least one routing device and / or switching device. The master device stores the communication hop count of each slave device, and the communication hop count of the slave device represents the number of forwarding times that a data acquisition uplink message of the slave device needs to go through to reach the master device.

[0079] Please refer to Figure 1 , Figure 1 A flow chart of a data collection method provided by an embodiment of the present invention is provided. The method is applied to a master device in an Internet of Things system. The method comprises the following steps:

[0080] S300, traversing all communication hops, and collecting a set of data from the slave device corresponding to each communication hop;

[0081] S400. In each data collection process, a data collection downlink message is broadcast at least once based on the current communication hop count, so that each slave device that receives the data collection downlink message can determine whether to send its own data collection uplink message and the response sending time according to the MAC address carried in the downlink message and the reporting interval.

[0082] In this embodiment, the complete process of performing data collection on all slave devices corresponding to one communication hop number is a group of data collection processes, and the data collection downlink message may be broadcast more than once in the process.

[0083] The communication hop count in each data collection process is the hop count field in the data collection downlink message sent each time. The data collection uplink message responded by the slave device may include the data collected by the slave device, and the data collected by the slave device may include but is not limited to: voltage, current, temperature and other data.

[0084] In the data collection method provided by the embodiment of the present invention, the master device stores the communication hop count of each slave device, and the communication hop count represents the number of forwarding times that the data collection uplink message of the slave device needs to go through to reach the master device. The method is as follows: the master device traverses all communication hop counts, and performs a group of data collection based on the slave device corresponding to each communication hop count. In each group of data collection process, the master device broadcasts and sends a data collection downlink message at least once based on the current communication hop count of the master device, so that each slave device that receives the data collection downlink message determines whether its own data collection uplink message is sent and the response sending time according to the information carried in the downlink message. In this way, batch collection based on different communication hop counts improves communication efficiency and reduces energy consumption while ensuring reliable communication, compared with the traditional method of using the maximum communication hop count to collect data from slave devices one by one. Response sending time.

[0085] The following is an introduction to the process of determining the number of communication hops for each slave device.

[0086] Before the first operation of the IoT system, the master device has not yet stored the communication hop count of each slave device, and the communication hop count of each slave device needs to be determined during the first operation. For example, after the photovoltaic power generation system is installed and debugged, when it is started for the first time, the communication hop count of each slave device needs to be determined during the first round of data collection. The first round of data collection is the process of collecting data for all slave devices for the first time.

[0087] Optionally, before the above step S300, the data collection method may further include:

[0088] S100: Obtain a list to be updated.

[0089] In this embodiment, the list to be updated is used to store the MAC address of each slave device whose communication hop count is not determined. Initially, the communication hop count of each slave device is unknown, so the list to be updated includes the MAC address of each slave device in the Internet of Things system.

[0090] S200 . Broadcast and send a data collection downlink message at least once based on the to-be-updated list, so as to determine the number of communication hops of each slave device according to the data collection uplink message responded by each slave device.

[0091] Optional, see Figure 2 , the sub-steps of step S200 may include:

[0092] S210: Initialize the current communication hop count of the master device to a first preset value.

[0093] In this embodiment, the master device communication hop count is a hop count field required for the master device to encapsulate a message.

[0094] S220. According to the list to be updated, the current communication hop count of the master device and the corresponding reporting interval and the preset collection period, broadcast and send the data collection downlink message at least once, and after each broadcast, determine the communication hop count when receiving the data collection uplink message responded by any slave device, and update the list to be updated.

[0095] In this embodiment, according to the list to be updated, the current communication hop count of the master device, the corresponding reporting interval and the preset collection period, a data collection downlink message will be broadcasted at least once. Within a period of time after each broadcast (i.e., the collection period), if a data collection uplink message is received in response from any slave device, the communication hop count of the slave device can be determined and the MAC address of the slave device can be deleted from the list to be updated.

[0096] S230: Determine whether the number of slave devices whose communication hop count is not determined is 0.

[0097] Combination Figure 2 It can be seen that if the number of slave devices whose communication hops are not determined is not 0, the following S240 is executed; if the number of slave devices whose communication hops are not determined is 0, the following S260 is executed.

[0098] S240: Determine whether the current communication hop count of the master device meets a preset stop condition.

[0099] Combination Figure 2 It can be seen that if the current communication hop count of the master device does not meet the preset stop condition, the following step S250 is executed and then step S220 is continued. If the current communication hop count of the master device meets the preset stop condition, the following step S260 is executed.

[0100] S250, update the current communication hop count of the master device.

[0101] In an optional implementation, the first preset value can be a smaller number such as 0, 1, 2, etc., so the current communication hop count of the master device can be updated by adding 1 each time (or adding 2), which is an incremental method. The preset stop condition at this time is: the current communication hop count of the master device is equal to the preset value (for example, 10 or 12).

[0102] S260: Obtain the communication hop count of each slave device.

[0103] If there are 100 slave devices (ID0 to ID99) in the entire IoT system, but slave devices ID98 and ID99 are both offline due to failure, then Figure 2In the final stage of the process of determining the communication hop count of each slave device, the number of slave devices whose communication hop counts have not been determined is always not 0, but the current communication hop count of the master device meets the preset stop condition. In fact, only 98 communication hop counts of slave devices can be obtained, but the communication hop counts of slave devices ID98 and ID99 will be temporarily set to the above preset values. This example is only an example, and the number of slave devices is not limited here.

[0104] In an optional implementation, Figure 2 Based on Figure 3 , the process of "broadcasting and sending a data collection downlink message at least once according to the list to be updated, the current communication hop count of the master device and the corresponding reporting interval and the preset collection period, and determining the communication hop count when receiving a data collection uplink message responded by any slave device after each broadcast, and updating the list to be updated" in the above step S220 includes the following sub-steps:

[0105] S221. Group all MAC addresses in the to-be-updated list according to the current communication hop count of the master device and its corresponding reporting interval and collection period to obtain at least one to-be-updated sub-list.

[0106] In this embodiment, the sublist to be updated may include the MAC address of at least one target slave device to be updated. Optionally, the master device also stores a preset relationship mapping table, which includes a plurality of reporting intervals corresponding to different hop counts. Therefore, the sub-steps of step S221 include:

[0107] S221-1. Find the reporting interval corresponding to the current communication hop count of the master device from the relationship mapping table;

[0108] S221-2, dividing the collection period by the reporting interval corresponding to the current number of communication hops of the master device, rounding down to obtain the number of slave devices that can be updated this time;

[0109] S221 - 3 . Based on the number of slave devices that can be updated this time, group all MAC addresses in the list to be updated to obtain at least one sub-list to be updated.

[0110] In this embodiment, if the number of MAC addresses in the list to be updated is M, and the number of slave devices that can be updated this time is Y, then the number of sub-lists to be updated is M÷Y rounded up, that is, the number of MAC addresses in the sub-list to be updated is either Y or an integer between 1 and Y-1.

[0111] S222: Use the first sub-list to be updated as the target sub-list to be updated.

[0112] S223. Generate a data acquisition downlink message based on the target sub-list to be updated, the current communication hop count of the master device and its corresponding reporting interval time, and broadcast the data acquisition downlink message so that each slave device that receives the data acquisition downlink message can determine whether to send its own data acquisition uplink message and the response sending time based on the data acquisition downlink message.

[0113] In this embodiment, the hop count field in the data collection downlink message is the latest current communication hop count of the master device, and the data collection downlink message also includes the target to be updated sublist and the reporting interval corresponding to the current communication hop count of the master device. After the data collection downlink message is broadcast and sent, it is flooded in the local communication network until the hop count field in the data collection downlink message is reduced to 0.

[0114] Among them, for each target to-be-updated slave device in the target to-be-updated sublist, it will respond to the master device with a data collection uplink message at the response sending time determined by itself.

[0115] For each target to-be-updated slave device that receives the data acquisition downlink message, the processing process when it receives the data acquisition downlink message is as follows:

[0116] (1) Parse the data collection downlink message to obtain the reporting interval and the target sublist to be updated;

[0117] (2) If the target to-be-updated sublist includes its own MAC address, multiply the sequence number of its own MAC address in the target to-be-updated sublist by the reporting interval to obtain the waiting time for sending the response message;

[0118] (3) At the time of sending the response after the waiting time ends, a data collection uplink message is generated based on its own MAC address and the collected data, and the data collection uplink message is sent to the master device.

[0119] It can be understood that, assuming that the reporting interval is 1s, the time when the target slave device to be collected receives the data collection downlink message is 10:00:00. If the MAC address of the target slave device to be collected ranks first in the target to be updated sublist, then the time when the reply message of this slave device is sent is 10:00:01. If the MAC address of the target slave device to be collected ranks second in the target to be updated sublist, then the time when the reply message of this slave device is sent is 10:00:02. It can be seen that setting the reporting interval can allow each slave device to send the data collection uplink message in time, so that the master device will not face the situation of high concurrency of data collection uplink messages from multiple slave devices at the same time. This example is only an example and is not limited here.

[0120] S224. When a data acquisition uplink message is received from any target slave device to be updated, the communication hop number of the target slave device to be updated is determined based on the data acquisition uplink message, and the MAC address of the target slave device to be updated is deleted from the to-be-updated list.

[0121] In this embodiment, when the master device receives a data collection uplink message responded by any target to-be-updated slave device, the master device can parse the data collection uplink message to obtain the collection data of the target to-be-updated slave device and determine the communication hop count of the target to-be-updated slave device, and delete the MAC address of the target to-be-updated slave device from the to-be-updated list. Figure 3 In step S230, the method for determining whether the number of slave devices with undetermined communication hops is 0 may be: determining whether the list to be updated is empty.

[0122] Optionally, each slave device may be configured with an associated collection flag value, which defaults to 0. When the master device receives a data collection uplink message from a target slave device to be updated, the collection flag value of the target slave device to be updated is set to 1. In this way, the method for determining whether the number of slave devices with undetermined communication hops is 0 in step S230 can be: determine whether there is a slave device with a collection flag value of 0.

[0123] S225: Determine whether the target sublist to be updated is the last sublist to be updated.

[0124] In this embodiment, if the target sublist to be updated is not the last sublist to be updated, the following step S226 is executed until the target sublist to be updated is the last sublist to be updated; if the target sublist to be updated is the last sublist to be updated, step S230 is executed.

[0125] S226, after waiting for a collection period from the moment when the data collection downlink message is broadcasted, the next sub-list to be updated is used as a new target sub-list to be updated.

[0126] In this embodiment, the interval between two adjacent broadcast transmissions is a collection period T.

[0127] In the optional example, assuming that the list to be updated includes 120 MAC addresses of slave devices, the collection period T = 20s, the current communication hop count of the master device is 2, and the corresponding reporting interval is 0.6s, then the number of slave devices that can be updated this time is 33, then the 120 MAC addresses obtained by copying the list to be updated are grouped into groups of 33, and 4 sub-lists to be updated are obtained, of which the first three sub-lists to be updated each include 33 MAC addresses, and the last sub-list to be updated includes only 21 MAC addresses. Based on these 4 sub-lists to be updated, it is necessary to broadcast and send 4 data collection downlink messages respectively. This example is only an example and is not limited here.

[0128] In the optional example, if the relationship mapping table is as shown in the following table:

[0129] Table (1)

[0130] Hop Count 0 1 2 3 4 5 Interval time 0.2s 0.4s 0.6s 0.8s 1s 1.2s

[0131] If the list to be updated includes 100 MAC addresses of slave devices, the collection period T = 20s, the current communication hop count of the master device is represented by Xi, and i represents the i-th round of data collection (i = 1, 2, 3...N, one round of data collection represents one collection for each slave device of the IoT system), then starting from the initialization of the current communication hop count Xi of the master device to 0, the process of determining the communication hop count of each slave device is as follows:

[0132] (1) When the current communication hop count Xi of the master device is 0, the number of slave devices that can be updated this time is calculated to be Y=100. After copying the 100 MAC addresses in the list to be updated, they are grouped into groups of 100 to obtain a sublist of slave devices to be collected, which needs to be broadcasted once;

[0133] Assuming that within 20 seconds after the broadcast is sent, data collection uplink messages are received from 10 slave devices, the communication hop counts of each of the 10 slave devices can be determined, and the MAC addresses of the 10 slave devices can be deleted from the list to be updated;

[0134] (2) When the current communication hop number Xi of the master device is 1, the number of slave devices that can be updated this time is calculated to be Y=50. After copying the 90 MAC addresses in the list to be updated, they are grouped into groups of 50 each to obtain two sub-lists of slave devices to be collected. Then, two broadcast transmissions are required in sequence;

[0135] Assume that within 20 seconds after the first broadcast, 15 slave devices respond to the data collection uplink message, and within 20 seconds after the second broadcast, 20 slave devices respond to the data collection uplink message. Then these two broadcasts can determine the communication hop count of 35 slave devices and the MAC addresses of these 35 slave devices will be deleted from the list to be updated.

[0136] (3) When the current communication hop number Xi of the master device is 2, the number of slave devices that can be updated this time is calculated to be Y=33. After copying the 55 MAC addresses in the list to be updated, they are grouped into groups of 33 to obtain two sub-lists of slave devices to be collected. Then, two broadcasts are required in sequence:

[0137] Assume that within 20 seconds after the first broadcast, 33 slave devices respond to uplink data collection messages, and within 20 seconds after the second broadcast, 22 slave devices respond to uplink data collection messages. Then these two broadcasts can determine the communication hops of 35 slave devices and the MAC addresses of these 55 slave devices will be deleted from the list to be updated. At this point, the list to be updated is empty, and the communication hops of 100 slave devices have been obtained.

[0138] This example is merely an illustrative example of each sub-step of the above step S200 and is not intended to be limiting here.

[0139] From the above content, it can be seen that in the relationship mapping table, the larger the hop count, the longer the reporting interval, because the larger the communication hop count of a slave device, the longer the transmission time required for the slave device to send the data collection uplink message to the master device, so the reporting interval corresponding to the current communication hop count of the master device in the relationship mapping table needs to be greater than or equal to the transmission time corresponding to the current communication hop count of the master device. In this way, a broadcast transmission is essentially only facing Y slave devices in a sublist to be updated, so that the Y slave devices can report data in sequence within a collection cycle T, that is, after this broadcast transmission is completed, it can ensure that the data collection uplink messages of all Y slave devices are received before the next broadcast, so as to avoid the signal interference caused by the simultaneous reporting of the slave devices, and also avoid the situation where the communication hop count of the slave device cannot be updated correctly.

[0140] While determining the communication hop count of each slave device based on each sub-step of step S200, a round of data collection is actually performed on all slave devices, that is, the master device determines the communication hop count of each slave device during the first round of data collection, so that subsequent data collection is performed according to the communication hop count in non-first round data collection.

[0141] It should be clear that in the photovoltaic power generation system, a round of data collection is performed at regular intervals, and each round of data collection needs to cover all slave devices. The first round of data collection of the system (i.e., the first round of data collection) can apply step S100, step S200 and its sub-steps in the aforementioned embodiment; the second and subsequent rounds of data collection all use step S300 and its sub-steps. Among them, a round of data collection process includes multiple groups of data collection, and each group of data collection only covers all slave devices corresponding to one communication hop number. And one data collection is only for all slave devices in the MAC address list in the data collection downlink message of one broadcast. Therefore, a set of data collection processes requires at least one data collection (i.e., one broadcast), so as to complete data collection for all slave devices corresponding to one communication hop number.

[0142] The following is a detailed introduction to the process of collecting a group of data based on each communication hop number during the non-first round of data collection.

[0143] Optionally, the sub-step of "traversing all communication hops and collecting a set of data for the slave devices corresponding to each communication hop" in the above step S300 may be: collecting a set of data for all slave devices corresponding to each communication hop in order from small to large communication hops.

[0144] Furthermore, after step S400, the following steps may also be included:

[0145] S500. During each data collection process, after a period of time of each broadcast transmission, determine whether there is any unresponsive slave device in this broadcast transmission. If so, update the communication hop count of each unresponsive slave device according to a preset rule.

[0146] Among them, one broadcast transmission targets multiple target slave devices to be collected. In the target collection sublist contained in the data collection downlink message sent by one broadcast, the slave device that failed to successfully send the data collection uplink message to the master device within a period of time after the master device broadcasts and sends it is an unresponsive slave device. The reason why the data collection uplink message was not successfully sent to the master device may be: the slave device did not receive the data collection downlink message at all, so it did not report it; or the slave device sent a data collection uplink message, but the packet was lost during the transmission process.

[0147] If there is an unresponsive slave device in a broadcast transmission, the first case is that the unresponsive slave device fails and goes offline, and the second case is that the position of the unresponsive slave device in the network topology changes, and the communication hop count of the unresponsive slave device stored by the master device can no longer transmit the message to the slave device. For the second case, in order to ensure the comprehensiveness of the collection, the preset rule can be to increase the communication hop count of the unresponsive slave device by at least 1, so that the unresponsive slave device can enter the next or next group of data collection.

[0148] Optionally, after each broadcast transmission, a collection cycle may be waited to determine whether there are any unresponsive slave devices in this broadcast transmission. If so, the communication hop count of each unresponsive slave device is increased by at least 1, so that the unresponsive slave devices can enter the next group or the next group of data collection.

[0149] S600: In each data collection process, when a data collection uplink message is received, the communication hop count of the corresponding slave device is updated according to the information in the data collection uplink message.

[0150] In this embodiment, when the master device receives the data acquisition uplink message, the communication hop count of the corresponding slave device can be updated when the number of forwarding times of the data acquisition uplink message meets the hop count update condition. That is, in S600, the sub-step of updating the communication hop count of the corresponding slave device according to the information in the data acquisition uplink message may include:

[0151] S610, determining the number of forwarding times of the data collection uplink message according to the information in the received data collection uplink message;

[0152] S620: If the communication hop count of the corresponding slave device is inconsistent with the forwarding number, modify the communication hop count of the corresponding slave device to the forwarding number.

[0153] It can be understood that if a slave device (assuming slave device A) suddenly encounters a communication failure and cannot send or receive messages, then during a certain round of collection, through step S500, the communication hop count of slave device A will increase to the maximum value (i.e., the preset value).

[0154] After a period of time, the slave device A recovers from the fault. In the next round of collection after the fault recovery, the slave device A can normally send data collection uplink messages to the master device. Then the master device can reset its communication hop count to the actual forwarding count, which can improve the collection efficiency.

[0155] See also Figure 4 To expand on this, for the above step S300, if data collection is performed in the order of the number of communication hops from small to large, then it may include the following sub-steps:

[0156] S310: Initialize the current communication hop count of the master device to a second preset value.

[0157] In this embodiment, the second preset value may be 0, or may be the minimum value of the communication hop counts of each slave device.

[0158] S320, screen out each slave device to be collected whose communication hop count is equal to the current communication hop count of the master device, and perform a group of data collection on all the slave devices to be collected by broadcasting and sending a data collection downlink message at least once.

[0159] In this embodiment, each time a broadcast is sent, the MAC addresses of multiple slave devices to be collected can be added to the data collection downlink message to realize the collection of these slave devices to be collected. Specifically, the sub-steps of step S320 may include:

[0160] S321, filter out the MAC address of each slave device to be collected whose communication hop count is equal to the current communication hop count of the master device from the MAC addresses of all slave devices, and obtain a list to be collected;

[0161] S322. According to the list to be collected, the current communication hop count of the master device and its corresponding reporting interval and collection period, broadcast and send the data collection downlink message at least once to obtain the data collection uplink message responded by each slave device to be collected.

[0162] In this embodiment, for the MAC addresses of all the slave devices to be collected in the list to be collected, it may be necessary to broadcast and send data collection downlink messages more than once to complete the collection.

[0163] S330: Determine whether the current communication hop count of the master device is equal to a preset stop threshold.

[0164] The preset stop threshold may be the maximum value of the communication hop counts of the slave devices. If the current communication hop count of the master device is not equal to the preset stop threshold, the following step S340 is executed; if the current communication hop count of the master device is equal to the preset stop threshold, the following step S350 is executed.

[0165] S340, increase the current communication hop count of the master device by 1.

[0166] In this embodiment, after the current communication hop count of the master device is increased by 1, step S320 is continued to be executed to start the next set of data collection. Wherein, step S320 can also be continued after the current communication hop count of the master device is increased by 2. S350, a round of data collection is completed, and the data collection uplink message responded by each slave device is obtained.

[0167] In this embodiment, one round of data collection needs to complete comprehensive collection of all slave devices. After completing one round of data collection, the master device can obtain the reported data of each slave device, and the master device can store the reported data locally and / or upload it to the cloud platform.

[0168] Assuming that the number of communication hops of each slave device is only 2, 3, 4, and 5, then 4 sets of data collection are required to complete one round of data collection. This example is only an example and is not limited here.

[0169] In an optional implementation, Figure 4 Based on Figure 5 , the process of "broadcasting and sending a data collection downlink message at least once according to the list to be collected, the current communication hop count of the master device and its corresponding reporting interval and collection period to obtain the data collection uplink message responded by each slave device to be collected" in the above step S322 may include the following sub-steps:

[0170] S322-1. Group all MAC addresses in the list to be collected according to the current communication hop count of the master device and its corresponding reporting interval and collection period to obtain at least one sub-list to be collected.

[0171] In this embodiment, the list of slave devices to be collected includes the MAC address of at least one target slave device to be collected. In combination with the relationship mapping table introduced above, the sub-steps of step S322-1 may include:

[0172] S322-11, searching the reporting interval corresponding to the current communication hop count of the master device from the preset relationship mapping table;

[0173] S322-12, dividing the collection period by the reporting interval corresponding to the current number of communication hops of the master device, rounding down to obtain the number of slave devices that can be collected this time;

[0174] S322-13. Based on the number of slave devices that can be collected this time, group all MAC addresses in the list to be collected to obtain at least one sub-list to be collected.

[0175] In this embodiment, if the number of MAC addresses in the list to be collected is N, and the number of slave devices that can be collected this time is Y, then the number of sub-lists to be collected is the result of N÷Y rounded up, that is, the number of MAC addresses in the sub-list to be collected is either Y or an integer between 1 and Y-1.

[0176] S322-2. Use the first sub-list to be collected as the target sub-list to be collected.

[0177] S322-3. Generate a data acquisition downlink message based on the target to-be-collected sub-list, the current communication hop count of the master device and its corresponding reporting interval, and broadcast the data acquisition downlink message, so that each slave device that receives the data acquisition downlink message determines whether to send and respond to the sending time based on the data acquisition downlink message.

[0178] In this embodiment, the hop count field in the data collection downlink message is the current communication hop count of the current master device, and the data collection downlink message also includes the target to-be-collected sublist and the reporting interval corresponding to the current communication hop count of the master device. After the data collection downlink message is broadcast and sent, it is flooded in the local communication network until the hop count field in the data collection downlink message is reduced to 0.

[0179] Among them, for each target slave device to be collected in the target sub-list, it will send a data collection uplink message to the master device at the response sending time determined by itself.

[0180] For each target slave device that receives the data collection downlink message, the processing process when it receives the data collection downlink message is as follows:

[0181] (1) Parse the data collection downlink message to obtain the reporting interval time and the target list to be collected;

[0182] (2) If the target list of sub-lists to be collected includes the MAC address of the user, multiply the sequence number of the user's MAC address in the target list of sub-lists to be collected by the reporting interval to obtain the waiting time;

[0183] (3) At the time of sending a response after the waiting time has expired, a data collection uplink message is generated based on its own MAC address and reported data, and the data collection uplink message is sent to the master device.

[0184] S322-4. When a data collection uplink message is received from any target slave device to be collected, the MAC address of the target slave device to be collected is deleted from the list to be collected.

[0185] In this embodiment, when the master device receives a data acquisition uplink message responded by any target slave device to be acquired, the master device parses the data acquisition uplink message to obtain the reported data of the target slave device to be acquired, and then deletes the MAC address of the target slave device to be acquired from the acquisition list.

[0186] Optionally, the above step S500 is to determine whether there is any slave device that does not respond to the current broadcast transmission after each broadcast transmission. Figure 5 After the judgment result of step S322-5 is "yes", determine whether the list to be collected is empty. If it is empty, directly continue to execute step S330. If it is not empty, the number of communication hops of the slave device to be collected corresponding to each MAC address remaining in the list to be collected is increased by at least 1, so that it enters the next group or the next group of data collection.

[0187] Optionally, each slave device may be configured with an associated collection flag value, which defaults to 0. S322-4 is replaced by: when the master device receives a data collection uplink message from a target slave device to be collected, the collection flag value of the target slave device to be collected is set to 1. Figure 5 After the judgment result of step S322-5 is "yes", it is determined whether there is an unresponsive slave device with a collection flag value of 0 among all the slave devices to be collected corresponding to the list to be collected. If not, step S330 is directly executed. If so, the communication hop count of each unresponsive slave device is increased by at least 1.

[0188] S322-5. Determine whether the target sub-list to be collected is the last sub-list to be collected.

[0189] In this embodiment, if the target sub-list to be collected is not the last sub-list to be collected, the following step S322-6 is executed and then the above step S322-3 is continued until the target sub-list to be collected is the last sub-list to be collected; if the target sub-list to be collected is the last sub-list to be collected, step S330 is executed.

[0190] S322-6, after waiting for the collection cycle from the moment when the data collection downlink message is broadcasted, the next sub-list to be collected is used as the new target sub-list to be collected.

[0191] Therefore, combined with Figure 5 It can be seen that for each communication hop, a set of data collection processes needs to collect data from each target slave device corresponding to the communication hop, and the list to be collected corresponding to the communication hop is divided into a number of sub-lists to be collected, that is, a number of data collection downlink messages need to be broadcast and sent.

[0192] The relationship mapping table introduced above is based on the premise that the collection cycle T remains unchanged, and the number of slave devices Y that can be collected this time is calculated based on the reporting interval time corresponding to the collection cycle T and the current communication hop number of the master device. As the current communication hop number of the master device increases, the number of slave devices Y that can be collected this time in the collection cycle T gradually decreases.

[0193] Optionally, the number of slave devices Y that can be collected this time can be set to a fixed value, the relationship mapping table remains unchanged, and the collection period T is flexibly adjusted based on the change of the current communication hop number of the master device, that is: for the list to be updated or the list to be collected, it is directly grouped based on the number of slave devices Y that can be collected this time, and for the current communication hop number Xi of the current master device, it is necessary to calculate the product of the number of slave devices Y that can be collected this time and the reporting interval time corresponding to the current communication hop number Xi of the master device in the relationship mapping table, and obtain the collection period corresponding to the current communication hop number Xi of the current master device, that is, the interval time between two broadcasts. For example, the number of slave devices Y that can be collected this time = 80, combined with the above table (1):

[0194] When the current communication hop number Xi of the master device is 0, the acquisition cycle T is 0.2s×80=16s. After each broadcast, it needs to wait for 16s before the next broadcast.

[0195] When the current communication hop number Xi of the master device is 1, the acquisition cycle T is 0.4s×80=32s. After each broadcast, it needs to wait for 32s before the next broadcast.

[0196] When the current communication hop number Xi of the master device is 2, the acquisition cycle T is 0.6s×80=48s. After each broadcast, it needs to wait for 48s before the next broadcast.

[0197] By analogy, it can be found that as the current communication hop number Xi of the master device increases, since the number of slave devices that can be collected this time Y remains fixed, the collection period T needs to become larger accordingly. This can ensure that in the process of collecting a group of data for all slave devices corresponding to each communication hop number in order from small to large, after one broadcast, each target slave device to be collected can send data collection uplink messages in time without signal interference.

[0198] This example is only an example and is not intended to be limiting.

[0199] An embodiment of the present invention further provides a data collection method applied to any slave device in an Internet of Things system, the method comprising:

[0200] S600: upon receiving a data collection downlink message broadcasted by a master device, determine whether to send its own data collection uplink message and the time to send a response according to the MAC address and reporting interval carried in the data collection downlink message.

[0201] Optionally, the sub-steps of step S600 may include:

[0202] S610, when receiving the data collection downlink message, parse the data collection downlink message to obtain the reporting interval time and the MAC address list;

[0203] S620: If the MAC address list includes its own MAC address, determine that its own data collection uplink message needs to be sent;

[0204] S630, multiplying the sequence number of its own MAC address in the MAC address list by the reporting interval time to obtain the waiting time; wherein, the time after the waiting time from the moment of receiving the data collection downlink message is the response sending time;

[0205] S640: Generate a data collection uplink message based on its own MAC address and reported data, and send the data collection uplink message to the master device at the response sending time.

[0206] It should be noted that the execution order of each step in the above method embodiment is not limited to that shown in the drawings, and the execution order of each step shall be based on the actual application situation.

[0207] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0208] In the present invention, the master device determines the communication hop count of each slave device during the first round of data collection, and can then collect data based on the communication hop count in subsequent non-first round data collection processes;

[0209] In the process of non-first round data collection, the present invention collects a group of data from all slave devices corresponding to each communication hop number in the order of small to large communication hop number. In the process of each group of data collection, all MAC addresses in the list to be collected are divided into at least one sub-list to be collected according to the number of slave devices that can be collected this time, and a broadcast is performed based on each sub-list to be collected, thereby realizing batch collection;

[0210] In the present invention, the data collection downlink message broadcasted by the master device each time includes a MAC address list (a sublist to be updated or a sublist to be collected), a hop number field equal to the current communication hop number of the master device, and a reporting interval corresponding to the current communication hop number of the master device, so that when the slave device receives the data collection downlink message, it can obtain the reporting interval and the MAC address list in the message, and then when it is confirmed that the MAC address list includes its own MAC address, it multiplies the arrangement position of its own MAC address in the MAC address list by the reporting interval to obtain the waiting time, and then at the time of sending the response after the waiting time ends, it generates a data collection uplink message based on its own MAC address and the collected data, and sends the data collection uplink message to the master device. In this way, it is ensured that within a collection cycle, each target to-be-collected slave device can send the data collection uplink message in time-sharing without signal interference.

[0211] The embodiment of the present invention also provides a photovoltaic power generation system, which includes a master device and a plurality of slave devices connected to the master device in communication, wherein the master device and the slave devices each execute the above data collection method to realize data collection of each slave device by the master device. The master device may be a data concentrator in the photovoltaic power generation system, and the slave device may be any one of an intelligent switch, an intelligent optimizer, and a photovoltaic module with communication function in the photovoltaic power generation system.

[0212] See also Figure 6 , Figure 6The electronic device 300 includes a processor 310 , a memory 320 , and a bus 330 , wherein the processor 310 is connected to the memory 320 via the bus 330 .

[0213] The memory 320 may be used to store software programs. The processor 310 executes various functional applications and data processing to implement the data acquisition method provided in the embodiment of the present invention by running the software programs stored in the memory 320 .

[0214] Among them, the memory 320 can be but is not limited to: RAM (Random Access Memory), ROM (Read Only Memory), FLASH (Flash Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0215] The processor 310 may be an integrated circuit chip with signal processing capability. The processor 310 may be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), SoC (System on Chip), etc.; it may also be: DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0216] It can be understood that the electronic device 300 can be a concentrator in a photovoltaic power generation system based on the Internet of Things architecture, or a collection server in other Internet of Things systems. Figure 6 The structure shown is for illustration only. The electronic device 300 may also include Figure 6 More or fewer components as shown, or with Figure 6 Different configurations shown. Figure 6Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0217] In summary, the embodiments of the present invention provide a data collection method, an electronic device, and a photovoltaic power generation system. The master device stores the communication hop count of each slave device. The communication hop count represents the number of forwarding times that the data collection uplink message of the slave device needs to go through to reach the master device. The method is as follows: the master device traverses all communication hop counts, and performs a group of data collection based on the slave device corresponding to each communication hop count. In each group of data collection process, the master device broadcasts and sends a data collection downlink message at least once based on the current communication hop count of the master device, so that each slave device that receives the data collection downlink message determines whether its own data collection uplink message is sent and the response sending time according to the information carried in the downlink message. In this way, batch collection based on different communication hop counts improves communication efficiency and reduces energy consumption while ensuring reliable communication, compared with the traditional method of using the maximum communication hop count to collect data from slave devices one by one.

[0218] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A data collection method, characterized in that: Applied to a master device, the master device is communicatively connected to at least one slave device; the master device stores the communication hop count of each slave device, the communication hop count of the slave device representing the number of forwarding times required for the data acquisition uplink message of the slave device to reach the master device; The method comprises: Traverse all communication hops and collect a set of data from the slave device corresponding to each communication hop; In each group of data collection process, the data collection downlink message is broadcast and sent at least once based on the current communication hop number, so that each slave device that receives the data collection downlink message can determine whether to send its own data collection uplink message and the response sending time according to the MAC address carried in the data collection downlink message and the reporting interval time.

2. The method according to claim 1, characterized in that The communication hop count of each slave device is determined in the following manner: Acquire a list to be updated, the list to be updated including the MAC address of each slave device for which the number of communication hops has not been determined; The data acquisition downlink message is broadcasted and sent at least once based on the to-be-updated list, so as to determine the communication hop number of each slave device according to the data acquisition uplink message responded by each slave device.

3. The method according to claim 2, characterized in that The step of broadcasting and sending the data acquisition downlink message at least once based on the to-be-updated list to determine the number of communication hops of each slave device according to the data acquisition uplink message responded by each slave device includes: Initialize the current communication hop count of the master device to a first preset value; According to the list to be updated, the current communication hop count of the master device and the corresponding reporting interval and the preset collection period, the data collection downlink message is broadcasted at least once, and after each broadcast, when a data collection uplink message in response to any slave device is received, its communication hop count is determined, and the list to be updated is updated; If it is not determined that the number of slave devices with the communication hop count is not 0 and the current communication hop count of the master device does not meet the preset stop condition, updating the current communication hop count of the master device; Continue to execute the step of broadcasting and sending the data acquisition downlink message at least once according to the list to be updated, the current communication hop number of the master device and the corresponding reporting interval time and the preset collection period, until the number of slave devices whose communication hop number is not determined is 0 or the current communication hop number of the master device meets the preset stop condition, and obtain the communication hop number of each slave device.

4. The method according to claim 3, characterized in that The step of broadcasting and sending the data acquisition downlink message at least once according to the list to be updated, the current communication hop count of the master device and the preset acquisition cycle, and determining the communication hop count when receiving the data acquisition uplink message responded by any slave device after each broadcast, and updating the list to be updated includes: According to the current communication hop count of the master device and its corresponding reporting interval time and the collection period, all MAC addresses in the to-be-updated list are grouped to obtain at least one to-be-updated sub-list; the to-be-updated sub-list includes at least one MAC address of a target to-be-updated slave device; Take the first sublist to be updated as the target sublist to be updated; Generate the data acquisition downlink message based on the target to-be-updated sublist, the current communication hop count of the master device and its corresponding reporting interval time, and broadcast and send the data acquisition downlink message, so that each slave device that receives the data acquisition downlink message determines whether to send its own data acquisition uplink message and the response sending time based on the data acquisition downlink message, wherein each target to-be-updated slave device responds to the master device with the data acquisition uplink message at the response sending time determined by itself; When receiving a data acquisition uplink message responded by any of the target to-be-updated slave devices, determining the communication hop number of the target to-be-updated slave device based on the data acquisition uplink message, and deleting the MAC address of the target to-be-updated slave device from the to-be-updated list; If the target sublist to be updated is not the last sublist to be updated, then after waiting for the collection cycle from the moment the data collection downlink message is broadcast, the next sublist to be updated is used as the new target sublist to be updated, and the steps of generating the data collection downlink message based on the target sublist to be updated, the current number of communication hops of the main device and its corresponding reporting interval time, and broadcasting the data collection downlink message are continued until the target sublist to be updated is the last sublist to be updated.

5. The method according to claim 4, characterized in that The step of grouping all MAC addresses in the to-be-updated list according to the current communication hop count of the master device and its corresponding reporting interval and the collection period to obtain at least one to-be-updated sub-list comprises: Searching for the reporting interval time corresponding to the current communication hop count of the master device from a preset relationship mapping table; the relationship mapping table includes the reporting interval time corresponding to each of a plurality of different hop counts; The result obtained by dividing the collection period by the reporting interval corresponding to the current communication hop number of the master device is rounded down to obtain the number of slave devices that can be updated this time; Based on the number of slave devices that can be updated this time, all MAC addresses in the list to be updated are grouped to obtain at least one sub-list to be updated.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In each data collection process, after a period of time after the broadcast transmission, it is determined whether there is an unresponsive slave device in this broadcast transmission; the unresponsive slave device is a slave device in the target to-be-collected slave device list included in the data collection downlink message sent by this broadcast transmission, which fails to send the data collection uplink message to the master device within a period of time after the master device broadcasts and sends the data; If so, the communication hop count of each of the non-responding slave devices is updated according to a preset rule.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In each group of data collection process, when a data collection uplink message is received, the communication hop count of the corresponding slave device is updated according to the information in the data collection uplink message.

8. The method according to claim 7, characterized in that The step of updating the communication hop count of the corresponding slave device according to the information in the data acquisition uplink message comprises: Determine the number of forwarding times of the data collection uplink message according to the information carried in the data collection uplink message; Determine whether the communication hop count of the corresponding slave device is consistent with the forwarding count; If they are inconsistent, change the communication hop count of the corresponding slave device to the forwarding count.

9. The method according to any one of claims 1 to 5, characterized in that: The step of traversing all communication hops and collecting a set of data from the slave device corresponding to each communication hop includes: Initialize the current communication hop count of the master device to a second preset value; Filter out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and perform a group of data collection on all the slave devices to be collected by broadcasting and sending the data collection downlink message at least once; If the current communication hop number of the master device is not equal to the preset stop threshold, then after adding 1 to the current communication hop number of the master device, continue to execute the steps of screening out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and perform a group of data collection on all the slave devices to be collected by broadcasting the data collection downlink message at least once, until the current communication hop number of the master device is equal to the preset stop threshold.

10. The method according to claim 9, characterized in that The step of screening out each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device, and performing a group of data collection on all the slave devices to be collected by broadcasting and sending the data collection downlink message at least once, comprises: Filter out the MAC address of each slave device to be collected whose communication hop number is equal to the current communication hop number of the master device from the MAC addresses of all slave devices, and obtain a list to be collected; According to the list to be collected, the current communication hop number of the master device and its corresponding reporting interval time and the collection period, the data collection downlink message is broadcasted at least once to obtain the data collection uplink message responded by each slave device to be collected.

11. The method according to claim 10, characterized in that The step of broadcasting and sending the data acquisition downlink message at least once according to the to-be-collected list, the current communication hop number of the master device and the acquisition cycle to obtain the data acquisition uplink message responded by each to-be-collected slave device includes: According to the current communication hop count of the master device and its corresponding reporting interval time and the collection period, all MAC addresses in the list to be collected are grouped to obtain at least one sub-list to be collected; the sub-list to be collected includes the MAC address of at least one target slave device to be collected; Take the first list of items to be collected as the target list of items to be collected; Generate the data acquisition downlink message based on the target to-be-collected sub-list, the current communication hop count of the master device and its corresponding reporting interval time, and broadcast and send the data acquisition downlink message, so that each slave device that receives the data acquisition downlink message determines whether to send and the response sending time based on the data acquisition downlink message, wherein each target to-be-collected slave device sends the data acquisition uplink message to the master device at the response sending time determined by itself; When receiving a data acquisition uplink message responded by any of the target slave devices to be acquired, deleting the MAC address of the target slave device to be acquired from the list to be acquired; If the target sub-list to be collected is not the last sub-list to be collected, then after waiting for the collection cycle from the moment when the data collection downlink message is broadcast, the next sub-list to be collected is used as the new target sub-list to be collected, and the steps of generating the data collection downlink message based on the target sub-list to be collected, the current communication hop number of the main device and its corresponding reporting interval time, and broadcasting and sending the data collection downlink message are continued until the target sub-list to be collected is the last sub-list to be collected.

12. The method according to claim 11, characterized in that The step of grouping all MAC addresses in the to-be-collected list according to the current communication hop count of the master device and its corresponding reporting interval and the collection period to obtain at least one to-be-collected sub-list comprises: Searching for the reporting interval time corresponding to the current communication hop count of the master device from a preset relationship mapping table; the relationship mapping table includes the reporting interval time corresponding to each of a plurality of different hop counts; The result obtained by dividing the collection period by the reporting interval corresponding to the current communication hop number of the master device is rounded down to obtain the number of slave devices that can be collected this time; Based on the number of slave devices that can be collected this time, all MAC addresses in the list to be collected are grouped to obtain at least one sub-list to be collected.

13. A data collection method, characterized in that: Applied to a slave device, the slave device is communicatively connected with a master device; the method comprises: When receiving the data acquisition downlink message broadcasted by the master device, it determines whether to send its own data acquisition uplink message and the time to send the response according to the MAC address and reporting interval carried in the data acquisition downlink message.

14. The method according to claim 13, characterized in that The step of determining whether to send its own data collection uplink message and the response sending time according to the MAC address and reporting interval carried in the data collection downlink message includes: When receiving the data collection downlink message, the response sending time analyzes the data collection downlink message to obtain the reporting interval time and the MAC address list; If the MAC address list includes its own MAC address, it is determined that its own data collection uplink message needs to be sent; The arrangement number of the own MAC address in the MAC address list is multiplied by the reporting interval to obtain the waiting time; wherein, the time after the waiting time from the moment of receiving the data collection downlink message is the response sending time; The data collection uplink message is generated based on its own MAC address and reported data, and the data collection uplink message is sent to the master device at the response sending time.

15. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement: the data collection method according to any one of claims 1 to 12, or the data collection method according to any one of claims 13 to 14.

16. A photovoltaic power generation system, characterized in that: The method comprises a master device and a plurality of slave devices in communication with the master device, wherein the master device performs the data collection method according to any one of claims 1 to 12, and the slave devices perform the data collection method according to any one of claims 13 to 14, so as to realize data collection of each slave device by the master device; The master device is a data concentrator in a photovoltaic power generation system, and the slave device is any one of an intelligent switch, an intelligent optimizer, and a photovoltaic component with communication function in the photovoltaic power generation system.

Citation Information

Patent Citations

  • Sniffing equipment data acquisition and processing method and system for sniffing equipment, storage medium and processor

    CN111343662A

  • Routing information transmission method, device and system and storage medium

    CN113472675A

  • Bluetooth mesh-based low-voltage acquisition system and clustering ad hoc network method

    CN114845287A

  • Fault detection method and device of IP unvarnished transmission ad hoc network and computer equipment

    CN115134271A

  • Master device and communication method

    US20230066623A1