The invention provides an asynchronous task
processing method based on persistent
queue and
business rule conflict detection, and the method specifically comprises the steps: receiving an e-commerce data flow, and analyzing the e-commerce data flow into an
atomic data line object; extracting a to-be-operated resource dimension in the object, and forming a resource locking identifier set consisting of a service main key and an association key; establishing a conflict dependency relationship between write operations, and constructing a directed acyclic
dependency graph according to the conflict dependency relationship; the objects are decomposed into a plurality of batches which are executed in sequence, and it is ensured that resource identification sets of all the objects in the same batch are not intersected; for each object, reading the current data version number of the target write-in position, and generating a write-in instruction containing an expected version; verifying the consistency of the real-time version and the expected version by using a
database CAS instruction; if the real-time version and the expected version are consistent, finishing persistence; if not, the
concurrency version conflict is judged; at the moment, a conflict avoiding mechanism is triggered,
rollback time
delay is calculated through an exponential back-off
algorithm, and conflict objects are re-injected into the dependent construction or execution process.