WO2024082815A1 - 一种数据获取方法、系统及相关设备 - Google Patents

一种数据获取方法、系统及相关设备 Download PDF

Info

Publication number
WO2024082815A1
WO2024082815A1 PCT/CN2023/114830 CN2023114830W WO2024082815A1 WO 2024082815 A1 WO2024082815 A1 WO 2024082815A1 CN 2023114830 W CN2023114830 W CN 2023114830W WO 2024082815 A1 WO2024082815 A1 WO 2024082815A1
Authority
WO
WIPO (PCT)
Prior art keywords
instance
data
network device
read request
information
Prior art date
Application number
PCT/CN2023/114830
Other languages
English (en)
French (fr)
Inventor
蔡昕辰
林钦亮
陈晓雨
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024082815A1 publication Critical patent/WO2024082815A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the present application relates to the field of computers, and in particular to a data acquisition method, system and related equipment.
  • the data management system is used to manage a certain amount of data.
  • the system includes data requesters, data owners, and data masters, among which the data master includes the metadata of the data, such as the data owner information of the data, etc.
  • the data owner has the write permission of the data and can modify the data.
  • the data master determines the data owner information of the data based on the metadata of the stored data, and forwards the read request to the data owner of the target data.
  • the data owner obtains the target data and sends it to the data requester.
  • the data master determines the data owner information according to the data identifier, which causes a large load. Therefore, how to reduce the load on the data master side during the process of obtaining data is a problem that needs to be solved.
  • the present application provides a data acquisition method, system and related equipment, which can reduce the participation of the data owner in the data acquisition process and reduce the load on the data owner side through direct communication between the data requester and the data owner.
  • an embodiment of the present invention provides a method for data acquisition, the method comprising: a network device acquires a first read request for first data sent by a first instance to a second instance, the first read request comprising a first data identifier, and the second instance comprising information of a third instance that has read and write permissions for the first data; the network device determines whether the network device includes information of a third instance, and when the network device includes information of the third instance, generates a second read request based on the information of the third instance and the first read request, and sends the second read request to the third instance, the second read request comprising an identifier of the first data and the information of the third instance, for requesting the third instance to read the first data.
  • the network device when the network device includes information of a third instance, the network device generates a second read request according to the first read request by replacing the content in the first read request sent by the first instance to the second instance with the information of the third instance.
  • the network device sends the second read request to the data owner of the first data, that is, to the third instance, thereby acquiring the first data.
  • the above process does not require communication with the data owner of the first data to determine the information of the data owner of the first data, and sends the read request for reading the first data to the data owner of the first data, which can reduce the CPU resource usage of the server where the data owner is located.
  • the network device further receives the first data read by the third instance, and sends the first data to the first instance.
  • the second read request is further used to instruct the third instance to return the first data to the first instance after reading the first data.
  • the network device when the network device does not include information of the third instance, the network device further sends the first read request to the second instance.
  • the first instance When the first read request cannot obtain the first data from the second instance, the first instance resends the request to read the first data to the second instance to ensure normal acquisition of the data.
  • the network device before the network device sends a first read request to the second instance, when the first read request is not the first data packet sent to the second instance, the network device modifies the data packet sequence number PSN of the first read request to be continuous with the PSN of the previous data packet sent to the second instance.
  • the above process can ensure that the PSN of the data packet received by the second instance is continuous, and the first instance can normally obtain data from the second instance, avoiding the situation where the PSN of the data packet obtained by the second instance is always discontinuous and unable to obtain data due to the network device forwarding the read request.
  • the network device before the network device obtains the first read request, the network device also receives a declaration request sent by the third embodiment to the second instance, the declaration request is used to request the read and write permission of the first data; checks whether the network device stores information of other instances that have the read and write permission of the first data, if not, sends the declaration request to the second instance, if so, deletes the information of the other instances, and then sends the declaration request to the second instance; receives response information of the declaration request sent by the second instance, the response information includes information of the first data and the third instance, indicating that the third instance has the read and write permission of the first data, and after recording the information of the first data and the third instance, sends the response information to the second instance.
  • the information is sent to the third instance.
  • the above process is a process in which the third instance declares to be the data owner of the first data.
  • the network device receives the response message of the declaration request sent by the second instance, it stores the information of the third instance.
  • the instance can not only obtain information about the third instance from the second instance, but also obtain information about the third instance from the network device. Obtaining information about the third instance from the network device does not require communication with the second instance, which can reduce the CPU resource usage of the server where the second instance is located.
  • an embodiment of the present invention provides a data acquisition system, which includes a first instance, a second instance, a network device, and a third instance.
  • the first instance is used to send a first read request of first data to the second instance, the first read request includes a first data identifier, and the second instance includes information of a third instance that has read and write permissions for the first data;
  • the network device is used to obtain the first read request; determine whether the network device includes information of the third instance, and when the network device includes information of the third instance, generate a second read request based on the information of the third instance and the first read request, and send the second read request to the third instance, the second read request includes an identifier of the first data and information of the third instance, and is used to request the third instance to read the first data.
  • the network device is further configured to receive the first data read by the third instance and send the first data to the first instance.
  • the second read request is further configured to instruct the third instance to return the first data to the first instance after reading the first data.
  • the network device when the network device does not include information of the third instance, the network device is further configured to send the first read request to the second instance.
  • the network device before sending the first read request to the second instance, is also used to modify the data packet sequence number PSN of the first read request to be continuous with the PSN of the previous data packet sent to the second instance when the first read request is not the first data packet sent to the second instance.
  • the network device before the network device is used to obtain a first read request, the network device is also used to receive a declaration request sent by the third embodiment to the second instance, the declaration request being used to request read and write permissions for the first data; checking whether the network device stores information of other instances having read and write permissions for the first data; if not, sending the declaration request to the second instance; if so, deleting the information of the other instances and then sending the declaration request to the second instance; receiving response information to the declaration request sent by the second instance, the response information including information of the first data and the third instance, indicating that the third instance has read and write permissions for the first data, and after recording the information of the first data and the third instance, sending the response information to the third instance.
  • the network device in a data acquisition system provided in the present application, the network device generates a second read request by changing the content of a first read request for first data sent by a first instance, and sends the second read request to a third instance that is the data owner of the first data.
  • the first data can be acquired without communicating with the data owner, thereby reducing the CPU resource usage in the server where the data owner is located.
  • an embodiment of the present invention provides a data acquisition device, which can be applied to a network device in a data acquisition system provided in the first aspect, and the data acquisition device includes: a receiving module, used to obtain a first read request for first data sent by a first instance to a second instance, the first read request including a first data identifier, and the second instance including information of a third instance that has read and write permissions for the first data; a processing module, used to determine whether the storage module includes information of the third instance, and when the storage module includes information of the third instance, generate a second read request according to the information of the third instance and the first read request, the second read request including an identifier of the first data and information of the third instance, and being used to request the third instance to read the first data; and a sending module, used to send the second read request to the third instance.
  • the storage module includes information of the third instance.
  • the sending module sends a second read request to the third instance
  • the receiving module is also used to receive the first data read by the third instance; the sending module is also used to send the first data to the first instance.
  • the second read request is further used to instruct the third instance to return the first data to the first instance after reading the first data.
  • the sending module is further configured to send the first read request to the second instance.
  • the processing module before the sending module sends the first read request to the second instance, when the first read request is not the first data packet sent to the second instance, the processing module is used to modify the data packet sequence number PSN of the first read request to be continuous with the PSN of the previous data packet sent to the second instance.
  • the receiving module before the receiving module is used to obtain a first read request for the first data sent by the first instance to the second instance, the receiving module is also used to receive a declaration request sent by the third embodiment to the second instance, wherein the declaration request is used to request read and write permissions for the first data; the processing module is also used to check whether the storage module stores information of other instances that have read and write permissions for the first data; if not, the sending module is used to send the declaration request to the second instance; if so, the sending module is used to send the declaration request to the second instance after the processing module deletes the information of the other instances; the receiving module is also used to receive response information to the declaration request sent by the second instance, wherein the response information includes information of the first data and the third instance, indicating that the third instance has read and write permissions for the first data; the sending module is also used to send the response information to the third instance after the storage module is used to record the first data and the information of the third instance.
  • an embodiment of the present invention provides a network device, which is applied to a data acquisition method provided in the first aspect, and the network device includes a processor, a memory, a communication interface, and a bus.
  • the processor, the memory, and the communication interface can be interconnected through an internal bus or can communicate through other means such as wireless transmission.
  • the memory can store computer instructions, and the processor is used to execute any possible implementation method of the first aspect or the third aspect to realize the functions of each module.
  • the communication interface is used to receive a first read request sent by the first instance, send a second read request to the third instance, etc.
  • an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and the instructions are executed on the network device to enable the network device to execute the method described in the first aspect above.
  • FIG1 is a schematic diagram of the architecture of a data management system provided by an embodiment of the present invention.
  • FIG2 is a flow chart of a method for declaring to be a data owner according to an example provided by an embodiment of the present invention
  • FIG3 is a flow chart of a data acquisition method provided by an embodiment of the present invention.
  • FIG4 is a schematic diagram of a PSN table provided in an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a PSN table change during a data acquisition process provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another PSN table change during data acquisition provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of the structure of a data acquisition device provided by an embodiment of the present invention.
  • FIG8 is a schematic diagram of the structure of a network device provided by an embodiment of the present invention.
  • the present application provides a schematic diagram of the architecture of a data management system, which is used to manage a certain amount of data, wherein the mode of managing data can be the same as the mode of managing data in a database system, and the present application does not specifically limit this.
  • the above-mentioned data management system includes a network device 110, a storage system 120, and multiple servers 130.
  • the storage system 120 can be a distributed storage system or a centralized storage system for storing data. Multiple instances are run on multiple servers 130, and one or more instances are run on each server.
  • the multiple instances include a data requester 140, a data owner 150, and a data master 160, wherein the data master is the instance where the metadata of the data is located, and the metadata may include the exclusive lock status of the data, the data owner information of the data, and the like.
  • the data owner has an exclusive lock on the data, and also has the write permission for the data, and the data owner can modify the data.
  • After an instance obtains an exclusive lock on the data it needs to send a declaration request to the data master, and the declaration request is used to instruct the data master to record the exclusive lock of the data, so that the instance becomes the data owner of the data.
  • the instance becomes the data owner of the data.
  • a data requester is an instance that requests data and needs to obtain data from the data owner.
  • the server to which the data requester belongs, the server to which the data owner belongs, and the server to which the data master belongs are connected through a network device.
  • the database system may include one or more data requesters, one or more data owners, and one or more data masters, and this application does not make specific limitations on this.
  • FIG1 only takes the example of a server to which a data requester belongs, a server to which a data owner belongs, a server to which a data master belongs, and servers to which multiple other instances belong, being connected through a network device.
  • the data requester forwards the first data to the data master via the network device.
  • the data master determines the data owner of the first data, it forwards the first data read request to the data owner via the network device.
  • the data owner sends the first data to the data requester.
  • the data master sends the data owner identifier and target address of the first data to the data requester via the network device.
  • the data requester obtains the first data from the data owner according to the data owner identifier and target address of the first data.
  • the CPU of the server where the data master is located needs to participate in order to determine the data owner information of the data, and there is a problem of excessive CPU resource usage of the server where the data master is located.
  • the present application provides a data acquisition method, which stores the data owner information of the data in a network device, and sends a read request of the target data to the data owner when the data requester needs to read the target data.
  • the network device receives the read request of the target data
  • the read request of the target data is sent to the data owner of the target data according to the data owner information of the target data
  • the data owner sends the target data to the data requester according to the read request of the target data.
  • the method provided by the present invention can determine the data owner information of the data without the participation of the data owner, and can reduce the CPU load of the server where the data owner is located.
  • an embodiment of the present application also provides a method for an instance to declare to be a data owner. Taking the third example declaring to be the data owner of the first data as an example, the method for declaring to be the data owner provided by the embodiment of the present application is introduced. As shown in Figure 2, Figure 2 is a flowchart of a method for declaring to be the data owner provided by the present application, which specifically includes the following steps.
  • S210 The third instance sends a declaration request to the second instance, applying to become the data owner of the first data.
  • the declaration request is used to request the third instance to have read and write permissions for the first data.
  • the declaration request includes a first data identifier and a first exclusive lock.
  • the second instance is the data owner of the first data and includes metadata of the first data, such as information about the data owner of the first data.
  • S220 The network device obtains a declaration request, and sends the declaration request to the second instance.
  • the network device After the network device obtains the declaration request, it queries, according to the first data identifier, whether information of other instances having the read and write permission for the first data is stored in the network device.
  • the network device when the information of the original data owner of the first data is stored in the network device, the network device deletes the information of the original data owner of the first data and sends the declaration request to the second instance.
  • the network device when the information of the original data owner of the first data does not exist in the network device, the network device sends the declaration request to the second instance after receiving the declaration request.
  • S230 The second instance receives the declaration request, generates response information according to the declaration request, and sends the response information to the network device.
  • the second instance receives the declaration request and generates response information according to the declaration request.
  • the second instance replaces the exclusive lock corresponding to the original data owner of the first data with the first exclusive lock in the declaration request, so that the third instance switches to the data owner of the first data.
  • the second instance sends an invalid message including the first data identifier to the original data owner of the first data to notify the original data owner that it is no longer the data owner of the first data. After receiving the invalid response message sent by the original data owner, the second instance generates response information.
  • the second instance records the first exclusive lock in the declaration request, takes the third instance as the data owner of the first data, and generates response information.
  • the above response information includes the information of the first data and the third instance, which is used to indicate that the third instance has the read and write permission of the first data.
  • the information of the third instance may include a second queue pair number (queue pair number, QPN), and the second QPN is used to indicate that the corresponding second queue pair (queue pair, QP) belongs to the third instance.
  • the information of the third instance may also include second location information, which is allocated by the second instance according to the first data and is used to indicate the location of the first data in the third instance.
  • the response information may also include more information, which is not specifically limited in this application.
  • the second instance After generating the response information, the second instance sends the response information to the network device.
  • S240 The network device receives and stores the response information sent by the second instance, and sends the response information to the third instance.
  • the network device receives the response information sent by the second instance and stores the response information.
  • the network device may store the correspondence between the first data identifier included in the response information and the information of the third instance. Afterwards, the network device sends the response message to the third instance.
  • S250 The third instance receives the response message and becomes the data owner of the first data.
  • the network device stores the information of the third instance when receiving the response message of the declaration request sent by the second instance. Therefore, when the instance needs to obtain the information of the data owner of the first data, it can not only obtain the information of the third instance from the second instance, but also obtain the information of the third instance from the network device. The instance does not need to send the request to the second instance, and the second instance does not need to process the request for obtaining the information of the data owner, which can reduce the CPU resource occupation of the server where the second instance is located.
  • the network device When the network device receives the response information sent by the second instance, the network device stores the response information, which is actually storing the mapping relationship between the first data identifier and the information of the third instance.
  • the network device stores the mapping relationship between the first data identifier and the second QPN; when the information of the third instance includes the second QPN and the second location information, the network device stores the mapping relationship between the first data identifier and the second QPN, and the mapping relationship between the first data identifier and the second location information.
  • the network device stores information about the data owner corresponding to each of the multiple data, that is, stores mapping relationships between multiple sets of data identifiers and data owner information.
  • the network device may also store mapping relationships between the first data identifier and more information of the third instance, which is not specifically limited in this application.
  • FIG3 is a flow chart of a data acquisition method provided by the present application.
  • the method can be applied to the data management system shown in FIG1 .
  • the method includes the following steps.
  • S310 The first instance sends a first read request for first data to the second instance via a network device.
  • the first instance When a first instance in a data management system needs to read first data, the first instance, as a data requester, sends a first read request for the first data to a second instance, wherein the second instance is the data master of the first data, including metadata of the first data, such as data owner information of the first data, etc.
  • the first read request includes a first data identifier and a preset value, wherein the preset value is an agreed value between the first instance and the network device, and is used to instruct the network device to query whether information about the data owner of the first data is stored in the network device.
  • multiple instances of the server in the data management system support remote direct data access (remote In the case of the direct memory access (RDMA) protocol, multiple instances can communicate through the RDMA technology.
  • the basic unit of communication is the queue pair QP.
  • Each local QP in an instance can be associated with a QP in another instance, and multiple instances communicate through mutually associated QPs.
  • Each QP in an instance corresponds to a QPN for indicating the QP.
  • the network device determines the QPN, it can determine the corresponding QP, thereby determining the instance to which the QP belongs. For example, the network device receives target data sent by the first instance, wherein the target data includes the second QPN corresponding to the second QP. After the network device determines that the second QP belongs to the third instance according to the second QPN, the target data is sent to the third instance.
  • the first read request also includes the first QPN, and the first QPN belongs to the second instance. It should be understood that the first read request may include more or less information, and the embodiments of the present application do not specifically limit this.
  • the network device obtains the first read request and queries whether the network device includes information of a third instance, wherein the third instance is the data owner of the first data. If the network device includes information of the third instance, the network device executes step S330; if the network device does not include information of the third instance, the network device executes step S340.
  • the network device obtains the first read request, and when it is determined that the preset value in the first read request is the agreed value between the first instance and the network device, queries the network device whether the information of the data owner of the first data is included. Since the third instance is the data owner of the first data, the network device is queried whether the information of the third instance is included.
  • the network device stores information of data owners corresponding to multiple data. There are multiple sets of mapping relationships between data identifiers and QPNs in the network device.
  • the network device can determine the data owner corresponding to the obtained data identifier based on the obtained data identifier and the mapping relationship between the stored data identifier and the QPN.
  • the network device can also store multiple sets of mapping relationships between data identifiers and location information, and the network device can determine the location of the data corresponding to the obtained data identifier in its data owner based on the corresponding relationship between the obtained data identifier and the stored data identifier and the location information.
  • the network device queries whether there is information of a third instance in the information of data owners corresponding to each of the plurality of data stored in the network device according to the first data identifier in the first read request.
  • the network device determines the second QPN corresponding to the first data identifier according to the mapping relationship between the first data identifier and the stored data identifier and the QPN, and the second QPN belongs to the third instance.
  • the network device also determines the second location information according to the corresponding relationship between the first data identifier and the stored data identifier and the location information, and determines the location of the first data in the third instance. The network device determines that there is information of the third instance including the second QPN, or also including the second location information, in the network device.
  • the network device cannot query the information of the data owner of the first data according to the first data identifier, and the network device determines that the information of the third instance does not exist in the network device.
  • S330 The network device generates a second read request according to the information of the third instance and the first read request, and sends the second read request to the third instance.
  • the network device In the case where the network device includes information about the third instance, the network device generates a second read request according to the information about the third instance and the first read request, and sends the second read request to the third instance.
  • the second read request includes an identifier of the first data and information about the third instance, and is used to request the third instance to read the first data, and is also used to instruct the third instance to return the first data to the first instance after reading the first data.
  • the network device generates a second read request according to the first read request and information of the third instance, wherein the network device generates the second read request in the following two ways:
  • both the server and the network device of the first instance support the remote direct memory access (RDMA) unilateral function
  • the network device after determining the second QPN and the second location information corresponding to the first data identifier, the network device replaces the first QPN in the first read request with the second QPN, and replaces the preset value with the second location information to obtain a second read request.
  • the network device sends the second read request to the third instance according to the second QPN in the second read request.
  • the second read request includes the first data identifier, the second QPN and the second location information, and the present application does not specifically limit the information included in the second read request.
  • the network device replaces the first QPN in the first read request with the second QPN after determining the second QPN corresponding to the first data identifier, thereby obtaining a second read request.
  • the network device sends the second read request to the third instance according to the second QPN in the second read request.
  • the second read request includes the first data identifier and the second QPN, and the present application does not specifically limit the information included in the second read request.
  • the network device replaces the first QPN in the first read request with the second QPN to obtain the second read request, and can send the second read request to the third instance according to the second QPN, without the need to communicate with the second instance (data master) in the process of acquiring data, thereby reducing the CPU resource occupation of the second instance.
  • the first instance can directly read the first data according to the second read request, without the CPU of the server where the third instance is located participating, which can reduce network communication and data latency.
  • the first read request may further include a first field, and the first field is used to record the sequence number of the read request sent by the first instance to the second instance.
  • the value of the first field may be expressed as [(A, B); m], where A indicates that the sending instance is the first instance. Instance, B indicates that the receiving instance is the second instance, and m indicates the packet sequence number (PSN).
  • PSN is an integer greater than or equal to 0, with an initial value of 0, which can indicate the number of requests sent by one instance to another instance.
  • the value of the first field included in the first read request is [(A, B); 4], indicating that the sequence number of the first read request sent by the first instance to the second instance is 4, and the first read request is the fifth read request sent by the first instance to the second instance.
  • the PSN is incremented by 1 so that the PSN of the next read request sent by the first instance to the second instance is 5.
  • the network device may further include a PSN table, as shown in FIG4 , which is a schematic diagram of a PSN table provided in the embodiment of the present application.
  • the PSN table is used to record the PSN of the data packet sent by the network device, as well as the sending instance and receiving instance corresponding to the data packet.
  • the initial value of the PSN of all data packets in the PSN table is 0.
  • the PSN corresponding to the data packet in the PSN table is incremented by 1 according to the sending instance and receiving instance corresponding to the data packet, and recorded.
  • the first instance, the second instance, and the third instance in the first column represent sending instances
  • the first instance, the second instance, and the third instance in the first row represent receiving instances.
  • the "2" in the PSN table indicates that the first instance has sent two data packets to the second instance.
  • the "3" in the PSN table indicates that the third instance has sent three data packets to the first instance.
  • the network device when the network device replaces the first QPN with the second QPN, since the second QPN belongs to the third instance, the network device determines that the data owner of the first data is the third instance, and determines to send the second read request to the third instance.
  • the network device modifies the first field in the second read request to [(A, C); s], where A indicates that the sending instance is the first instance, C indicates that the receiving instance is the third instance, and s indicates the PSN corresponding to the sending instance being the first instance and the receiving instance being the third instance in the PSN table.
  • s in the PSN table increments by 1 and is recorded.
  • step S350 After the network device completes step S330, the third instance executes step S350.
  • S340 The network device sends the first read request to the second instance.
  • the network device sends the first read request to the second instance and fails to obtain the first data from the second instance. Afterwards, the network device sends the response message sent by the second instance indicating the failure to obtain the first data to the first instance, so that the first instance resends the request to obtain the first data to the second instance.
  • the second read request can forward the request to obtain the first data sent by the first instance to the third instance, so that the third instance sends the first data to the first instance, thereby ensuring normal acquisition of the data.
  • the network device before the network device sends the first read request to the second instance, when the first read request is not the first data packet sent to the second instance, the network device modifies the data packet sequence number PSN of the first read request to be continuous with the PSN of the previous data packet sent to the second instance.
  • the above process can ensure that the PSNs of the data packets sent by the first instance and received by the second instance are continuous, so that the first instance can obtain data from the second instance.
  • Figure 5 is a schematic diagram of a PSN table change during a data acquisition process provided by an embodiment of the present application.
  • the PSN of the first read request sent by the first instance to the second instance through the network device is 3.
  • the network device obtains the first read request and determines that the first read request is not the first data packet sent by the first instance to the second instance.
  • the network device modifies the PSN of the first read request according to the first read request and the PSN table, where the sending instance in the PSN table is the first instance and the receiving instance is the PSN corresponding to the second instance, which is 1.
  • the PSN of the first read request sent by the network device received by the second instance is 1. Since the second instance has previously received a data packet sent by the first instance, the PSN of the data packet is 0, and the PSN of the first read request received by the second instance is continuous with the PSN of the previously received data packet sent by the first instance.
  • the second instance can obtain data according to the first read request.
  • the network device After the network device sends the first read request to the second instance, the network device increments the PSN corresponding to the sending instance as the first instance and the receiving instance as the second instance in the PSN table by 1, generates a new PSN value of 2, and records the current PSN value in the PSN table.
  • S350 The third instance receives the second read request, obtains the first data according to the second read request, and returns the first data to the network device.
  • the third instance is the data owner of the first data. After receiving the second read request, the third instance determines the first data stored in the third instance according to the second read request and returns the first data to the network device.
  • the third instance determines the first data according to the second location information, and sends the first data to the network device.
  • the third instance When the third instance does not support the RDMA unilateral function, or the second read request does not include the second location information, the third instance finds the first data according to the first data identifier included in the second read request, and sends the first data to the network device.
  • the third instance before the third instance obtains the first data according to the second read request, the third instance needs to determine whether the PSN of the data packet sent by the received first instance is continuous.
  • the third instance may include a third field, which is used in the third instance to record the serial number of the read request sent by the first instance to be received by the third instance, and is used to determine whether the serial number of the read request sent by the received first instance is continuous.
  • the value of the third field can be expressed as [(A, C); i], where A indicates that the sending instance is the first instance, and C indicates The receiving instance is the third instance, i represents the PSN, which is obtained by incrementing the number of read requests sent by the first instance that the third instance has received by the third instance by 1.
  • the third field recorded in the third instance is [(A,C); 5]. According to the third field, it can be determined that the third instance has received five read requests sent by the first instance, the sequence number of the fifth read request is 4, and the sequence number of the read request sent by the first instance that the third instance receives next should be 5. If the sequence number of the read request sent by the first instance that the third instance receives next is 5, then the PSN is continuous.
  • the PSNs are continuous, and the third instance can obtain the first data.
  • the PSNs are discontinuous, the third instance cannot obtain the first data, and the first instance resends the read request to obtain the first data.
  • S360 The network device sends the first data returned by the third instance to the first instance.
  • the network device receives the first data sent by the third instance, and sends the first data to the first instance.
  • FIG6 is a schematic diagram of another change in the PSN table during data acquisition provided by an embodiment of the present application.
  • the first instance sends a first read request for the first data to the second instance through a network device, and the first read request includes a preset value, a first QPN, and a first field [(1,2); 3].
  • the first field indicates that the sending instance of the first read request is the first instance, the receiving instance is the second instance, and the PSN of the first read request is 3, indicating that the first read request is the fourth data packet sent by the first instance to the second instance.
  • the first instance determines that the sequence number of the next data packet sent to the second instance is 4.
  • the network device receives the first read request, determines that the preset value in the first read request is the agreed value between the first instance and the network device, and queries whether the network device includes information of the third instance, which is the data owner of the first data.
  • the network device finds the corresponding second QPN according to the first data identifier, the network device replaces the first QPN with the second QPN and generates a second read request.
  • the network device determines that the sending instance of the second read request is the first instance and the receiving instance is the third instance based on the second QPN.
  • the network device combines the PSN corresponding to the sending instance being the first instance and the receiving instance being the third instance in the PSN table, and modifies the first field in the second read request to [(1,3); 1].
  • the PSN corresponding to the sending instance being the first instance and the receiving instance being the third instance in the PSN table is incremented by 1, and a new PSN value of 2 is obtained, which is recorded in the PSN table.
  • the third instance When the third instance receives the second read request and determines that the PSN of the second read request is 1, it determines that the PSN in the second read request is the same as the PSN in the third field, and determines that the PSN is continuous.
  • the third instance can normally obtain the first data and send the first data to the network device.
  • the data packet containing the first data also includes the PSN corresponding to the sending instance being the third instance and the receiving instance being the first instance.
  • the network device determines that the sending instance of the data packet containing the first data is the third instance and the receiving instance is the first instance, and the network device sends the data packet containing the first data to the first instance.
  • the network device After the network device sends the first data to the first instance, the network device increments the PSN corresponding to the sending instance being the third instance and the receiving instance being the first instance in the PSN table by 1, obtains a new PSN value of 2, and records it in the PSN table.
  • the network device in the process of the first instance acquiring the first data, can change the content included in the first read request, and directly send the read request for reading the first data sent by the first instance to the data owner of the first data, without the need to communicate with the data owner of the first data, which can reduce the network communication in the process of the data requester acquiring the data, reduce the data delay, and reduce the CPU resource usage of the data owner.
  • the RDAM technology is used between the first instance, the network device and the third instance to read the data, and the RDMA technology can reduce the data delay.
  • FIG. 7 is a structural schematic diagram of a data acquisition device provided by the present application, which is applied to a network device in a data management system.
  • the data acquisition device 700 includes: a receiving module 710, used to obtain a first read request for first data sent by a first instance to a second instance, the first read request including a first data identifier, and the second instance including information of a third instance that has read and write permissions for the first data; a processing module 720, used to determine whether the storage module 730 includes information of the third instance, and when the storage module 730 includes information of the third instance, a second read request is generated according to the information of the third instance and the first read request, the second read request including an identifier of the first data and information of the third instance, and used to request the third instance to read the first data; a sending module 740, used to send the second read request to the third instance.
  • the second read request is also used to instruct the third instance to return the first data to the first instance after reading the first data.
  • the sending module is also used to send the first read request to the second instance.
  • the data acquisition device cannot obtain the first data from the second instance, and the first instance needs to send a bilateral request to the second instance to obtain the first data.
  • the receiving module before the receiving module is used to obtain a first read request for the first data sent by the first instance to the second instance, the receiving module is also used to receive a declaration request sent by the third embodiment to the second instance, wherein the declaration request is used to request read and write permissions for the first data; the processing module is also used to check whether the storage module stores information of other instances that have read and write permissions for the first data; if not, the sending module is used to send the declaration request to the second instance; if so, the sending module is used to send the declaration request to the second instance after the processing module deletes the information of the other instances; the receiving module is also used to receive response information to the declaration request sent by the second instance, wherein the response information includes information of the first data and the third instance, indicating that the third instance has read and write permissions for the first data; the sending module is also used to send the response information to the third instance after the storage module is used to record the first data and the information of the third instance.
  • the storage module includes a PSN table as shown in FIG4.
  • the processing module is further configured to: In the case where a third read request is sent from the first instance to the second instance after the request is sent, the data packet sequence number PSN of the third read request is modified in combination with the PSN table so that the PSN of the third read request received by the second instance is continuous with the PSN of the read request sent by the first instance that was previously received by the second instance.
  • the receiving module 710 is used to execute steps S220 and S240 in Figure 2
  • the processing module 720 and the storage module 730 are used to execute step S240 in Figure 2
  • the sending module 740 is used to execute steps S220 and S240 in Figure 2.
  • the receiving module 710 and the processing module 720 are also used to execute steps S320 and S330 in Figure 3, and the sending module 740 is also used to execute steps S330 and S340 in Figure 3.
  • the receiving module can also be used to execute the steps executed by the processing module, or the processing module can also be used to execute the steps executed by the receiving module, and so on. This application does not make specific limitations on the steps specifically executed by the modules in the data acquisition device.
  • the data acquisition device can, when acquiring the first data in the first instance, send the first read request corresponding to the first data to the data owner of the first data. There is no need to communicate with the data owner of the first data, thereby reducing the occupancy of CPU resources in the server where the data owner is located.
  • FIG8 is a schematic diagram of the structure of a network device provided by an embodiment of the present invention
  • the network device 800 includes: a processor 810, a memory 820, a communication interface 830 and a bus 840.
  • the processor, the memory, and the communication interface can be interconnected through an internal bus or can communicate through other means such as wireless transmission.
  • the processor 810 may be composed of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
  • the processor 810 is used to execute various types of digital storage instructions.
  • the processor may execute the steps executed by the acquisition module, the processing module, and the sending module to realize the corresponding functions.
  • the memory 820 may be a volatile memory, such as a random access memory (RAM), a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous dynamic RAM (SDRAM), a double data rate RAM (DDR), a cache, etc.
  • the memory may also include a combination of the above types.
  • the memory 820 includes a program code, and the processor 810 may execute the steps executed by the network device in Figures 2 and 3 by executing the program code to implement the functions in Figures 2 and 3.
  • the memory 820 also includes data, and the data may include a correspondence between multiple groups of data identifiers and QPNs, a correspondence between multiple groups of data identifiers and location information, and a correspondence between a received read request and a sent read request, etc.
  • the data in the memory may also include more content, which is not specifically limited in this application.
  • the communication interface 830 may be configured to receive a first read request sent by the first instance, or to send a second read request generated by a processor or a processing module to a third instance.
  • FIG. 8 is only a possible implementation of an embodiment of the present application.
  • the network device may also include more or fewer components, which is not limited here.
  • An embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored.
  • the computer-readable storage medium is executed on a processor, the method flow shown in FIG. 2 and FIG. 3 is implemented.
  • the embodiment of the present application further provides a computer program product.
  • the computer program product runs on a processor, the method flow shown in FIG. 2 and FIG. 3 is implemented.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage node such as a server, data center, etc. that contains at least one set of available media. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., high-density digital video discs (DVD), or semiconductor media).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了一种数据获取方法、系统及相关设备,其中,数据获取方法包括:网络设备获取第一实例向第二实例发送的第一数据的第一读请求,第一读请求包括第一数据标识,第二实例中包括对第一数据具有读写权限的第三实例的信息;确定网络设备是否包括第三实例的信息,在网络设备中包括第三实例的信息时,根据第三实例的信息及第一读请求,生成第二读请求,并发送第二读请求至第三实例,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取第一数据。该方法中网络设备不需要与第一数据的数据主通信,即可获取第一数据的数据拥有者信息,将第二读请求发送至第一数据的数据拥有者,可以减少数据获取过程中数据主的负载。

