Data frame distribution method, data acquisition method and data acquisition system

By obtaining the device communication list in the power system and dynamically allocating data frames to the communication thread, the problems of delay and resource waste caused by the uncontrollable number of data frames are solved, achieving efficient data acquisition and resource utilization, and improving the data acquisition efficiency of the power monitoring system.

CN121239366APending Publication Date: 2025-12-30SCHNEIDER SMART TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410865348.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

The existing data acquisition methods in the power system have problems such as uncontrollable data frame numbers leading to delays or resource waste. In particular, when data is allocated on a gateway-by-gateway basis, the excessive number of data frames causes delays, while when data is allocated on a device-by-device basis, resources are wasted and cannot be dynamically adjusted.

Method used

By obtaining the device communication list, the data acquisition duration and interval of each data frame are determined, and the data frames are dynamically allocated to multiple communication threads to ensure that the acquisition duration of each communication thread does not exceed the expected duration. The data frames are allocated according to the order of the device communication list or randomly selected.

Benefits of technology

Dynamic allocation of communication threads in the power system is realized, ensuring that the single acquisition time of each communication thread is less than the expected time, improving the timeliness of data acquisition, avoiding resource overload and delay, and improving data acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121239366A_ABST
    Figure CN121239366A_ABST
Patent Text Reader

Abstract

The invention provides a data frame distribution method, a data acquisition method, a data acquisition system and a computer readable storage medium. The data frame distribution method is applied to an electric power system and comprises the steps that an equipment communication list is acquired, and the equipment communication list comprises information of a plurality of data frames; determining the data acquisition duration of each data frame and the acquisition interval duration between the data frames; and according to the data acquisition time length of each data frame and the acquisition interval time length between the data frames, distributing the plurality of data frames to a plurality of communication threads, so that the total time length of each communication thread for acquiring the data frames therein does not exceed the expected time length. According to the embodiment of the invention, the communication threads are dynamically allocated, the single acquisition duration of each single communication thread is ensured to be less than the expected duration, the data acquisition duration requirement of specific services is met, the duration of single data acquisition is reasonably allocated, the timeliness of data acquisition can be improved, and the working efficiency of data acquisition and specific services is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a data frame allocation method, a data acquisition method, and a data acquisition system. Background Technology

[0002] In power systems, some application scenarios require the acquisition and monitoring of data from different data sources. For example, SCADA (Supervisory Control and Data Acquisition) systems, based on computers, achieve automated power monitoring. In data acquisition systems, the device access layer allocates threads when acquiring data. Allocation methods primarily include allocation by gateway (including communication address and port) and allocation by device. Both of these thread allocation methods have drawbacks.

[0003] In the method of allocating threads based on gateways, the number of data acquisition threads is relatively controllable, but the number of data frames acquired each time is uncontrollable. If the number of data frames acquired in a single data acquisition is too large, it may cause delays in data acquisition.

[0004] The method of allocating threads on a device-by-device basis can lead to a linear increase in the number of data acquisition threads as the number of devices increases when the data frame size is small, resulting in increased load on the data acquisition system and wasted system resources. On the other hand, when the number of frames per device is large, it can cause data acquisition delays and cannot be dynamically adjusted.

[0005] The content of the background section is merely the technology known to the inventor and does not necessarily represent the prior art in this field. Summary of the Invention

[0006] To address one or more deficiencies in the prior art, this invention provides a data frame allocation method applied to data acquisition in a power system for allocating data frames. The data frame allocation method includes:

[0007] Obtain the device communication list, which includes information on multiple data frames, where each piece of information corresponds to one data frame;

[0008] Determine the data acquisition duration for each data frame and the acquisition interval between data frames; and

[0009] Based on the data acquisition duration of each data frame and the acquisition interval between data frames, the multiple data frames are allocated to multiple communication threads, so that the total acquisition duration of the data frames in each communication thread does not exceed the expected duration.

[0010] According to one aspect of the present invention, the data frame allocation method further includes: sorting the information of multiple data frames in the device communication list;

[0011] The step of allocating the plurality of data frames to the plurality of communication threads includes:

[0012] According to the order of the device communication list, n+1 data frames are selected sequentially;

[0013] When the total acquisition time of the n+1 data frames exceeds the expected time, and the total acquisition time of the n data frames does not exceed the expected time, the n data frames are allocated to a communication thread.

[0014] Repeat the above process until all data frames have been allocated.

[0015] According to one aspect of the invention, the step of allocating the plurality of data frames to a plurality of communication threads includes:

[0016] The value of n is determined based on the expected duration, the data acquisition duration, and the acquisition interval duration between data frames, wherein the total acquisition duration of the n+1 data frames exceeds the expected duration, and the total acquisition duration of the n data frames does not exceed the expected duration.

[0017] The n data frames are allocated to a single communication thread.

[0018] According to one aspect of the invention, the step of allocating the plurality of data frames to a plurality of communication threads includes:

