A virtual subnet-based data access method and related apparatus
By fixing the subnet address of the target service process in the virtual subnet, the problem of external devices being unable to obtain the subnet address during service process restart is solved, achieving efficient data access and improving system resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-04-12
- Publication Date
- 2026-05-19
AI Technical Summary
During the restart of the virtual subnet service process, external devices cannot obtain a new subnet address in a timely manner, resulting in reduced data access efficiency.
By obtaining data access requests from external devices, the process identifier of the target service process in the target virtual subnet is determined. Based on the correspondence between the process identifier and the subnet address, the subnet address of the target service process before and after the restart is fixed, and the target subnet address is directly returned to the external device so that the target data can still be accessed after the service process restarts.
It improves the data access efficiency of external devices during service process restart, reduces waiting time, avoids repetitive operations in the virtual subnet management center, and improves system resource utilization.
Smart Images

Figure CN116938634B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud storage, and in particular to data access methods and related apparatus based on virtual subnets. Background Technology
[0002] Network resource virtualization is the process of abstracting, pooling, and reallocating the resources of the underlying physical network. Through network resource virtualization, it is possible to maintain multiple virtual subnets existing in parallel within a network environment.
[0003] Virtual subnets can be used to store data resources. External devices can access a virtual subnet using its subnet address to retrieve the data they need. Typically, external devices obtain the subnet address through the Domain Name System (DNS) based on the service process identifier. The service process identifier indicates the process accessing the virtual subnet; external devices can access the service process through the subnet address and then access data within the virtual subnet.
[0004] In related technologies, due to business or maintenance needs, the service process of virtual subnets in a network environment often needs to be restarted. After the service process restarts, a new subnet address is reallocated to the virtual subnet. During the service process restart, the original subnet address of the virtual subnet is invalidated. Therefore, when external devices access their corresponding virtual subnets during service process restarts, DNS cannot resolve the subnet address based on the service process identifier. Furthermore, after the service process restarts or is rebuilt, external devices need to re-resolve the DNS based on the service process identifier to obtain the newly allocated subnet address, affecting the efficiency of external devices accessing the virtual subnet.
[0005] Therefore, there is an urgent need for a more efficient data access method based on virtual subnets. Summary of the Invention
[0006] To address the aforementioned technical issues, this application provides a data access method and related apparatus based on a virtual subnet, which can still obtain the corresponding subnet address during service process restart, thereby improving the efficiency of external devices accessing the virtual subnet.
[0007] The embodiments of this application disclose the following technical solutions:
[0008] On one hand, embodiments of this application provide a data access method based on a virtual subnet, characterized in that the method includes:
[0009] Obtain a data access request sent by an external device for accessing target data, wherein the access request includes a data identifier of the target data;
[0010] Based on the data identifier, obtain the target process identifier of the target service process in the target virtual subnet where the target data is located;
[0011] Based on the correspondence between process identifiers and subnet addresses of virtual subnets, the target subnet address of the target virtual subnet is determined by the target process identifier, and the subnet address of the target service process is fixed to the target subnet address before and after restarting;
[0012] The target subnet address is returned to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0013] On the other hand, embodiments of this application provide a data access device based on a virtual subnet, characterized in that the device includes:
[0014] A data access request acquisition unit is used to acquire a data access request sent by an external device for accessing target data, wherein the access request includes a data identifier of the target data;
[0015] The target process identifier acquisition unit is used to acquire the target process identifier of the target service process in the target virtual subnet where the target data is located, based on the data identifier.
[0016] The target subnet address determination unit is used to determine the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet, wherein the subnet address of the target service process is fixed to the target subnet address before and after restarting.
[0017] The return unit is used to return the target subnet address to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0018] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:
[0019] The memory is used to store program code and transmit the program code to the processor;
[0020] The processor is used to execute the virtual subnet-based data access method described above according to the instructions in the program code.
[0021] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program for executing the data access method based on a virtual subnet described above.
[0022] In another aspect, embodiments of this application provide a computer program product including instructions that, when run on a computer, cause the computer to perform the data access method based on a virtual subnet described above.
[0023] As can be seen from the above technical solution, by obtaining a data access request sent by an external device, including a data identifier of the target data, the target process identifier of the target service process in the target virtual subnet where the target data resides is obtained based on the data identifier. Then, according to the correspondence between the process identifier and the subnet address of the virtual subnet, the target subnet address of the target virtual subnet is determined by the target process identifier. The subnet address of the target service process is fixed before and after a restart, so even during a service process restart, the target subnet address of the target virtual subnet can still be determined by the target process identifier. The determined target subnet address is then returned to the external device, allowing the external device to access the target service process through this target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0024] Since the subnet address of the target service process is fixed before and after the restart, meaning the correspondence between the target service process and the target subnet address of the target virtual subnet is not changed by the restart of the service process, the access layer can still determine the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet during the restart of the target service process. This target subnet address is then returned to the external device, so that the external device can access the target service process through this target subnet address after the target service process restarts and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A schematic diagram of a system architecture for data access based on a virtual subnet, provided for an embodiment of this application;
[0027] Figure 2 A flowchart illustrating a data access method based on a virtual subnet, provided as an embodiment of this application;
[0028] Figure 3 A schematic diagram illustrating the correspondence between process identifiers and subnet addresses provided in an embodiment of this application;
[0029] Figure 4 A flowchart illustrating another data access method based on a virtual subnet provided in this application embodiment;
[0030] Figure 5 A schematic diagram of the structure of a data access device based on a virtual subnet provided in this application embodiment;
[0031] Figure 6 A structural diagram of a terminal device provided in an embodiment of this application;
[0032] Figure 7 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation
[0033] The embodiments of this application will now be described with reference to the accompanying drawings.
[0034] A virtual subnet is an example of utilizing network resource virtualization technology. Virtual subnets can be used to store data resources, such as training data for models or rendering data needed for animation rendering. External devices can access the virtual subnet through its subnet address to obtain the data resources within it.
[0035] In related technologies, external devices obtain subnet addresses through DNS resolution based on the service process identifier. The service process identifier is used to identify the service process accessing the virtual subnet. External devices can access the service process of the virtual subnet through the subnet address and then access the data in the virtual subnet through the service process.
[0036] However, due to business or maintenance needs, the service process of a virtual subnet in a network environment often needs to be restarted, and in some cases, it needs to be rebuilt. When the service process restarts or is rebuilt, the original address of the virtual subnet is invalidated, and a new subnet address is reassigned to the virtual subnet after the restart or rebuild.
[0037] Therefore, when the service process restarts or resumes, if an external device accesses the corresponding virtual subnet, the DNS cannot resolve the subnet address based on the service process identifier. Furthermore, after the service process restarts or resumes, the external device needs to re-resolve the DNS based on the service process identifier to obtain the newly assigned subnet address, impacting the efficiency of external devices accessing the virtual subnet.
[0038] In view of this, this solution provides a highly efficient data access method based on a virtual subnet. This method can be implemented by any computer device including an access layer. This computer device can be a terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, smart TV, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0039] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0040] Currently, the storage method of storage systems is as follows: Logical volumes are created. During the creation of a logical volume, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Clients store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as a data identifier (ID, ID entity). The file system writes each object to the physical storage space of that logical volume and records the storage location information of each object. Therefore, when a client requests access to data, the file system can allow the client to access the data based on the storage location information of each object.
[0041] The process by which a storage system allocates physical storage space to a logical volume is as follows: the physical storage space is pre-divided into strips according to the capacity estimate of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of Redundant Array of Independent Disks (RAID). A logical volume can be understood as a strip, thus allocating physical storage space to the logical volume.
[0042] like Figure 1The diagram illustrates a system architecture for a data access method based on a virtual subnet provided in this application. The system includes an external device 200 and an internal device 100 (hereinafter referred to as the access layer) including an access layer, wherein the access layer 100 and the external device 200 can communicate. Specifically, the external device 200 sends a data access request, including a data identifier of the target data, to the access layer 100. The access layer 100 obtains the target subnet address, which instructs the external device 200 to access the target service process to obtain the target data, based on the data access request, and returns the target subnet address to the external device 200. The external device 200 can access the target service process based on the target subnet address returned by the access layer 100, and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0043] Specifically, the access layer 100 can obtain the target process identifier of the target service process in the target virtual subnet where the target data resides, based on the data identifier of the target data included in the data access request. This target service process identifier is used to identify the target service process. Since the target data is located in the target virtual subnet, external devices need to access the target service process of the target virtual subnet through its subnet address, thereby enabling the reading of the target data from the target virtual subnet through the target service process.
[0044] Access layer 100 can determine the target subnet address of the target virtual subnet based on the correspondence between process identifiers and virtual subnet addresses, using the target process identifier. The subnet address of the target service process remains fixed before and after a restart. That is, the target subnet address does not change due to the restart of the target service process. During the restart process, external device 200 can still obtain the target subnet address of the target virtual subnet. After the target service process restarts, external device 200 can access the target service process through this target subnet address.
[0045] After obtaining the target subnet address of the target virtual subnet where the target data is located at the access layer 100, the access layer 100 can return the target subnet address to the external device 200. The external device 200 can access the target service process through the target subnet address and obtain the target data corresponding to the data identifier of the target data from the target virtual subnet through the target service process.
[0046] Since the correspondence between process identifier and virtual subnet address does not change when the service process restarts, when the external device 200 wants to access the corresponding target virtual subnet when the target service process restarts, it can also obtain the target subnet address through the correspondence between process identifier and virtual subnet address. Thus, after the target service process is updated, it can directly access the target service process through the target subnet address and obtain the corresponding target data from the target virtual subnet.
[0047] In this way, the external device 200 can obtain the target subnet address through the access layer under any circumstances (including when the target service process restarts), and then access the target service process through the target subnet address when the target service process does not restart. The target service process can then obtain the target data corresponding to the data identifier from the target virtual subnet, thereby enabling data access to the virtual subnet, reducing waiting time, and effectively improving data access efficiency.
[0048] Figure 2 This is a flowchart illustrating a data access method based on a virtual subnet, provided as an embodiment of this application. In this embodiment, it is described using the access layer 100 in a computer device. The method includes the following steps:
[0049] S202: The access layer obtains a data access request sent by an external device for accessing target data.
[0050] When an external device needs to access data within a virtual subnet, it sends a data access request to the access layer to access the target data. The external device can be any computer device outside the virtual subnet, which can be a terminal device or a server. The access request includes a data identifier for the target data. The data identifier can be a key in a key-value pair store, and the target data can be the value in that key-value pair.
[0051] Key-value pair storage is a storage method that offers fast query speeds, large data storage capacity, and high concurrency support. It allows for the determination of a unique value based on a key. In this embodiment, the access layer can determine the target service process within the virtual subnet where the target data resides based on its keywords. Then, it determines the corresponding target subnet address, enabling external devices to access the target service process via the target subnet address and retrieve the target data (value) from the target virtual subnet based on the data identifier (key).
[0052] In some possible implementations, the target data can be the training data for the model, the rendering data required for animation rendering, etc.
[0053] In this embodiment, the data identifier of the target data is not only used to determine the target process identifier of the target service process in the target virtual subnet where the target data is located, but also used by the external device to obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process after obtaining the target subnet address.
[0054] S204: The access layer obtains the target process identifier of the target service process in the target virtual subnet where the target data is located based on the keyword.
[0055] Specifically, the access layer can perform hash calculations on data identifiers (e.g., keys) to obtain the target process identifier of the target service process within the target virtual subnet where the target data resides. Hash calculation refers to converting an input of arbitrary length into a fixed-length output through a mapping rule, which is the corresponding hash algorithm.
[0056] The target process identifier is used to identify the target process. The access layer can determine the target service process in the target virtual subnet where the target data is located based on the data identifier. The target service process can be identified by the target service process identifier.
[0057] In some possible implementations, the data access request sent by the external device also includes the cluster identifier of the target cluster of the target data, and the target cluster includes a target virtual subnet. Therefore, the access layer can use this cluster identifier to obtain the target process identifier of the target service process in the target virtual subnet of the target data within the target cluster, and thus obtain the target process identifier of the target service process in the target virtual subnet where the target data resides.
[0058] For example, the target process identifier of the target service process can be: <cluster identifier>.<hash value of the data identifier of the target data>. In this way, the target cluster can be determined based on the cluster identifier. The target cluster is the cluster where the target virtual subnet is located. Thus, the target virtual subnet can be determined among multiple virtual subnets of the target cluster without having to search in other clusters. The target virtual subnet can be quickly determined through the target cluster, and the target process identifier of the target service process in the target virtual subnet can be determined.
[0059] S206: The access layer determines the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet.
[0060] The subnet address of the target service process is fixed to the target subnet address before and after the restart.
[0061] The mapping between process identifiers and virtual subnet addresses is determined when a service process is established. Specifically, when a service process is established, the virtual subnet management center assigns a virtual subnet address to the service process, thus determining the mapping between the service process and the virtual subnet address. The process identifier is used to identify the service process.
[0062] Once the virtual subnet management center has completed the allocation, the mapping between process identifiers and virtual subnet addresses can usually be configured in the DNS. The access layer can then obtain the mapping between process identifiers and virtual subnet addresses from the DNS.
[0063] In related technologies, the original subnet address is invalidated when a service process restarts. After the virtual subnet service process restarts, the virtual subnet management center will reassign a new subnet address to the service process, and external devices need to access the service process through the new subnet address. However, due to business or maintenance needs, virtual subnet service processes in the network environment often need to be restarted. During the restart process, external devices cannot obtain the target subnet address based on the keywords of the target data. Furthermore, after the restart is complete, it is necessary to wait until the new subnet address is allocated before the target subnet address can be obtained based on the process identifier and the correspondence between virtual subnets and subnet addresses, thereby accessing the target service process and obtaining the target data corresponding to the keywords from the target virtual subnet through the target service process.
[0064] In this solution, the subnet address of the target service process remains fixed before and after restarting; this is the target subnet address. The virtual subnet management center only allocates the subnet address of the virtual subnet to the service process when it is established. When the service process restarts or is rebuilt, the subnet address of the virtual subnet corresponding to the service process remains fixed, eliminating the need for the virtual subnet management center to allocate it again. This avoids redundant operations by the virtual subnet management center, effectively reducing the waste of system resources and improving the system's resource utilization.
[0065] Since the correspondence between process identifiers and virtual subnet addresses remains fixed before and after a restart, the access layer can determine the target subnet address of the target virtual subnet based on the correspondence between process identifiers and virtual subnet addresses during the restart of the target service process.
[0066] Therefore, after the target service process restarts, external devices can directly access the target service process based on the obtained target subnet address, and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0067] In some possible implementations, since the subnet address of the target service process is fixed before and after restarting in this scheme, the correspondence between the process identifier and the subnet address of the virtual subnet does not change due to the restart of the service process. The correspondence between the process identifier and the subnet address of the virtual subnet is determined when the service process is established, such as... Figure 3 As shown, the virtual subnet management center only allocates a subnet address to a service process when the service process is established. When the service process is restarted or rebuilt, the subnet address of the virtual subnet corresponding to the service process is fixed, and there is no need for the virtual subnet management center to allocate it again. This avoids repetitive operations by the virtual subnet management center, effectively reduces the waste of system resources, and improves the system's resource utilization.
[0068] Once the access layer determines the target process identifier of the target service process within the target virtual subnet where the target data resides based on the data identifier, it can determine the target subnet address of the target virtual subnet from the DNS using the target process identifier. However, in some cases, due to frequent data access (typically including some low-speed access and some high-speed access), it is necessary to resolve the target subnet address from the DNS based on the mapping relationship. However, the DNS resolution capability is limited. As the scale of data storage increases, DNS resolution becomes insufficient to meet the data requirements of high-speed access, and DNS performance restricts the expansion of data scale.
[0069] Based on this, the mapping between the process identifier for high-speed access to target data and the subnet address of the virtual subnet can be cached in the cache space. This allows the target subnet address of the target virtual subnet to be determined from the target process identifier in the cache space, without needing to obtain it from DNS, thus reducing the DNS load and avoiding the constraint of DNS performance on data storage scale. This cache space can be a local cache space at the access layer, a cloud cache space, or a DNS cache space.
[0070] The mapping between target process identifiers and target subnet addresses in the cache space can be obtained and updated from DNS. When the cache space does not contain the mapping between target process identifiers and target subnet addresses, the target subnet address of the target virtual subnet is determined from the target process identifier in DNS. For some process identifiers that access target data at low speeds, resolving them through DNS will not affect the data storage scale, so DNS resolution can be used. In this way, different resolution methods are used for process identifiers with different access speeds. For process identifiers that access target data at low speeds, there is no need to load them into the cache space to meet the resolution requirements, thereby saving system cache space.
[0071] DNS can also resolve the target process identifier for the first access to target data, determining the target subnet address corresponding to the target process identifier. After the access layer determines the target subnet address from the target process identifier in DNS, the DNS can update the mapping between the target process identifier and the target subnet address in the cache space for high-speed access to target data. This allows the access layer to directly retrieve the target subnet address from the cache space on subsequent accesses, thus achieving traffic distribution for DNS access resolution. In this way, even if the cache space does not contain the mapping between the target process identifier and the target subnet address, updating the process identifier and subnet address in the cache space allows for direct resolution from the cache space on subsequent accesses to the same target data, improving data access efficiency.
[0072] Thus, only the initial resolution for high-speed access and low-speed access require DNS resolution. All other accesses (especially non-initial high-speed accesses with large data volumes) can be performed in the cache space. This effectively reduces the workload of DNS and avoids the impact of DNS performance on the expansion of data storage. S208: The access layer returns the target subnet address to external devices.
[0073] The target subnet address is the subnet address of the target virtual subnet. The target subnet address is used to instruct external devices to access the target service process through the target subnet address and obtain the target data corresponding to the keyword from the target virtual subnet through the target service process.
[0074] The external device obtains the target subnet address corresponding to the target data based on the target subnet address returned by the access layer. Further, the external device uses this target subnet address to access the target service process through the access layer, and then uses the target service process to obtain the target data from the target virtual subnet according to the correspondence between the data identifier and the target data.
[0075] Based on the above description, this solution provides a data access method based on a virtual subnet. This method acquires a data access request sent by an external device, including a data identifier for the target data. Based on the data identifier, it obtains the target process identifier of the target service process within the target virtual subnet where the target data resides. Then, according to the correspondence between the process identifier and the subnet address of the virtual subnet, the target subnet address of the target virtual subnet is determined by the target process identifier. The subnet address of the target service process is fixed before and after a restart. The determined target subnet address is then returned to the external device, enabling the external device to access the target service process through this target subnet address and retrieve the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0076] Since the subnet address of the target service process is fixed before and after the restart, meaning the correspondence between the target service process and the target subnet address of the target virtual subnet is not changed by the restart of the service process, the access layer can still determine the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet during the restart of the target service process. This target subnet address is then returned to the external device, so that the external device can access the target service process through this target subnet address after the target service process restarts and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0077] In some possible implementations, the virtual subnet-based data access method in this solution can be used for model training, where the model's training data is stored in the virtual subnet. When an external device needs to train the model, it retrieves the training data (target data) from the virtual subnet. The external device accesses the training data at high speed. In this scenario, such as... Figure 4 As shown, the data access method based on a virtual subnet includes the following steps:
[0078] S202: The access layer obtains a data access request sent by an external device for accessing target data.
[0079] The target data is the model's training data, and the access request includes the data identifier of the training data.
[0080] S204: The access layer obtains the target process identifier of the target service process in the target virtual subnet where the target data is located based on the data identifier.
[0081] S2062: The access layer determines whether the cache space contains the correspondence between the target process identifier and the target subnet address.
[0082] The target subnet address is the target subnet address of the target virtual subnet.
[0083] Specifically, the access layer can look up the correspondence between process identifiers and virtual subnet addresses included in the cache, and determine whether the cache space includes the correspondence between target process identifiers and target subnet addresses.
[0084] For example, the access layer can check in the cache whether the process identifiers in the corresponding relationships include the target process identifier, thereby determining whether the cache contains the correspondence between the target process identifier and the target subnet address. When the process identifiers in the corresponding relationships in the cache include the target process identifier, it indicates that the cache contains the correspondence between the target process identifier and the target subnet address.
[0085] Since DNS resolution performance limits the scale of data storage, the resolution of some target process identifiers can be offloaded to the cache space. The target subnet address can then be obtained by resolving the correspondence between the target process identifier and the target subnet address in the cache space, thereby reducing the performance load of DNS.
[0086] If the cache space contains the mapping between the target process identifier and the target subnet address, execute S2064; if the cache space does not contain the mapping between the target process identifier and the target subnet address, execute S2066.
[0087] S2064: The access layer determines the target subnet address of the target virtual subnet from the target process identifier in the cache space.
[0088] Since the cache space contains the correspondence between the target process and the target subnet address, the access layer can determine the target subnet address of the target virtual subnet from the target process identifier in the cache space.
[0089] S2066: The access layer determines the target subnet address of the target virtual subnet from the target process identifier in the DNS.
[0090] Since the cache space does not contain the mapping between the target process identifier and the target subnet address, the access layer needs to determine the target subnet address of the target virtual subnet from the DNS using the target process identifier. The mapping between the process identifier and the subnet address of the virtual subnet in the DNS is determined when the service process is established. Specifically, when the service process is established, the virtual subnet management center assigns a subnet address to the service process and then configures the mapping between the process identifier and the subnet address of the virtual subnet in the DNS. Therefore, when the cache space does not contain the mapping between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet can be determined from the DNS using the target process identifier.
[0091] S2068: The access layer updates the mapping between the target process identifier and the target subnet address to the cache space.
[0092] Since the cache space does not contain the mapping between the target process identifier and the target subnet address, the mapping between the target process identifier and the target subnet address can be updated in the cache space so that when the training data needs to be accessed again, the target subnet address of the target virtual subnet can be determined from the target process identifier in the cache space.
[0093] S2066 and S2068 can be executed sequentially or simultaneously. The condition for executing S2068 is that the cache space does not contain the correspondence between the target process identifier and the target subnet address.
[0094] S208: The access layer returns the target subnet address to the external device.
[0095] External devices access the target service process through the target subnet address and obtain the training data corresponding to the data identifier from the target virtual subnet through the target service process.
[0096] Thus, when an external device first accesses the training data in the virtual subnet, it sends a data access request, including the data identifier of the training data, to the access layer. The access layer executes steps S202, S204, S2062, S2066, S2068, and S208. Specifically, the access layer receives the data access request from the external device for accessing the training data. Then, based on the data identifier, the access layer obtains the target process identifier of the target service process in the target virtual subnet where the training data is located. The access layer determines that the cache space does not contain the mapping between the target process identifier and the target subnet address. Therefore, it determines the target subnet address of the target virtual subnet from the DNS based on the target process identifier, updates the mapping between the target process identifier and the target subnet address in the cache space, and finally returns the target subnet address to the external device.
[0097] Therefore, the access layer can obtain the target subnet address and cache the correspondence between the target process identifier and the target subnet address of the target virtual subnet in the cache space, so that the target subnet address of the target virtual subnet can be quickly determined from the target process identifier in the cache space later.
[0098] When an external device accesses the training data of a virtual subnet for the first time, it sends a data access request, including the data identifier of the training data, to the access layer. The access layer executes steps S202, S204, S2062, S2064, S2068, and S208. Specifically: the access layer receives the data access request from the external device to access the training data; then, based on the data identifier, it obtains the target process identifier of the target service process in the target virtual subnet where the training data is located; the access layer determines the correspondence between the target process identifier and the target subnet address in the cache space; therefore, it determines the target subnet address of the target virtual subnet from the target process identifier in the cache space; and finally, it returns the target subnet address to the external device.
[0099] Therefore, the access layer can determine the target virtual subnet from the target process identifier in the cache space, instead of determining it in DNS. This reduces the performance load of DNS resolution, shifting a large amount of resolution work to the cache space and avoiding the performance constraints of DNS on the expansion of data storage. Based on this scheme, external devices can quickly obtain the subnet address of training data in the virtual subnet, access the target service process through the target subnet address, and obtain the training data corresponding to the data identifier from the target virtual subnet, thus enabling rapid model training.
[0100] In the foregoing Figures 1-4 Based on the corresponding embodiments, Figure 5 The diagram shows the structure of a data access device based on a virtual subnet. The data access device 500 based on a virtual subnet includes: a data access request acquisition unit 502, a target process identifier acquisition unit 504, a target subnet address determination unit 506, and a return unit 508.
[0101] The data access request acquisition unit 502 is used to acquire a data access request sent by an external device for accessing target data, wherein the access request includes the data identifier of the target data;
[0102] The target process identifier acquisition unit 504 is used to acquire the target process identifier of the target service process in the target virtual subnet where the target data is located, based on the data identifier.
[0103] The target subnet address determination unit 506 is used to determine the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet, wherein the subnet address of the target service process is fixed to the target subnet address before and after restarting.
[0104] The return unit 508 is used to return the target subnet address to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0105] In one possible implementation, the target subnet address determination unit 506 is specifically used for:
[0106] When the cache space includes the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the cache space by the target process identifier.
[0107] In one possible implementation, the target subnet address determination unit 506 is specifically used for:
[0108] When the cache space does not contain the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the DNS by the target process identifier.
[0109] In one possible implementation, the device further includes an updating unit, which is used for:
[0110] The mapping between the target process identifier and the target subnet address is updated in the cache space.
[0111] In one possible implementation, the target subnet address of the target virtual subnet is assigned when the target virtual subnet is first established.
[0112] In one possible implementation, the access request includes a cluster identifier of a target cluster, the target cluster including multiple virtual subnets, and the target cluster including a target virtual subnet;
[0113] The target process acquisition unit 504 is specifically used for:
[0114] The target cluster is determined based on the cluster identifier;
[0115] In the target cluster, the target process identifier of the target service process in the target virtual subnet where the target data is located is obtained according to the data identifier.
[0116] In one possible implementation, the target subnet address determination unit 506 is specifically used for:
[0117] During the restart of the target service process, the target subnet address of the target virtual subnet is determined by the target process identifier based on the correspondence between the process identifier and the subnet address of the virtual subnet.
[0118] In one possible implementation, the target data includes the model's training data.
[0119] Therefore, by acquiring a data access request from an external device that includes a data identifier for the target data, the system obtains the target process identifier of the target service process within the target virtual subnet where the target data resides. Then, based on the mapping between process identifiers and subnet addresses of the virtual subnet, the target subnet address of the target virtual subnet is determined from the target process identifier. The subnet address of the target service process remains fixed before and after a restart, so even during a service process restart, the target subnet address of the target virtual subnet can still be determined from the target process identifier. The determined target subnet address is then returned to the external device, allowing the external device to access the target service process through this target subnet address and retrieve the target data corresponding to the data identifier from the target virtual subnet via the target service process.
[0120] Since the subnet address of the target service process is fixed before and after the restart, meaning the correspondence between the target service process and the target subnet address of the target virtual subnet is not changed by the restart of the service process, the access layer can still determine the target subnet address of the target virtual subnet based on the correspondence between the process identifier and the subnet address of the virtual subnet during the restart of the target service process. This target subnet address is then returned to the external device, so that the external device can access the target service process through this target subnet address after the target service process restarts and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0121] This application also provides a computer device, which is the computer device described above, and may include a terminal device or a server. The aforementioned data access device based on a virtual subnet can be configured in this computer device. The computer device will now be described in conjunction with the accompanying drawings.
[0122] If the computer device is a terminal device, please refer to Figure 6 As shown, this application provides a terminal device, taking a mobile phone as an example:
[0123] Figure 6 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 6 The mobile phone includes components such as a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a Wi-Fi module 670, a processor 680, and a power supply 690. Those skilled in the art will understand that... Figure 6 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0124] The following is combined Figure 6 A detailed introduction to each component of a mobile phone:
[0125] The RF circuit 610 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 680; in addition, it transmits uplink data to the base station.
[0126] The memory 620 can be used to store software programs and modules. The processor 680 executes various functions and data processing of the mobile phone by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0127] The input unit 630 can be used to receive input numeric or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632.
[0128] The display unit 640 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 640 may include a display panel 641.
[0129] The mobile phone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors.
[0130] Audio circuit 660, speaker 661, and microphone 662 provide an audio interface between the user and the mobile phone.
[0131] WiFi is a short-range wireless transmission technology. Through the WiFi module 670, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access.
[0132] The processor 680 is the control center of the mobile phone. It connects various parts of the mobile phone through various interfaces and lines. It performs various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 620 and calling data stored in the memory 620.
[0133] The phone also includes a power supply 690 (such as a battery) that powers the various components.
[0134] In this embodiment, the processor 680 included in the terminal device also has the following functions:
[0135] Obtain a data access request sent by an external device for accessing target data, wherein the access request includes a data identifier of the target data;
[0136] Based on the data identifier, obtain the target process identifier of the target service process in the target virtual subnet where the target data is located;
[0137] Based on the correspondence between process identifiers and subnet addresses of virtual subnets, the target subnet address of the target virtual subnet is determined by the target process identifier, and the subnet address of the target service process is fixed to the target subnet address before and after restarting;
[0138] The target subnet address is returned to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
[0139] If the computer device is a server, this application embodiment also provides a server; please refer to [link to relevant documentation]. Figure 7 As shown, Figure 7 This is a structural diagram of a server 700 provided in an embodiment of this application. The server 700 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 722 (e.g., one or more processors) and a memory 732, and one or more storage media 730 (e.g., one or more mass storage devices) for storing application programs 742 or data 744. The memory 732 and storage media 730 can be temporary or persistent storage. The program stored in the storage media 730 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 722 may be configured to communicate with the storage media 730 and execute the series of instruction operations in the storage media 730 on the server 700.
[0140] Server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input / output interfaces 758, and / or one or more operating systems 741, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0141] The steps performed by the server in the above embodiments can be based on Figure 7 The server structure shown.
[0142] In addition, this application embodiment also provides a storage medium for storing a computer program for executing the method provided in the above embodiment.
[0143] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to perform the methods provided in the above embodiments.
[0144] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0145] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0146] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Moreover, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data access method based on a virtual subnet, characterized in that, The method includes: Obtain a data access request sent by an external device for accessing target data, wherein the access request includes a data identifier of the target data; Based on the data identifier, obtain the target process identifier of the target service process in the target virtual subnet where the target data is located; During the restart of the target service process, the target subnet address of the target virtual subnet is determined by the target process identifier according to the correspondence between the process identifier and the subnet address of the virtual subnet. The subnet address of the target service process before and after the restart is fixed to the target subnet address. The target subnet address is returned to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
2. The method according to claim 1, characterized in that, The step of determining the target subnet address of the target virtual subnet based on the correspondence between process identifiers and subnet addresses of virtual subnets includes: When the cache space includes the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the cache space by the target process identifier.
3. The method according to claim 1, characterized in that, The method further includes: When the cache space does not contain the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the DNS by the target process identifier.
4. The method according to claim 3, characterized in that, The method further includes: The mapping between the target process identifier and the target subnet address is updated in the cache space.
5. The method according to claim 1, characterized in that, The target subnet address of the target virtual subnet is assigned when the target virtual subnet is first established.
6. The method according to claim 1, characterized in that, The access request includes the cluster identifier of the target cluster, the target cluster includes multiple virtual subnets, and the target cluster includes a target virtual subnet; The step of obtaining the target process identifier of the target service process in the target virtual subnet where the target data is located based on the data identifier includes: The target cluster is determined based on the cluster identifier; In the target cluster, the target process identifier of the target service process in the target virtual subnet where the target data is located is obtained according to the data identifier.
7. The method according to claim 1, characterized in that, The target data includes the model's training data.
8. A data access device based on a virtual subnet, characterized in that, The device includes: A data access request acquisition unit is used to acquire a data access request sent by an external device for accessing target data, wherein the access request includes a data identifier of the target data; The target process identifier acquisition unit is used to acquire the target process identifier of the target service process in the target virtual subnet where the target data is located, based on the data identifier. The target subnet address determination unit is used to determine the target subnet address of the target virtual subnet by the target process identifier based on the correspondence between the process identifier and the subnet address of the virtual subnet during the restart of the target service process. The subnet address of the target service process before and after the restart is fixed to the target subnet address. The return unit is used to return the target subnet address to the external device. The target subnet address is used to instruct the external device to access the target service process through the target subnet address and obtain the target data corresponding to the data identifier from the target virtual subnet through the target service process.
9. The apparatus according to claim 8, characterized in that, The target subnet address determination unit is specifically used for: When the cache space includes the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the cache space by the target process identifier.
10. The apparatus according to claim 8, characterized in that, The target subnet address determination unit is specifically used for: When the cache space does not contain the correspondence between the target process identifier and the target subnet address, the target subnet address of the target virtual subnet is determined from the DNS by the target process identifier.
11. The apparatus according to claim 10, characterized in that, The device further includes an updating unit, the updating unit being used for: The mapping between the target process identifier and the target subnet address is updated in the cache space.
12. The apparatus according to claim 8, characterized in that, The target subnet address of the target virtual subnet is assigned when the target virtual subnet is first established.
13. The apparatus according to claim 8, characterized in that, The access request includes the cluster identifier of the target cluster, the target cluster includes multiple virtual subnets, and the target cluster includes a target virtual subnet; The target process acquisition unit is specifically used for: The target cluster is determined based on the cluster identifier; In the target cluster, the target process identifier of the target service process in the target virtual subnet where the target data is located is obtained according to the data identifier.
14. The apparatus according to claim 8, characterized in that, The target data includes the model's training data.
15. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the data access method based on any one of claims 1-7 according to the instructions in the program code.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for executing the data access method based on a virtual subnet as described in any one of claims 1-7.
17. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-7.