Search

US-20260129047-A1 - ACCESS METHOD AND ACCESS APPARATUS

US20260129047A1US 20260129047 A1US20260129047 A1US 20260129047A1US-20260129047-A1

Abstract

Embodiments of this disclosure provide an access method and an access apparatus, and relate to the field of computer technologies, to resolve problems of poor extensibility and low performance during mutual data access between server nodes. A specific solution is: determining, based on a first virtual address, an address of a second server node corresponding to the first virtual address, where the first virtual address is an address carried in an access request obtained by a first server node (S 501 ); and if the address of the second server node is a second virtual address, sending the access request to the second virtual address, where the second virtual address is a shared virtual address of the first server node and the second server node (S 502 ). Embodiments of this disclosure are applied to the process of mutual data access between the server nodes.

Inventors

  • Guijin Tang

Assignees

  • HUAWEI TECHNOLOGIES CO., LTD.

Dates

Publication Date
20260507
Application Date
20260103
Priority Date
20230705

Claims (15)

  1. 1 . An access method, wherein the method comprises: determining, based on a first virtual address, an address of a second server node corresponding to the first virtual address, wherein the first virtual address is an address carried in an access request obtained by a first server node; and sending the access request to the address of the second server node, wherein the address of the second virtual node is determined to be a shared virtual address of the first server node and the second server node.
  2. 2 . The method according to claim 1 , wherein the determining, based on the first virtual address, the address of the second server node corresponding to the first virtual address comprises: determining, based on the first virtual address, a virtual physical address corresponding to the first virtual address, wherein the virtual physical address is an address of a virtual space of the first server node; and determining, based on the virtual physical address, the address of the second server node corresponding to the virtual physical address.
  3. 3 . The method according to claim 2 , wherein a correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and a correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.
  4. 4 . The method according to claim 3 , wherein a page table entry length of the server node page table is different from a page table entry length of the bus page table.
  5. 5 . The method according to claim 1 , wherein the access request further comprises an access credential and an identification of the second server node, and the access credential is used to configure an access permission of the access request.
  6. 6 . The method according to claim 1 , wherein the method further comprises: in response to the address of the second server node being a physical address, accessing a physical memory of the first server node based on the physical address, wherein the first server node and the second server node are the same server node.
  7. 7 . An access method, wherein the method comprises: receiving an access request comprising a second virtual address, wherein the second virtual address is a shared virtual address of a first server node and a second server node; determining, based on the second virtual address, a physical address corresponding to the second virtual address; and accessing a physical memory of the second server node based on the access request and the physical address.
  8. 8 . The method according to claim 7 , wherein the access request further comprises an access credential, and the access credential is used to configure an access permission of the access request; and before the determining, based on the second virtual address, the physical address corresponding to the second virtual address, the method further comprises: determining, based on the access credential, whether the access permission of the access request is valid.
  9. 9 . The method according to claim 7 , wherein the second virtual address is determined by the first server node based on a virtual physical address, wherein the virtual physical address is an address of the virtual space of the first server node.
  10. 10 . An apparatus, wherein the apparatus comprises a processor and a memory, the memory stores instructions, and when the processor runs the instructions, the apparatus is enabled to perform the following method: determining, based on a first virtual address, an address of a second server node corresponding to the first virtual address, wherein the first virtual address is an address carried in an access request obtained by a first server node; and if the address of the second server node is a second virtual address that is a shared virtual address of the first server node and the second server node, sending the access request to the second virtual address.
  11. 11 . The apparatus according to claim 10 , wherein the apparatus is further enabled to perform the following method: the determining, based on the first virtual address, the address of the second server node corresponding to the first virtual address comprises: determining, based on the first virtual address, a virtual physical address corresponding to the first virtual address, wherein the virtual physical address is an address of a virtual space of the first server node; and determining, based on the virtual physical address, the address of the second server node corresponding to the virtual physical address.
  12. 12 . The apparatus according to claim 11 , wherein a correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and a correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.
  13. 13 . The apparatus according to claim 12 , wherein a page table entry length of the server node page table is different from a page table entry length of the bus page table.
  14. 14 . The apparatus according to claim 10 , wherein the access request further comprises an access credential and an identification of the second server node, and the access credential is used to configure an access permission of the access request.
  15. 15 . The apparatus according to claim 10 , wherein the apparatus is further enabled to perform the following method: if the address of the second server node is a physical address, accessing a physical memory of the first server node based on the physical address, wherein the first server node and the second server node are the same server node.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2024/077964, filed on February 21, 2024, which claims priority to Chinese Patent Application No. 202310831471.6, filed on July 5, 2023. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD Embodiments of this disclosure relate to the field of computer technologies, and in particular, to an access method and an access apparatus. BACKGROUND A distributed system or a computer cluster typically includes multiple server nodes interconnected through a high-speed link. To make full use of computing capabilities of the multiple server nodes in the distributed system or the computer cluster, one computing task may be typically divided into multiple computing subtasks to be delivered to different server nodes for computing, and then computing results of all the computing subtasks are summarized. Computing tasks are typically run in a form of processes. Address spaces of processes deployed on different server nodes are isolated, and operating systems (OSs) on the different server nodes are also isolated from each other. Therefore, how to efficiently, simply, securely, and reliably summarize inter-process computing results is challengeable. SUMMARY Embodiments of this disclosure provide an access method and an access apparatus. A shared virtual address space is allocated for a first server node and a second server node, so that the first server node and the second server node can securely and reliably access each other based on a shared virtual address. This resolves problems of poor extensibility and low performance of an existing implementation. To achieve the foregoing objectives, the following technical solutions are used in embodiments of this disclosure. According to a first aspect, an embodiment of this disclosure provides an access method. The method includes: determining, based on a first virtual address, an address of a second server node corresponding to the first virtual address, where the first virtual address is an address carried in an access request obtained by a first server node; and if the address of the second server node is a second virtual address, sending the access request to the second virtual address, where the second virtual address is a shared virtual address of the first server node and the second server node. Therefore, if the address of the second server node is the shared virtual address, for example, the second virtual address, it indicates that the address of the second server node can be shared by another server node, for example, the first server node for access. Compared with the conventional technology in which complex packet receiving and sending are required or sending is performed through a protocol stack, this application is more efficient and has better performance. In addition, in this embodiment of this disclosure, the shared virtual address is used, and this embodiment does not depend on a topology structure of a server node. Therefore, this embodiment is more flexible to extend than the conventional technology. In addition, a correspondence between the first virtual address and the address of the second server node may be stored in a physical memory of the first server node. Therefore, accessing the physical memory of the first server node is more efficient than accessing a remote physical memory. In a possible design, the determining, based on the first virtual address, the address of the second server node corresponding to the first virtual address includes: determining, based on the first virtual address, a virtual physical address corresponding to the first virtual address, where the virtual physical address is an address of a virtual space of the first server node; and determining, based on the virtual physical address, the address of the second server node corresponding to the virtual physical address. Based on this, the first server node may be divided into a virtual space corresponding to the virtual physical address, where the virtual space may be far greater than a space of a local physical address. This can expand a physical memory space that can be accessed by the first server node. In a possible design, a correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and a correspondence between the virtual physical address and the address of the second server node is stored in a bus page table. In this design, the server node page table and the bus page table may be stored in the local physical memory of the first server node. When performing address translation, the first server node reads the page table in the local physical memory, thereby improving efficiency and performance. In a possible design, a page table entry length of the server node page table is different from a page table entry length of the bus page tabl