[0019] From the device communication list, randomly select n+1 data frames;

[0020] When the total acquisition time of the n+1 data frames exceeds the expected time, and the total acquisition time of the n data frames does not exceed the expected time, the n data frames are allocated to a communication thread.

[0021] Repeat the above process until all data frames have been allocated.

[0022] According to one aspect of the invention, the step of allocating the plurality of data frames to a plurality of communication threads includes:

[0023] Data frames are selected sequentially according to the order of the device communication list;

[0024] Determine the total acquisition duration of the data frame;

[0025] Determine whether the total acquisition time of the data frame is less than the expected time;

[0026] When the total acquisition time of the data frames is less than the expected time, return to the step of sequentially selecting data frames and repeat the subsequent steps;

[0027] When the total acquisition time of the data frame is not less than the expected time, the value of n is the first position of the data frame in the device communication list.

[0028] According to one aspect of the present invention, the data frame allocation method further includes:

[0029] Information about data frames allocated to the same communication thread is retrieved from the device communication list;

[0030] The device communication list is reordered.

[0031] According to one aspect of the present invention, the data frame information includes: a communication address, a communication port number, a device number, and a device frame start address; the step of sorting the device communication list includes:

[0032] Sort the device communication list according to the communication address;

[0033] Within the same communication address, sorting is based on the communication port number;

[0034] Within the same communication port number, sort according to the device number;

[0035] Within the same device number, they are sorted according to the starting address of the device frame.

[0036] According to one aspect of the present invention, the data frame information includes: a communication address, a communication port number, a device number, and a device frame start address; the step of sorting the device communication list includes:

[0037] Generate a group string, the group string including the communication address and the communication port number;

[0038] Sort the device communication list according to the grouping string;

[0039] Within the same grouping string, sort according to the device number;

[0040] Within the same device number, they are sorted according to the starting address of the device frame.

[0041] According to one aspect of the invention, the data acquisition duration of the data frame and the acquisition interval duration between data frames are preset or set according to the actual measurement results; the expected duration is preset.

[0042] According to one aspect of the invention, in the device communication list, the data acquisition duration of data frames in the same group string is an average value determined based on actual measurement results.

[0043] According to one aspect of the present invention, the present invention further includes a data acquisition method, the data acquisition method comprising:

[0044] According to the data frame allocation method described above, multiple data frames are allocated to multiple communication threads;

[0045] The multiple communication threads are started to collect the corresponding data frames.

[0046] According to one aspect of the present invention, the step of acquiring data according to a communication thread includes:

[0047] Generate a communication thread string, which includes a communication address, a communication port number, a device number, and a device frame start address;

[0048] Sort the communication threads according to their communication thread strings;

[0049] Data is collected in order of communication threads.

[0050] According to one aspect of the present invention, the device frame start address in the communication thread string is: the device frame start address of the data frame that is last in the device communication list among the data frames allocated to the same communication thread.

[0051] According to one aspect of the present invention, the present invention further includes a data acquisition system for acquiring data from multiple devices in a power system, the data acquisition system comprising:

[0052] Multiple data sources;

[0053] A processor that communicates with multiple data sources and is configured to execute the data acquisition method described above, acquiring data from the multiple data sources.

[0054] According to one aspect of the invention, the invention also includes a computer-readable storage medium including computer-executable commands stored thereon, which, when executed by a processor, implement the data frame allocation method and / or the data acquisition method as described above.

[0055] Compared with the prior art, the embodiments of the present invention provide a data frame allocation method that addresses the problem of unreasonable allocation of communication threads in power monitoring systems. This method enables automated monitoring of power systems by dynamically allocating communication threads, ensuring that the duration of each single data acquisition by a single communication thread is less than the expected duration, thus meeting the data acquisition duration requirements of specific business operations. By rationally allocating the duration of each data acquisition, the timeliness of data acquisition can be improved, preventing excessive load on the data acquisition system, avoiding significant delays, and improving the efficiency of data acquisition and specific business operations.

[0056] The present invention also includes an embodiment of a data acquisition method, an embodiment of a data acquisition system, and an embodiment of a computer-readable storage medium, which can apply or execute the aforementioned data frame allocation method. Attached Figure Description

[0057] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0058] Figure 1 This is a flowchart illustrating the data frame allocation method in some embodiments of the present invention;

[0059] Figure 2 This is a flowchart illustrating a data frame allocation method that includes a step of sorting a device communication list in some embodiments of the present invention.

[0060] Figure 3 This is a flowchart illustrating the data frame allocation method in an embodiment of the present invention where data acquisition duration and data frame sorting are positively correlated.

[0061] Figure 4 This is a flowchart illustrating a data frame allocation method that allocates a fixed number of data frames in some embodiments of the present invention.

[0062] Figure 5 This is a flowchart illustrating a data frame allocation method for randomly selecting data frames in some embodiments of the present invention;

