The invention relates to an SDN flow rule batch updating method and device, and the method comprises the steps: determining a candidate address range of each first SDN flow rule in a main rule table of a tri-state
content addressable memory based on a rule
dependency graph under the condition that a plurality of first SDN flow rules are temporarily stored in a temporary rule table of the tri-state
content addressable memory, searching available flow table items in the main rule table; solving the maximum matching problem of the
bipartite graph to obtain a matching result; and according to a matching result, updating the plurality of first SDN flow rules in the main rule table. A candidate address range of the SDN flow rule in the main rule table is determined based on the rule
dependency graph, available flow table entries in the range are retrieved, a rule-available table entry
bipartite graph to be updated is constructed, the maximum matching of the
bipartite graph is solved, and zero-movement updating is achieved; according to the method and the device, frequent change of the main rule table of the TCAM can be reduced, the TCAM
storage efficiency is improved, and the updating cost is reduced as much as possible.