This study proposes a strategy for determining the optimal configuration of photovoltaic (PV) module arrays in shading or malfunction conditions. This strategy was based on particle swarm optimization (PSO). If shading or malfunctions of the photovoltaic module array occur, the module array immediately undergoes adaptive reconfiguration to increase the power output of the PV power generation system. First, the maximal power generated at various irradiation levels and temperatures was recorded during normal array operation. Subsequently, the irradiation level and module temperature, regardless of operating conditions, were used to recall the maximal power previously recorded. This previous maximum was compared with the maximal power value obtained using the maximum power point tracker to assess whether the PV module array was experiencing shading or malfunctions. After determining that the array was experiencing shading or malfunctions, PSO was used to identify the optimal module array connection scheme in abnormal conditions, and connection switches were used to implement optimal array reconfiguration. Finally, experiments were conducted to assess the strategy for identifying the optimal reconfiguration of a PV module array in the event of shading or malfunctions.