Description

一种数据获取方法、系统及相关设备
本申请要求于2022年10月21日提交中国专利局、申请号为202211296811.1、申请名称为“一种数据获取方法、系统及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机领域,尤其涉及一种数据获取方法、系统及相关设备。
背景技术
目前,数据管理系统用于管理一定数量的数据,系统中包括数据请求者、数据拥有者以及数据主等,其中,数据主中包括数据的元数据,如数据的数据拥有者信息等,数据拥有者拥有数据的写权限,可以对数据进行修改。数据请求者获取目标数据时,需要将目标数据的读请求发送给数据主,数据主根据存储的数据的元数据确定数据的数据拥有者信息,将读请求转发至目标数据的数据拥有者,由数据拥有者获取目标数据并发送给数据请求者。
上述数据请求者获取数据的方式中,数据主根据数据标识确定数据的数据拥有者信息,负载较大,因此,如何在获取数据的过程中减少数据主侧的负载,是一个需要解决的问题。
发明内容
本申请提供了一种数据获取方法、系统及相关设备,可以通过数据请求者和数据拥有者之间的直接通信,在数据获取的过程中减少数据主的参与,降低数据主侧的负载。
第一方面,本发明实施例提供了一种数据获取的方法,该方法包括:网络设备获取第一实例向第二实例发送的第一数据的第一读请求,第一读请求包括第一数据标识,第二实例中包括对第一数据具有读写权限的第三实例的信息;网络设备确定网络设备是否包括第三实例的信息,并在网络设备中包括第三实例的信息时,根据第三实例的信息及第一读请求,生成第二读请求,并发送第二读请求至第三实例,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取第一数据。
在本申请提供的一种数据获取方法中,在网络设备包括第三实例的信息的情况下,网络设备通过将第一实例向第二实例发送的第一读请求中的内容替换为第三实例的信息,根据第一读请求生成第二读请求。网络设备将第二读请求发送给第一数据的数据拥有者,也就是发送给第三实例,从而获取第一数据。上述过程不需要与第一数据的数据主通信,即可确定第一数据的数据拥有者的信息,将读取第一数据的读请求发送给第一数据的数据拥有者,可以降低数据主所在的服务器的CPU资源占用。
在一种可能的实施方式中,网络设备还接收第三实例读取的第一数据,并将第一数据发送至第一实例。
在一种可能的实施方式中,第二读请求还用于指示第三实例在读取第一数据后,将第一数据返回给第一实例。
在一种可能的实施方式中,在网络设备中不包括第三实例的信息时,网络设备还将第一读请求发送至第二实例。在第一读请求无法从第二实例中获取第一数据的情况下,第一实例向第二实例重新发送读取第一数据的请求,以保证数据的正常获取。
在一种可能的实施方式中,在网络设备将第一读请求发送至第二实例之前,在第一读请求不是第一个发送至第二实例的数据包时,网络设备将第一读请求的数据包序列号PSN修改为与前一个发送至第二实例的数据包的PSN连续。
上述过程可以保证第二实例接收的数据包的PSN连续,第一实例可以正常从第二实例中获取数据,避免由于网络设备转发读请求而造成的第二实例获取的数据包的PSN一直不连续而无法获取数据的情况。
在一种可能的实施方式中,在网络设备获取第一读请求之前,网络设备还接收第三实施例发送给第二实例的声明请求,声明请求用于请求拥有第一数据的读写权限;查看网络设备是否存储有拥有第一数据的读写权限的其他实例的信息,如果没有,则将声明请求发送至第二实例,如果有,则删除其他实例的信息后,将声明请求发送至第二实例;接收第二实例发送的声明请求的响应信息,响应信息包括第一数据及第三实例的信息,表示第三实例拥有了第一数据的读写权限,并记录第一数据及第三实例的信息后,将响应 信息发送至第三实例。上述过程是第三实例声明成为第一数据的数据拥有者的过程,网络设备在接收第二实例发送的声明请求的响应消息的情况下,存储第三实例的信息。
因此,实例不仅可以从第二实例中获取第三实例的信息,还可以从网络设备中获取第三实例的信息,从网络设备中获取第三实例的信息不需要与第二实例进行通信,可以减少第二实例所在服务器的CPU资源占用。
第二方面,本发明实施例提供了一种数据获取系统,该数据获取系统包括第一实例、第二实例、网络设备和第三实例。第一实例,用于向第二实例发送第一数据的第一读请求,第一读请求包括第一数据标识,第二实例中包括对第一数据具有读写权限的第三实例的信息;网络设备,用于获取第一读请求;确定网络设备是否包括第三实例的信息,并在网络设备中包括第三实例的信息时,根据第三实例的信息及第一读请求,生成第二读请求,并发送第二读请求至第三实例,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取所述第一数据。
在一种可能的实施方式中,网络设备还用于接收第三实例读取的第一数据,并将第一数据发送至第一实例。第二读请求还用于指示第三实例在读取第一数据后,将第一数据返回给第一实例。
在一种可能的实施方式中,在网络设备中不包括第三实例的信息时,网络设备还用于将第一读请求发送至第二实例。
在一种可能的实施方式中,在将第一读请求发送至第二实例之前,网络设备,还用于当第一读请求不是第一个发送至第二实例的数据包时,网络设备将第一读请求的数据包序列号PSN修改为与前一个发送至第二实例的数据包的PSN连续。
在一种可能的实施方式中,在网络设备用于获取第一读请求之前,网络设备还用于接收第三实施例发送给第二实例的声明请求,声明请求用于请求拥有第一数据的读写权限;查看网络设备是否存储有拥有第一数据的读写权限的其他实例的信息,如果没有,则将声明请求发送至第二实例,如果有,则删除其他实例的信息后,将声明请求发送至第二实例;接收第二实例发送的声明请求的响应信息,响应信息包括第一数据及第三实例的信息,表示第三实例拥有了第一数据的读写权限,并记录第一数据及第三实例的信息后,将响应信息发送至第三实例。
综上所述,在本申请提供的一种数据获取系统中,网络设备通过改变第一实例发送的第一数据的第一读请求的内容,生成第二读请求,将第二读请求发送给第一数据的数据拥有者第三实例,无需与数据主进行通信,即可获取第一数据,可以降低数据主所在服务器中的CPU资源占用。
第三方面,本发明实施例提供了一种数据获取装置,该装置可以应用于第一方面提供的一种数据获取系统中的网络设备中,该数据获取装置包括:接收模块,用于获取第一实例向第二实例发送的第一数据的第一读请求,第一读请求包括第一数据标识,第二实例中包括对第一数据具有读写权限的第三实例的信息;处理模块,用于确定存储模块中是否包括第三实例的信息,并在存储模块中包括第三实例的信息时,根据第三实例的信息及第一读请求,生成第二读请求,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取第一数据;发送模块,用于发送第二读请求至第三实例。
在一种可能的实施方式中,在存储模块中包括第三实例的信息,发送模块发送第二读请求至第三实例的情况下,接收模块还用于接收第三实例读取的第一数据;发送模块还用于将第一数据发送至第一实例。
在一种可能的实施方式中,第二读请求还用于指示第三实例在读取第一数据后,将第一数据返回给第一实例。
在一种可能的实施方式中,在存储模块中不包括第三实例的信息时,发送模块还用于将第一读请求发送至第二实例。
在一种可能的实施方式中,在发送模块将第一读请求发送至第二实例之前,当第一读请求不是第一个发送至第二实例的数据包时,处理模块用于将第一读请求的数据包序列号PSN修改为与前一个发送至第二实例的数据包的PSN连续。
在一种可能的实施方式中,在接收模块用于获取第一实例向第二实例发送的第一数据的第一读请求之前,接收模块还用于接收第三实施例发送给第二实例的声明请求,其中,声明请求用于请求拥有第一数据的读写权限;处理模块,还用于查看存储模块是否存储有拥有第一数据的读写权限的其他实例的信息,如果没有,发送模块用于将声明请求发送至第二实例,如果有,发送模块用于在处理模块删除其他实例的信息后,将声明请求发送至第二实例;接收模块还用于接收第二实例发送的声明请求的响应信息,其中,响应信息包括第一数据及第三实例的信息,表示第三实例拥有了第一数据的读写权限;发送模块还用于在存储模块用于记录第一数据及第三实例的信息后,将响应信息发送至第三实例。
第四方面,本发明实施例提供了一种网络设备,应用于第一方面提供的一种数据获取方法中,该网络设备包括处理器、存储器、通信接口以及总线。其中,处理器、存储器、通信接口可以通过内部总线相互连接也可以通过无线传输等其他手段实现通信。存储器可以存储计算机指令,处理器用于执行第一方面或第三方面任一种可能的实现方式,实现各个模块的功能。通信接口,用于接收第一实例发送的第一读请求,将第二读请求发送给第三实例等。
第五方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,所述指令在所述网络设备上运行,使所述网络设备执行上述第一方面所述的方法。
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。
附图说明
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。
图1是本发明实施例提供的一种数据管理系统的架构示意图;
图2是本发明实施例提供的一种实例声明成为数据拥有者的方法的流程图;
图3是本发明实施例提供的一种数据获取方法的流程示意图;
图4是本发明实施例提供的一种PSN表的示意图;
图5是本发明实施例提供的一种数据获取过程中PSN表变化的示意图;
图6是本发明实施例提供的另一种数据获取过程中PSN表变化的示意图;
图7是本发明实施例提供的一种数据获取装置的结构示意图;
图8是本发明实施例提供的一种网络设备的结构示意图。
具体实施方式
如图1所示,本申请提供一种数据管理系统的架构示意图,数据管理系统用于管理一定数量的数据,其中,管理数据的模式可以与数据库系统中管理数据的模式相同,对此本申请不作具体限定。上述数据管理系统中包括网络设备110、存储系统120和多个服务器130。存储系统120可以是分布式存储系统,或者是集中式存储系统,用于存储数据。多个服务器130上运行多个实例,每个服务器上运行一个或者多个实例。多个实例中包括数据请求者140、数据拥有者150、数据主160,其中,数据主是数据的元数据所在的实例,元数据可以包括数据的排他锁状态、数据的数据拥有者信息等等。数据拥有者拥有数据的排它锁,也就拥有数据的写权限,数据拥有者可以对数据进行修改。在一个实例获取数据的排他锁后,需要向数据主发送声明请求,声明请求用于指示数据主记录数据的排它锁,使得该实例成为数据的数据拥有者。该实例在接收到数据主发送的声明成功报文后,成为该数据的数据拥有者。数据请求者是请求数据的实例,需要从数据拥有者中获取数据。
数据请求者所属的服务器、数据拥有者所属的服务器、数据主所属的服务器通过网络设备连接,应理解,数据库系统中可以包括一个或者多个数据请求者,一个或者多个数据拥有者,一个或者多个数据主,对此本申请不作具体限定。图1中仅以一个数据请求者所属的服务器,一个数据拥有者所属的服务器,一个数据主所属的服务器以及多个其他实例各自所属的服务器通过网络设备连接为例。
在上述数据库系统中,当数据请求者需要读取一个第一数据时,数据请求者经网络设备转发,向数据主发送第一数据的读请求,数据主确定第一数据的数据拥有者后,将第一数据的读请求经网络设备转发至数据拥有者,数据拥有者在接收到第一数据的读请求后,将第一数据发送给数据请求者。或者,数据主在接收数据请求者经网络设备发送的第一数据的读请求后,将第一数据的数据拥有者标识和目标地址经由网络设备发送给数据请求者,数据请求者根据第一数据的数据拥有者标识和目标地址从数据拥有者中获取第一数据。上述数据请求者获取数据的过程中,都需要数据主所在服务器的CPU参与,以确定数据的数据拥有者信息,存在数据主所在服务器的CPU资源占用过高的问题。
本申请提供了一种数据获取方法,通过在网络设备中存储数据的数据拥有者信息,在数据请求者需要读取目标数据的情况下,向数据主发送目标数据的读请求,网络设备在接收到目标数据的读请求的情况下,根据目标数据的数据拥有者信息,将目标数据的读请求发送至目标数据的数据拥有者,数据拥有者根据目标数据的读请求,将目标数据发送给数据请求者。本发明提供的方法可以在数据主不参与的情况下,确定数据的数据拥有者信息,可以降低数据主所在服务器的CPU负载。
在介绍本申请提供的数据获取方法之前,本申请实施例还提供了一种实例声明成为数据拥有者的方法。 以第三实例声明成为第一数据的数据拥有者为例,介绍本申请实施例提供的实例声明成为数据拥有者的方法。如图2所示,图2是本申请提供的一种实例声明成为数据拥有者的方法的流程图,具体包括如下步骤。
S210:第三实例向第二实例发送声明请求,申请成为第一数据的数据拥有者。
声明请求用于请求第三实例拥有第一数据的读写权限,声明请求中包括第一数据标识和第一排它锁,其中,第二实例是第一数据的数据主,包括第一数据的元数据,如第一数据的数据拥有者信息等。
S220:网络设备获取声明请求,将声明请求发送至第二实例。
网络设备获取声明请求后,根据第一数据标识在网络设备中查询是否存储有拥有第一数据的读写权限的其他实例的信息。
在一种可能的实施方式中,在网络设备中存储有第一数据的原数据拥有者的信息的情况下,网络设备删除第一数据的原数据拥有者的信息,将声明请求发送至第二实例。
在另一种可能的实施方式中,在网络设备中不存在第一数据的原数据拥有者的信息的情况下,网络设备在接收到声明请求后,将声明请求发送至第二实例。
S230:第二实例接收声明请求,根据声明请求生成响应信息,并将响应信息发送给网络设备。
第二实例接收声明请求,根据声明请求生成响应信息。在系统中存在第一数据的原数据拥有者的情况下,第二实例将第一数据的原数据拥有者对应的排它锁替换为声明请求中的第一排它锁,以使第三实例切换为第一数据的数据拥有者。第二实例向第一数据的原数据拥有者发送包括第一数据标识的无效报文,以通知原数据拥有者不再是第一数据的数据拥有者。第二实例在接收到原数据拥有者发送的无效响应报文后,生成响应信息。或者,在网络设备中不存在第一数据的原数据拥有者的信息的情况下,第二实例记录声明请求中的第一排它锁,将第三实例作为第一数据的数据拥有者,生成响应信息。上述响应信息包括第一数据以及第三实例的信息,用于指示第三实例拥有第一数据的读写权限。其中,第三实例的信息可以包括第二队列对编号(queue pair number,QPN),第二QPN用于指示对应的第二队列对(queue pair,QP)属于第三实例。或者,第三实例的信息还可以包括第二位置信息,第二位置信息由第二实例根据第一数据进行分配,用于指示第一数据在第三实例中的位置。响应信息还可以包括更多的信息,对此本申请不作具体限定。
第二实例在生成响应信息后,将响应信息发送给网络设备。
S240:网络设备接收并存储第二实例发送的响应信息,并将响应信息发送给第三实例。
网络设备接收第二实例发送的响应信息,并存储响应信息,网络设备可以存储响应信息中包括的第一数据标识与第三实例的信息的对应关系,之后,网络设备将响应消息发送给第三实例。
S250:第三实例接收响应消息,成为第一数据的数据拥有者。
综上所述,在上述第三实例声明成为第一数据的数据拥有者的过程中,网络设备在接收第二实例发送的声明请求的响应消息的情况下,存储第三实例的信息。因此,实例在需要获取第一数据的数据拥有者的信息的情况下,不仅可以从第二实例中获取第三实例的信息,还可以从网络设备中获取第三实例的信息。实例不需要将请求发送至第二实例,不需要第二实例对获取数据拥有者的信息的请求进行处理,可以减少第二实例所在服务器的CPU资源占用。在网络设备接收到第二实例发送的响应信息的情况下,网络设备存储响应信息,实际上是存储第一数据标识与第三实例的信息的映射关系。在第三实例的信息包括第二QPN的情况下,网络设备存储第一数据标识与第二QPN的映射关系;在第三实例的信息包括第二QPN以及第二位置信息的情况下,网络设备存储第一数据标识与第二QPN的映射关系,以及第一数据标识与第二位置信息的映射关系。
应理解,网络设备中存储有多个数据各自对应的数据拥有者的信息,也就是存储有多组数据标识与数据的数据拥有者信息的映射关系。网络设备还可以存储第一数据标识与第三实例的更多信息的映射关系,对此本申请不作具体限定。
下面对本申请提供的一种数据获取方法进行说明,如图3所示,图3是本申请提供的一种数据获取方法的流程示意图,该方法可以应用于图1所示的数据管理系统中,该方法包括如下步骤。
S310:第一实例经过网络设备向第二实例发送第一数据的第一读请求。
在数据管理系统中的第一实例需要读取第一数据的情况下,第一实例作为数据请求者,向第二实例发送第一数据的第一读请求,其中,第二实例是第一数据的数据主,包括第一数据的元数据,如第一数据的数据拥有者信息等,第一读请求包括第一数据标识以及预设值,其中,预设值是第一实例与网络设备之间的约定值,用于指示网络设备查询网络设备中是否存储第一数据的数据拥有者的信息。
在一种可能的实现方式中,在数据管理系统中的多个实例的服务器支持远程直接数据存取(remote  direct memory access,RDMA)协议的情况下,多个实例之间可以通过RDMA技术进行通信。其中,通信的基本单元是队列对QP。一个实例中每个本地的QP可以与另一个实例中的一个QP关联,多个实例之间通过相互关联的QP进行通信。实例中的每个QP对应一个用于指示该QP的QPN,网络设备在确定QPN的情况下,即可确定对应的QP,从而确定QP所属的实例。例如,网络设备接收第一实例发送的目标数据,其中,目标数据包括第二QP对应的第二QPN,网络设备根据第二QPN确定第二QP属于第三实例后,将目标数据发送给第三实例。
因此,在第一实例的服务器和第二实例的服务器都支持RDMA协议的情况下,第一读请求中还包括第一QPN,第一QPN属于第二实例。应理解,第一读请求中可以包括更多或者更少的信息,本申请实施例对此不作具体限定。
S320:网络设备获取第一读请求,查询网络设备是否包括第三实例的信息,其中,第三实例是第一数据的数据拥有者。在网络设备包括第三实例的信息的情况下,网络设备执行步骤S330,在网络设备不包括第三实例的信息的情况下,网络设备执行步骤S340。
网络设备获取第一读请求,在确定第一读请求中的预设值是第一实例与网络设备之间的约定值的情况下,查询网络设备中是否包括第一数据的数据拥有者的信息。由于第三实例是第一数据的数据拥有者,查询网络设备中是否包括第三实例的信息。
本申请实施例中,网络设备中存储有多个数据各自对应的数据拥有者的信息。网络设备中存在多组数据标识与QPN的映射关系。在网络设备获取读请求中数据标识的情况下,网络设备可以根据获取的数据标识以及存储的数据标识与QPN的映射关系,确定获取的数据标识对应的数据拥有者。网络设备还可以存有多组数据标识与位置信息的映射关系,网络设备可以根据获取的数据标识以及存储的数据标识与位置信息的对应关系,确定获取的数据标识对应的数据在其数据拥有者中的位置。
网络设备根据第一读请求中的第一数据标识在网络设备中存储的多个数据各自对应的数据拥有者的信息中,查询是否存在第三实例的信息。
在一种可能的实施方式中,网络设备根据第一数据标识以及存储的数据标识与QPN的映射关系,确定第一数据标识对应的第二QPN,第二QPN属于第三实例。或者,网络设备还根据第一数据标识以及存储的数据标识与位置信息的对应关系,确定第二位置信息,确定第一数据在第三实例中的位置。网络设备确定网络设备中存在包括第二QPN,或者,还包括第二位置信息的第三实例的信息。
在另一种可能的实施方式中,网络设备根据第一数据标识查询不到第一数据的数据拥有者的信息,网络设备确定网络设备中不存在第三实例的信息。
S330:网络设备根据第三实例的信息及第一读请求,生成第二读请求,并发送第二读请求至第三实例。
在网络设备包括第三实例的信息的情况下,网络设备根据第三实例的信息及第一读请求,生成第二读请求,并发送第二读请求至第三实例。其中,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取第一数据,还用于指示第三实例在读取第一数据后,将第一数据返回给第一实例。
网络设备根据第一读请求和第三实例的信息,生成第二读请求,其中,网络设备生成第二读请求包括以下两种方式:
在第一实例的服务器和网络设备都支持远程直接数据存取(remote direct memory access,RDMA)单边功能的情况下,网络设备在确定上述第一数据标识对应的第二QPN和第二位置信息后,将第一读请求中的第一QPN替换为第二QPN,将预设值替换为第二位置信息,得到第二读请求。网络设备根据第二读请求中的第二QPN,将第二读请求发送给第三实例。其中,第二读请求包括第一数据标识、第二QPN和第二位置信息,本申请对于第二读请求中包括的信息不作具体限定。
在第一实例的服务器或者网络设备不支持RDMA单边功能的情况下,网络设备在确定上述第一数据标识对应的第二QPN后,将第一读请求中的第一QPN替换为第二QPN,得到第二读请求。网络设备根据第二读请求中的第二QPN,将第二读请求发送给第三实例。第二读请求包括第一数据标识和第二QPN,本申请对于第二读请求中包括的信息不作具体限定。
上述过程中,网络设备将第一读请求中的第一QPN替换为第二QPN,得到第二读请求,可以将第二读请求根据第二QPN发送给第三实例,不需要在获取数据的过程中与第二实例(数据主)进行通信,减少了对第二实例的CPU资源的占用。在利用RDMA单边功能的情况下,第一实例根据第二读请求可以直接读取第一数据,不需要第三实例所在服务器的CPU参与,可以减少网络通信,降低数据时延。
在一种可能的实现方式中,第一读请求还可以包括第一字段,第一字段用于记录第一实例向第二实例发送的读请求的序列号。示例性的,第一字段的值可以表示为[(A,B);m],其中,A表示发送实例为第一 实例,B表示接收实例为第二实例,m表示数据包序列号(packet sequence number,PSN)。其中,PSN是大于或者等于0的整数,初始值为0,能够指示一个实例向另一实例发送的请求数量。例如,第一读请求包括的第一字段的值是[(A,B);4],表示第一实例向第二实例发送的第一读请求的序列号是4,第一读请求是第一实例向第二实例发送的第五个读请求,在第一实例发送PSN为4的第一读请求后,PSN自增1,以使第一实例向第二实例发送的下一个读请求的PSN为5。
本申请实施例中,网络设备中还可以包括PSN表,如图4所示,图4是本申请实施例提供的一种PSN表的示意图。PSN表用于记录网络设备发送的数据包的PSN,以及数据包对应的发送实例和接收实例。PSN表中所有数据包的PSN的初始值都为0,在网络设备发送数据包的情况下,根据数据包对应的发送实例和接收实例,将PSN表中该数据包对应的PSN自增1,进行记录。
示例性的,在图4中,第一列中的第一实例、第二实例和第三实例表示发送实例,第一行中的第一实例、第二实例和第三实例表示接收实例。PSN表中的“2”表示第一实例已经向第二实例发送了两个数据包。PSN表中的“3”表示第三实例已经向第一实例发送了三个数据包。
在一具体的实施方式中,在网络设备将第一QPN替换为第二QPN的情况下,由于第二QPN属于第三实例,网络设备确定第一数据的数据拥有者是第三实例,确定将第二读请求发送至第三实例。网络设备结合PSN表,将第二读请求中的第一字段修改为[(A,C);s],其中,A表示发送实例为第一实例,C表示接收实例为第三实例,s表示PSN表中发送实例为第一实例,接收实例为第三实例对应的PSN。在网络设备向第三实例发送第二读请求后,PSN表中的s自增1,并进行记录。
在网络设备执行完步骤S330后,第三实例执行步骤S350。
S340:网络设备将第一读请求发送给第二实例。
在网络设备不包括第三实例的信息的情况下,网络设备将第一读请求发送给第二实例,无法从第二实例中获取第一数据。之后,网络设备将第二实例发送的获取第一数据失败的响应报文发送给第一实例,以使第一实例向第二实例重新发送获取第一数据的请求。第二读请求可以将第一实例发送的获取第一数据的请求转发至第三实例,使第三实例向第一实例发送第一数据,从而保证数据的正常获取。在网络设备执行完步骤S340后,不再执行后续步骤。
在一种可能的实施方式中,在网络设备将第一读请求发送给第二实例之前,在第一读请求不是第一个发送至第二实例的数据包时,网络设备将第一读请求的数据包序列号PSN修改为与前一个发送至第二实例的数据包的PSN连续。上述过程可以保证第二实例接收到的第一实例发送的数据包的PSN连续,可以使第一实例从第二实例中获取数据。
在一具体的实施方式中,如图5所示,图5是本申请实施例提供的一种数据获取过程中PSN表变化的示意图。第一实例经过网络设备向第二实例发送的第一读请求的PSN为3,网络设备获取第一读请求,确定第一读请求不是第一实例发送至第二实例的第一个数据包。
在网络设备将第一读请求发送至第二实例之前,网络设备根据第一读请求以及PSN表,将第一读请求的PSN修改为,PSN表中发送实例为第一实例,接收实例为第二实例对应的PSN,该PSN为1。第二实例接收到的网络设备发送的第一读请求的PSN为1,由于第二实例之前接收过一个第一实例发送的数据包,该数据包的PSN为0,第二实例接收的第一读请求的PSN与前一个接收到的第一实例发送的数据包的PSN连续。第二实例可以根据第一读请求获取数据。
在网络设备将第一读请求发送至第二实例后,网络设备将PSN表中发送实例为第一实例,接收实例为第二实例对应的PSN自增1,生成新的PSN的值为2,并在PSN表中记录当前的PSN的值。
S350:第三实例接收第二读请求,根据第二读请求获取第一数据并返回给网络设备。
第三实例是第一数据的数据拥有者,第三实例在接收到第二读请求后,根据第二读请求确定第三实例存储的第一数据,将第一数据返回给网络设备。
在第二读请求中包括第二位置信息的情况下,第三实例根据第二位置信息,确定第一数据,并将第一数据发送给网络设备。
在第三实例不支持RDMA单边功能,或者,第二读请求中不包括第二位置信息的情况下,第三实例根据第二读请求中包括的第一数据标识,找到第一数据,将第一数据发送给网络设备。
在一种可能的实施方式中,在第三实例根据第二读请求获取第一数据之前,第三实例需要确定接收到的第一实例发送的数据包的PSN是否是连续的。第三实例可以包括第三字段,第三字段是第三实例中用于记录第三实例将要接收的第一实例发送的读请求的序列号,用于判断接收的第一实例发送的读请求的序列号是否连续。示例性的,第三字段的值可以表示为[(A,C);i],其中,A表示发送实例为第一实例,C表示 接收实例为第三实例,i表示PSN,是在第三实例已接收到的第一实例发送的读请求的数量上自增1得到的。例如,第三实例中记录的第三字段为[(A,C);5],根据第三字段可以确定第三实例已经接收到第一实例发送的五个读请求,第五个读请求的序列号是4,第三实例下一次接收的第一实例发送的读请求的序列号应是5,如果第三实例下一次接收到第一实例发送的读请求的序列号是5,则PSN是连续的。
在第二读请求的PSN与第三实例包括的第三字段中的PSN相同的情况下,PSN是连续的,第三实例可以获取第一数据。在第二读请求的PSN与第三实例包括的第三字段中的PSN不相同的情况下,PSN不连续,第三实例无法获取第一数据,第一实例重新发送获取第一数据的读请求。
S360:网络设备将第三实例返回的第一数据发送给第一实例。
网络设备接收第三实例发送的第一数据,将第一数据发送给第一实例。
在一具体的实施方式中,如图6所示,图6是本申请实施例提供的另一种数据获取过程中PSN表变化的示意图。第一实例经过网络设备向第二实例发送第一数据的第一读请求,第一读请求中包括预设值、第一QPN以及第一字段[(1,2);3]。其中,第一字段表示第一读请求的发送实例为第一实例,接收实例为第二实例,第一读请求的PSN为3,表示第一读请求是第一实例向第二实例发送的第四个数据包。在第一实例发送第一读请求后,第一实例确定下一次向第二实例发送的数据包的序列号为4。
网络设备接收到第一读请求,确定第一读请求中的预设值是第一实例与网络设备之间的约定值,网络设备查询网络设备中是否包括第三实例的信息,第三实例是第一数据的数据拥有者。在网络设备根据第一数据标识找到对应的第二QPN的情况下,网络设备将第一QPN替换为第二QPN,生成第二读请求。网络设备根据第二QPN,确定第二读请求的发送实例为第一实例,接收实例为第三实例。网络设备结合PSN表中发送实例为第一实例,接收实例为第三实例对应的PSN,将第二读请求中的第一字段修改为[(1,3);1]。网络设备将第二读请求发送至第三实例后,将PSN表中发送实例为第一实例,接收实例为第三实例对应的PSN自增1,得到新的PSN值为2,并在PSN表中进行记录。
第三实例在接收到第二读请求,确定第二读请求的PSN为1的情况下,确定第二读请求中的PSN与第三字段中的PSN相同,确定PSN连续,第三实例可以正常获取第一数据,并将第一数据发送给网络设备。其中,第一数据所在的数据包还包括发送实例为第三实例,接收实例为第一实例对应的PSN。网络设备确定第一数据所在的数据包发送实例为第三实例,接收实例为第一实例,网络设备将第一数据所在的数据包发送至第一实例。在网络设备将第一数据发送至第一实例后,网络设备将PSN表中发送实例为第三实例,接收实例为第一实例对应的PSN自增1,得到新的PSN值为2,并在PSN表中进行记录。
综上所述,根据本申请提供的数据获取方法,在第一实例获取第一数据的过程中,网络设备可以通过改变第一读请求包括的内容,将第一实例发送的用于读取第一数据的读请求直接发送给第一数据的数据拥有者,不需要与第一数据的数据主进行通信,可以减少数据请求者获取数据的过程中的网络通信,降低数据时延,降低数据主的CPU资源占用。在第一实例、网络设备和第三实例之间运用RDAM技术进行数据的读取,RDMA技术可以降低数据时延。
如图7所示,图7是本申请提供的一种数据获取装置的结构示意图,该装置应用于数据管理系统中的网络设备中,该数据获取装置700包括:接收模块710,用于获取第一实例向第二实例发送的第一数据的第一读请求,第一读请求包括第一数据标识,第二实例中包括对第一数据具有读写权限的第三实例的信息;处理模块720,用于确定存储模块730中是否包括第三实例的信息,并在存储模块730中包括第三实例的信息时,根据第三实例的信息及第一读请求,生成第二读请求,第二读请求包括第一数据的标识及第三实例的信息,用于请求第三实例读取第一数据;发送模块740,用于发送第二读请求至第三实例。
第二读请求还用于指示第三实例在读取第一数据后,将第一数据返回给第一实例。
在存储模块中不包括第三实例的信息时,发送模块还用于将第一读请求发送至第二实例,数据获取装置无法从第二实例中获取第一数据,需要第一实例向第二实例发送获取第一数据的双边请求。
在一种可能的实施方式中,在接收模块用于获取第一实例向第二实例发送的第一数据的第一读请求之前,接收模块还用于接收第三实施例发送给第二实例的声明请求,其中,声明请求用于请求拥有第一数据的读写权限;处理模块,还用于查看存储模块是否存储有拥有第一数据的读写权限的其他实例的信息,如果没有,发送模块用于将声明请求发送至第二实例,如果有,发送模块用于在处理模块删除其他实例的信息后,将声明请求发送至第二实例;接收模块还用于接收第二实例发送的声明请求的响应信息,其中,响应信息包括第一数据及第三实例的信息,表示第三实例拥有了第一数据的读写权限;发送模块还用于在存储模块用于记录第一数据及第三实例的信息后,将响应信息发送至第三实例。
在一种可能的实施方式中,存储模块中包括如图4所示的PSN表。处理模块,还用于在确定将第一读 请求的后一个由第一实例发送给第二实例的第三读请求发送给第二实例的情况下,结合PSN表,修改第三读请求的数据包序列号PSN,以使第二实例接收的第三读请求的PSN与第二实例上一个接收的第一实例发送的读请求的PSN连续。
其中,接收模块710用于执行图2中的步骤S220和S240,处理模块720和存储模块730用于执行图2中的步骤S240,发送模块740用于执行图2中的步骤S220和S240,接收模块710和处理模块720还用于执行图3中的步骤S320、S330,发送模块740还用于执行图3中的步骤S330和步骤S340,其中,接收模块还可以用于执行处理模块执行的步骤,或者处理模块还可以用于执行接收模块执行的步骤等等,对于数据获取装置中模块具体执行的步骤本申请不作具体限定。
综上所述,数据获取装置通过接收模块、处理模块、存储模块和发送模块的相互配合,可以使数据获取装置在第一实例获取第一数据的情况下,将第一数据对应的第一读请求发送至第一数据的数据拥有者中,不需要与第一数据的数据主进行通信,可以减少数据主所在的服务器中CPU资源的占用。
如图8所示,图8是本发明实施例提供的一种网络设备的结构示意图,该网络设备800包括:处理器810、存储器820、通信接口830和总线840。其中,处理器、存储器、通信接口可以通过内部总线相互连接也可以通过无线传输等其他手段实现通信。
处理器810可以由至少一个通用处理器构成,例如中央处理器(central processing unit,CPU),或者CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC)、可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。处理器810用于执行各种类型的数字存储指令。处理器可以执行获取模块、处理模块和发送模块执行的步骤,实现相应的功能。
存储器820可以是易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)、动态随机存储器(dynamic RAM,DRAM)、静态随机存储器(static RAM,SRAM)、同步动态随机存储器(synchronous dynamic RAM,SDRAM)、双倍速率同步动态随机存储器(double data rate RAM,DDR)、高速缓存(cache)等等,存储器还可以包括上述种类的组合。存储器820中包括程序代码,处理器810通过执行该程序代码可以执行图2和图3中网络设备执行的步骤,实现图2和图3中的功能。存储器820中还包括数据,数据中可以包括多组数据标识和QPN的对应关系,多组数据标识和位置信息的对应关系以及接收的读请求和发送的读请求之间的对应关系等,存储器的数据中还可以包括更多的内容,对此本申请不作具体限定。
通信接口830可以用于接收第一实例发送的第一读请求,或者将处理器或者处理模块生成的第二读请求发送至第三实例。
需要说明的,图8仅仅是本申请实施例的一种可能的实现方式,实际应用中,网络设备还可以包括更多或更少的部件,这里不作限制。
本申请实施例,还提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在处理器上运行时,图2和图3所示的方法流程得以实现。
本申请实施例,还提供一种计算机程序产品,当计算机程序产品在处理器上运行时,图2和图3所示的方法流程得以实现。
在计算机上加载或执行计算机程序指令时,全部或部分地产生按照本发明实施例的流程或功能。计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。
计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含至少一个可用介质集合的服务器、数据中心等数据存储节点。可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(digital video disc,DVD)、或者半导体介质)。
以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。

