Multi-master and one-slave multi-channel data acquisition method

Through dynamic statistics and Bayesian risk calculation methods, the priority of each uplink channel in the photovoltaic inverter system is adjusted, and the problem of insufficient copying and reading success rate caused by multiple master stations simultaneously copying and reading the same inverter is solved, and communication efficiency and reliability are improved.

CN119603322APending Publication Date: 2025-03-11NANJING LINYANG POWER TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411649789.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In a photovoltaic inverter system, when multiple uplink channels copy and read the same inverter at the same time, it is difficult for the prior art to effectively adjust the priority of each channel, resulting in insufficient copy and read success rate, affecting the stability and efficiency of the system.

Method used

By dynamically counting the historical copy-reading success rate of each uplink channel, combining factors such as communication time, communication frequency and number of main stations, a likelihood function is constructed and the posterior probability is calculated using Bayesian theorem, the loss function of communication failure loss and success gain is defined, Bayesian risk value is calculated, and the priority of each uplink channel is dynamically adjusted to improve the copy-reading success rate.

Benefits of technology

By dynamically adjusting priority, the copy-reading success rate of each uplink channel is significantly improved, communication efficiency and reliability are improved, and the problem of multiple master stations copying and reading the same inverter at the same time is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603322A_ABST
    Figure CN119603322A_ABST
Patent Text Reader

Abstract

The invention provides a multi-master and one-slave multi-channel data acquisition method, and aims to solve the problem of communication conflict when a plurality of master stations copy and read the same slave device at the same time. According to the method, based on the Bayesian decision theory, the priority of each uplink channel is dynamically adjusted by combining important parameters in an actual communication environment, such as the communication success rate, the communication frequency and the number of master stations, so that efficient data forwarding and processing are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of electric power, and in particular relates to a multi-master and one-slave data acquisition method. Background Art

[0002] Under the background of global energy transformation, new energy, especially photovoltaic power generation, is rapidly becoming an important part of the global energy structure. As an important device connecting photovoltaic power generation components and the power grid, photovoltaic inverters play a vital role in the entire photovoltaic power generation system. With the expansion of photovoltaic power generation and the rapid development of distributed energy, the access of photovoltaic inverters to the grid has become a key link to ensure the stable operation of the power grid and the efficient use of energy. However, although the communication protocols followed by current photovoltaic inverter manufacturers belong to the Modbus-RTU framework, their protocol contents are different, which poses a huge challenge to the integration and management of photovoltaic systems after they are connected to the grid.

[0003] At present, a photovoltaic inverter access unit has been developed. This access unit can be connected to the national grid's data collection master station and data collection sticks of different photovoltaic manufacturers, and can be connected to multiple photovoltaic inverters to achieve protocol conversion, data collection, output control, flexible adjustment and other functions.

[0004] However, during the communication process, there may be multiple upstream channels reading the same downstream inverter at the same time, so it is necessary to make a decision on the priority of each channel to decide to give priority to forwarding and processing the data sent by a certain upstream channel.

[0005] According to relevant technical regulations, the acquisition system's one-time reading success rate for inverter data shall not be less than 99.9%; the acquisition system's one-time reading success rate for inverter data is proposed to be 80.0%. The formula for the one-time reading success rate of each upstream channel is as follows:

[0006]

[0007] In summary, in order to meet the requirements, it is necessary to dynamically adjust the priority of each upstream channel to ensure the success rate of each copying. Summary of the invention

[0008] The present invention aims at the above problems and proposes a method for obtaining the statistical communication success rate of the uplink channels corresponding to each master station within a fixed time period through dynamic statistics, and dynamically adjusting the priority of each uplink channel in the subsequent reading process to ensure forwarding processing, thereby effectively solving the processing problem of different uplink channels reading from slave devices at the same time and effectively improving the one-time reading success rate of each uplink channel.

[0009] The technical solution of the present invention is:

