An event-driven data acquisition optimization system and method

By using an event-driven data acquisition optimization system, the real-time and integrity issues of traditional timed tasks in base station data acquisition are solved, achieving efficient and flexible data acquisition to meet the needs of modern communication networks.

CN120614647BActive Publication Date: 2026-11-20INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510993629.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2026-11-20
Estimated Expiration
2045-07-18

AI Technical Summary

Technical Problem

Traditional timed task methods cannot effectively cope with the dynamic and unbalanced changes in data traffic during base station data acquisition, resulting in poor real-time performance, easy data loss, and difficulty in meeting the stringent requirements of modern communication networks.

Method used

An event-driven data acquisition optimization system is adopted, including an event monitoring module, a task scheduling module, and a data acquisition module. The system monitors the base station data file storage directory through the inotify mechanism, generates and prioritizes acquisition tasks, reads and verifies data in blocks, and dynamically adjusts the transmission rate to ensure the stability and integrity of data transmission.

Benefits of technology

It significantly improves the real-time performance and completeness of base station data collection, enhances resource utilization efficiency, possesses good scalability and flexibility, and avoids data loss and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120614647B_ABST
    Figure CN120614647B_ABST
Patent Text Reader

Abstract

The application particularly relates to an event-driven data collection optimization system and method. The event-driven data collection optimization system comprises an event monitoring module, a task scheduling module and a data collection module. The event-driven data collection optimization method effectively solves the problems of poor real-time performance and easy data loss of traditional timing tasks in base station data collection, significantly improves the real-time performance and completeness of base station data collection, improves resource utilization efficiency, and has good scalability and flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data acquisition and scheduling technology, and in particular to an event-driven data acquisition optimization system and method. Background Technology

[0002] In today's era of rapid development in communication networks, base stations, as key nodes in these networks, undertake the task of processing and transmitting massive amounts of data. The accuracy, real-time performance, and completeness of base station data collection play a crucial role in optimizing, managing, and improving the quality of service in communication networks.

[0003] Currently, traditional timed tasks are commonly used for data acquisition scheduling in base station data acquisition systems. This timed task model can ensure data acquisition to a certain extent when data traffic is relatively stable and regular. However, with the increasing diversification and complexity of communication services, data traffic exhibits dynamic characteristics, and these changes are significantly uneven.

[0004] Specifically, when the time interval is set small, such as when tasks are executed on an hourly basis, the following situation often occurs: at the time of task execution, the corresponding data files have not yet been generated or transmitted. This results in a local execution idle period, causing the data collection task to fail to acquire valid data. This not only wastes system resources but may also lead to the loss of critical data, affecting subsequent accurate analysis and decision-making regarding the base station's operational status.

[0005] On the other hand, while setting a larger time interval can avoid the problem of missed rounds due to files not being generated to some extent, it also introduces new issues. When the task is executed, the accumulation of too many data files during the interval can cause local data transmission congestion. Data transmission congestion not only reduces the data transmission speed and affects the real-time performance of data acquisition, but also may lead to the loss of some data when the data volume is too large and transmission resources are limited, thus seriously affecting the integrity of data acquisition.

[0006] In summary, traditional timed task scheduling methods for base station data acquisition face significant challenges in controlling the data acquisition process due to their inability to effectively handle dynamic and unbalanced changes in data traffic. This makes it difficult to meet the stringent requirements of modern communication networks for the real-time performance and completeness of base station data acquisition. Therefore, a more advanced, flexible, and effective scheduling technology is urgently needed to solve these problems.

[0007] Based on the above, this invention proposes an event-driven data acquisition optimization system and method. Summary of the Invention

[0008] To overcome the shortcomings of existing technologies, this invention provides a simple and efficient event-driven data acquisition optimization method.

[0009] This invention is achieved through the following technical solution:

[0010] An event-driven data acquisition optimization system includes an event monitoring module, a task scheduling module, and a data acquisition module.