[0063] Figure 6 This is a flowchart illustrating a data frame allocation method that skips some data frames, as described in some embodiments of the present invention.

[0064] Figure 7 This is a flowchart illustrating a data frame allocation method that includes a step of reordering the device communication list in some embodiments of the present invention.

[0065] Figure 8 This is a flowchart illustrating the sorting of the device communication list in some embodiments of the present invention;

[0066] Figure 9 This is a schematic diagram of a device communication list in some embodiments of the present invention;

[0067] Figure 10 This is a flowchart illustrating the sorting of the device communication list in other embodiments of the present invention;

[0068] Figure 11 This is a schematic diagram of a device communication list in some other embodiments of the present invention;

[0069] Figure 12 This is a flowchart illustrating the data acquisition method in some embodiments of the present invention;

[0070] Figure 13 This is a structural block diagram of a data acquisition system in some embodiments of the present invention. Detailed Implementation

[0071] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0072] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly and specifically defined.

[0073] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows for communication; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0074] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0075] The following disclosure provides many different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. In addition, examples of various specific processes and materials are provided in this invention, but those skilled in the art will recognize the application of other processes and / or the use of other materials.

[0076] The embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0077] Figure 1 The flowchart of a data frame allocation method 100 according to an embodiment of the present invention is shown below, in conjunction with... Figure 1 The data frame allocation method 100 is explained.

[0078] The data frame allocation method 100 in this embodiment is applied to allocate data frames when collecting data from a power system. When collecting data from a power monitoring system, such as a SCADA system, the data volume is very large, and the timeliness requirements are high; therefore, high efficiency is required for data acquisition. The data frame allocation method 100 in this embodiment can be used to efficiently collect data from multiple devices in a power monitoring system.

[0079] like Figure 1 As shown, in step 101, a device communication list is obtained. This list includes information on multiple data frames, each corresponding to a data frame. In this embodiment, a data frame represents the smallest unit of data acquisition and transmission, and a set of data may include one or more data frames. A power system may simultaneously include multiple devices, and each device may also include or generate multiple data sets. Data from one device can be divided into multiple data frames for data packet encapsulation. Conversely, a communication thread can also read data from multiple points on multiple devices. In this embodiment, the device communication list is divided into data frames, including all the data required to perform the corresponding task. Data collected from the power system may be used to perform different tasks, such as telemetry, onboard alarms, and remote signaling. Different tasks require multiple devices to collect different data frames. In a preferred embodiment of this invention, a device communication list can be obtained according to actual needs, including all the required data, which has been divided into different frames according to preset rules (e.g., preset data length). Those skilled in the art will readily understand that the information on the data frames included in the device communication list in this invention does not necessarily include the data of a complete frame; it may only represent a pointer to the corresponding data segment, as will be described in detail below.

[0080] According to different embodiments of the present invention, the device communication list can be generated by the processor after being reported by different devices (data sources), or a list corresponding to the data required for specific tasks can be pre-stored. When a specific task needs to be performed, the list of required data is called, and the required data is matched to the corresponding device (data source) to generate the device communication list. The device communication list specifically includes the communication address corresponding to the data frame, the receiving port for receiving the data frame, and the corresponding device information, etc., which will be described in detail in subsequent embodiments.

[0081] In step S102, the data acquisition duration of each data frame and the acquisition interval duration between data frames are determined.

[0082] During data acquisition, each data frame requires a certain amount of time to complete. The time required to complete the acquisition of one data frame is called the data acquisition duration. In different embodiments of this invention, the data acquisition duration for different data frames can be the same or different, for example, 15 milliseconds. The data acquisition duration can be preset or obtained based on actual measurements, such as taking the average value after multiple measurements.

[0083] When continuously acquiring data, there is a time interval between adjacent data frames, which may be limited by hardware devices or preset by the data acquisition program. The time interval between adjacent data frames is the acquisition interval duration between data frames. The acquisition interval duration between data frames is mainly limited by hardware devices and is preferably preset to a fixed value, such as 30 milliseconds. It can also be set according to the actual measurement results, such as taking the average value after multiple measurements.

[0084] In different embodiments of the present invention, the data acquisition duration of the data frame and the acquisition time interval between data frames can be obtained by actual measurement or can be preset.

[0085] In step S103, based on the data acquisition duration of each data frame and the acquisition interval duration between data frames, multiple data frames are allocated to multiple communication threads, wherein the total acquisition duration of the data frames in each communication thread does not exceed the expected duration.

[0086] The expected duration can represent the maximum expected acquisition time in the power monitoring system. Preferably, the expected duration is preset according to the specific work. For example, the expected duration is set according to non-functional requirements. Different types of work have different expected durations. For example, the expected duration of telemetry data can be set to 2 seconds, the expected duration of remote signaling data can be set to 1.5 seconds, and the expected duration of onboard alarm data can be set to 3 seconds.

