The invention discloses a vector calculation-based water meter water quantity and water rate calculation method, and aims to solve the technical problems of I / O
bottleneck, high calculation
delay and poor expansibility in existing large-scale water meter charging. The method comprises the following steps: constructing a water meter data
column vector, calculating an original
difference vector based on a current-period reading vector and a previous-period reading vector, and performing Boolean
mask processing to obtain a meter reading
water volume vector; actual
water consumption accounting, total and
score table allocation and allocated water amount calculation are achieved through vector operation; a billing
water volume vector is obtained in combination with a preferential strategy, and an actual water fee is finally obtained through mixed
water splitting, stepped billing matrix operation and water fee preferential adjustment. According to the method, vectorization and matrix operation are adopted to replace traditional line-by-line calculation, so that the operation efficiency can be improved through parallel calculation, the vector
algorithm is designed to adapt to complex water affair billing logic, the
processing performance is effectively improved, efficient and large-scale billing is achieved, the intelligent water affair development requirement is met, and practicability and popularization value are achieved.