Conceptual Design of a Comprehensive Farm Nitrogen Management System

de Abstract: Data that are required for nutrient management are becoming increasingly available in digital format, leading to a high innovation potential for digital nitrogen (N) management applications. However, it is currently difﬁcult for farmers to analyze, assess, and optimize N ﬂows in their farms using the existing software. To improve digital N management, this study identiﬁed, evaluated, and systematized the requirements of stakeholders. Furthermore, digital farm N management tools with varying objectives in terms of system boundaries, data requirements, used methods and algorithms, performance, and practicality were appraised and categorized. According to the identiﬁed needs, the concept of a farm N management system (FNMS) software is presented which includes the following modules: (1) management of site and farm data, (2) determination of fertilizer requirements, (3) N balancing and cycles, (4) N turnover and losses, and (5) decision support. The aim of FNMS is to support farmers in their farming practices for increasing N efﬁciency and reducing environmentally harmful N surpluses. In this study, the conceptual requirements from the agricultural and computer science perspectives were determined as a basis for developing a consistent, scientiﬁcally sound, and user-friendly FNMS, especially applicable in European countries. This FNMS enables farmers and their advisors to make knowledge-based decisions based on comprehensive and integrated data.


Introduction 1.Scientific Challenges
Rapidly developing sensing technology and data processing techniques have opened up new opportunities for realizing the knowledge-based control, regulation, and optimization of agricultural production processes [1][2][3].Digital agriculture includes the innovation and application of digital nitrogen (N) management [4][5][6][7][8][9][10].Recently, various digital tools have been developed for N management in agricultural production.However, these tools are predominantly tailored to certain needs, for example, sensor-and satellite-based systems for site-specific fertilization in crop production [11,12].Some of the available tools can effectively help balance nutrient flows throughout the soil-plant-animal-environmental system [13][14][15][16].In addition, soil process models can quantify N turnover in soil and N emissions into the environment [17,18].
Like other Western European countries, there is an urgent need for action towards N management optimization in Germany due to high N surpluses and low N efficiencies [19][20][21][22].N surplus is frequently caused by insufficient spatial distribution and the inefficient use of organic fertilizers, particularly liquid manure and digestate [23,24].Another reason is the inappropriate use of mineral fertilizers when the plant-specific N fertilization requirements are not taken into consideration [25].In German agriculture, the N balance is 80 kg ha −1 referring to total agricultural land [26] to 70 kg ha −1 when solely considering the crop production [27].The N use efficiency (NUE) in agriculture (including livestock production) is only 50%, whereas the NUE for crop production is 65%, which can still be further optimized [27].Challenges for N management include the excessive use of fertilizers in conventional agriculture (high-input systems) and extreme spatial differences in the N balance due to specialization, such as the regional concentration of livestock farming, biogas plants, and intensive vegetable production [28].Moreover, in organic farming (low-input systems), the N supply is often a critical factor limiting plant yield [29][30][31].
For digital N management, it is challenging to connect different software applications for exchanging data and productive interoperation.Currently, it is difficult for farmers to link data from different nutrient management tools using a reasonable amount of effort.Therefore, important information is unconsidered and thus, often remains unused in decision-making processes.The total available data volume is also increasing rapidly as more process data are being obtained through modern agricultural technology [32].This reinforces the need for external technological support to farmers to solve problems associated with data integration which result from the lack of system interoperability and inconsistent data quality and availability.
Successful N management can optimize crop yields and increase profitability while minimizing N losses to the environment and, thereby, the negative effects on biodiversity and human health [33].Using digital systems has enormous potential to reduce N emissions and increase N efficiency to a desirable level [24,34,35].In this study, we analyzed the possibilities and limits of connecting the functionality of existing digital systems and derived requirements in developing a farm N management system (FNMS) that is comprehensive as considered from the perspective of potential users, agricultural scientists, and software engineers.

Need for Research and Development
In agriculture, the NUE depends on many interrelated factors, such as the genetic potential of crops and animals, environmental conditions (soil, climate, weather, and yield potential), N fertilization (type and amount of fertilizer, application time, and technology), livestock production (stable system, pasture grazing, performance, feeding intensity, and slurry management), farm structure (animal stocking density, and crop rotation), and production method (conventional or organic, irrigation) [36][37][38][39].The associated data are becoming increasingly digitally available.The challenges faced by the concept of digital FNMS is to accurately depict and analyze the abovementioned complex relationships and develop applicable models for nutrient management.The data acquisition and linking required for this can be achieved with appropriate software that considers and documents the N flows at the farm level.The developed software should include powerful and scientifically sound algorithms.Aiming to simplify the complexity of information flows, the developed software should include practicable agri-environmental indicators, such as NUE or N balance, and must be configurable to individual user needs.Such management systems should be easily applicable by operational farm management.

