The paper aims to apply the algebra of octonions to explore the contributions of external derivative of electric moments and so forth on the induced electric currents, revealing a few major influencing factors relevant to the direct and inverse piezoelectric effects. J. C. Maxwell was the first to adopt the algebra of quaternions to describe the physical quantities of electromagnetic fields. The contemporary scholars utilize the quaternions and octonions to research the physical properties of electromagnetic and gravitational fields. The application of octonions is able to study the physical quantities of electromagnetic and gravitational fields, including the octonion field strength, field source, linear moment, angular moment, torque and force. When the octonion force is equal to zero, it is capable of achieving eight independent equations, including the force equilibrium equation, fluid continuity equation, current continuity equation, and second-precession equilibrium equation and others. One of inferences derived from the second-precession equilibrium equation is that the electric current and derivative of electric moments are able to excite each other. The external derivative of electric moments can induce the electric currents. Meanwhile the external electric currents are capable of inducing the derivative of electric moments. The research states that this inference can be considered as the underlying mechanism for the direct and inverse piezoelectric effects. Further the second-precession equilibrium equation is able to predict several new influencing factors of direct and inverse piezoelectric effects.