[0011] Event monitoring module: responsible for creating inotify instances based on the inotify mechanism, registering monitoring items with the kernel to monitor the base station data file storage directory; reading the inotify event queue in a loop and parsing the captured events; if a data file generation event is detected, the event notification is sent to the task scheduling module.

[0012] After creating an inotify instance, the event monitoring module first obtains the inotify file descriptor; then, based on the inotify file descriptor, it uses system call functions to add a monitoring item for the base station data file storage directory to the kernel and sets the monitoring event mask, including data file creation events.

[0013] Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

[0014] Task scheduling module: After receiving an event notification, it is responsible for generating corresponding data collection tasks according to the event type and setting priorities for the tasks; inserting tasks into the task queue according to priority, monitoring the status of the task queue in real time, and retrieving the highest priority task from the task queue and assigning it to the data collection module when system resources allow, and recording the task execution status.

[0015] The task scheduling module is responsible for task generation, priority setting, task queue management, task allocation, and status recording. The specific implementation method is as follows:

[0016] (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task.

[0017] (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user;

[0018] (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue.

[0019] (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed.

[0020] Data acquisition module: Responsible for receiving tasks from the task scheduling module, obtaining the path to the data file to be collected, reading the data file in blocks, performing checksum calculation on each data block after reading, and comparing it with the checksum information carried in the file.

[0021] If they match, the data is sent to the data processing center.

[0022] If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module.

[0023] After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module.

[0024] The data acquisition module is responsible for reading data files, transmitting data in chunks, performing verification calculations, and handling errors. The specific implementation method is as follows:

[0025] (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size.

[0026] (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. In terms of data transmission protocol selection, a suitable protocol, such as TCP / IP protocol, is selected according to the characteristics of the base station data file and the network environment.

[0027] (3) Checksum calculation: For each read data block, a checksum is calculated using a preset checksum algorithm (such as CRC-32 algorithm), and the calculated checksum is compared with the checksum information carried in the data file;

[0028] (4) Error handling: If the comparison results are inconsistent, the data block should be reread.

[0029] The data acquisition module has a pre-set reasonable buffer size, and the reasonable buffer size is dynamically adjusted according to the average size of the base station data file and the network bandwidth to balance memory usage and transmission speed.

[0030] An event-driven data acquisition optimization method includes the following steps:

[0031] Step S1: Create an inotify instance based on the inotify mechanism, register monitoring items with the kernel to monitor the base station data file storage directory; read the inotify event queue in a loop and parse the captured events. If a data file generation event is detected, send the event notification to the task scheduling module.

[0032] Step S2: After receiving the event notification, the task scheduling module generates the corresponding data acquisition task according to the event type and sets the priority of the task; inserts the task into the task queue according to the priority, monitors the status of the task queue in real time, and when system resources allow, takes the highest priority task from the task queue and assigns it to the data acquisition module, and records the task execution status.

[0033] Step S3: After receiving the task from the task scheduling module, the data acquisition module obtains the path to the data file to be acquired, and reads the data file in blocks. After each data block is read, a checksum is calculated and compared with the checksum information carried in the file.

[0034] If they match, the data is sent to the data processing center.

[0035] If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module.

[0036] After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module.

[0037] In step S1, after creating the inotify instance, the inotify file descriptor is first obtained; then, based on the inotify file descriptor, a system call function is used to add a monitoring item for the base station data file storage directory to the kernel, and a monitoring event mask is set, including data file creation events.

[0038] Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

[0039] The specific implementation method of step S2 is as follows:

[0040] (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task.

[0041] (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user;

[0042] (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue.

[0043] (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed.

[0044] The specific implementation method of step S3 is as follows:

[0045] (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size.

[0046] (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. In terms of data transmission protocol selection, a suitable protocol, such as TCP / IP protocol, is selected according to the characteristics of the base station data file and the network environment.

[0047] (3) Checksum calculation: For each read data block, a checksum is calculated using a preset checksum algorithm (such as CRC-32 algorithm), and the calculated checksum is compared with the checksum information carried in the data file;

[0048] (4) Error handling: If the comparison results are inconsistent, the data block should be reread.

[0049] In step S3, a reasonable buffer size is preset, and the reasonable buffer size is dynamically adjusted according to the average size of the base station data file and the network bandwidth to balance memory usage and transmission speed.

[0050] The beneficial effects of this invention are: the event-driven data acquisition optimization method effectively solves the problems of poor real-time performance and easy data loss in traditional timed tasks when acquiring base station data, significantly improves the real-time performance and integrity of base station data acquisition, improves resource utilization efficiency, and has good scalability and flexibility. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram of the event-driven workflow of the present invention. Detailed Implementation

[0053] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below in conjunction with the embodiments of this invention. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0054] This event-driven data acquisition optimization system includes an event monitoring module, a task scheduling module, and a data acquisition module.

[0055] Event monitoring module: responsible for creating inotify instances based on the inotify mechanism, registering monitoring items with the kernel to monitor the base station data file storage directory; reading the inotify event queue in a loop and parsing the captured events; if a data file generation event is detected, the event notification is sent to the task scheduling module.

[0056] After creating an inotify instance, the event monitoring module first obtains the inotify file descriptor; then, based on the inotify file descriptor, it uses system call functions to add a monitoring item for the base station data file storage directory to the kernel and sets the monitoring event mask, including data file creation events.

[0057] Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

[0058] Task scheduling module: After receiving an event notification, it is responsible for generating corresponding data collection tasks according to the event type and setting priorities for the tasks; inserting tasks into the task queue according to priority, monitoring the status of the task queue in real time, and retrieving the highest priority task from the task queue and assigning it to the data collection module when system resources allow, and recording the task execution status.

[0059] The task scheduling module is responsible for task generation, priority setting, task queue management, task allocation, and status recording. The specific implementation method is as follows:

[0060] (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task.

[0061] (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user; for example, set higher priority for urgent data files and lower priority for ordinary data files.

[0062] (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue.

[0063] (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed.

[0064] Data acquisition module: Responsible for receiving tasks from the task scheduling module, obtaining the path to the data file to be collected, reading the data file in blocks, performing checksum calculation on each data block after reading, and comparing it with the checksum information carried in the file.

[0065] If they match, the data is sent to the data processing center.

[0066] If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module.

[0067] After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module.

[0068] The data acquisition module is responsible for reading data files, transmitting data in chunks, performing verification calculations, and handling errors. The specific implementation method is as follows:

[0069] (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size.

[0070] (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. In terms of data transmission protocol selection, a suitable protocol, such as TCP / IP protocol, is selected according to the characteristics of the base station data file and the network environment.

[0071] (3) Checksum calculation: For each read data block, a checksum is calculated using a preset checksum algorithm (such as CRC-32 algorithm), and the calculated checksum is compared with the checksum information carried in the data file;

[0072] (4) Error handling: If the comparison results are inconsistent, the data block should be reread.

[0073] The data acquisition module pre-sets a reasonable buffer size and dynamically adjusts the reasonable buffer size based on the average size of the base station data file and network bandwidth to balance memory usage and transmission speed.

[0074] This event-driven data acquisition optimization method includes the following steps:

[0075] Step S1: Create an inotify instance based on the inotify mechanism, register monitoring items with the kernel to monitor the base station data file storage directory; read the inotify event queue in a loop and parse the captured events. If a data file generation event is detected, send the event notification to the task scheduling module.

[0076] Step S2: After receiving the event notification, the task scheduling module generates the corresponding data acquisition task according to the event type and sets the priority of the task; inserts the task into the task queue according to the priority, monitors the status of the task queue in real time, and when system resources allow, takes the highest priority task from the task queue and assigns it to the data acquisition module, and records the task execution status.

[0077] Step S3: After receiving the task from the task scheduling module, the data acquisition module obtains the path to the data file to be acquired, and reads the data file in blocks. After each data block is read, a checksum is calculated and compared with the checksum information carried in the file.

[0078] If they match, the data is sent to the data processing center.

[0079] If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module.

[0080] After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module.

[0081] In step S1, after creating the inotify instance, the inotify file descriptor is first obtained; then, based on the inotify file descriptor, a system call function is used to add a monitoring item for the base station data file storage directory to the kernel, and a monitoring event mask is set, including data file creation events.

[0082] Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

[0083] The specific implementation method of step S2 is as follows:

[0084] (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task.

[0085] (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user;

[0086] (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue.

[0087] (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed.

[0088] The specific implementation method of step S3 is as follows:

[0089] (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size.

[0090] (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. In terms of data transmission protocol selection, a suitable protocol, such as TCP / IP protocol, is selected according to the characteristics of the base station data file and the network environment.

[0091] (3) Checksum calculation: For each read data block, a checksum is calculated using a preset checksum algorithm (such as CRC-32 algorithm), and the calculated checksum is compared with the checksum information carried in the data file;

[0092] (4) Error handling: If the comparison results are inconsistent, the data block should be reread.

[0093] In step S3, a reasonable buffer size is preset, and the reasonable buffer size is dynamically adjusted according to the average size of the base station data file and the network bandwidth to balance memory usage and transmission speed.

[0094] Compared with existing technologies, this event-driven data acquisition optimization method has the following characteristics:

[0095] (1) Improved real-time performance: By replacing traditional timed tasks with event-driven methods, the data collection task can be started the moment the base station data file is generated, which greatly shortens the time interval between data generation and collection, and provides timely data support for base station monitoring scenarios with high real-time requirements.

[0096] (2) Ensures integrity: Accurately senses data file generation events, reasonably arranges collection tasks, and avoids excessive data accumulation; the method of reading and verifying in blocks strictly ensures data accuracy from triggering collection to transmission process, effectively avoiding data loss.

[0097] (3) It achieves efficient use of resources: Data collection is triggered by data generation events, which avoids invalid collection attempts and reduces resource waste; reasonable task scheduling and data transmission strategies, such as dynamically adjusting the buffer size, enable more reasonable allocation and utilization of network resources and system memory, thereby reducing system operating costs.

[0098] (4) Enhanced scalability and flexibility: The inotify mechanism makes it easy to extend the monitoring directory and file types, and the event-driven architecture facilitates the integration of other event processing logic. The system can easily adapt to changes in base station data collection requirements without large-scale reconstruction.

[0099] The embodiments described above are merely one specific implementation of the present invention. Ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included within the protection scope of the present invention.

Claims

1. An event-driven data acquisition optimization system, characterized in that: It includes an event monitoring module, a task scheduling module, and a data acquisition module; Event monitoring module: responsible for creating inotify instances based on the inotify mechanism, registering monitoring items with the kernel to monitor the base station data file storage directory; reading the inotify event queue in a loop and parsing the captured events; if a data file generation event is detected, the event notification is sent to the task scheduling module. Task scheduling module: Responsible for generating corresponding data collection tasks based on the event type after receiving an event notification, and setting priorities for the tasks; Tasks are inserted into the task queue according to priority, and the status of the task queue is monitored in real time. When system resources allow, the highest priority task is taken out from the task queue and assigned to the data acquisition module, and the task execution status is recorded. The task scheduling module is responsible for task generation, priority setting, task queue management, task allocation, and status recording. The specific implementation method is as follows: (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task. (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user; (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue. (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed. Data acquisition module: Responsible for receiving tasks from the task scheduling module, obtaining the path to the data file to be collected, reading the data file in blocks, performing checksum calculation on each data block after reading, and comparing it with the checksum information carried in the file. If they match, the data is sent to the data processing center. If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module. After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module. The data acquisition module is responsible for reading data files, transmitting data in chunks, performing verification calculations, and handling errors. The specific implementation method is as follows: (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size; (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. (3) Checksum calculation: For each read data block, the checksum is calculated using a preset checksum algorithm, and the calculated checksum is compared with the checksum information carried in the data file; (4) Error handling: If the comparison results are inconsistent, the data block should be read again; Meanwhile, the data acquisition module pre-sets a reasonable buffer size and dynamically adjusts the reasonable buffer size based on the average size of the base station data file and network bandwidth to balance memory usage and transmission speed.

2. The event-driven data acquisition optimization system according to claim 1, characterized in that: After creating an inotify instance, the event monitoring module first obtains the inotify file descriptor; then, based on the inotify file descriptor, it uses system call functions to add a monitoring item for the base station data file storage directory to the kernel and sets the monitoring event mask, including data file creation events. Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

3. An event-driven data acquisition optimization method, characterized in that: Includes the following steps: Step S1: Create an inotify instance based on the inotify mechanism, register monitoring items with the kernel to monitor the base station data file storage directory; read the inotify event queue in a loop and parse the captured events. If a data file generation event is detected, send the event notification to the task scheduling module. Step S2: After receiving the event notification, the task scheduling module generates the corresponding data acquisition task according to the event type and sets the priority of the task; inserts the task into the task queue according to the priority, monitors the status of the task queue in real time, and when system resources allow, takes the highest priority task from the task queue and assigns it to the data acquisition module, and records the task execution status. The specific implementation method of step S2 is as follows: (1) Task generation: Based on the event notification sent by the event monitoring module, determine the event type. If it is a data file generation event, generate the corresponding base station data acquisition task. (2) Priority setting: Set priority for the generated tasks according to the type and size of the data file and the importance factors determined by the user; (3) Task queue management: After setting the priority, the tasks are inserted into the task queue in order of priority. The priority queue data structure is used for storage and management to ensure that high priority tasks are always at the head of the queue. (4) Task allocation and status recording: Real-time monitoring of task queue status. When the system's CPU utilization, memory free amount and network bandwidth utilization all meet the task execution conditions, the highest priority task is taken from the head of the task queue and allocated to the data acquisition module. The execution status information of the task is recorded, including allocation time and task ID. During the task execution process, the task status is updated in real time, including in progress, completed and failed. Step S3: After receiving the task from the task scheduling module, the data acquisition module obtains the path to the data file to be acquired, and reads the data file in blocks. After each data block is read, a checksum is calculated and compared with the checksum information carried in the file. If they match, the data is sent to the data processing center. If there is a discrepancy, the data will be read again, with a maximum of 3 retries. If the 3 retries still fail, the error message will be recorded and reported to the task scheduling module. After successfully reading and sending all data blocks of a data file, a task completion notification is sent to the task scheduling module. The specific implementation method of step S3 is as follows: (1) Data file reading: Based on the path of the data file to be collected obtained from the task scheduling module, the data file is opened using file system operation functions, and the data file content is read block by block in a pre-set block size; (2) Chunked transmission: The read data blocks are sent to the data processing center through the selected data transmission protocol. During the transmission process, the transmission rate is dynamically adjusted according to the network congestion to ensure the stability and efficiency of data transmission. (3) Checksum calculation: For each read data block, the checksum is calculated using a preset checksum algorithm, and the calculated checksum is compared with the checksum information carried in the data file; (4) Error handling: If the comparison results are inconsistent, the data block should be read again; In step S3, a reasonable buffer size is preset, and the reasonable buffer size is dynamically adjusted according to the average size of the base station data file and the network bandwidth to balance memory usage and transmission speed.

4. The event-driven data acquisition optimization method according to claim 3, characterized in that: In step S1, after creating the inotify instance, the inotify file descriptor is first obtained; then, based on the inotify file descriptor, a system call function is used to add a monitoring item for the base station data file storage directory to the kernel, and a monitoring event mask is set, including data file creation events. Finally, a loop structure is used to read event data from the inotify event queue through a system call function, and the read event data is parsed to identify the specific event type.

Citation Information

Patent Citations

  • Distributed server cluster log processing method and device

    CN120123184A