Purpose and Objective
For optimizing N management on a farm level, a systemic and integrative approach is required.Our goal is an FNMS that enables farmers and advisors to make decisions based on comprehensive and integrated data.Such a system is intended to identify and address the causes of N surplus.Therefore, the purposes and objectives of this study were: -To describe, analyze, systemize, and evaluate the existing digital tools for N management (in crop and livestock production and on the farm level as a whole) and its various components related to system boundaries, relevant N flows and N pools, methods, and algorithms; -To assess the practicality of these systems regarding data requirements, availability, connectivity, performance, and informative value as well as the feasibility of recommendations in management processes; and -To evaluate the potential for integrating existing digital tools and their data into an FNMS (such as existing interfaces, linking components, and ensuring consistent calculations using the same primary data).
Conceptual requirements for developing an FNMS were derived based on the investigation results that were inspired by German requirements with attention to the adaptability to countries with similar agroecosystems, mainly in Central and Western Europe.
In this paper, we propose a software architecture that considers the necessary components, performance parameters, and feasibility of interoperability.

Materials and Methods
The digital tools and their connection to the digital FNMS were analyzed in the following subsequent steps: (a) Systematization of digital models and components relevant for an FNMS due to the following aspects:  Results from several years of application and testing of FNMS components, for example, in pilot farms [31,42].
(c) Analysis and evaluation of digital tools and their components, focusing on investigations of N fertilizer requirements and balancing.(d) Definition of an integrated FNMS with its required components and their interrelationships, as well as the goals and areas of application for a comprehensive FNMS.
The requirements for FNMS components were established in accordance with the research results and conceptual work.These results provide insight into the problems and challenges that need to be solved from both agricultural and computer science perspectives to develop a consistent, user-friendly system based on scientific principles.
In this study, we primarily considered the conditions and systems used in Germany.However, conceptual approaches presented in this study can be applied to other regions, particularly to Central and Western European countries with similar site and management conditions.