[0087] During the data acquisition process, multiple data frames are allocated to different communication threads. Data is acquired on a per-thread basis, and the total time for each communication thread to acquire all data frames does not exceed the expected time. This ensures that the required data can be obtained in a timely manner and prevents communication delays caused by one or more communication threads needing to acquire too many data frames.

[0088] In the data frame allocation method of this embodiment, the multiple data frames to be collected are allocated according to the data collection duration and the collection interval between data frames. The data collection duration of each communication thread can meet the expected duration requirement. Even if the data volume of one or more devices is too large, it can be allocated to different communication threads. Dynamic allocation of data frames according to the actual situation is beneficial to improving the efficiency of data collection. It is suitable for power monitoring systems with complex situations and high timeliness requirements.

[0089] Figure 2 The flowchart of a data frame allocation method 200 including a device communication list sorting step is shown in a preferred embodiment of the present invention, wherein step S201 is basically the same as step S101 in the foregoing embodiment, and will not be described again.

[0090] In step S202, the device communication list is sorted. The information of multiple data frames in the device communication list is arranged in a preset order. The sorting rules of the device communication list will be described in detail in subsequent embodiments.

[0091] The steps of allocating multiple data frames to multiple communication threads based on the data acquisition duration of each data frame and the acquisition interval between data frames include step S203, where n+1 data frames are sequentially selected from the device communication list according to its order, and step S204, where the n data frames are allocated to one communication thread when the total acquisition duration of the n+1 data frames exceeds the expected duration, and the total acquisition duration of the n data frames does not exceed the expected duration. Returning to step S203, data frames are sequentially selected from the device communication list and allocated to the next communication thread, until all data frames in the device communication list have been allocated.

[0092] In this embodiment, n represents a positive integer greater than or equal to 1. During the data acquisition process, a communication thread includes one or more data frames. Within a communication thread, data frames are acquired sequentially. The total acquisition time of all data frames is the time required by the communication thread. The total acquisition time includes the data acquisition time of each data frame and the acquisition interval time between data frames.

[0093] Selecting n+1 data frames in this step does not mean collecting data frames from the device communication list, but rather selecting n+1 data frames from multiple data frame entries in the device communication list for analysis in subsequent steps. After determining the thread allocation for the data frames, the corresponding data is collected; the data collection method will be described in later embodiments.

[0094] Figure 3 The flowchart of a data frame allocation method 300 according to a preferred embodiment of the present invention is shown. The data frame allocation method 300 includes a step of sorting the device communication list and a process of comparing the total acquisition time of the data frames with the expected time. Step S301 is essentially the same as step S101 in the data frame allocation method 100 in the aforementioned embodiment, and will not be described again here.

[0095] like Figure 3As shown, after obtaining the device communication list in step S301, the device communication list is sorted in step S302. According to different embodiments of the present invention, various sorting methods for the device communication list can be provided. For example, the data frames in the device communication list can be randomly sorted, or they can be grouped and sorted by device, or by gateway. Furthermore, the sorting priority can be set according to specific actual needs; however, this embodiment does not impose any limitations.

[0096] In step S303, data frames are selected sequentially from the device communication list according to their order. For each data frame, subsequent steps are executed separately to determine the total acquisition duration of that data frame and whether it is less than the expected duration. Based on the determination result, the data frame is allocated. For example, the data frame ranked first in the device communication list is selected, and subsequent steps are executed. After the subsequent steps for the first data frame are completed, the data frame ranked second in the device communication list is selected. Specifically, corresponding identifiers can be assigned to data frames according to the order of the device communication list (without needing to be appended to the data frame) to simplify the calculation. After allocating one data frame according to the order of the device communication list, each data frame in the device communication list is traversed to allocate all data frames.

[0097] In step S304, the total acquisition duration of the data frame is determined. In a preferred embodiment of the present invention, the total acquisition duration of the data frame is related to the data acquisition duration of the data frame, the acquisition interval duration between data frames, and the order of the data frame in the device communication list.

[0098] Within a communication thread, data is collected according to the order in the device communication list. The total collection time of a data frame includes the time consumed by data frames collected before this data frame. Therefore, in this embodiment, the total collection time of a data frame is determined based on the data collection time of the data frame, the collection interval between data frames, and the order of the data frames in the device communication list.

[0099] In step S305, it is determined whether the total acquisition time of the data frame is less than the expected time. When the total acquisition time of the data frame is less than the expected time, it means that the time required to acquire all data frames in the communication thread is less than the expected time, and the communication thread may be able to accommodate more data frames. The process returns to step S303, where data frames are selected from the device communication list according to the order of the device communication list, and subsequent steps are executed until the total acquisition time of a data frame in the device communication list is not less than the expected time.

[0100] Specifically, for example, in step S303, the data frame of the i-th bit is selected, and in step S305, it is determined that the total acquisition time of the data frame of the i-th bit is less than the expected time. Then, the process returns to step S303, selects the data frame of the (i+1)-th bit from the device communication list, and executes the subsequent steps.

