Particle swarm optimization (PSO) stands as a prominent and robust meta-heuristic algorithm within swarm intelligence (SI). It originated in 1995 by simulating the foraging behavior of bird flocks. In recent years, numerous PSO variants have been proposed to address various optimization applications. However, the overall performance of these variants has not been deemed satisfactory. This article introduces a novel PSO variant, presenting three key contributions: First, a novel dynamic oscillation inertia weight is introduced to strike a balance between exploration and exploitation; Second, the utilization of cosine similarity and dynamic neighborhood strategy enhances both the quality of solution and the diversity of particle populations; Third, a unique worst-best example learning strategy is proposed to enhance the quality of the least favorable solution and consequently improving the overall population. The algorithm's validation is conducted using a test suite comprised of benchmarks from the CEC2014 and CEC2022 test suites on real-parameter single-objective optimization. The experimental results demonstrate the competitiveness of our algorithm against recently proposed state-of-the-art PSO variants and well-known algorithms.