From Academic Kids
zh:马氏管 The Malpighian tubules are the insects' main organ of excretion and osmoregulation, helping them to maintain water and electrolyte balance. They are named after their discoverer, Marcello Malpighi.
The tubules are long thin outgrowths of the alimentary canal each consisting a single layer of cells and closed off at the end; they join the canal at the junction between the midgut and hindgut. Scale insects have just two, while large types of locusts may have up to 200; aphids are the only type of insect with no tubules.
Pre-urine is formed in the tubules, when the nitrogenous waste and electrolytes (sodium, potassium and uric acid) are actively transported through the ends of the tubules. Water follows thereafter. The pre-urine, along with digested food, merge in the hindgut. At this time, uric acid precipitates out, and sodium and potassium are actively absorbed by the hindgut, along with water following through osmosis. Uric acid is left to mix with feces, where they are then ready for excretion.