[0101] When the total acquisition time of the data frames is not less than the expected time, in step S306, the first position of the data frame in the device communication list is selected as n, and the n data frames are allocated to a communication thread. Specifically, for example, in step S303, the i-th data frame is selected, and in step S305, it is determined that the total acquisition time of the i-th data frame is not less than the expected time. This means that when there are i data frames in the communication thread, the total acquisition time of the communication thread exceeds the expected time. Then, in step S306, the value of n is selected as the i-1th position, and n = i-1 data frames are allocated to a communication thread so that the total acquisition time of the communication thread does not exceed the expected time.

[0102] If the total acquisition time of all data frames in the device communication list is less than the expected time, all data frames in the device communication list can be assigned to a single communication thread.

[0103] According to a preferred embodiment of the present invention, the total acquisition time of the data frame can be calculated and determined according to the following formula:

[0104] T n =nt1+(n-1)t,

[0105] In the above formula, n represents the order of the data frame in the device communication list, and T n Let tn represent the total acquisition duration of the nth data frame in the device communication list, t1 represent the data acquisition duration of the data frame, and t represent the acquisition interval duration between data frames. In this embodiment, the difference in data acquisition duration between different data frames is small, and the data acquisition duration t1 of multiple different data frames is taken as a fixed value, while the acquisition interval duration t between data frames is set to a fixed value. When the data acquisition durations of different data frames are approximately equal, the total acquisition duration T of the nth data frame can be calculated according to the above formula. n .

[0106] According to the above formula, in some embodiments of the present invention, the total acquisition time of the data frame is positively correlated with the order of the data frame in the device communication list, i.e., T n The value of increases as n increases. Once the value of n is determined, it represents T. n Less than the expected duration, and T n+1 The total acquisition duration of data frames after the nth position in the device communication list is not less than the expected duration, and there is no need to calculate the total acquisition duration of data frames in subsequent sorting.

[0107] In other embodiments of the present invention, the data acquisition duration of different data frames may vary significantly. n When there are significant differences, the total acquisition time T of the data frame is calculated using the above formula. n There may be some error. Preferably, the total acquisition time T of the data frame is... n The following formula can be used for calculation:

[0108] T n =t n +t+T n-1 ,

[0109] T1 = t1,

[0110] Where t n This represents the data acquisition duration of the nth data frame in the device communication list. Based on the above formula, the total acquisition duration T of the data frame can be further increased. n This ensures accuracy while avoiding an excessive number of communication threads that could lead to high resource consumption.

[0111] Figure 4 The flowchart of a data frame allocation method 400 that allocates a fixed number of data frames according to some embodiments of the present invention is shown, wherein step S401 is basically the same as step S101 in the data frame allocation method 100 described in the foregoing embodiments, and will not be repeated.

[0112] In step S402, the value of n is determined based on the expected duration, the data acquisition duration of the data frame, and the acquisition interval duration between data frames.

[0113] For example, in some embodiments of the present invention, the data acquisition duration t1 of each data frame is approximately equal and can be a fixed value. The acquisition interval t between data frames can also be a fixed value.

[0114] T n =nt1+(n-1)t <E(T),

[0115] Where E(T) represents the expected duration, t1, t, and E(T) in the above formula can all be preset. Based on the above formula, we can obtain the inequality for n.

[0116]

[0117] After rounding, the value of n can be calculated, meaning that each communication thread includes n data frames, which can meet the expected duration requirement. For example... Figure 4As shown, in step S403, allocating n data frames to one communication thread ensures that the total acquisition time of the communication thread does not exceed the expected time. Furthermore, data frames in the device communication list can be grouped into n groups and allocated to the same communication thread. This embodiment simplifies the calculation process and reduces resource consumption.

[0118] Figure 5 The flowchart of a data frame allocation method 500 according to a preferred embodiment of the present invention is shown, which includes the step of randomly selecting data frames. In the data frame allocation method 500, step S501 is basically the same as step S101 in the data frame allocation method 100 in the foregoing embodiment, and will not be described again.

[0119] In step S502, n+1 data frames are randomly selected from the device communication list. Multiple data frame entries in the device communication list correspond to individual data frames. In this embodiment, the device communication list does not need to be sorted; n+1 data frames are randomly selected from the device communication list.

[0120] When the total acquisition time of n+1 data frames exceeds the expected time, and the total acquisition time of n data frames does not exceed the expected time, the n data frames are allocated to a communication thread. After allocating a communication thread, before returning to step S502, n+1 data frames are randomly selected from the device communication list until all data frames in the device communication list have been allocated. This embodiment eliminates the need to sort the device communication list, which simplifies the process and reduces resource consumption. Furthermore, different communication threads can have different numbers of data frames (n).

[0121] Figure 6 The flowchart of a data frame allocation method 600 according to a preferred embodiment of the present invention is shown. Steps S601, S602, S603, S604 and S605 of the data frame allocation method 600 are basically the same as steps S301, S302, S303, S304 and S305 of the data frame allocation method 300 in the foregoing embodiment, and will not be described again.