Claims (14)

  1. 一种数据获取方法,其特征在于,包括:
    网络设备获取第一实例向第二实例发送的第一数据的第一读请求,所述第一读请求包括第一数据标识,所述第二实例中包括对所述第一数据具有读写权限的第三实例的信息;
    所述网络设备确定所述网络设备是否包括所述第三实例的信息,并在所述网络设备中包括所述第三实例的信息时,根据所述第三实例的信息及所述第一读请求,生成第二读请求,并发送所述第二读请求至所述第三实例,所述第二读请求包括所述第一数据的标识及所述第三实例的信息,用于请求所述第三实例读取所述第一数据。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    接收所述第三实例读取的所述第一数据,并将所述第一数据发送至所述第一实例。
  3. 根据权利要求1所述的方法,其特征在于,所述第二读请求还用于指示所述第三实例在读取所述第一数据后,将所述第一数据返回给所述第一实例。
  4. 根据权利要求1至3任意一项所述的方法,其特征在于,所述方法还包括:
    在所述网络设备中不包括所述第三实例的信息时,将所述第一读请求发送至所述第二实例。
  5. 根据权利要求1-3任一项所述的方法,其特征在于,在将所述第一读请求发送至所述第二实例之前,所述方法包括:
    当所述第一读请求不是第一个发送至所述第二实例的数据包时,所述网络设备将所述第一读请求的数据包序列号PSN修改为与前一个发送至所述第二实例的数据包的PSN连续。
  6. 根据权利要求1所述的方法,其特征在于,在网络设备获取第一实例向第二实例发送的第一数据的第一读请求之前,所述方法还包括:
    所述网络设备接收所述第三实施例发送给所述第二实例的声明请求,所述声明请求用于请求拥有所述第一数据的读写权限;
    所述网络设备查看所述网络设备是否存储有拥有所述第一数据的读写权限的其他实例的信息,如果没有,则将所述声明请求发送至所述第二实例,如果有,则删除所述其他实例的信息后,将所述声明请求发送至所述第二实例;
    所述网络设备接收所述第二实例发送的所述声明请求的响应信息,所述响应信息包括所述第一数据及所述第三实例的信息,表示所述第三实例拥有了所述第一数据的读写权限,并记录所述第一数据及所述第三实例的信息后,将所述响应信息发送至所述第三实例。
  7. 一种数据获取系统,其特征在于,所述系统包括第一实例、第二实例、网络设备和第三实例:
    所述第一实例,用于向所述第二实例发送第一数据的第一读请求,所述第一读请求包括第一数据标识,所述第二实例中包括对所述第一数据具有读写权限的第三实例的信息;
    所述网络设备,用于获取所述第一读请求;
    所述网络设备,用于确定所述网络设备是否包括所述第三实例的信息,并在所述网络设备中包括所述第三实例的信息时,根据所述第三实例的信息及所述第一读请求,生成第二读请求,并发送所述第二读请求至所述第三实例,所述第二读请求包括所述第一数据的标识及所述第三实例的信息,用于请求所述第三实例读取所述第一数据。
  8. 根据权利要求7所述的系统,其特征在于,所述网络设备还用于接收所述第三实例读取的所述第一数据,并将所述第一数据发送至所述第一实例。
  9. 根据权利要求7所述的系统,其特征在于,所述第二读请求还用于指示所述第三实例在读取所述第一数据后,将所述第一数据返回给所述第一实例。
  10. 根据权利要求7-9任一项所述的系统,其特征在于,所述网络设备还用于在所述网络设备中不包括所述第三实例的信息时,将所述第一读请求发送至所述第二实例。
  11. 根据权利要求7-9任一项所述的系统,其特征在于,在将所述第一读请求发送至所述第二实例之前,所述网络设备,还用于当所述第一读请求不是第一个发送至所述第二实例的数据包时,所述网络设备将所述第一读请求的数据包序列号PSN修改为与前一个发送至所述第二实例的数据包的PSN连续。
  12. 根据权利要求7所述的系统,其特征在于,在网络设备用于获取所述第一读请求之前,所述网络设备还用于:
    接收所述第三实施例发送给所述第二实例的声明请求,所述声明请求用于请求拥有所述第一数据的读写权限;
    查看所述网络设备是否存储有拥有所述第一数据的读写权限的其他实例的信息,如果没有,则将所述声明请求发送至所述第二实例,如果有,则删除所述其他实例的信息后,将所述声明请求发送至所述第二实例;
    接收所述第二实例发送的所述声明请求的响应信息,所述响应信息包括所述第一数据及所述第三实例的信息,表示所述第三实例拥有了所述第一数据的读写权限,并记录所述第一数据及所述第三实例的信息后,将所述响应信息发送至所述第三实例。
  13. 一种网络设备,其特征在于,所述网络设备包括处理器和存储器,所述存储器存储计算机程序,所述处理器执行所述计算机程序,以使所述网络设备执行如权利要求1至6任一项所述的方法。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序,所述程序在网络设备上运行时,使所述网络设备执行如权利要求1至6任一项所述的方法。