[0010] The present invention provides a multi-master and one-slave multi-channel data acquisition method, which dynamically counts the one-time reading success rate of each uplink channel and adjusts the communication priority according to the reading success rate, specifically comprising:

[0011] S1. Obtain the historical reading success rate of each upstream channel and set the historical reading success rate as the prior probability P(H i ), H i Indicates the master station M with number i i The success rate of copying and reading;

[0012] S2. Get the communication time T i 、Communication frequency F i and the number of master stations N i , combined with the prior probability to construct the likelihood function P(D|H i );

[0013] S3, using Bayesian theorem, combined with prior probability P(H i ) and the likelihood function P(D|H i ), calculate the posterior probability P(H i |D);

[0014] S4. For each master station, define the loss L including communication failure fail and success income R succ The loss function L(a|H i ), reflecting the scheduling loss assigned to the non-optimal master station;

[0015] S5. Based on the posterior probability P(H i |D) and the loss function L(a|H i ), for each channel priority scheduling decision a, calculate the Bayesian risk value R(a) of each master station, and select the scheduling plan with the smallest Bayesian risk as the final decision;

[0016] When multiple master stations read the same slave device at the same time, the Bayesian risk values ​​of the master stations are sorted, and the communication signal volume is allocated one by one starting from the master station with the smallest Bayesian risk value.

[0017] Furthermore, in S1, the historical copying success rate is dynamically adjusted:

[0018] If the communication is successful, the number of successes in the current cycle is S succ Add 1, total number of times S all Add 1; if failed, only increase the total number of times S all , to achieve dynamic adjustment of communication success rate.

[0019] Furthermore, S2 specifically includes:

[0020] Get the communication time T between each master station and slave device i By counting the time intervals between the communication between each master station and the slave device, the communication frequency F of each master station is obtained. i ; Count the number of master stations in the access unit N i ; According to the communication time, communication frequency and number of master stations, construct the likelihood function P(D|H i );

[0021]

[0022] Where: W succ Represents the communication success weighted value, W fail Indicates that the communication failure reduces the weight, and X indicates the weight adjustment factor.

[0023] Furthermore, in S3, the posterior probability P(H i |D) is calculated as follows:

[0024]

[0025] Where: D represents all observation factors, including communication time, number of master stations and communication frequency; j represents the number of the observation factor.

[0026] Furthermore, S4 specifically includes:

[0027] Define the communication failure loss L fail , L fail =C fail ×(1-P succ (H i |D));

[0028] Defining Success Revenue R succ , R succ =G succ ×P succ (H i |D);

[0029] Establish the loss function L(a|H i ), L(a|H i )=L fail +R succ ;

[0030] Furthermore, S5 specifically includes:

[0031] S51, according to the posterior probability P(H) of each master station obtained in step S3 i |D) and the loss function L(a|H) defined in step S4 i ), calculate the Bayesian risk R(a);

[0032] S52, compare the Bayesian risks R(a) of all scheduling decision actions a, and select the scheduling solution with the smallest Bayesian risk as the final decision;

[0033] S53: If there are multiple master stations in the access unit reading the same slave device at the same time, then the Bayesian risk array A of each master station at this time is obtained according to the decision result of step S52, A=R i0 ,R i1 ,R i2 …R in ; n represents the number of master stations;

[0034] S54, sort array A from small to large to obtain index array B, B = ID 0 ,ID 1 ,ID 2 …ID n ;

[0035] S55. Starting from the first one in array B, the channel numbers of the corresponding master stations are obtained one by one, semaphores are allocated, and the master station with the semaphore is controlled to communicate with the slave device. The remaining channels are blocked.

[0036] Furthermore, in S55, if a channel is continuously blocked and reaches a preset threshold, data of the channel is forwarded and processed preferentially.

[0037] Furthermore, the Bayesian risk value R(a) of each master station is calculated using the following formula:

[0038] R(a)=P(D|H i )×L(a|H i ).

