A multi-channel low-voltage batch reading system and method based on HPLC and double-mode communication

CN116456216BActive Publication Date: 2026-10-13HANGZHOU XILI INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310104123.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-10-13
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

[0004]本发明是为了克服现有技术中的集中器在进行并发抄表的过程中,容易受到其他非抄表过程的操作影响而造成采集成功率低的问题,提供了一种基于HPLC和双模通信的多路低压集抄系统及方法,在集中器处创建若干线程和分拣邮箱,并通过接收数据的AFN功能码的不同分拣到不同功能的线程中,避免了不同类型任务之间的冲突和拥堵,提高了低压集抄设备的采集成功率和采集即时性

Benefits of technology

[0038]本发明中对于并发抄表返回帧的完整性的判断是采集是否成功的一项条件,不完整的并发抄表返回帧说明数据采集失败;当并发抄表返回帧不完整时可以继续等到后续的数据帧,但是为了保证整个过程的流畅性以及其他测量点的采集,对等待时间进行阈值设置,超过时间阈值的认为采集失败。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116456216B_ABST
    Figure CN116456216B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on HPLC and dual-mode communication's multichannel low-voltage collection system, comprising: concentrator and HPLC-dual-mode module of two-way communication connection;The concentrator includes data receiving sorting main thread, the data receiving sorting main thread is used to create the sub-thread of different function types, and after the analysis of received task data, classification is carried out;The sub-thread selects the task data of corresponding function type and executes corresponding operation;Also disclosed is a kind of based on HPLC and dual-mode communication's multichannel low-voltage collection method.The application creates several threads and sorting mailbox at concentrator, and by the different sorting of the AFN function code of received data into different function threads, the conflict and congestion between different types of tasks are avoided, and the acquisition success rate and acquisition immediacy of low-voltage collection equipment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-voltage data collection equipment technology, and in particular to a multi-channel low-voltage data collection system and method based on HPLC and dual-mode communication. Background Technology

[0002] With the continuous development of society and the economy, the demand for diversified functions in electricity information collection systems is increasing. Simultaneously, due to the large-scale integration of new energy sources, microgrids, and interactive devices, as well as the rapid growth in residential electricity demand, current electricity collection systems are completely unable to meet the needs of diversified development. This has led to the emergence of a new generation of electricity information collection systems oriented towards the customer-side energy internet, constructing a "power supply + energy efficiency" service model. Built according to the positioning of "the main entry point for sensing data and the main exit point for control commands," the customer-side energy data infrastructure system follows the design principles of "universal and forward-looking architecture, stable and advanced technology, independent functional expansion, and customized interface," meeting the "plug-and-play" requirements of massive numbers of terminal devices. As electricity information collection systems are upgraded, the requirements for the collection capabilities of low-voltage collection equipment are becoming increasingly stringent. However, the existing collection programs of low-voltage meter reading equipment are still in a low-speed and narrow-bandwidth processing mode using narrow-band carrier and low-power wireless modules, which cannot meet the growing demands. Specifically, the carrier meter reading program of the concentrator cannot simultaneously process the data read by the electricity meter agent and the data reported by the HPLC-dual-mode module during concurrent meter reading. When these operations frequently occur during concurrent meter reading, they will seriously affect the execution of the collection task, and concurrent meter reading can only be paused to process the agent operation or the data reported by the module first, which greatly reduces the collection success rate.

[0003] The "Method, Apparatus and System for Meter Reading" disclosed in Chinese patent literature, publication number CN104318750A, publication date January 28, 2015, describes a method, apparatus and system for meter reading. During the first meter reading cycle, the concentrator continuously sends a first meter reading command and a second meter reading command to the central coordination device (CCO). The first meter reading command instructs the CCO to obtain the first meter reading data from the first meter, and the second meter reading command instructs the CCO to obtain the second meter reading data from the second meter. The system also receives a first reporting message and a second reporting message from the CCO. The first reporting message includes the first meter reading data and the identifier of the first meter, and the second reporting message includes the second meter reading data and the identifier of the second meter, thereby improving the efficiency of meter reading. However, this technology only considers the case where there is only concurrent meter reading during the working process. In reality, during the concurrent meter reading process, the concentrator will intersperse operations such as agent point reading, module data reporting (STA events and meter search events), concentrator periodically reading meter search data, and remote configuration parameters. These operations will seriously affect the normal execution of data collection tasks during the concurrent meter reading process, resulting in problems such as daily freeze and low success rate of load curve collection. Summary of the Invention