PCT/CN2023/114830 2022-10-21 2023-08-25 一种数据获取方法、系统及相关设备 WO2024082815A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211296811.1 2022-10-21
CN202211296811.1A CN117917884A (zh) 2022-10-21 2022-10-21 一种数据获取方法、系统及相关设备

Publications (1)

Publication Number Publication Date
WO2024082815A1 true WO2024082815A1 (zh) 2024-04-25

Family

ID=90729655

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/114830 WO2024082815A1 (zh) 2022-10-21 2023-08-25 一种数据获取方法、系统及相关设备

Country Status (2)

Country Link
CN (1) CN117917884A (zh)
WO (1) WO2024082815A1 (zh)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741731A (zh) * 2009-12-03 2010-06-16 中兴通讯股份有限公司 内容分发网络中内容元数据的存储、查询方法及管理系统
CN102761572A (zh) * 2011-04-28 2012-10-31 腾讯科技(深圳)有限公司 动态调整数据流量的方法及系统
CN103166978A (zh) * 2011-12-08 2013-06-19 中兴通讯股份有限公司 数据获取方法及装置
CN107306279A (zh) * 2016-04-18 2017-10-31 阿里巴巴集团控股有限公司 数据处理方法、内容分发网络节点和常驻网关
CN107872486A (zh) * 2016-09-28 2018-04-03 华为技术有限公司 通信方法和装置
CN110430286A (zh) * 2019-08-30 2019-11-08 杭州领智云画科技有限公司 Cdn系统中获取资源的方法、装置、设备及存储介质
CN113573326A (zh) * 2020-04-28 2021-10-29 华为技术有限公司 一种地址获取方法及装置
US20220209859A1 (en) * 2019-04-18 2022-06-30 Huawei Technologies Co., Ltd. Data packet processing method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741731A (zh) * 2009-12-03 2010-06-16 中兴通讯股份有限公司 内容分发网络中内容元数据的存储、查询方法及管理系统
CN102761572A (zh) * 2011-04-28 2012-10-31 腾讯科技(深圳)有限公司 动态调整数据流量的方法及系统
CN103166978A (zh) * 2011-12-08 2013-06-19 中兴通讯股份有限公司 数据获取方法及装置
CN107306279A (zh) * 2016-04-18 2017-10-31 阿里巴巴集团控股有限公司 数据处理方法、内容分发网络节点和常驻网关
CN107872486A (zh) * 2016-09-28 2018-04-03 华为技术有限公司 通信方法和装置
US20220209859A1 (en) * 2019-04-18 2022-06-30 Huawei Technologies Co., Ltd. Data packet processing method and apparatus
CN110430286A (zh) * 2019-08-30 2019-11-08 杭州领智云画科技有限公司 Cdn系统中获取资源的方法、装置、设备及存储介质
CN113573326A (zh) * 2020-04-28 2021-10-29 华为技术有限公司 一种地址获取方法及装置