Overview, Categorization, and Evaluation of Existing Digital Tools for N Management
N flows in agricultural farms may be managed using different systems, methods, and models regarding the N requirement calculation, N balancing and N cycle modeling, and soil process modeling and N loss calculation.
The detailed functionalities depend on the farm system and management ability.The N fluxes and interactions between the diverse production systems on a farm require the consideration of crop, livestock, and biogas production, beyond frequently used indicator goals [14,20,[43][44][45][46][47].A digital tool needs to consider all of these factors in the design of an integrated management system.Therefore, our system approach focuses on the optimization of the entire farm.

N Requirement Calculation
Digital tools and systems for determining N fertilizer requirements of crops can be categorized into two categories: (1) uniform fertilizer application on the field level and (2) site-specific fertilizer application (Table 1). 1 Pros and cons regarding practicality, technical implementation, requirements, complexity, functionality, and performance. 2Soil mineral nitrogen (SMN). 3Nitrate test [58], N-Tester (measurement of chlorophyll concentration) [59]. 4Vegetation indices that were derived from satellite data or multispectral sensors are radiometric measures of the spatial and temporal patterns of vegetation photosynthetic activity that are related to biophysical variables such as leaf area index, biomass, or N content [60]. 5Calculation algorithm that calculates the N requirement in defined development stages of the crop according to the development of the crop based on vegetation indices, yield potential, desired product quality, and other possible influencing factors.
• Methods for uniform fertilizer application on field level Basic software systems for determining N fertilizer requirements [48] help farmers comply with legal requirements.Globally, a widespread and simple principle for determining N requirement is fertilization depending on crop N uptake, i.e., target yield of the crop multiplied by the N content of the harvested product.Site conditions are only indirectly considered via the target yield.More differentiated systems consider additional parameters, such as previous crops, organic fertilization of the previous crops, soil humus content, or soil mineral N (SMN) content at the beginning of a vegetation period [50].Moreover, some systems aiming at specified determination of fertilizer requirements include the current development of a crop stand (biomass and N content) [49,61].Therefore, farmers must conduct plant analyses (such as nitrate test [62] and N-Tester [59]); such methods are mainly used for uniform fertilizer application at the field level.Most farmers know the approximate yield potential of their fields and can determine appropriate fertilizer amounts as well as modify them, if necessary, by simply manually controlling the fertilizer application process.However, this process involves subjective assessments and requires a substantial amount of extra work (as well as knowledge, time, and effort).

•
Methods for site-specific fertilization Mapping and real-time sensor systems have specific advantages, particularly in heterogeneous sites and high-input systems [63].These systems contribute to (a) increase the N efficiency, (b) precise fertilizer application according to crop N requirements, and thus (c) achieve lower N balance.N overfertilization and losses can be avoided in low-yield zones, whereas the yield and quality potential can be realized without depleting the N content in the soil in high-yield zones.Site-specific fertilization systems can be divided into mapping, sensor, and combined systems (map-overlay) [64].
In the mapping approach, N application maps are generated according to digital soil data (for example, soil maps, georeferenced soil texture, electrical conductivity, and nutrient content [65]) and/or historical yield data (for example, annual or multiyear yield records) [66].If available, via satellite or drone images, derived data about the nutrient supply of the crop stand can be used to create supplemental maps [67][68][69].In addition, service providers offer fertilization algorithms, yield potential, and N application maps specifying N fertilization recommendations in the vegetation period based on current or predicted weather and other factors [70].
Further sensor-supported real-time systems are already available in the market [71].Most tractor-carried sensor systems (for example, Yara N-Sensor [52] and Crop Sensor ISARIA [53]) rely on vegetation indices for recording the N uptake of the crop stand in real time, thus estimating fertilizer requirements for certain areas [72,73].In some systems, measuring the crop biomass or the N content of biomass at a representative area in the field (spot calibration) is crucial for defining the N application rate before transferring to the entire field [54,59].Alternative systems, such as Crop Sensor ISARIA [56,74], use algorithms to determine the site-specific N fertilization requirement in defined developmental stages according to the crops' N uptake.
The map-overlay system combines the mapping and sensor approach.By considering high-quality data of the spatial variability in yield potential and current plant development, a high degree of precision can be achieved [75].

N Balancing and N Cycle
The N balances are calculated at different system levels of crop production system (with various degrees of spatial resolution), the livestock system and the biogas production system, and the entire farming system [76,77].N surplus, which describes the N loss potential, is the difference between the N input and N output of a certain system [78,79].Notably, there is no standard method for the N balancing.Therefore, N balance results can only be interpreted correctly if the balancing model is considered [80,81].According to Goodlass et al. [13], Halberg et al. [14], and Küstermann et al. [76], the N balance models differ in terms of: -System level and system boundary, namely the entire farm (farm-gate balance), crop production (field balance), and livestock production (barn balance); -N flows considered, such as N inputs, N outputs, and N flows within the system; -N pools considered, such as soil organic N (SON) and soil mineral N (SMN); -N balance parameters used, for example, the N contents of products and NH 3 emission factors; -Algorithms used, for example, for calculating the N 2 -fixation; -Data basis, namely the measurement data, model data, and statistical data.
In crop production, N balances quantify the N inputs and N outputs for a relevant area (subfield, field, crop rotation, farm).The N surplus indicates the N loss potential in the soil-plant-environment system.N loss pathways, such as NH 3 volatilization and NO 3 leaching to groundwater, and N forms, including NH 3 , N 2 O, N 2 , and NO 3 − , are not specified.In the context of N fertilization, the area-related N balance is the most useful balance method (Table 2).Soil N turnover is typically not considered in N balances [82]; however, some models estimate N immobilization and mineralization for accurate N loss calculation [76,83].[14], REPRO [76] In livestock production (barn balance), N inputs (feed and purchased animals) and N outputs (animal products) are compared to determine the N loss potential.In more complex N balances, the amount of N in manure is quantified in addition to the NH 3 losses of the animal-housing system and the manure storage system [76,86].
The farm-gate balance, used for overall operational analysis, is relatively simple to calculate using the N inputs and N outputs across the farm.It provides reliable and verifiable results related to the overall N loss potential of a farm; therefore, it serves as a control method for legal requirements.However, a notable disadvantage is that it is impossible to verify the causes of N balance because internal N flows are not mapped [43].In practice, N balances are widely employed but typically as simple balancing approaches, for instance, the N balance of crop production (according to the fertilizer ordinance [48]) and farm-gate (according to the nutrient flow balance ordinance [87]).Owing to the black box approach of the farm-gate balance and isolated consideration of partial balances, the interconnected N flows, dependencies, and interrelationships, including between crop and livestock production, are often concealed.
To reveal the causes of N losses and to determine the potential for improved efficiency in the N cycle, internal N flows must be modeled by linking different balance results.Essentially, the N outputs from one subsystem are the N inputs for another subsystem and, thus, the N flows are continuously modeled.There are only a few N balance models, such as the REPRO model [85,88], that integrate these partial N balances into a coherent overall system.Figure 1 shows the interdependencies of the N balances on the farm level realized through the interconnected subsystem's N balances.

Soil C/N Turnover, N Uptake, and N Losses
The N turnover in the soil (mineralization and immobilization) can be determined using soil process modeling or direct measurement.It is a prerequisite for quantifying N losses (NH 3 , N 2 O, and NO 3 − ).However, a large amount of input data are required for soil process modeling.Relevant models require detailed measured soil parameter values (often for several soil layers) as well as detailed management and weather data, which must be collected daily.Using a model without adaptation to the specific soil-climate area is usually impossible or produces inaccurate results.In addition, these models are often coupled with plant growth models, but they can only analyse limited crop types.Therefore, the application of soil process modeling is still limited.Nonetheless, the simulation of soil-N dynamics may provide practical information, including the SMN content at the beginning of a vegetation period [89,90].
Model approaches to ascertain the N turnover in the soil and potential N losses based on existing data are available [91][92][93][94].As N and C turnovers are linked, the N turnover tool of the REPRO model [76,84,88] divides soil N into three interacting N pools: SMN, SON, and humus N pools [85].Depending on the composition of the applied fertilizers (NH 4 + and NO 3 − contents, organically bound N, and C:N ratio), soil properties (soil texture), and weather-dependent parameters, the N mineralization is calculated using the effective mineralization time [95].Further information regarding the soil-N turnover tool can be found in Abraham [84] and Küstermann et al. [76].A useful application of the N turnover tool is the simulation of potential NO 3 − leaching in drinking water protection areas [61,85].

Concept of a Farm N Management System
Several digital tools available for N management are used for different purposes and produce different data.Linking these data is an essential basis component for N management decisions.Therefore, a major challenge for developing comprehensive software is to design it to provide functionality that can be scaled according to the different expert levels of users (from basic functionality to power users and scientists).Furthermore, the designed software should integrate different data sources into one system and offer additional interfaces for interoperability with other systems.

Stakeholder Requirements and Application Areas
The main target user groups of an FNMS are farmers and crop advisory services.The requirements of business partners, legal authorities, certifiers, insurance, and laboratories should also be considered, as they need to interact with the system if mandated by the farmer.In addition, the system could be used by scientists and farmer associations.All user groups have slightly different requirements for an FNMS.Notwithstanding, the requirements of farmers allow covering the essential aspects of the system, thus specifying the basics for developing an FNMS (Table 3).A fundamental challenge facing any FNMS is to determine the system's capability and then achieve acceptance for the application [97].It is crucial that users are not overwhelmed by the technology, for example, due to excessive data requirements.Complex relationships derived from the data must be presented simply, and calculations must be transparent and comprehensible.Failure to consider these factors can result in users losing confidence in the generated results [98].A clear program structure, self-explanatory user interface, graphic processing, and visualization of the results (for example, Figure 1) are factors essential for ensuring the potential success of the application and durability of an FNMS [99,100].In addition, a farm-centered FNMS could be part of an integrated N management strategy that covers the entire value chain, works with an integrated assessment modeling tool, includes cost-benefit analyses, and works together with all stakeholders [33].
The farmers group, however, is heterogeneous.There are minimalistic users who only want to meet the legal requirements, and power users who require a high-performance system.Power users desire a holistic system approach integrating all production systems (crop, livestock, and biogas) with high resolution, such as site-specific calculations of N requirements and N balances.Therefore, it is crucial that users can easily access the basic functionality of an FNMS and then gradually expand their expertise level for solving increasingly complex tasks.Concerning the development of software, a modular architecture using a shared database is required to provide the possibility of individual customizations.Another reason for the need for a high degree of individuality is the potentially differing legislations within a country; therefore, various versions of data and algorithms are required.
In addition to user-friendliness and configurability, the interoperability with other internal (for example, machine process, operation record, and resource input data) and external (for example, weather, soil, and remote sensing data) farm data through interfaces is crucial for connecting data of divergent formats, structures, and meaning [101].Moreover, the stakeholders require different analysis levels at various spatial (such as farm, field, and subfield) and temporal (such as annual and crop rotation) scales, which is beneficial for strategic and operational planning.For example, the site-specific applied fertilizer should be easily aggregated to the mean N input of a field for N balancing on the farm level.However, the evaluation of single crops or crop rotations at a specific spatial scale (subfield or field) and temporal period should be possible.Following this, different data are required for digital N management depending on the application area and functionalities.For simple applications, such as the basic determination of fertilizer requirements, the need for data is low.However, for more demanding modules, such as soil process modeling, measurement data with high spatial and temporal resolutions are required.
Because an FNMS is complex, the data links between the modules and calculations need to have a high level of transparency and traceability to gain user trust in the system.Farmers demand clear management decision support beyond the balances and calculation values.The support needs to be personalized and may contain a scenario simulation with different probabilities, for example, covering the nutrition need of crops, input availability, and allocation management.A modern FNMS should be designed as a web application according to the current state of application programming; it must contain at least one mobile application to easily record operations in the field.Additionally, appealing visualization and a user-friendly interface are required.

Basic Functionalities and Data Requirements
All applications concerning N management require site and farm data.Depending on the functionality, data are allocated according to site conditions (climate, weather, and soil) and production system (crop, livestock, and biogas) (Table 4).Almost all data required for an FNMS are available for farms through continuous recording and documentation, or can be obtained through free or paid services.As such, a noticeable problem is that the data origins and system levels that indicate the reference scale (for example, farm or field level) differ.In addition, different data mining methods can be employed, which results in different levels of data accuracy (such as automatically measured vs. digitized manual records).Notably, relevant data are often recorded using different methods, including unincorporated and/or incompatible data portals and agricultural software (Table 4).An example of diverse data origins is the acquisition of site conditions (1) in Table 4.In Germany, high-quality and consistent climate and weather data (1.1) in Table 4 are available nationwide and have been updated daily for several years [102].Weather data for individual areas can be mapped through heuristic searches of nearby weather stations or interpolation [103,104].For instance, digital on-farm weather stations could further improve spatial resolution and data reliability.
Depending on the desired functions, different soil data (1.2) in Table 4 of different spatial resolutions are required.Soil-related information (for example, soil type) available in analog form is increasingly being transferred to primarily open-sourced digital formats, such as digital soil maps [105].Soil nutrient contents (for example, SMN content) are still commonly determined via soil samples and laboratory analysis.Mobile soil sensors and systems that continuously make measurements with a high spatial and temporal information density are increasingly being used to determine soil nutrient contents, especially those with mobile sensors in different spectra (such as infrared (IR), visible-near-infrared (vis-NIR), mid-infrared (MIR), and X-ray fluorescence spectrometers (XRF)) [106][107][108][109][110].
The database for describing crop production ( 2) is information about the field and cropping structure (2.1) in Table 4, including field size, field contour, and cultivated crop, which is already recorded across the EU according to the Integrated Administration and Control System (IACS) [111].Additional relevant geographic information (for example, water protection areas and nature reserves with restricted land use) is provided by agricultural and environmental authorities.Nevertheless, only limited data exchange between these systems and field records, as well as other frequently used stand-alone software solutions from various providers [112,113], is possible due to individual data structures and classifications lacking in compatibility [41,[114][115][116].
Further crop production data are generated through the crop production system (2.2) in Table 4.The associated data pool can contain process data generated by a machine via an ISOBUS interface, biomass maps generated using satellite images representing crop N requirements, applied fertilizer maps, quality parameters generated through product analysis, and electronic field record data which provide information about the crop variety.The data collection and documentation in crop production may also be performed using a farm management information system (FMIS), which supports the field-related recording of production data (field operation, date, and resource inputs) [117].These systems typically have interface functions for other machine and process data, such as the seed rate map, the application map for fertilizer spreaders, or yield mapping of the combine [118].NIR spectroscopy sensors providing further process data when applying organic fertilizer or harvesting forage (for example, dry matter and protein content) are still being developed [119,120].
In livestock production (3) in Table 4, N efficiency and emissions depend on the animal species, animal performance, feed regime, and husbandry system, among other factors [36,121].Data collection and documentation are performed in various digital systems, such as livestock management systems, systems for determining feeding requirements, and systems for calculating the quantity and storage capacity for manure.The increasing digitalization of livestock farming (for example, animal sensors and milking robots) necessitates high-resolution data management at various object levels: the entire livestock, a group of animals, or individual animals.In addition, the storage system of substrate and manure influence N emissions.

Definition of a Farm N Management System
An FNMS integrates all of the functionalities relevant for farmers to make decisions related to optimizing N flows at the farm and field levels.In essence, with an FNMS, N flows in agricultural enterprises can be administered, analyzed, evaluated, and controlled (optimized) by integrating different models and software into one system.Crucial software components (modules) of an FNMS include (1) digital systems for managing site and farm data, (2) digital tools for determining fertilizer requirements, (3) models for N balancing, (4) models for analyzing N turnover and potential N losses, and (5) decision support systems (Figure 2).Each module has its data model, data structures, and algorithms, which use a shared database.An FNMS should be expandable and adaptable to new site and management conditions [122].An FNMS integrates everything related to crop and livestock production systems, as well as the entire farm-level N flows and pools and their influencing factors (soil, climate, weather, technology used, yield performance, etc.).By comprehensively linking the components of the diverse production systems, it would be possible to understand interactions at the farm level and gain new insights that could be useful in N management, for example, in N cycle optimization to increase N efficiency and reduce environmentally significant N emissions.

•
Decision support in FNMS As this study shows, numerous software and systems exist for supporting farmers in N management.However, most of these systems are geared toward relatively simple decision-making, such as determining the N fertilizer requirement.In the future, it will be necessary to assist and motivate decision-makers with complex issues, for example, to support farm N cycle optimization.Therefore, an integrated decision support system is required.

•
Decision support system requirements A decision support system should include: (a) Comprehensive access to data from individual programs or modules to combine and evaluate information in a context-related manner.(b) Evaluation methods and benchmarks (target values) to analyze results and identify optimization requirements.(c) Decision-making rules and algorithms to determine farm-specific recommendations for management and evaluate the field operations carried out by the farmers.The required algorithms and decision pathways can be modeled according to techniques from the field of decision support systems, for example best practices, decision trees, rules, or fuzzy logic.According to Fernandez-Mena et al. [123], a promising approach to optimize nutrient cycles is to combine nutrient flow models with agentbased modeling and analyze the environmental impacts.Notably, the quality of the recommendations depends heavily on the technical content (expert knowledge) or the quality of the knowledge base, the applied algorithms or their implied modeling (rule base), and the comprehensibility of the dialog component for the user.(d) A dialog component that allows users to interact with the FNMS and allows decisionrelevant parameters to be given values.
In general, decision support systems in agriculture should have the following characteristics: good performance, easy handling, and clear benefits from application [124].

Software Design for a Farm N Management System
Owing to agriculture digitalization, data from agricultural equipment and technology operated in the field or the stable are being continuously recorded [114,125,126].The everincreasing automation of agriculture is accelerating this trend [127][128][129].Efforts to establish data integration platforms (for instance, DEMETER [130] or IAIS [131] at the EU level) are attempting to harmonize and improve data exchange between systems from different agricultural technology manufacturers and may ease data connectivity in the future.For the successful integration and implementation of an FNMS, a robust data management system is essential to process data from different storage locations, formats, and structures (thematic, spatial, and temporal) in a way that allows them to be used for a specific purpose in operational N management.

Representation of Farm Structure and System Implementation
Optimizing the nutrient supply of an agricultural production system presupposes the digital representation of an entire farm.Therefore, the production processes must be systemically mapped, for which information about the structural design of farm systems is required along with consideration of the required system levels (spatial and temporal scales).The processes in crop production are recorded through the digital description of the individual work processes, dates, use of machines, and inputs (for example, fertilizer type, quality, and quantity), which correspond to the structure of record-keeping software.By contrast, the structures, production methods, and the use of operating resources of all production systems are described.Figure 3 provides an overview of a cross-system consideration of crop, livestock, and (if existing) biogas production.In detail, crop production is represented through a domain-specific entity relationship model.The annual, perennial, or permanent crop production cycles can be described by a time interval, for example, individual crop years or multiyear crop periods.For livestock production, equivalent fattening periods or average stocks can be assigned depending on the documentation objective and balancing approaches.Each crop year is related to the fields managed by farms.Field information contains the corresponding meta-information, such as name, indication, or field status (arable/pasture land).For spatial localization, vector or raster data are assigned to each field, with the raster size (for example, 10 m × 10 m) representing the minimum normalization unit.Subsequently, geospatial data (such as soil sensor or yield data) are interpolated to raster size, even in the case of high-resolution data granularity (using geostatistical methods, e.g., Kriging method).In the future, the idea of spot farming could be a driving force in this field [132].For small-scale management, plots are subdivided into subfields or "management units" due to the heterogeneous site conditions (such as soil type or yield potential).These units are treated as one field and assigned to one parent field.Consequently, field operations and user inputs can be recorded for each field with a grid reference which is usually manually performed at the subfield or field level with a lower degree of resolution.However, digital data acquisition with execution date and corresponding information (for example, for seed variety, quality, and density) enable subsequent spatial and temporal evaluations.It is also possible to conduct selection and analysis according to the recorded attributes (for example, field operation, or cultivated crop type).This mapping includes the catch crops, second crops, and main crops.Entity relationship model of a farm with cardinalities throughout the crop production system.* Optional a cropping year, calendar year, crop rotation or a growing/fattening period depending on the management goal (e.g., documentation, planning, analysis).** A Field or Subfield is defined as a coherent area that has one or more common properties (e.g., soil type, yield level, field operation, cultivar) in the respective time interval.The defining property maybe a field operation (e.g., different sowing dates, site-specific fertilization) or may also be an aggregation of vector/raster data for the strategic farm management (e.g., analysis of selected crops, humus balancing).*** Smallest unit with available attributive data.A point as the smallest possible unit is defined by a single x-y-coordinate.Lines and areas are composed of points.
A schematic use case is depicted in Figure 4, which shows which the spatially variable data that are required to be mapped by the data model.To develop fertilizer application maps, yield potential and N uptake maps are necessary; such components are developed using different methods (for example, volume flow measurement on combines, digital soil maps, sensor measurements, and satellite data).If the N application and N uptake of the harvested products are georeferenced, the GIS maps of the N surplus and nitrate leaching can be modeled accordingly.Notably, the quality of the input data largely determines the accuracy of the results.Initial studies on heterogeneous fields showed that site-specific N balance based on sensor measurements is strongly correlated with nitrate leaching [133].It is reasonable to consider additional information from satellite data or georeferenced soil data.Figure 4 shows the integrative use of georeferenced data required for site-specific N fertilization, N balancing, and N turnover modeling, which means that the data structures of the software core system must be selected appropriately to map and manage the shown complexity of reality.In this way, such a system can offer the possibility of optimizing N management.

Software Design and Modularity
The requirements for software development are determined by the need for a systematic representation of a farm and the diverse functional requirements of the stakeholders (Table 4); different user groups place different demands on the software.Furthermore, the system must be adaptable to changing functionalities or state requirements.Therefore, a modular architecture is required for the software which is based on a common database to realize user-specific configurability and, thus, an individual module selection of varying complexity.For the software design, we employ the layer pattern which is a common software architecture pattern [134].The programming code is split into layers where each layer has a certain responsibility and provides services for higher layers.Each logical component is based on the layer pattern which leads to a vertical structure of modules.Figure 5 shows the software modular structure.We used the classical three-tier model comprising of a presentation layer, business concept layer/application logic, and a data management layer (which comprises two sublayers: a persistence layer and database or data interface).In the vertical view, we distinguish the core system (something similar to a microkernel) and various specialized modules.Each module has its own set of algorithms and accesses the shared database.We use standardized interfaces to connect modules and the core system.The core system comprises of the following components: -Master data component-contains data structures and functionality for managing and using master data, for example, climate data or generally applicable crop-specific data; -Site and farm data component-contains data structures and functionality for administering and using individual farm data; -Administration component-contains data structures and functionality for administering user data, user roles, and access rights.
These core components are organized according to the layer pattern.Layers are hierarchically organized which means requests move top down from layer to layer.For example, if a user selects to edit some specific farm data, the graphical user interface (GUI) (the presentation layer) creates an appropriate request that is sent to the respective parts of the service layer.The service function probably needs access to data and sends a request to the data model.The persistence layer enables data storage and serves as an interface for data access (input/output).
The core system is required for every application built from this system.Further modules may be added, such as N requirement calculation, which provides a high degree of configurability of possible applications.A module can only be fully executed if the required data are completely available.The user interacts with the system via an integrative GUI which includes textual and graphical representations of farm data and calculation results, including geographic maps.Implementation as a web system facilitates installation and support.Data interfaces enable both internal and external data exchange.
The core system contains data relevant for all of the modules and for understanding the domain system.As an example, an applied fertilizer input can be used for calculating not only the N cycle but also the N balance.The structure of two modules, N requirement calculation and N Cycle in Figure 5, is exemplary and is divided into several subcomponents: -Algorithms and calculations-completely independent of the overall system, they can be reused in further systems, and they define the necessary data requirements independent of the master data or core data model.-Model-the data model of a module for data transformation from data storage to algorithm-specific data structures.Both operational and site data, master data, and module-specific master data are processed and prepared for use in algorithms.
-Data access-to access module-specific master data, for example, the database.
The N requirement calculation module comprises of submodules with different levels of difficulty (Figure 2): a basic variant for fulfilling legal obligations, the extended variant, and methods of site-specific fertilization.
Owing to its modular structure, the system can be expanded upon with new features.New components, for example, a decision support system on the farm level, can be integrated into the core system with little adaptation effort.The corresponding data interfaces are implemented via the core system or with direct module access (Figure 6).In the specific case of the N requirement calculation according to the mapping system, the required data, i.e., updated satellite data and area-related soil sample investigations, are imported to generate an application map for fertilization.

Conclusions
Our conceptual design of an FNMS system follows a specific data network approach for the purpose of N management.The proposed system uses external ecosystem-related data (for example, soil information and weather data), internal operating data (for example, field measure documentation), and personal information (for example, the individualized farmer strategy).By exchanging data within the overall system, the data requirements of the subsystems and modules can be restricted thus reducing the need for multiple entries.The proposed domain model, modular architecture, and software design support the crucial technical requirements.By merging the available information, previously unrecognized relationships become visible, allowing management decisions to be easily determined by farmers based on factual information.
Our proposed FNMS can be useful in various application areas.Owing to its modular structure, getting started with the system is relatively easy, for example, using simple tools to determine fertilizer requirements.Additional components can gradually be integrated, albeit adding a few complexities to the user.It is just as likely that this system will be used by farmers and by highly specialized consultants who, for example, use model components, such as N turnover modeling and their influence on nitrate dynamics, to establish recommendations for the protection of drinking water.A decisive advantage with the FNMS here is the possibility for conclusive and consistent calculations through access to the consistent site and operational data from a common basis.
Our conceived FNMS aims to provide a systematic approach for N management.Perhaps more crucial than the final accuracy of the detailed data is the integration of the results into a comprehensive operational context, as system optimization goes beyond the achievements of indicator goals.With respect to the scientific aspect of the approach, the analysis, evaluation, and optimization of N flows in farming systems have been somewhat successful but so far require enormous effort.However, none of the existing systems has yet been universally implemented or accepted.Because agricultural process data are gradually becoming increasingly available in digital form, modern FNMS now has the chance to become a tool for optimizing the N flow of agricultural operations.Furthermore, our concept for an FNMS is designed in such a way that other nutrients such as phosphorus, potassium, magnesium, and also carbon, can be integrated in the future.This leads us to a software system for agriculture that provides complete nutrient management enabling farmers and their advisors to make knowledge-based decisions based on comprehensive and integrated data.

Figure 1 .
Figure 1.On-farm N cycle of a mixed farming system with crop and livestock production showing N inputs, N flows, and the N outputs of the farm-gate, the soil surface, and the barn balance as modeled using REPRO [76].

-
Data acquisition on the field and subfield levels -Perspective: raster scale for soil parameters, fertilization, and yield -Data aggregation to the crop rotation, land usage (arable/pasture land, intensively/extensively used), and on-farm level Systemic approach -Analysis of interactions between the production systems (crop-, livestock-, and biogas-production system) -Entire farm view for the integrated optimization on the farm-level -Modeling of N flows for the entire farm -Linking farm-gate, barn, and field balances Transparency -Transparency and traceability of the calculations and decision recommendations -High level of trust in the software and digital support -Transparency regarding model parameters and underlying algorithms -Comprehensive information on underlying models -Publication of used models, standardized data models Analysis and decision support -Analysis and evaluation of the farm's optimization goals (e.g., maximum/optimum yield) -Focus on the individual farm conditions -Possibility of simulating management options -Clear management decision support beyond balances and calculation values -Development of a decision support module based on scientific findings, expert and special domain knowledge, and algorithms Usability -modern, self-explanatory user interface mobile application -Customizable options, Intuitiveness, Visualization, e.g., GIS function with field and yield maps, N cycle (Figure 1)

Figure 2 .
Figure 2. Modular concept of a farm nitrogen management system (FNMS).

Figure 3 .
Figure3.Entity relationship model of a farm with cardinalities throughout the crop production system.* Optional a cropping year, calendar year, crop rotation or a growing/fattening period depending on the management goal (e.g., documentation, planning, analysis).** A Field or Subfield is defined as a coherent area that has one or more common properties (e.g., soil type, yield level, field operation, cultivar) in the respective time interval.The defining property maybe a field operation (e.g., different sowing dates, site-specific fertilization) or may also be an aggregation of vector/raster data for the strategic farm management (e.g., analysis of selected crops, humus balancing).*** Smallest unit with available attributive data.A point as the smallest possible unit is defined by a single x-y-coordinate.Lines and areas are composed of points.

Figure 4 .
Figure 4. Integrative use of georeferenced data required for site-specific N fertilization and N balancing.

Figure 5 .
Figure 5. Modular architecture of the FNMS.* Intern data (e.g., calulation values) and extern data (e.g., weather) is stored in the core system.** Purpose-specific provision of data required for module functionality by the core system.

Figure 6 .
Figure 6.Data input and output of the FNMS.* Depending on the dynamic of the data changes seldom or frequently used.** Data from the Integrated Administration and Control Systems (IACS) of the member states of the European Union.Mostly containing field contour data, the main crop and information about statutory restrictions of the area.

Table 1 .
Fertilization systems and methods for the calculation of the crop N requirement of arable and pasture land.

Table 2 .
Methods of N balancing.

Table 3 .
Selection of non-functional requirements for an FNMS.

Table 4 .
Site-specific and farm data for an FNMS.