[0004] This invention aims to overcome the problem in existing technologies where concentrators are easily affected by other non-meter reading processes during concurrent meter reading, resulting in low data acquisition success rates. It provides a multi-channel low-pressure data collection system and method based on HPLC and dual-mode communication. Several threads and sorting mailboxes are created at the concentrator, and the received data is sorted into different functional threads based on different AFN function codes. This avoids conflicts and congestion between different types of tasks, improving the data acquisition success rate and immediacy of low-pressure data collection equipment.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A multi-channel low-voltage data collection system based on HPLC and dual-mode communication includes:

[0007] A concentrator and HPLC-dual-mode module with bidirectional communication connectivity;

[0008] The concentrator includes a main thread for receiving and sorting data, which is used to create sub-threads of different functional types and to parse and classify the received task data.

[0009] The sub-thread selects the task data of the corresponding function type and performs the corresponding operation.

[0010] This invention improves upon existing low-voltage meter reading equipment in the concentrator section by setting up a main thread for data reception and sorting and multiple sub-threads for different functional processing. A dedicated sub-thread is set up to handle the data collection task, while other types of tasks are executed by different sub-threads. Tasks within multiple sub-threads can be performed simultaneously within their respective threads, thereby ensuring that concurrent meter reading tasks are not interfered with by other operations, avoiding conflicts and congestion between different types of tasks, and improving the data collection success rate.

[0011] Preferably, the data receiving and sorting main thread creates several sorting mailboxes according to the circular linked list method;

[0012] The received Q / GDW376.2 protocol data is parsed to obtain AFN function codes and classified. Based on the classified AFN function code type, the data is sorted by the sorting mailbox to the corresponding sub-thread.

[0013] In the main thread of data receiving and sorting in this invention, the data collection files of the data collection device are synchronized with the files stored in the HPLC-dual-mode module. A circular linked list method is used to create sorting mailboxes, and the task data is classified according to the AFN function code in the received data. Different AFN function codes are matched with their corresponding sorting mailboxes to dispatch the task data to the queue of the corresponding sorting mailbox. The queues in the sorting mailboxes are processed according to the first-in, first-out principle.

[0014] Preferably, the sub-thread includes a data acquisition task execution sub-thread, which executes tasks in the data acquisition task queue sequentially according to the first-in-first-out principle;

[0015] For the data acquisition task being performed, the measurement points that need to be acquired are selected according to the preset or stored acquisition scheme, and then numbered and sorted.

[0016] In this invention, the task execution sub-thread is mainly used to extract the task with the longest queue time in the task queue and execute it. It collects electricity meter data according to the acquisition scheme associated with the current task and has the ability to automatically adapt to the maximum number of concurrent windows of the HPLC-dual-mode module and manage the acquisition and meter reading windows.

[0017] Preferably, the sub-thread includes a data acquisition task scheduling sub-thread, which stores data acquisition tasks and acquisition schemes, polls all stored data acquisition tasks at fixed intervals, and triggers a task execution switch based on the execution cycle and start time of the data acquisition tasks.

[0018] Once the execution switch for a data collection task is turned on, tasks are queued according to their priority and then pushed into the data collection task queue.

[0019] In this invention, the task scheduling sub-thread is mainly used to create the task queue and load the acquisition tasks and acquisition schemes configured by the acquisition 2.0 system in the memory of the data collection device. The acquisition tasks and acquisition schemes are pre-set and stored.

[0020] Preferably, the sub-thread includes a forwarding and reporting processing sub-thread, which is used to communicate with the remote acquisition system server and quickly respond to the data actively reported by the HPLC-dual-mode module.

[0021] In this invention, the forwarding and reporting sub-thread is mainly used to realize transparent forwarding to read and set operation data of the electricity meters connected to the current distribution area, as well as the active reporting data processing of the HPLC-dual-mode module. It can adapt to high-frequency remote operation of the electricity meters in the distribution area without affecting the execution progress of the acquisition task. At the same time, it can quickly respond to the data actively reported by the HPLC-dual-mode module, thereby realizing the full event acquisition function of the integrated acquisition and the electricity meters connected to the distribution area.

[0022] A multi-channel low-voltage data collection method based on HPLC and dual-mode communication includes:

[0023] S1. Filter measurement points and load acquisition mask data according to the acquisition task configuration and acquisition plan;

[0024] S2. After sorting the measurement points, data is collected sequentially. The data collection result mask is used to determine whether the current measurement point has completed the data collection. S3. If the data collection has not been completed, a concurrent meter reading frame is loaded according to the protocol type of the current measurement point, and the concurrent meter reading return frame is waited for.

[0025] S4. Parse the concurrent meter reading return frame and determine whether the returned data is empty or incorrect. If so, return to S2 to collect data for the next measurement point. Otherwise, store the current measurement point data and set the corresponding successful acquisition mask to 1.

