The ecu via the knock sensor is obviously detecting some form of noise and hence trying to safeguard the engine by pulling back ignition, so i'd be inclined to look at what can be causing the noise. This might not be engne related at all. It could be something reverberating at that revs and the knock sensor is detecting it and telling the ecu that it is the engine detonating.
A couple of suggestions in a moment are probably unlikely to be an issue,but shouldn't be dismissed out of hand, such as gearbox noise, parts vibrating against metal or even quality of fuel. Could even have been caused by sediment in the fuel tank which has now restricted the fuel filter and hence caused a drop in 'volume' of fuel even though pressure is there. These suggestions are as i said unlikely, but only you know the history and use of the car.
Could the knock sensor be a particularly sensitive example? For the sake of a couple of minutes changing, it might be worth swapping with someone, resetting the ecu and see what happens from there. You'll know how long it takes to see the symptom come back.
There's probably a hundred and one other suggestions as to the cause, but it's something else to be going on with and think about.