[0122] In this embodiment, the total acquisition time of data frames that are later in the device communication list may be less than the total acquisition time of data frames that are earlier in the list. In this embodiment, when the total acquisition time T of the i-th data frame is... iIf the acquisition duration is not less than the expected duration, skip the i-th data frame. In step S606, select the (i+1)-th data frame from the device communication list, return to step S604, and execute subsequent steps. In some embodiments, when the data acquisition duration of the i-th data frame is large, the total acquisition duration of the i-th data frame is not less than the expected duration, meaning the i-th data frame cannot be allocated to the current communication thread. However, the data acquisition duration of the (i+1)-th data frame may be small (excluding the acquisition duration of the i-th data frame). After skipping the i-th data frame, the total acquisition duration of the (i+1)-th data frame may be less than the expected duration, satisfying the requirement of allocation to a communication thread. The data frame method in this embodiment can make full use of communication threads, which is beneficial to reducing the number of communication threads.

[0123] Figure 7 The flowchart of a data frame allocation method 700 according to a preferred embodiment of the present invention is shown. Steps S701, S702, S703, S704, S705, and S706 in the data frame allocation method 700 are substantially the same as steps S301, S302, S303, S304, S305, and S306 in the data frame allocation method 300 of the aforementioned embodiment, and will not be repeated here. The following describes the process in conjunction with… Figure 7 The data frame allocation method 700 is explained.

[0124] When the total acquisition time of the data frames is not less than the expected time, in step S706, after determining the value of n, the n data frames are allocated to one communication thread, and in step S707, the information of the data frames allocated to the same communication thread is retrieved from the device communication list. Retrieving the data frame information from the device communication list in this step indicates that some data frames in the device communication list have been allocated, and does not mean that the data acquisition task will be executed directly.

[0125] In step S708, the device communication list is reordered. The sorting rule for the device communication list can be the same as the sorting rule in step S702, or it can be sorted using other sorting rules.

[0126] Preferably, when reordering the device communication list, the sorting rules in step S702 are used, or the order is directly shifted upwards. For example, in step S707, after retrieving information from n data frames in the device communication list, the (n+1)th data frame in the device communication list is used as the first data frame in the rearranged device communication list. After reordering the device communication list, the process returns to before step S703 and continues with subsequent steps until all data frames in the device communication list have been allocated.

[0127] Figure 8 and Figure 10The steps for sorting the device communication list according to different embodiments of the present invention are shown respectively. Figure 9 and Figure 11 The device communication lists in different embodiments of the present invention are shown below. Figures 8-11 The steps for sorting the device communication list are explained.

[0128] According to some embodiments of the present invention, the information of data frames in the device communication list includes a communication address, a communication port number, a device number, and a device frame start address. The communication address can represent the gateway address for device data communication, the communication port can represent the communication port of a device with similar functions such as a gateway, and the communication port number can be numbered in a preset order or randomly to distinguish different communication ports. The device number represents the device of the data source; each device has a preset number, and the numbering rule can also be random, used only to distinguish devices. One device may correspond to multiple data frames, and different data frames correspond to different start addresses within the device, which can be distinguished by the device frame start address. In this embodiment, a unique data frame can be identified through the communication address, communication port number, device number, and device frame start address, and these elements provide multiple sorting levels for sorting data frames in the device communication list. In different embodiments of the present invention, different sorting rules can be used for sorting. Figure 8 and Figure 9 This is just one specific example.

[0129] The steps for sorting the device communication list are as follows: Figure 8 As shown, in step S1001, the device communication list is sorted according to the communication address. For example, in complex systems with a large number of data sources, multiple communication addresses need to be allocated. The device communication list can be sorted according to the communication address. Figure 9 As shown, the communication addresses include 127.0.0.1, 127.0.0.2, 127.0.0.3, 127.0.0.4, 127.0.0.5, 127.0.0.6, etc., which can be sorted in ascending order or other sorting methods, and are not limited in this embodiment. In some embodiments of the present invention, the data acquisition system in the power monitoring system may only include one communication address, and this step can be skipped, without sorting, and subsequent steps can be performed directly.

[0130] A single communication address may include multiple communication ports. For example, a gateway device may include multiple communication ports. In step S1002, within the same communication address, the ports are sorted according to their communication port numbers. Figure 9As shown, 127.0.0.1 includes two communication ports, 502 and 503, which can also be sorted in ascending order. This step does not limit the specific sorting method, and different sorting levels can be sorted in different orders.

[0131] Multiple devices may transmit data through the same communication port. In step S1003, within the same communication port number, they are sorted according to their device numbers, for example... Figure 9 As shown, the device numbers corresponding to communication port 502 include 1 and 2, which can also be sorted in ascending order.