[0026] S5. Determine whether all measurement points have been successfully collected. If so, store the successful collection mask data of the corresponding measurement point to complete the collection task. Otherwise, return to S2 to collect the next measurement point.

[0027] In this invention, a data acquisition mask is set during the data acquisition task, including a data acquisition result mask and a data acquisition success mask. A value of 1 corresponds to successful acquisition, and a value of 0 corresponds to successful acquisition. For data acquisition at a measurement point, when both masks are 1, it indicates that all data items at the current measurement point have been successfully acquired; otherwise, it indicates that all data items have not been acquired. In addition, a judgment on the concurrent meter reading return frame data is added during the entire concurrent meter reading data acquisition task to ensure the correctness of data acquisition.

[0028] Preferably, step S2 further includes the following step:

[0029] S21. Retrieve the acquisition result mask of the current measurement point to determine whether the acquisition is complete. If yes, proceed to S23; otherwise, proceed to S22. S22. Determine whether the number of acquisition failures of the current measurement point exceeds the set value. If yes, proceed to S23; otherwise, proceed to S3.

[0030] S23. Set the mask of the current measurement point to 1 and continue to collect data for the next measurement point. Enter S3.

[0031] In this invention, the acquisition result mask is used to determine whether the current measurement point has been successfully acquired. At the same time, a threshold setting is added for the number of acquisition failures. If the number of acquisition failures for the current measurement point exceeds the set value, it indicates that the acquisition of the measurement point has not been successful. After the normal acquisition task is completed, the acquisition of these measurement points that have not been successfully acquired is re-accounted at a later time.

[0032] Preferably, during the process of waiting for concurrent meter reading return frames in S3...

[0033] Check if the concurrent meter reading window of the detection point has timed out and returned; if so, delete the timed-out concurrent meter reading window.

[0034] Check if the number of concurrent meter reading windows is greater than the maximum number of windows. If so, continue to wait for the concurrent meter reading return frame. Otherwise, return to S2 and start collecting data for the next measurement point.

[0035] The invention removes concurrent meter reading windows that return timeouts, ensuring that there are no stagnant windows throughout the process, thereby completing the data acquisition of the entire area's electricity meters with minimal time loss. In addition, multiple concurrent meter reading windows can work simultaneously throughout the process, with the maximum number of windows depending on the maximum number of concurrent windows in the HPLC-dual-mode module.

[0036] As a preferred option, before parsing the concurrent meter reading return frame, it is determined whether a normal concurrent meter reading return frame has been received. If so, proceed to S4; otherwise, continue to wait for the concurrent meter reading return frame. When the waiting time exceeds the time threshold, return to S2 to collect the data for the next measurement point.

[0037] The normal concurrent meter reading return frame is a data frame containing the complete Q / GWD376.2 protocol format.

[0038] In this invention, the integrity of the concurrent meter reading return frame is a condition for whether the data acquisition is successful. An incomplete concurrent meter reading return frame indicates that the data acquisition has failed. When the concurrent meter reading return frame is incomplete, we can continue to wait for subsequent data frames. However, in order to ensure the smoothness of the whole process and the acquisition of other measurement points, a threshold is set for the waiting time. If the waiting time exceeds the threshold, the acquisition is considered to have failed.

[0039] This invention has the following beneficial effects: Several threads and sorting mailboxes are created at the concentrator, and task data is sorted into threads with different functions based on the different AFN function codes received according to the Q / GDW376.2 protocol. This perfectly solves the problem of frequently interleaving different AFN function code tasks during data acquisition, avoiding conflicts and congestion between different types of tasks, and improving the success rate and immediacy of data acquisition for low-voltage data collection equipment. Furthermore, by creating a linked list to implement a buffer queue for pending data acquisition tasks, the problem of the next data acquisition task failing to execute when the previous task is not completed and has timed out is solved, thereby reducing the number of lost data points in low-voltage data collection equipment. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the multi-channel low-voltage data collection system of the present invention;

[0041] Figure 2 This is a flowchart of the multi-channel low-voltage centralized meter reading method of the present invention;

[0042] Figure 3 This is a schematic diagram of the thread of the multi-channel low-voltage centralized data collection system in an embodiment of the present invention;

[0043] Figure 4 This is a flowchart of the data acquisition task in an embodiment of the present invention. Detailed Implementation

[0044] The present invention will now be further described with reference to the accompanying drawings and specific embodiments.

[0045] like Figure 1 As shown, a multi-channel low-voltage data collection system based on HPLC and dual-mode communication includes:

[0046] A concentrator and HPLC-dual-mode module with bidirectional communication connectivity;

