A memory access method, wherein the method comprises: receiving (101, 201), by a switch (11, 802), a data packet, wherein the data packet comprises source node information, destination node information, and a protocol type, wherein the protocol type is used to indicate a type of the data packet; matching (102, 202) a flow table on the data packet, wherein the flow table comprises at least one flow entry, wherein each flow entry comprises a matching field and an action field, and the at least one flow entry comprises a first flow entry, wherein a matching field of the first flow entry is used to match the source node information, the destination node information, and the protocol type in the data packet, and an action field of the first flow entry is used to indicate an operation command for a storage device embedded in the switch (11, 802); and when the data packet successfully matches the first flow entry, performing (103, 203) an operation on the storage device according to the operation command in the action field of the successfully matched first flow entry, characterized in that the method further comprises: allocating, by a controller, storage space in the switch (11, 802) to an application program; notifying, by the controller, processors (04, 42) running the application program of an address of the allocated storage space; and sending, by the controller, flow table configuration information to the switch (11, 802) to configure at least two first flow entries, wherein: a matching field of one first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a write operation command (MEM WR); and a matching field of the other first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a read operation command (MEM RD). receiving (101, 201), by a switch (11, 802), a data packet, wherein the data packet comprises source node information, destination node information, and a protocol type, wherein the protocol type is used to indicate a type of the data packet; matching (102, 202) a flow table on the data packet, wherein the flow table comprises at least one flow entry, wherein each flow entry comprises a matching field and an action field, and the at least one flow entry comprises a first flow entry, wherein a matching field of the first flow entry is used to match the source node information, the destination node information, and the protocol type in the data packet, and an action field of the first flow entry is used to indicate an operation command for a storage device embedded in the switch (11, 802); and when the data packet successfully matches the first flow entry, performing (103, 203) an operation on the storage device according to the operation command in the action field of the successfully matched first flow entry, characterized in that the method further comprises: allocating, by a controller, storage space in the switch (11, 802) to an application program; notifying, by the controller, processors (04, 42) running the application program of an address of the allocated storage space; and sending, by the controller, flow table configuration information to the switch (11, 802) to configure at least two first flow entries, wherein: a matching field of one first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a write operation command (MEM WR); and a matching field of the other first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a read operation command (MEM RD). allocating, by a controller, storage space in the switch (11, 802) to an application program; notifying, by the controller, processors (04, 42) running the application program of an address of the allocated storage space; and sending, by the controller, flow table configuration information to the switch (11, 802) to configure at least two first flow entries, wherein: a matching field of one first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a write operation command (MEM WR); and a matching field of the other first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a read operation command (MEM RD). a matching field of one first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a write operation command (MEM WR); and a matching field of the other first flow entry includes a source node identifier corresponding to the processors (04, 42), a destination node identifier corresponding to the switch (11, 802), and a protocol type, and the corresponding action field is a read operation command (MEM RD).