摘要

Background: The large high altitude air shower observatory (LHAASO) is a major national science and technology infrastructure approved for the 12th Five-Year Plan. It is one of the scientific infrastructures with the highest altitude in China and its core goal is to explore high-energy cosmic ray. As an important component of LHAASO, the ground shower particle array (KM2A) has a huge total area of one square kilometer. Unlike most high-energy physics experiments, the KM2A has a total of about 6 500 channels, and a total input bandwidth of about 546 MB?s-1. There is no hardware trigger function in KM2A. Purpose: This study aims to design and implement a software for KM2A to complete the trigger and real-time data processing.Methods: Data transmission scheme based on standard Ethernet and TCP / IP protocol was employed to receive all packet data including all detector units at the same time. Online processing and calculation of data packets were achieved by using the configured trigger algorithm. Data with physical significance were extracted and packaged to form different events with physical labels, then these events were sent to different receivers according to the configured output rules. By using distributed technology and task division, this software was able to finish real-time data processing through selectable algorithm scheduling. Results & Conclusions:The software is able to trigger KM2A in real time, reduce the amount of data, and lessen the burden of transmission and storage. It has been put into use in the data center of 4 410 m altitude experiment site, and has been running well so far.