[0047] The concentrator includes a main thread for receiving and sorting data. This main thread is used to create sub-threads with different functional types and to parse and classify the received task data.

[0048] The child thread selects the task data of the corresponding function type and performs the corresponding operation.

[0049] The main thread for receiving and sorting data creates several sorting mailboxes using a circular linked list method.

[0050] The received Q / GDW376.2 protocol data is parsed to obtain AFN function codes and classified. Based on the classified AFN function code type, the data is sorted by the sorting mailbox to the corresponding sub-thread.

[0051] Sub-threads include data acquisition task execution sub-threads, which execute tasks in the data acquisition task queue sequentially according to the first-in-first-out principle; for each executed data acquisition task, the measurement points that need to be collected are selected according to the preset or stored data acquisition scheme, and then numbered and sorted.

[0052] The sub-threads include a task scheduling sub-thread, which stores the task and the plan, polls all the stored tasks at fixed intervals, and triggers the task execution switch according to the task's execution cycle and start time.

[0053] Once the execution switch for a data collection task is turned on, tasks are queued according to their priority and then pushed into the data collection task queue.

[0054] The sub-threads include forwarding and reporting processing sub-threads, which are used to communicate with the remote acquisition system server and quickly respond to the data actively reported by the HPLC-dual-mode module.

[0055] The sub-threads also include advanced application sub-threads, used to implement advanced application functions, including active meter search by the data collection device, program upgrades for master-slave node (HPLC-dual-mode module and energy meter) modules, broadcast time synchronization, obtaining and comparing the ID information of master-slave node modules, obtaining network scale, obtaining network topology information, obtaining node phase information, and obtaining slave node version information, and storing the above information in the data collection device's memory for recall; realizing asset management of the HPLC-dual-mode module, drawing power line communication network topology maps, and locating the phase of the energy meter in the distribution area.

[0056] This invention improves upon existing low-voltage meter reading equipment in the concentrator section by setting up a main thread for data reception and sorting and multiple sub-threads for different functional processing. A dedicated sub-thread is set up to handle the data collection task, while other types of tasks are executed by different sub-threads. Tasks within multiple sub-threads can be performed simultaneously within their respective threads, thereby ensuring that concurrent meter reading tasks are not interfered with by other operations, avoiding conflicts and congestion between different types of tasks, and improving the data collection success rate.

[0057] In the main thread of data receiving and sorting in this invention, the data collection files of the data collection device are synchronized with the files stored in the HPLC-dual-mode module. A circular linked list method is used to create sorting mailboxes, and the task data is classified according to the AFN function code in the received data. Different AFN function codes are matched with their corresponding sorting mailboxes to dispatch the task data to the queue of the corresponding sorting mailbox. The queues in the sorting mailboxes are processed according to the first-in, first-out principle.

[0058] In this invention, the data acquisition task execution sub-thread is mainly used to extract the acquisition task with the longest queuing time from the acquisition task queue and execute it. It acquires electricity meter data according to the acquisition scheme associated with the current acquisition task, and has the ability to automatically adapt to the maximum number of concurrent windows of the HPLC-dual-mode module and manage the acquisition and meter reading windows. When communication is not smooth at a single measurement point (such as an electricity meter) on the power line, the acquisition and meter reading window that has timed out while waiting for the reading return will be deleted, and a new acquisition and meter reading window for a new measurement point will be added, thereby achieving the goal of completing the data acquisition of the entire distribution area's slave nodes with minimal time loss.

[0059] In this invention, the task scheduling sub-thread is mainly used to create the task queue and load the acquisition tasks and acquisition schemes configured by the acquisition 2.0 system in the memory of the data collection device. The acquisition tasks and acquisition schemes are pre-set and stored.

[0060] In this invention, the forwarding and reporting sub-thread is mainly used to realize transparent forwarding to read and set operation data of the electricity meters connected to the current distribution area, as well as the active reporting data processing of the HPLC-dual-mode module. It can adapt to high-frequency remote operation of the electricity meters in the distribution area without affecting the execution progress of the acquisition task. At the same time, it can quickly respond to the data actively reported by the HPLC-dual-mode module, thereby realizing the full event acquisition function of the integrated acquisition and the electricity meters connected to the distribution area.

[0061] like Figure 2 and Figure 4 As shown, a multi-channel low-voltage data collection method based on HPLC and dual-mode communication includes:

[0062] S1. Filter measurement points and load acquisition mask data according to the acquisition task configuration and acquisition plan;

[0063] S2. After sorting the measurement points, data is collected sequentially. The data collection result mask is used to determine whether the current measurement point has completed the data collection. S3. If the data collection has not been completed, a concurrent meter reading frame is loaded according to the protocol type of the current measurement point, and the concurrent meter reading return frame is waited for.