[0039] Beneficial effects of the present invention:

[0040] The present invention discloses a multi-channel data acquisition method with multiple masters and one slave, which is a communication scheduling optimization scheme based on Bayesian risk. By obtaining the historical reading success rate of each uplink channel as a priori probability, a likelihood function is constructed in combination with factors such as communication time, communication frequency and the number of master stations, and the posterior probability of each master station is calculated using the Bayesian theorem. For each master station, a loss function including communication failure loss and success gain is defined, and the Bayesian risk value is calculated. When multiple master stations read the same slave device at the same time, the Bayesian risk value of each master station is sorted, and the communication signal quantity is allocated one by one starting from the master station with the smallest risk value.

[0041] The present invention realizes continuous optimization of communication success rate through dynamic adjustment. The method effectively solves the problem of multiple master stations reading the same inverter at the same time, and improves communication efficiency and reliability. By comprehensively considering historical data and real-time factors, the present invention realizes more intelligent and flexible communication scheduling, and provides a new solution for resource allocation in complex communication environments.

[0042] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.

[0044] Figure 1 A schematic diagram showing an access unit according to an embodiment of the present invention encountering multiple master stations reading the same inverter at the same time.

[0045] Figure 2 A flow chart of a multi-master-one-slave multi-channel data acquisition method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0046] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0047] Example 1

[0048] like Figure 1 , 2 As shown, the present embodiment provides a multi-master and one-slave multi-channel data acquisition method, which may specifically include:

[0049] S1. Obtain the historical reading success rate of each upstream channel and set the historical reading success rate as the prior probability P(H i ), H i Indicates the master station M with number i i The historical reading success rate is dynamically adjusted: if the communication is successful, the number of successes in the current cycle S succ Add 1, total number of times S all Add 1; if failed, only increase the total number of times S all , to achieve dynamic adjustment of communication success rate;

[0050] S2. Get the communication time T i 、Communication frequency F i and the number of master stations N i , combined with the prior probability to construct the likelihood function P(D|H i );

[0051]

[0052] Where: Wsucc Represents the communication success weighted value, W fail Indicates that the communication failure reduces the weight, and X indicates the weight adjustment factor;

[0053] S3, using Bayesian theorem, combined with prior probability P(H i ) and the likelihood function P(D|H i ), calculate the posterior probability P(H i |D);

[0054]

[0055] Where: D represents all observation factors, including communication time, number of master stations and communication frequency; j represents the number of observation factors;

[0056] S4. For each master station, define the loss L including communication failure fail and success income R succ The loss function L(a|H i ), reflecting the scheduling loss assigned to the non-optimal master station;

[0057] L fail =C fail ×(1-P succ (H i |D));

[0058] R succ =G succ ×P succ (H i |D);

[0059] L(a|H i )=L fail +R succ ;

[0060] S5. Based on the posterior probability P(H i |D) and the loss function L(a|H i ), for each channel priority scheduling decision a, calculate the Bayesian risk value R(a) of each master station, and select the scheduling plan with the smallest Bayesian risk as the final decision;

[0061] The Bayesian risk is specifically:

[0062]

[0063] When multiple master stations read the same slave device at the same time, the Bayesian risk values ​​of the master stations are sorted, and the communication signal volume is allocated one by one starting from the master station with the smallest Bayesian risk value.

[0064] By dynamically adjusting the weights of various parameters, the communication success rate can be continuously optimized.

[0065] In one example, the likelihood function of S2 is specifically:

[0066] Considering that the master station with a high success rate usually has a shorter reading time, when the number of master stations requesting reading is small, the probability of a single master station reading successfully is higher, and the master station with a high communication frequency usually needs to read more frequently, the higher the communication frequency, the greater the probability of successful reading.

[0067] Combining the likelihood functions yields:

[0068]

