The invention relates to the technical field of IPv6 self-configuration, in particular to an IPv6 network mode self-adaptive configuration method and
system based on an RA message. In the method, a finite-state
machine establishes a state transition path according to the combination relation of M and O flag bits in an RA message cache set and prefix field content, converts a network mode recognition process into a quantifiable state judgment sequence, and sends the state judgment sequence to the RA message cache set; configuration
ambiguity caused by flag bit fluctuation in traditional static judgment is eliminated,
pattern recognition under network environment changes has continuity and self-consistency, the classification regression tree constructs a
branch judgment path with the duration, the advertisement interval and the prefix consistency of an RA source as characteristic variables, an optimal node is selected through a hierarchical splitting
algorithm, and the judgment accuracy is improved. The
dynamic mapping of stateful and stateless configuration paths is realized, the misjudgment rate of configuration branches is reduced, and the address allocation
delay is optimized, so that the IPv6 self-configuration has a structured decision-making capability and a parameter mapping self-optimization characteristic, and the connection reliability, the address generation speed and the configuration accuracy are improved.