[0064] S4. Parse the concurrent meter reading return frame and determine whether the returned data is empty or incorrect. If so, return to S2 to collect data for the next measurement point. Otherwise, store the current measurement point data and set the corresponding successful acquisition mask to 1.

[0065] S5. Determine whether all measurement points have been successfully collected. If so, store the successful collection mask data of the corresponding measurement point to complete the collection task. Otherwise, return to S2 to collect the next measurement point.

[0066] S2 also includes the following steps:

[0067] S21. Retrieve the acquisition result mask of the current measurement point to determine whether the acquisition is complete. If yes, proceed to S23; otherwise, proceed to S22. S22. Determine whether the number of acquisition failures of the current measurement point exceeds the set value. If yes, proceed to S23; otherwise, proceed to S3.

[0068] S23. Set the mask of the current measurement point to 1 and continue to collect data for the next measurement point. Enter S3.

[0069] During the process of waiting for concurrent meter reading return frames in S3

[0070] Check if the concurrent meter reading window of the detection point has timed out and returned; if so, delete the timed-out concurrent meter reading window.

[0071] Check if the number of concurrent meter reading windows is greater than the maximum number of windows. If so, continue to wait for the concurrent meter reading return frame. Otherwise, return to S2 and start collecting data for the next measurement point.

[0072] Before parsing the concurrent meter reading return frame, determine whether a normal concurrent meter reading return frame has been received. If so, proceed to S4; otherwise, continue waiting for the concurrent meter reading return frame. When the waiting time exceeds the time threshold, return to S2 to collect data for the next measurement point.

[0073] Normal concurrent meter reading returns a data frame containing the complete Q / GWD376.2 protocol format.

[0074] In this invention, a data acquisition mask is set during the data acquisition task, including a data acquisition result mask and a data acquisition success mask. A value of 1 corresponds to successful acquisition, and a value of 0 corresponds to successful acquisition. For data acquisition at a measurement point, when both masks are 1, it indicates that all data items at the current measurement point have been successfully acquired; otherwise, it indicates that all data items have not been acquired. In addition, a judgment on the concurrent meter reading return frame data is added during the entire concurrent meter reading data acquisition task to ensure the correctness of data acquisition.

[0075] In this invention, the acquisition result mask is used to determine whether the current measurement point has completed the acquisition. At the same time, a threshold setting is added for the number of acquisition failures. If the number of acquisition failures for the current measurement point exceeds the set value, it indicates that the acquisition of the measurement point has not been successful. After the normal acquisition task is completed, the acquisition of these measurement points that have not been successfully acquired is re-read at a later time. This processing method has been applied in existing low-voltage data collection equipment.

[0076] The invention removes concurrent meter reading windows that return timeouts, ensuring that there are no stagnant windows throughout the process, thereby completing the data acquisition of the entire area's electricity meters with minimal time loss. In addition, multiple concurrent meter reading windows can work simultaneously throughout the process, with the maximum number of windows depending on the maximum number of concurrent windows in the HPLC-dual-mode module.

[0077] In this invention, the integrity of the concurrent meter reading return frame is a condition for whether the data acquisition is successful. An incomplete concurrent meter reading return frame indicates that the data acquisition has failed. When the concurrent meter reading return frame is incomplete, we can continue to wait for subsequent data frames. However, in order to ensure the smoothness of the whole process and the acquisition of other measurement points, a threshold is set for the waiting time. If the waiting time exceeds the threshold, the acquisition is considered to have failed.

[0078] The test results from the on-site installation test in this embodiment are shown in the table below:

[0079] Time taken to collect 2 data items ≤200 seconds ≤300 seconds ≤900 seconds Time taken to collect 7 data items ≤370 seconds ≤800 seconds ≤1200 seconds

