Limiting probability of a false positive when measuring whether two binary variables correlate

Note: I don't have formal training in statistics, so please excuse any mistake I've made in my question.

I have two arrays, each with the time-series data of a binary variable, like this:

A: 001101011010100100101001...
B: 100101000101001100101101...

The time-series are of length $$N$$ (they can vary). (Edit: Thanks to @Mai for pointing out that I've said "time-series" here, but I only care about their "spatial" correlations, so the samples for each time-step can be treated as independent samples.)

The goal is to determine whether $$A$$ and $$B$$ correlate (negative or positive) with one another or not, but to limit the chance of a false positive to $$0.0001\%$$ (for example). This obviously means raising the probability of a false negative - and that's fine for my use case. Also, to be clear, I don't care about the strength of the correlation - only whether or not they correlate at all.

A simple approach would be to look at the difference between $$P(A|B)$$ and $$P(A)$$. If there is a difference, then they correlate. This obviously will give a lot of false positives, since the time-series are of length $$N$$, which is finite.

So I had the idea that I'd get the absolute value of the difference between $$P(A|B)$$ and $$P(A)$$, and then subtract the maximum absolute difference that we'd "expect" to see between those values in $$99.9999\%$$ of experiments between two independent binary variables with $$P(A)$$ and $$P(B)$$ where the time-series are of length $$N$$. As far as I can see, that would cause the probability of a false positive to be $$0.0001\%$$.

Is this a reasonable approach? Is there a simpler way? I'm actually dealing with trillions of pairs of binary variables, and so performance is a consideration. If I went with the above approach, then I think I'd need to use a combination of normal and poisson approximations to the binomial distribution to be able to handle the full range of $$N$$ and $$p$$ values. Thanks!