Also Published As

Publication number Publication date
CN117917884A (zh) 2024-04-23

Similar Documents

Publication Publication Date Title
US8086581B2 (en) Method for managing lock resources in a distributed storage system
WO2018040589A1 (zh) 一种基于分布式存储系统的数据处理方法及存储设备
US10831612B2 (en) Primary node-standby node data transmission method, control node, and database system
CN112578997B (zh) 一种数据迁移方法、系统及相关设备
US9940020B2 (en) Memory management method, apparatus, and system
WO2020103679A1 (zh) 一种数据存储方法及装置
WO2021082401A1 (zh) 一种数据的上传方法、系统、装置及电子设备
US11231964B2 (en) Computing device shared resource lock allocation
US12001450B2 (en) Distributed table storage processing method, device and system
CN110858162A (zh) 内存管理方法及装置、服务器
CN103297490B (zh) 信息处理装置、分布式处理系统和分布式处理方法
CN109684237A (zh) 基于多核处理器的数据访问方法和装置
CN107992270B (zh) 一种多控存储系统全局共享缓存的方法及装置
CN107493309B (zh) 一种分布式系统中的文件写入方法及装置
JP4271967B2 (ja) 分散ファイルシステム及び分散ファイルシステムの運用方法
WO2024082815A1 (zh) 一种数据获取方法、系统及相关设备
EP3964996A1 (en) Database access method and device
US20110153958A1 (en) Network load reducing method and node structure for multiprocessor system with distributed memory
WO2023024656A1 (zh) 数据访问方法、存储系统及存储节点
WO2022206170A1 (zh) 一种数据处理方法、服务端及系统
CN111400327B (zh) 一种数据同步方法、装置、电子设备及存储介质
WO2022083267A1 (zh) 数据处理方法、装置、计算节点以及计算机可读存储介质
WO2021063242A1 (zh) 一种存储系统的元数据的发送方法及存储系统
KR100785774B1 (ko) 객체 기반 파일 입출력 시스템 및 방법
WO2023045385A1 (zh) 数据处理方法以及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23878810

Country of ref document: EP

Kind code of ref document: A1