[0080] like Figure 3The diagram illustrates the thread structure of the multi-channel low-voltage data collection system in this embodiment of the invention. The main thread for receiving and sorting data (thread 3) is used for receiving and sorting serial port data; the sub-thread for executing acquisition tasks (thread 2) is used for executing acquisition tasks; the sub-thread for scheduling acquisition tasks (thread 5) is used for scheduling acquisition tasks; the sub-thread for forwarding and reporting processing (thread 1) is used for transparent forwarding and reporting processing; and the sub-thread for in-depth application processing (thread 4) is used for data processing in in-depth applications. After the electricity meter data acquisition task starts, thread 3 is created. After completing the initialization of the HPLC-dual-mode communication module and the synchronization of the acquisition files, thread 3 creates threads 2, 5, 1, and 4, and creates mailboxes Memory Cache 1#, Memory Cache 2#, Memory Cache 3#, and Memory Cache 4#. The mailboxes are created using a circular linked list method, and data inflow and outflow follow a first-in, first-out (FIFO) principle. Thread 3 then enters the loop detection phase to receive data sent by the HPLC-dual-mode communication module. Once a Q / GWD376.2 protocol data frame is identified in the receive buffer, it is parsed sequentially. Based on the extracted AFN function codes in the Q / GWD376.2 protocol data frames, the data is sorted and dispatched to the corresponding sorting mailboxes. Thread 2 detects whether meter reading data with AFN=0xf1 exists in Memory Cache 2# mailbox; Thread 1# detects whether HPLC-dual-mode communication module actively reported data with AFN=0x06 exists in Memory Cache 1# mailbox and whether transparent forwarding return data with AFN=0x13 exists in Memory Cache 3# mailbox; Thread 4# detects whether HPLC-dual-mode module parameter or data read return data with AFN=0x10 exists in Memory Cache 3# mailbox or HPLC-dual-mode module setting return response data with AFN=0x00 exists. Subsequently, each thread processes its extracted AFN function code data in parallel.

[0081] Thread 3 is the parent thread for data reception and sorting, primarily responsible for serial port initialization and serial data reception and parsing. It also creates threads 2#, 5#, 1#, and 4#; loads the acquisition files stored in memory; compares and synchronizes them with the files stored in the HPLC-dual-mode module; and creates AFN sorting mailboxes Memory Cache 1#, Memory Cache 2#, Memory Cache 3#, and the acquisition task queue mailbox Memory Cache 4#. After reading the acquisition files from memory, Thread 3 places them into the memory of the low-voltage data collection device and compares them with the electricity meter information stored in the HPLC-dual-mode module. If the electricity meter stored in the HPLC-dual-mode module is not found in the memory of the low-voltage data collection device, it is deleted. After completing the reading and comparison of all electricity meter information in the HPLC-dual-mode module, if an electricity meter in the memory of the low-voltage data collection device is not found in the HPLC-dual-mode module, the corresponding electricity meter is added to the module. After the file synchronization is completed, thread 3 enters a loop to detect and receive Q / GDW376.2 protocol data from the serial port, and sorts and dispatches the data to the corresponding sorting mailboxes Memory Cache 1#, Memory Cache 2#, and Memory Cache 3# according to the AFN function code of the parsed Q / GDW376.2 protocol.

[0082] Thread 2 is a sub-thread for executing data acquisition tasks. It retrieves a data acquisition task from the task queue in Memory Cache 4# and executes it. First, Thread 2 retrieves a data acquisition task from Memory Cache 4#, and then obtains the corresponding scheme information from the task scheme configuration parameter file of the low-voltage data acquisition device based on the scheme number in the task configuration information. Then, based on the user type configured in the scheme information, it filters the corresponding measurement points (measurement points are electricity meters) from the data acquisition archive memory created by Thread 3 and stores them in array A for sorting. Then, starting from measurement point 0 in array A, it packages Q / GDW376.2 protocol meter reading data frames and sends them to the HPLC-dual-mode module. The maximum number of meter reading windows initially increases gradually, and stops increasing when the HPLC-dual-mode module returns an error code indicating that the meter reading window is full. When encountering power line communication congestion and continuous timeouts when reading electricity meters, Thread 2 will decrease the maximum number of meter reading windows according to the transmit / receive ratio, and will stop decreasing when the number of windows reaches 5. Subsequently, if power line communication is smooth and the transmit / receive ratio increases, the maximum number of meter reading windows is incremented until the HPLC-dual-mode module returns an error code indicating that the meter reading window is full, thus stopping the increment and automatically adjusting the maximum number of meter reading windows. Additionally, when power line carrier communication is unsuccessful, thread 2 will count timeout windows exceeding 30 seconds based on the start time of the issued meter reading window and delete these timeout windows. Then, a new meter reading window for the next measurement point is added to array A in memory, ensuring no idle windows during the acquisition process and completing the data acquisition of the entire transformer area's electricity meters with minimal time loss.