[0069] If a master station has a higher communication success rate in history, the priority of the master station should be higher, and this weighted value can be directly added to the likelihood function so that the master station with a high success rate has a greater weight in Bayesian reasoning.

[0070]

[0071] If a master station has a long history of communication failures, you can fail To reduce its priority in the Bayesian model:

[0072]

[0073] The weight adjustment factor X can be used as an overall adjustment factor for unified adjustment to obtain the final likelihood function:

[0074]

[0075] In an example, S5 specifically includes:

[0076] S51, according to the posterior probability P(H) of each master station obtained in step S3 i |D) and the loss function L(a|H) defined in step S4 i ), calculate the Bayesian risk R(a);

[0077] S52, compare the Bayesian risks R(a) of all scheduling decision actions a, and select the scheduling solution with the smallest Bayesian risk as the final decision;

[0078] S53: If there are multiple master stations in the access unit reading the same slave device at the same time, then the Bayesian risk array A of each master station at this time is obtained according to the decision result of step S52, A=R i0 ,R i1 ,R i2 …R in ; n represents the number of master stations;

[0079] S54, sort array A from small to large to obtain index array B, B = ID 0 ,ID 1 ,ID 2 …ID n ;

[0080] S55, starting from the first one in array B, the channel numbers of the corresponding master stations are obtained one by one, semaphores are allocated, and the master station with the semaphore is controlled to communicate with the slave device, and the other channels are blocked;

[0081] If a channel is blocked continuously and reaches a preset threshold, the data of this channel will be forwarded and processed first.

[0082] Example 2

[0083] The invention discloses a multi-master-one-slave data acquisition method, which dynamically counts the communication success rate between the master station and the inverter and performs functions such as protocol conversion, data acquisition, output control, and flexible regulation.

[0084] The access unit is regarded as a slave device for operation, and the statistical cycle is 1 day, which is divided into 24 reading periods at the hour.

[0085] When the access unit encounters multiple master stations sending data to read the same inverter at the same time, set the initial value H of the communication success rate of each master station i , channel occupancy time T i 、Communication frequency F i 、Number of master stations i , and introduce the communication success weighted value W succ , communication failure reduces the weight W fail And the weight adjustment factor X, for example: H i =50%, W succ 1%, W fail is 1%, F is 0.5, α is 1, β is 1, and γ is -1.

[0086] The addition and subtraction weights are dynamically adjusted according to the changing trend of the average communication success rate of several consecutive copying cycles.

[0087] Example 3

[0088] In a multi-master and one-slave data acquisition method as described in Example 1, when multiple master stations simultaneously send data to read the same inverter, the Bayesian risk value of the master station is calculated, and the channel with the smallest Bayesian risk is preferentially selected for data forwarding and processing.

[0089] The Bayesian risk is specifically calculated as follows:

[0090] It is known that the main collection station A reads the inverter once every 30 minutes, and the manufacturer's collector B reads the inverter once every 5 minutes. The number of master stations N = 2, The probability of communication failure of acquisition master station 1 is 1%, and the probability of communication failure of manufacturer collector 2 is 2%. It can be calculated that the probability of the next communication failure being caused by data sent by acquisition master station A is The calculated value is 7.69%. Similarly, the probability of data transmission from the manufacturer's collector is 92.30%. For data communication, a higher success rate should be pursued, so the loss in case of failure should be higher than the gain in case of success. Let C fail =10%, G succ =1%. By calculation, the loss function value of A is 1.09%, and the loss value of B is 1.18%.

[0091] Combining the above data with the final settlement, it can be seen that the Bayesian risk of A is 8.29‰, and the Bayesian risk of B is 108.9‰. When the two master stations A and B read the same inverter at the same time, the data of A with lower risk should be forwarded first.

[0092] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.

Claims