[0132] like Figure 8 As shown, the same device may include multiple data frames, which can be distinguished by the device frame start address. In step S1004, within the same device number, they are sorted according to the device frame start address. For example, the device numbered 1 can be distinguished and sorted by device frame start addresses 3000, 4000 and 5000, so as to correspond to a unique data frame.

[0133] Figure 9 The device communication list shown is only an example. The communication address, communication port number, device number and device frame start address have been simplified. In this embodiment, the data frames in the device communication list are sorted, but the sorting method is not limited to a single one.

[0134] Figure 10 The steps of sorting the device communication list are shown in some other embodiments according to the present invention. Figure 11 It shows the Figure 10 The steps shown are used to sort the device communication list.

[0135] In this embodiment, the device communication list includes the communication address, communication port number, device number, and device frame start address. For example... Figure 10 As shown, in step S2001, a group string is generated. The group string includes the communication address and the communication port number. Specifically, for example... Figure 11 As shown, the block string = communication address | communication port number. The block string represents a communication port for communication between the processor and the data source in the data acquisition system. Each communication port corresponds to a unique block string.

[0136] In step S2002, the device communication list is sorted according to the group string. The sorting rule can be... Figure 11 The ascending order shown can also be other sorting rules.

[0137] A single communication port may correspond to one or more devices. In step S2003, within the same group string, they are sorted according to the device number. A single device may correspond to multiple data frames, each with a unique device frame start address. In step S2004, within the same device number, they are sorted according to the device frame start address. The sorted device communication list is as follows: Figure 11 As shown.

[0138] According to a preferred embodiment of the present invention, when determining the data acquisition duration of a data frame based on actual measurement results, the data acquisition duration of data frames within the same group string can be determined based on the average value of the actual measurement results. Each group string represents a communication interface. For multiple data frames within that communication interface, the data acquisition duration of each data frame can be determined by calculating the average value. Setting the data acquisition duration of data frames within the same communication interface to a fixed value provides a certain degree of accuracy, ensuring the data acquisition duration of the data frame closely approximates the actual data acquisition duration. Furthermore, it simplifies calculations and reduces resource consumption.

[0139] This invention also includes an embodiment of a data acquisition method, which can be used to acquire data when monitoring power systems. Figure 12 The flowchart of a data acquisition method 800 according to an embodiment of the present invention is shown below, in conjunction with... Figure 12 The data acquisition method 800 is described.

[0140] In step S801, data frames are allocated according to the data frame allocation method described in the foregoing embodiments. According to the data frame allocation method described in the foregoing embodiments, multiple data frames in the device communication list are allocated to multiple communication threads. In subsequent steps, data is collected according to the communication threads based on the data frame allocation results.

[0141] According to a preferred embodiment of the present invention, the step of collecting data according to the communication thread includes steps S802-S804. In step S802, a communication thread string is generated. The communication thread string includes a communication address, a communication port number, a device number, and a device frame start address. In this embodiment, the communication thread string represents the identification ID (identity code) of the communication thread. The communication thread that needs to be used in data communication is named through the communication thread string.

[0142] According to a specific embodiment of the present invention, the communication thread string = communication address | communication port number | device number | device frame start address, for example 127.0.0.1 | 502 | 1 | 3000. The communication thread string represents a communication thread that has been allocated in step S801, which includes one or more data frames allocated to the communication thread.

[0143] In step S803, the communication threads are sorted according to the communication thread string. The specific sorting rule can be ascending order, but preferably, the communication threads are sorted in ascending order of data frame allocation, meaning that after one communication thread is allocated, it is placed next to the previously allocated communication thread. In step S804, the communication threads are executed according to the communication thread sorting to collect data.

[0144] According to a preferred embodiment of the present invention, the device frame start address in the communication thread string can be set to: the device frame start address of the last data frame in the device communication list among the data frames allocated to the communication thread. For example... Figure 9 In the device communication list shown, the first 5 rows of data frames are assigned to the same communication thread. The device frame start address of the last data frame in the device communication list is 3000. The device frame start address in the communication thread string corresponding to this communication thread can be 3000 to indicate the ending position of the data frame corresponding to the communication thread in the device communication list.

[0145] Preferably, the communication thread string can completely correspond to the last data frame in the device communication list among the data frames allocated to that communication thread, for example... Figure 9 The fifth line of the data frame contains the communication address, communication port number, device number, and device frame start address.

[0146] like Figure 13 As shown, the present invention also includes an embodiment of a data acquisition system 1 for acquiring data from multiple devices in a power system, enabling monitoring of the power system. The data acquisition system 1 includes multiple data sources 10 and a processor 20, wherein the processor 20 communicates with the multiple data sources 10, and the processor 20 is configured to execute the data acquisition method described in the foregoing embodiments, acquiring data from the multiple data sources 10.

[0147] In this embodiment, the data source can represent one or more physical devices in the power system, or it can represent a virtual device that does not exist physically. One data source can correspond to one data frame or multiple data frames.