[0083] In Example 1, when Thread 2 sends a data frame from the energy meter to the HPLC-dual-mode module during the data acquisition task, Thread 1 receives the data frame from the remotely summoned energy meters in the acquisition 2.0 system (remote acquisition system server) and packages it into a Q / GWD376.2 protocol data frame, sending it to the HPLC-dual-mode module. Then, Thread 3 receives the Q / GWD376.2 protocol routing and forwarding and concurrent meter reading return data frames returned by the HPLC-dual-mode module. Thread 3 parses the return data with AFN function codes 0x13 and 0xf1 and distributes them to Thread 1 and Thread 2 respectively via mailboxes Memory Cache 3# and Memory Cache 2#. Subsequently, Thread 1 extracts the transparent forwarding return data frame from mailbox Memory Cache 3# and sends it to the acquisition 2.0 system (remote acquisition system server) via message queue and GPRS. Simultaneously, Thread 2 extracts the meter reading return data from mailbox Memory Cache 2# and completes the data acquisition and storage of the energy meter at the current measurement point.

[0084] In Example 2, when Thread 2 sends the data frame from the energy meter to the HPLC-dual-mode module during the data acquisition task, Thread 3 receives the active reporting data frame and the concurrent meter reading return data frame from the HPLC-dual-mode module, respectively, according to the Q / GWD376.2 protocol. Thread 3 parses the return data with AFN function codes 0x06 and 0xf1 and distributes them to Thread 1 and Thread 2 via mailboxes MemoryCache1# and MemoryCache2#, respectively. Then, Thread 1 retrieves the reported data from mailbox MemoryCache1# and processes it according to the reported data content, responding instantly to the on-demand data acquisition or full-event data acquisition function of the data acquisition 2.0 system (remote data acquisition system server). Simultaneously, Thread 2 retrieves the meter reading return data from mailbox MemoryCache2# and completes the data acquisition and storage of the energy meter at the current measurement point.

[0085] In Example 3, when Thread 2 sends the data frame from the electricity meter to the HPLC-dual-mode module during the data acquisition task, Thread 4 enters the timed operations of the HPLC-dual-mode module for reading meter search information and collecting in-depth application information of the transformer area, and sends a data query command to the HPLC-dual-mode communication module. Then, Thread 3 receives the return data frames of the Q / GWD376.2 protocol routing query and concurrent meter reading from the HPLC-dual-mode module. Thread 3 parses the return data with AFN function codes 0x10 and 0xf1 and distributes them to Thread 4 and Thread 2 respectively through mailboxes Memory Cache 3# and Memory Cache 2#. Subsequently, Thread 4 extracts the meter search information or in-depth application information data from the HPLC-dual-mode module from mailbox Memory Cache 3# and saves the information data to the memory of the acquisition device. At the same time, Thread 2 extracts the meter reading return data from mailbox Memory Cache 2# and completes the data acquisition and storage of the electricity meter at the current measurement point.

[0086] In Example 4, when Thread 2 sends a data frame from the electricity meter to the HPLC-dual-mode module during the data acquisition task, Thread 3 receives multiple complete and one incomplete Q / GWD376.2 protocol concurrent meter reading data frames returned by the HPLC-dual-mode module. Thread 3 first extracts the complete protocol data frame from the receive buffer and assigns it to Thread 2 via Memory Cache 2# to complete the electricity meter data acquisition. Then, Thread 3 shifts the start pointer of the data frame extraction function module to the last byte of the incomplete data frame, and continues to read the serial port of the acquisition device, appending the read data to the end of the incomplete data frame. Thread 3's data frame extraction part continuously scans the entire receive buffer to search for and extract complete Q / GWD376.2 protocol data frames. If a complete data frame has not yet been extracted, Thread 3 continues the above operation until the time exceeds a set time threshold. If no complete data frame is found at the end of the receive buffer, the entire buffer is cleared and initialized, and the system continues to receive data sent by other HPLC-dual-mode modules.

[0087] In Example 5, when Thread 2 sends a data frame from the energy meter to the HPLC-dual-mode module during the data acquisition task, Thread 5 detects a new task that needs to be executed and pushes the information of the currently executing task into MemoryCache 4#. After Thread 2 completes its current task, it retrieves the new task from the data acquisition task queue in MemoryCache 4# and begins executing it. If Thread 2's data acquisition task progress is slow, resulting in more than 10 tasks accumulating in MemoryCache 4#, Thread 5 scans the memory space of MemoryCache 4# when pushing in a new task, removing tasks whose push time is more than two execution cycles of the task, and reclaiming the memory space of those tasks. When the application encounters an exception or reset, Thread 5 stores the unexecuted tasks in MemoryCache 4# into the device's memory. When the application restarts, Thread 5 reloads the unexecuted task data from memory and pushes it into MemoryCache 4#, allowing Thread 2 to continue completing the data acquisition task before the program exited.

