Example 2 Figure 1 is a triangular network, from top to bottom, the first row has $n$ nodes, the second row has $n-1$ nodes, $\cdots \cdots$ the $n$-th row has 1 node. Now, each node is filled with a number 0 or 1 according to the following rule: for each inverted unit small equilateral triangle “ $\nabla$ ”, the number at the bottom node is equal to the absolute value of the difference of the numbers at the two adjacent nodes above it. For all valid filling schemes, try to find the maximum value of the sum of the numbers filled in all nodes.
Let's consider a regular triangle with $k$ nodes in the first row, which is called a $k(k=2,3, \cdots)$-order regular triangle, and the maximum sum of the numbers filled in it is denoted as $f(k)$.
Obviously, $f(2)=2, f(3)=4$.
If we also consider the case with only one point as a degenerate regular triangle, then $f(1)=1$.
Next, we seek the recursive relationship between $f(n)$ and $f(n+3)$.
Consider the first three rows of an $(n+3)$-order triangle:
$$
\begin{array}{cccccccc}
a_{1} & a_{2} & a_{3} & a_{4} & \cdots & a_{n+1} & a_{n+2} & a_{n+3} \\
& b_{1} & b_{2} & b_{3} & b_{4} & \cdots & b_{n+1} & b_{n+2} \\
& & c_{1} & c_{2} & c_{3} & c_{4} & \cdots & c_{n+1}
\end{array}
$$

First, we prove: Among the $3n+6$ numbers in the first three rows, there are at least $n+2$ zeros.

For this, we divide the numbers in the first three rows into $n+1$ triplets $\left(a_{1}, b_{1}, c_{1}\right),\left(a_{2}, b_{2}, c_{2}\right), \cdots,\left(a_{n+1}, b_{n+1}, c_{n+1}\right)$, and one upper-right triangular group $\left(a_{n+2}, a_{n+3}, b_{n+2}\right)$.

For the first $n+1$ triplets, if a triplet $\left(a_{k}, b_{k}, c_{k}\right)$ contains at least one 0, it is called a "0-containing triplet"; if two adjacent triplets $\left(a_{k}, b_{k}, c_{k}\right),\left(a_{k+1}, b_{k+1}, c_{k+1}\right)$ together contain at least two 0s, they are both called "average 0-containing triplets".

Starting from the first triplet $\left(a_{1}, b_{1}, c_{1}\right)$, we consider the presence of 0s in each triplet from left to right. Each triplet is either a 0-containing triplet or an average 0-containing triplet, and the last triplet contains at least one 0, while the last two triplets together contain at least two 0s.

Therefore, among the $3n+6$ numbers in the first three rows, there are at least $n+2$ zeros.
Thus, the number of 1s in the first three rows is no more than $2n+4$.
Hence, $f(n+3) \leqslant f(n)+(2n+4)$.
We calculate that $f(n) \leqslant\left[\frac{n^{2}+n+1}{3}\right]$.
Next, we show that the equality can be achieved.
Using a construction method, we adopt reverse thinking and construct two numerical modules:
\begin{tabular}{|c|c|c|c|}
\hline $1 \quad 10$ & & 1 & 1 \\
\hline $0 \quad 1$ & 1 & 0 & 1 \\
\hline 1 & \begin{tabular}{ll}
0 & 1
\end{tabular} & 1 & \\
\hline
\end{tabular}

Module A
Module B

We embed the numerical modules A and B into each region of a "infinite" regular triangle, as shown in Figure 2, and then take the numbers from the bottom $n$ rows.