[0148] The present invention also includes a computer-readable storage medium comprising computer-executable commands stored thereon, which, when executed by a processor, implement the data frame allocation method and / or data acquisition method as described in the foregoing embodiments. Specifically, the computer-readable storage medium may be a hard disk, magnetic disk, magnetic tape, optical disk, etc.

[0149] Finally, it should be noted that the above descriptions are merely embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for allocating data frames, applied to data acquisition in a power system, the method comprising: obtaining a device communication list, the device communication list comprising information of a plurality of data frames, wherein each information corresponds to a data frame; determining a data acquisition duration of each data frame and an acquisition interval duration between data frames; and allocating the plurality of data frames into a plurality of communication threads according to the data acquisition duration of each data frame and the acquisition interval duration between data frames, so that a total duration of data frames acquired by each communication thread does not exceed an expected duration. sorting the information of the plurality of data frames in the device communication list; the step of allocating the plurality of data frames into a plurality of communication threads comprises: sequentially selecting n+1 data frames according to the order of the device communication list; when a total acquisition duration of the n+1 data frames exceeds the expected duration and a total acquisition duration of n data frames does not exceed the expected duration, allocating the n data frames into one communication thread; repeating the above process until all data frames are allocated. 3.The method of claim 1, wherein the step of allocating the plurality of data frames into a plurality of communication threads comprises: determining a value of n according to the expected duration, the data acquisition duration and the acquisition interval duration between data frames, wherein a total acquisition duration of the n+1 data frames exceeds the expected duration and a total acquisition duration of n data frames does not exceed the expected duration; and allocating the n data frames into one communication thread. 4.The method of claim 1, wherein the step of allocating the plurality of data frames into a plurality of communication threads comprises: randomly selecting n+1 data frames from the device communication list; when a total acquisition duration of the n+1 data frames exceeds the expected duration and a total acquisition duration of n data frames does not exceed the expected duration, allocating the n data frames into one communication thread; and repeating the above process until all data frames are allocated. 5.The method of claim 2, wherein the step of allocating the plurality of data frames into a plurality of communication threads comprises: sequentially selecting a data frame according to the order of the device communication list; determining a total acquisition duration of the data frame; judging whether the total acquisition duration of the data frame is less than the expected duration; when the total acquisition duration of the data frame is less than the expected duration, returning to the step of sequentially selecting a data frame and repeating the subsequent steps; and when the total acquisition duration of the data frame is not less than the expected duration, taking a value of n as a previous one of the data frame in the device communication list.

2. The data frame allocation method of claim 1, further comprising: 6.The method of claim 2 or 5, further comprising: taking information of data frames allocated into the same communication thread from the device communication list; and re-sorting the device communication list. a communication address, a communication port number, a device number and a device frame start address; the step of sorting the device communication list comprises: ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ 7. The data frame allocation method of claim 2 or 5, wherein the data frame information includes: ​ ​ sorting the device communication list according to the communication address; sorting the device communication list according to the communication port number within the same communication address; sorting the device communication list according to the device number within the same communication port number; sorting the device communication list according to the device frame start address within the same device number.

8. The data frame allocation method of claim 2 or 5, wherein the data frame information includes: communication address, communication port number, device number and device frame start address; the step of sorting the device communication list comprises: generating a grouping string, the grouping string comprising the communication address and the communication port number; sorting the device communication list according to the grouping string; sorting the device communication list according to the device number within the same grouping string; sorting the device communication list according to the device frame start address within the same device number.

9. The data frame allocation method of claim 8, wherein the data acquisition duration of the data frame and the acquisition interval duration between the data frames are pre-set or set according to actual measurement results; and the expected duration is pre-set.

10. The data frame allocation method of claim 9, wherein the data acquisition duration of the data frame in the same grouping string in the device communication list is an average value determined according to actual measurement results.

11. A data acquisition method, comprising: allocating a plurality of data frames to a plurality of communication threads according to the data frame allocation method of any one of claims 1-10; and starting the plurality of communication threads to acquire the corresponding data frames.

12. The data acquisition method of claim 11, wherein the step of acquiring data according to the communication thread comprises: generating a communication thread string, the communication thread string comprising the communication address, the communication port number, the device number and the device frame start address; sorting the communication thread according to the communication thread string; and acquiring data according to the communication thread sorting.

13. The data acquisition method of claim 12, wherein the device frame start address in the communication thread string is the device frame start address of the data frame sorted last in the device communication list among the data frames allocated to the same communication thread.

14. A data acquisition system for acquiring data of a plurality of devices in a power system, the data acquisition system comprising: a plurality of data sources; a processor in communication with the plurality of data sources and configured to execute the data acquisition method of any one of claims 12-13 to acquire data from the plurality of data sources.

15. A computer readable storage medium comprising computer executable commands stored thereon, the executable commands, when executed by a processor, implementing the data frame allocation method of any one of claims 1-10 and / or the data acquisition method of any one of claims 11-14.