[0088] The above embodiments are further elaborations and descriptions of the present invention to facilitate understanding, and are not intended to limit the present invention in any way. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A multi-channel low-voltage data collection system based on HPLC and dual-mode communication, characterized in that, include: A concentrator and HPLC-dual-mode module with bidirectional communication connectivity; The concentrator includes a main thread for receiving and sorting data. This main thread is used to create sub-threads of different functional types and several sorting mailboxes, and to parse and classify the received task data. The received Q / GDW376.2 protocol data is parsed to obtain AFN function codes and classified. Based on the classified AFN function code type, the data is sorted by the sorting mailbox to the corresponding sub-thread. The sub-threads include at least a data acquisition task execution sub-thread and a forwarding and reporting processing sub-thread, with each sub-thread processing the data of its extracted AFN function code in parallel; The sub-thread selects the task data of the corresponding function type and performs the corresponding operation.

2. The multi-channel low-voltage data collection system based on HPLC and dual-mode communication according to claim 1, characterized in that, The data receiving and sorting main thread creates the several sorting mailboxes according to the circular linked list method.

3. A multi-channel low-voltage data collection system based on HPLC and dual-mode communication according to claim 1 or 2, characterized in that, The data acquisition task execution sub-thread executes the tasks in the data acquisition task queue sequentially according to the first-in-first-out principle; for each data acquisition task being executed, the measurement points that need to be acquired are selected according to the preset or stored data acquisition scheme, and then numbered and sorted.

4. The multi-channel low-voltage data collection system based on HPLC and dual-mode communication according to claim 3, characterized in that, The sub-threads include a task scheduling sub-thread for storing task collection and collection plans. It polls all stored task collections at fixed intervals and triggers task execution switches based on the task execution cycle and start time. Once the execution switch for a data collection task is turned on, tasks are queued according to their priority and then pushed into the data collection task queue.

5. A multi-channel low-voltage data collection system based on HPLC and dual-mode communication according to claim 1, 2, or 4, characterized in that, The forwarding and reporting sub-thread is used to communicate with the remote acquisition system server and quickly respond to the data actively reported by the HPLC-dual-mode module.

6. A multi-channel low-voltage data collection method based on HPLC and dual-mode communication, applicable to the multi-channel low-voltage data collection system as described in any one of claims 1-5, characterized in that, include: S1. Filter measurement points and load acquisition mask data according to the acquisition task configuration and acquisition plan; S2. After sorting the measurement points, data is collected sequentially. The current measurement point is determined to have completed data collection based on the mask of the collection results. S3. If data collection is not completed, load and send a concurrent meter reading frame according to the current measurement point protocol type, and wait for the concurrent meter reading return frame. S4. Parse the concurrent meter reading return frame and determine whether the returned data is empty or incorrect. If so, return to S2 to collect data for the next measurement point. Otherwise, store the current measurement point data and set the corresponding successful acquisition mask to 1. S5. Determine whether all measurement points have been successfully collected. If so, store the successful collection mask data of the corresponding measurement point to complete the collection task. Otherwise, return to S2 to collect the next measurement point.

7. The multi-channel low-voltage data collection method based on HPLC and dual-mode communication according to claim 6, characterized in that, S2 also includes the following steps: S21. Retrieve the acquisition result mask of the current measurement point to determine whether the acquisition is complete. If yes, proceed to S23; otherwise, proceed to S22. S22. Determine whether the number of failed acquisitions at the current measurement point exceeds the set value. If yes, proceed to S23; otherwise, proceed to S3. S23. Set the mask of the current measurement point to 1 and continue to collect data for the next measurement point. Enter S3.

8. The multi-channel low-voltage data collection method based on HPLC and dual-mode communication according to claim 6, characterized in that, During the process of waiting for concurrent meter reading return frames in S3... Check if the concurrent meter reading window of the detection point has timed out and returned; if so, delete the timed-out concurrent meter reading window. Check if the number of concurrent meter reading windows is greater than the maximum number of windows. If so, continue to wait for the concurrent meter reading return frame. Otherwise, return to S2 and start collecting data for the next measurement point.

9. A multi-channel low-voltage data collection method based on HPLC and dual-mode communication according to claim 6, 7, or 8, characterized in that, Before parsing the concurrent meter reading return frame, determine whether a normal concurrent meter reading return frame has been received. If so, proceed to S4; otherwise, continue waiting for the concurrent meter reading return frame. When the waiting time exceeds the time threshold, return to S2 to collect data for the next measurement point. The normal concurrent meter reading return frame is a data frame containing the complete Q / GWD376.2 protocol format.

Citation Information

Patent Citations

  • Meter reading method, device and system

    CN104318750A

  • Lock-free multi-co-processing thread concurrent meter reading method based on double-ring queue

    CN113242059A

  • Concurrent meter reading method and system applied to HPLC (High Performance Liquid Chromatography) meter reading

    CN115665211A