1. A multi-master and one-slave multi-channel data acquisition method, characterized in that: The method dynamically counts the first reading success rate of each uplink channel and adjusts the communication priority according to the reading success rate, specifically including: S1. Obtain the historical reading success rate of each upstream channel and set the historical reading success rate as the prior probability P(H i ), H i Indicates the master station M with number i i The success rate of copying and reading; S2. Get the communication time T i 、Communication frequency F i and the number of master stations N i , combined with the prior probability to construct the likelihood function P(D|H i ); S3, using Bayesian theorem, combined with prior probability P(H i ) and the likelihood function P(D|H i ), calculate the posterior probability P(H i |D); S4. For each master station, define the loss L including communication failure fail and success income R succ The loss function L(a|H i ), reflecting the scheduling loss assigned to the non-optimal master station; S5. Based on the posterior probability P(H i |D) and the loss function L(a|H i ), for each channel priority scheduling decision a, calculate the Bayesian risk value R(a) of each master station, and select the scheduling plan with the smallest Bayesian risk as the final decision; When multiple master stations read the same slave device at the same time, the Bayesian risk values ​​of the master stations are sorted, and the communication signal volume is allocated one by one starting from the master station with the smallest Bayesian risk value.

2. The multi-master-one-slave multi-channel data acquisition method according to claim 1 is characterized in that In S1, the historical copying success rate is dynamically adjusted: If the communication is successful, then the number of successes in the current cycle is S succ Add 1, total number of times S all Add 1; if failed, only increase the total number of times S all , to achieve dynamic adjustment of communication success rate.

3. The multi-master-one-slave multi-channel data acquisition method according to claim 2, characterized in that S2 Specifically include: Get the communication time T between each master station and slave device i By counting the time intervals between the communication between each master station and the slave device, the communication frequency F of each master station is obtained. i ; Count the number of master stations in the access unit N i ; According to the communication time, communication frequency and number of master stations, construct the likelihood function P(D|H i ); Where: W succ Represents the communication success weighted value, W fail Indicates that the communication failure reduces the weight, and X indicates the weight adjustment factor.

4. The multi-master-one-slave multi-channel data acquisition method according to claim 1 is characterized in that In S3, the posterior probability P(H i |D) is calculated as follows: Where: D represents all observation factors, including communication time, number of master stations and communication frequency; j represents the number of the observation factor.

5. The multi-master-one-slave multi-channel data acquisition method according to claim 1 is characterized in that S4 specifically includes: Define the communication failure loss L fail , L fail =C fail ×(1-P succ (H i |D)); Defining Success Revenue R succ , R succ =G succ ×P succ (H i |D); Establish the loss function L(a|H i ), L(a|H i )=L fail +R succ .

6. The multi-master-one-slave multi-channel data acquisition method according to claim 1 is characterized in that S5 specifically includes: S51, according to the posterior probability P(H) of each master station obtained in step S3 i |D) and the loss function L(a|H) defined in step S4 i ), calculate the Bayesian risk R(a); S52, compare the Bayesian risks R(a) of all scheduling decision actions a, and select the scheduling solution with the smallest Bayesian risk as the final decision; S53: If there are multiple master stations in the access unit reading the same slave device at the same time, then the Bayesian risk array A of each master station at this time is obtained according to the decision result of step S52, A=R i0 , R i1 , R i2 …R in ; n represents the number of master stations; S54, sort the array A from small to large to obtain the index array B, B = ID0, ID1, ID2...ID n ; S55. Starting from the first one in array B, the channel numbers of the corresponding master stations are obtained one by one, semaphores are allocated, and the master station with the semaphore is controlled to communicate with the slave device. The remaining channels are blocked.

7. The multi-master-one-slave multi-channel data acquisition method according to claim 6 is characterized in that In S55, if a channel is continuously blocked and reaches a preset threshold, data of the channel is forwarded and processed preferentially.

8. The multi-master-one-slave multi-channel data acquisition method according to claim 1 or 6, characterized in that: The following formula is used to calculate the Bayesian risk value R(a) of each master station: R(a)=P(D|H i )×L(a|H i )。