CN110381136A - A kind of method for reading data, terminal, server and storage medium - Google Patents

A kind of method for reading data, terminal, server and storage medium Download PDF

Info

Publication number
CN110381136A
CN110381136A CN201910653830.7A CN201910653830A CN110381136A CN 110381136 A CN110381136 A CN 110381136A CN 201910653830 A CN201910653830 A CN 201910653830A CN 110381136 A CN110381136 A CN 110381136A
Authority
CN
China
Prior art keywords
server
terminal
data
local
target data
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910653830.7A
Other languages
Chinese (zh)
Other versions
CN110381136B (en
Inventor
葛凯凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910653830.7A priority Critical patent/CN110381136B/en
Publication of CN110381136A publication Critical patent/CN110381136A/en
Application granted granted Critical
Publication of CN110381136B publication Critical patent/CN110381136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

This application discloses a kind of method for reading data, terminal, server and storage mediums, which comprises in response to the read requests of target data, multiple servers where Xiang Suoshu target data send information inquiring request;Each server is received according to the information inquiring request, the reading and writing data average time at a distance from the local terminal and in preset time period of transmission;Based on each server at a distance from local terminal and each server reading and writing data average time within a preset period of time, determines destination server and send the read requests of the target data to the destination server;Receive the target data that the destination server is sent.Using the technical solution of the application, it can be according to server at a distance from terminal and reading and writing data number that server is current, the optimum target server for reading target data is filtered out, and target data is read by destination server, to improve the reading speed of target data.

Description

A kind of method for reading data, terminal, server and storage medium
Technical field
This application involves Internet communication technology field more particularly to a kind of method for reading data, terminal, server and deposit Storage media.
Background technique
In distributed file system, data reading operation mainly reads main object storage equipment (OSD).It is logical in client It crosses Crush algorithm and calculates multiple OSD, find out main OSD therein, main OSD is generally first in three copies;Then directly The read operation of data is carried out on main OSD.
Due to the read-only main osd data of data reading operation, the unbalanced of osd data access will lead to;The unevenness of data access The operation requests that will lead on the OSD of part that weigh are excessive, and I/O operation is caused to overstock, and others OSD is then in idle condition, from And reduce the reading speed of data.
Therefore, it is necessary to provide a kind of method for reading data, terminal, server and storage medium, the reading of Lai Tigao data Take speed.
Summary of the invention
This application provides a kind of method for reading data, terminal, server and storage mediums, effectively increase the reading of data Take speed.
On the one hand, this application provides a kind of method for reading data, which comprises
In response to the read requests of target data, multiple servers where Xiang Suoshu target data send information inquiry and ask It asks, the information inquiring request carries the location information of local terminal;
Each server is received according to the information inquiring request, transmission it is at a distance from the local terminal and default Reading and writing data average time in period;Described is each server at a distance from the local terminal according to described What the location information of ground terminal determined;
Based on each server at a distance from local terminal and each server within a preset period of time Reading and writing data average time, determines destination server;
The read requests of the target data are sent to the destination server;
Receive the target data that the destination server is sent according to the read requests.
On the other hand a kind of method for reading data is provided, which comprises
The information inquiring request that terminal is sent in response to the read requests of target data is received, the information inquiring request is taken Location information with the terminal;
Based on the location information of the terminal, determine local server at a distance from the terminal;
The local server is sent at a distance from the terminal to the terminal and the local server is default Reading and writing data average time in period;
Receive the read requests for the target data that the terminal is sent;
Based on the read requests of the target data, the target data is obtained;
The target data is sent to the terminal.
On the other hand a kind of reading data terminal is provided, the terminal includes:
Information inquiring request sending module, for the read requests in response to target data, Xiang Suoshu target data place Multiple servers send information inquiring request, the information inquiring request carries the location information of local terminal;
Information receiving module, for receiving each server according to the information inquiring request, transmission with the local The distance of terminal and the reading and writing data average time in preset time period;Described is described every at a distance from the local terminal A server is determined according to the location information of the local terminal;
Destination server determining module, at a distance from local terminal and described each based on each server The reading and writing data average time of server within a preset period of time, determines destination server;
Read requests sending module, for sending the read requests of the target data to the destination server;
Target data receiving module, the target sent for receiving the destination server according to the read requests Data.
On the other hand a kind of reading data server is provided, the server includes:
Information inquiring request receiving module is looked into for receiving the information that terminal is sent in response to the read requests of target data Request is ask, the information inquiring request carries the location information of the terminal;
Apart from determining module, for the location information based on the terminal, determine local server and the terminal away from From;
Information sending module, it is at a distance from the terminal and described for sending the local server to the terminal The reading and writing data average time of local server within a preset period of time;
Read requests receiving module, for receiving the read requests for the target data that the terminal is sent;
Target data obtains module, for the read requests based on the target data, obtains target data;
Target data sending module, for sending the target data to the terminal.
On the other hand a kind of data reading system is provided, the system comprises terminal and server,
The terminal, multiple servers for the read requests in response to target data, where Xiang Suoshu target data Information inquiring request is sent, the information inquiring request carries the location information of the terminal;And it is based on the multiple service Device determines target at a distance from the terminal and the multiple server reading and writing data average time within a preset period of time Server;And the read requests of the target data are sent to the destination server;
The server determines local server at a distance from the terminal for the location information based on the terminal; And the local server is sent at a distance from the terminal to the terminal and the local server is in preset time Reading and writing data average time in section;And the read requests based on the target data, obtain the target data;And to The terminal sends the target data.
On the other hand a kind of reading data terminal is provided, the terminal includes processor and memory, the memory In be stored at least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, described at least one Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize method for reading data as described above.
On the other hand a kind of reading data server is provided, the server includes processor and memory, described to deposit Be stored at least one instruction, at least a Duan Chengxu, code set or instruction set in reservoir, at least one instruction, it is described extremely A few Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize reading data side as described above Method.
On the other hand a kind of computer readable storage medium is provided, at least one finger is stored in the storage medium Enable, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or Instruction set is loaded by processor and is executed to realize method for reading data as described above.
Method for reading data, terminal, server and storage medium provided by the present application, have the following technical effect that
For the application in response to the read requests of target data, multiple servers where Xiang Suoshu target data send information Inquiry request;And based on the multiple server at a distance from local terminal and the multiple server within a preset period of time Reading and writing data average time, determine destination server;So as to according to server at a distance from terminal and server Current reading and writing data number filters out the optimum target server for reading target data, and reads mesh by destination server Data are marked, to improve the reading speed of target data.
Detailed description of the invention
It in ord to more clearly illustrate embodiments of the present application or technical solution in the prior art and advantage, below will be to implementation Example or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, the accompanying drawings in the following description is only It is only some embodiments of the present application, for those of ordinary skill in the art, without creative efforts, It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is a kind of schematic diagram of system provided by the embodiments of the present application;
Fig. 2 is a kind of flow diagram of method for reading data provided by the embodiments of the present application;
Fig. 3 is that the process of determining terminal provided by the embodiments of the present application and nearest public ancestors' method of each server is shown It is intended to;
Fig. 4 is a kind of cluster topology graph provided by the embodiments of the present application;
Fig. 5 is the minimum of OSD0 and OSD1 provided by the embodiments of the present application with rhizosphere structural schematic diagram;
Fig. 6 is the minimum of OSD0 and OSD3 provided by the embodiments of the present application with rhizosphere structural schematic diagram;
Fig. 7 is nearest public ancestors' lookup schematic diagram of OSD provided by the embodiments of the present application and terminal;
Fig. 8 is a kind of shared work queue figure provided by the embodiments of the present application;
Fig. 9 is that Ceph original system provided by the embodiments of the present application reports hum pattern;
Figure 10 is CPU usage contrast curve chart provided by the embodiments of the present application;
Figure 11 is the flow diagram of another method for reading data provided by the embodiments of the present application;
Figure 12 is a kind of flow diagram of determining destination server method provided by the embodiments of the present application;
Figure 13 is the flow diagram of another method for reading data provided by the embodiments of the present application;
Figure 14 is a kind of structural schematic diagram of reading data terminal provided by the embodiments of the present application;
Figure 15 is a kind of structural schematic diagram of reading data server provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, those of ordinary skill in the art without making creative work it is obtained it is all its His embodiment, shall fall in the protection scope of this application.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, system, product or server need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
Referring to Fig. 1, Fig. 1 is a kind of schematic diagram of system provided by the embodiments of the present application, as shown in Figure 1, the system can To include at least two servers 01 and a client 02.
Specifically, the server 01 may include an independently operated server in this specification embodiment, or Distributed server, or the server cluster being made of multiple servers.Server 01 may include have network communication unit, Processor and memory etc..Two servers 01 can be used for providing background service for the client 02, specifically, Two servers 01 can be used for storing the corresponding data of application program in client 02.
Specifically, the client 02 may include smart phone, desktop computer, plate electricity in this specification embodiment The entity device of the types such as brain, laptop, digital assistants, intelligent wearable device, also may include running on entity to set Software in standby, such as some service providers are supplied to the Webpage of user, or those service providers are supplied to user's Using.Specifically, the client 02 can be used for interacting with two servers, in response to data read request from two An acquisition data in a server.
Method for reading data of the application introduced below based on above system, Fig. 2 are one kind provided by the embodiments of the present application The flow diagram of method for reading data, present description provides the method operating procedures as described in embodiment or flow chart, but It may include more or less operating procedure based on routine or without creative labor.The step of enumerating in embodiment is suitable Sequence is only one of numerous step execution sequence mode, does not represent and unique executes sequence.System or clothes in practice Device product be engaged in when executing, can be executed according to embodiment or method shown in the drawings sequence or it is parallel execute it is (such as parallel The environment of processor or multiple threads).It is specific as shown in Fig. 2, the method may include:
S201: in response to the read requests of target data, multiple servers where Xiang Suoshu target data send terminal Information inquiring request, the information inquiring request carry the location information of the terminal.
In this specification embodiment, the multiple server can provide background service for the terminal.The target The read requests of data can be the request that user triggers in terminal display interface.
In this specification embodiment, each server may each comprise object storage device (Object-based Storage Device, OSD), each OSD is stored with target data, i.e. a target data corresponds to multiple OSD.
In this specification embodiment, the read requests of the target data carry the storage location letter of the target data Breath, in response to the read requests of target data, multiple servers where Xiang Suoshu target data send information and look into the terminal Asking request may include:
Storage location information of the terminal based on the target data, determines the location information of the multiple server;
Location information of the terminal based on the multiple server sends information inquiry to the multiple server and asks It asks.
In some embodiments, terminal storage location information based on the data, determines the multiple server Location information include:
Terminal storage location information based on the data sends index node search request to meta data server;
The meta data server is based on the index node search request, obtains the index node information of the data, The index node information of the data includes data pool identification information;
The meta data server sends the index node information of the data to the terminal;
Terminal pond identification information based on the data, determines the location information of the multiple server.
In some embodiments, the method can also include:
The terminal data information in read requests based on the data, determines the corresponding placement group mark of the data Information;
Correspondingly, terminal pond information based on the data, determines that the location information of the multiple server includes:
The terminal pond identification information and the placement group identification information based on the data, determine the mesh of the placement group Mark identification information;
The terminal uses Crush (Controoled Replication Under Scalable Hashing) algorithm The target identification information of the placement group is calculated, determines the location information of the multiple server.
In this specification embodiment, the data pool identification information can number for the data pool, the placement group Identification information can be the placement group #.Crush algorithm is a kind of pseudo-random data Distribution Algorithm, it can be in level knot The copy of object is effectively distributed in the storage cluster of structure.Crush realizes a kind of function of pseudorandom (certainty), its ginseng Number is object identity, and returns to storage equipment (the copy OSD for conservation object).
In some embodiments, in distributed file system (Ceph), biography is substituted using Crush pseudo-random algorithm The metadata table of looking into of system carries out data positioning, to realize the data positioning of " calculation is all right, without tabling look-up ", and Crush is counted Calculation can be carried out in any client, without searching central node.
After object striping carries out data fragmentation, it is known which object is data fall in above, pass through data now Location algorithm navigates to object on specific OSD, specific data position algorithm in two steps:
Which step 1: fallen in placement group (PG) by Hash calculation object.
Step 2: PG is calculated by Crush and is fallen on which group OSD.
The first step calculates object name by using Jenkins hash function, is then carried out by hash value PG sum modulus, the remainder of taking-up are the serial number of selected PG.Calculation formula is as follows:
Pgid=hash (oid) &mask
Wherein, pgid is the serial number of PG, and oid is object identity, and mask is used to limit the normalization section of data;Such as Mask is 10, then obtained data are just between 0-9.
Crush algorithm is an efficient pseudo-random algorithm, it can obtain one group of fixation by one group of fixed input Output, just because of this feature just can guarantee that different clients can be accurately located its institute when calculating identical data object The position OSD of category is to the lookup independent of concentration.
Second step needs to place group # (pgid) when calculating Crush, and (poolid) is numbered in pond, cluster topology graph (CRUSH Map) and copy stores regular (rule) these parameters, and the OSD of a copy size is finally exported according to the copy number of setting Array.Such as general default is three copies, can finally export [2,4,5] array, indicate data object be distributed in OSD2, OSD4 and On OSD5, and first OSD is primary copy, and calculation formula is as follows:
CRUSH(pps,map,ruleno)→(osdn1,osdn2,....,osdnk);
Parameter interpretation therein is as follows:
(1) pgid and poolid pps: is carried out by the value that Hash calculation obtains by Jenkins function.
(2) Map: cluster topology structure.
(3) ruleno: copy storage rule.
(4)(osdn1,osdn2,....,osdnk): the osd array of output.
The OSD array of last output copy number known to data position algorithm, for the write operation of data, due to Ceph Using strong consistency principle, it is necessary to first write the data to main OSD, be then written on copy OSD again.And for read operation, it can lead to It crosses reading dispatching algorithm and one suitable OSD progress data reading is selected based on distance and I/O (data input/output) load-factor It takes.
S203: location information of each server based on the terminal determines each server and the terminal Distance.
In this specification embodiment, the location information of each server based on the terminal is determined described each Server may include: at a distance from the terminal
S2031: each server obtains the location information of each server;
S2033: the location information of each server location information based on the terminal and each server, Determine the terminal at a distance from each server.
In this specification embodiment, the distance refers to network distance, apart from it is larger when, will lead to terminal receive service Device data when extend.
In this specification embodiment, location information of each server based on the terminal and each service The location information of device determines that the terminal may include: at a distance from each server
S20331: believe the position of location information of each server based on the terminal and each server Breath, determines the nearest public ancestors of the terminal Yu each server;
S20333: nearest public ancestors of each server based on the terminal Yu each server determine The terminal is at a distance from each server.
As shown in figure 3, in this specification embodiment, location information and institute of each server based on the terminal The location information for stating each server, determines the terminal and the nearest public ancestors of each server may include:
S203311: believe the position of location information of each server based on the terminal and the multiple server Breath, determines the root node of the multiple server Yu the terminal;
S203313: root node of each server based on the multiple server Yu the terminal determines described every A server and the terminal reach the routing information of the root node;
S203315: each server reaches the root node based on each server and the terminal Routing information determines the same rhizosphere of the minimum of the terminal and each server;
S203317: the same rhizosphere of minimum of each server based on the terminal and each server determines institute State the nearest public ancestors of terminal Yu each server.
In this specification embodiment, choosing OSD reading data nearest with a distance from terminal network can be improved system Reading performance.
In some embodiments, the input of Crush algorithm needs to provide cluster topology graph (Crush Map), this Map The level distributed architecture of OSD, is indicated using tree structure as shown in Figure 4 in mainly RADOS.RADOS(Reliable Autonomic Distributed Object Store) it is one of core of Ceph, as Ceph distributed file system One sub-project can be mentioned specifically for the Demand Design of Ceph on a storage equipment group of planes for dynamic change and heterojunction structure For a kind of stabilization, expansible, high performance unity logic object memory interface and the adaptive and Self management that can be realized node Storage system.As shown in figure 4, the cluster topology graph is three-decker, the bottom represents disk corresponding to OSD, his father Node on behalf host (host), top layer root represent the root node of a logic, do not correspond to any entity, are used only to manage Tree.The above is simplest three-decker, and Ceph storage cluster can also perceive rack, computer room and data center etc., Crush algorithm Object copies can be separated to different failure domains using this characteristic.It is indicated in Ceph using bucket (bucket) in tree One node represents a position or a hardware facility, and there are many types by bucket, and each type has a class Type number, as shown in table 1 below:
Table 1:
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 region
type 10 root
Number from low to high (0-10) respectively indicate disk, host, rack, cabinet, row, power distribution unit, power distribution unit collection, Computer room, data center, region and root.The number of bucket type is equivalent to this bucket when not lacking certain bucket type Height of the node in tree;Such as OSD shown in Fig. 4 is the leaf in tree, then the height that the height of OSD is 0, host is 1. And if when lacking certain bucket types, the height non-equivalence of the number number of type with tree;Such as the height of root root is 2, And its types value is 10.Although the height of node is inconsistent with types value in the case where lacking certain bucket types, Its height of the big bucket of types value is also big.Therefore, use the types value of bucket as distance value, relative to leaf node Highly, for example, the distance of osd is 0, host in Fig. 4 distance be 1, root distance be 10.
In order to find nearest OSD with a distance from client, a same rhizosphere of minimum is defined first.Minimum refers to rhizosphere Two nodes are capable of the minimum tree of intercommunication in Crush Map tree;Such as the minimum of OSD0 and OSD1 refers to rhizosphere and includes in Fig. 5 The subtree host1 of OSD0 and OSD1, that is, can be interconnected by host, for another example in Fig. 6 OSD0 and OSD3 the same root of minimum Domain refers to the subtree root comprising host1 and host2, that is, belongs to a logical root and can be interconnected.According to various Bucket type, there is also a variety of same rhizospheres of minimum, have and belong to a cabinet, computer room and data center etc..
In some embodiments, the multiple server can be three, that is, there are three OSD copies, calculate by Crush Method calculates finally 3 OSD of output, and these three OSD belong to different failure domains, and Ceph current Replica placement rule is supported The failure domain of host-level and chassis level, host-level failure domain refer to that three OSD are fallen on three different hosts, chassis level failure domain Refer to that three OSD are fallen in three different racks.Here by taking host-level failure domain as an example, last object data falls in Fig. 5,6 In OSD0, OSD3 and OSD6 in, be distributed on three different hosts.
Crush Map tree default only includes the layered position information of OSD, and client will not be added thereto, it is now desired to be counted The OSD nearest apart from client is calculated, needs to be added the location information of client in configuration file, for example client is in which machine The information such as on the host of which rack in room, such Ceph can just perceive the position of client.
In this specification embodiment, the client be can be set on the host of same failure domain, also can be set In other racks or other computer rooms, a variety of different usage scenarios thus can be flexibly handled.Assuming that client is in host2 On, by it is assumed above that three OSD successively search client on host1, host2 and host3, using minimum public ancestors' algorithm With the same rhizosphere of minimum of three OSD, it is divided into following two step:
Step 1: three OSD and client are calculated separately to the path of root node.
Step 2: successively compare Client path and the path OSD and find out nearest public ancestors.
The calculating in path refers to the path from present node to root, and records the bucket type and name of father node. As shown in fig. 7, the path of OSD0 is { (host, host1), (root, root) }, the path of OSD3 be (host, host2), (root, root) }, the path of client is { (host, host2), (root, root) }, the path of OSD6 be (host, Host3), (root, root) }.Path obtained by calculation can compare nearest public ancestors, as a result as follows: OSD0 and The nearest public ancestors of client are root, and the nearest public ancestors of OSD3 and client are host2, and OSD6 and client are most Nearly public ancestors are root, if client will carry out communicating needs on network with OSD by nearest public ancestors, so, The distance of transmission over networks is directly proportional to nodal distance defined in Crush Map, so the type according to bucket is passed Defeated distance is 10:1:10, so, the OSD nearest apart from client is OSD3, chooses host2 if the close OSD of selected distance On OSD3.
S205: each server sends each server at a distance from the terminal and institute to the terminal State the reading and writing data average time of each server within a preset period of time.
In this specification embodiment, the information inquiring request includes reading and writing data average time inquiry request, described Method can also include:
Each server reads and writes average time inquiry request based on the data, determines each server pre- If the reading and writing data average time in the period.
In this specification embodiment, each server reads and writes average time inquiry request based on the data, really Determining the reading and writing data average time of each server within a preset period of time may include:
Each server read-write average time inquiry request based on the data, determines each server described Data read-write operation sum in preset time period in be processed and processing;
Each server is by data read-write operation sum of each server in the preset time period divided by pre- If the time difference of period, the reading and writing data average time of each server within a preset period of time is obtained.
In this specification embodiment, the method can also include:
Each server stores reading and writing data average time of each server at interval of preset time threshold Number.
In some embodiments, the intuitive index of data access lack of uniformity is current OSD medium to be processed and It is bigger to indicate that the I/O of this OSD is overstock because current OSD waits the I/O number of operation more for the I/O operation number summation of processing, And the I/O number being presently processing is more, indicates that the duty factor of this OSD request is heavier, therefore subsequent request operation is as far as possible Other OSD are issued to be handled.
OSD makes requests processing using typical producer consumer mode, by network receiving module request message Be added a shared message work queue, then take message to make requests processing with a worker thread pond, wait it is to be processed with I/O is being handled all in this work queue, i.e. the number of request of this message queue is exactly the I/O operation sum of current OSD.But If transmission I/O sum is directly reported, due to that can have network transmission delay, in network by network transmission operation requests number When transmission, OSD can handle always request, even if report cycle is very short, can not avoid, and then pass through and report certain for the moment Between in section I/O average value, i.e. the I/O number of unit time replaces the I/O total, reports delay with average value to alleviate.For Statistical time difference needs to receive when shared queue is added in message by processing module in the network of OSD plus current time stamp, When reporting I/O number, the difference of oldest message and latest news timestamp is calculated, then again with queue I/O sum divided by difference The average value of I/O to be processed is obtained, transmission is carried out with this value and is reported;Fig. 8 is shared work queue figure, and time linked list is also made It is managed with double indexes.Wherein, Shard list is data list, the corresponding slot position of each Shard;By data in list It is divided into two parts, the IO queue (with PG for index) for waiting IO queue to be processed and handling, time-sequencing chained list is by two IO is ranked up according to the processing time in queue.
By Crush algorithm it is found that obtaining target OSD is to be executed in client, and work queue is on OSD Face, that just needs that I/O information is transmitted to client by network, but if being transmitted directly to client, requests each time Primary network transmission will be increased, can seriously occupy the network bandwidth of cluster in this way.Fig. 9 show Ceph original system and reports information Figure, wherein tick is server refreshing frequency;Heartbeat project is a component part of Linux-HA engineering, it is realized One highly available cluster system, heartbeat service and cluster communication are two key components of high-availability cluster, in Heartbea In project, the two functions are realized by heartbeat module.The request operation of Ceph client will be from monitoring module (Monitor, MON) obtains newest object storage device data (OSDMap) information, its inside contain OSD, MON, MDS with And some information of Crush algorithm, other than OSDMap, OSD can regularly report PG above this OSD to Monitor The information namely PGMap of (Placement Group).PG can regard the dummy node in consistency Hash as, maintain one Partial data and be Data Migration and change minimum unit.Monitor can be located at a server with OSD, can also be with Monopolize a server.PGMap is by the state of all PG of Monitor maintenance, and each OSD, which can be grasped, oneself to be possessed PG state.
If the I/O information that OSD is reported is not transmitted directly to client, that can only allow Monitor to pass by means of OSDMap It is defeated by client, but OSD only can be reported periodically to Monitor and be updated PGMap, and OSDMap and PGMap are on Monitor Relevant treatment operations are carried out using two independent module PGMonitor and OSDMonitor, and PGMap reports the life of content It is comparatively laborious at updating, so PGMap timing simply cannot be added in I/O information is reported to Monitor.Here one is redesigned The information message type of a similar PGMap is used to upload the I/O information of OSD, is transmitted directly at OSD Monitor module Reason.OSDMap can rapidly search OSD by Hash table using the mapping of Hash table storage OSD label and its I/O information.
S207: the terminal is based on each server at a distance from the terminal and each server is pre- If the reading and writing data average time in the period, determines destination server.
In this specification embodiment, the terminal is at a distance from the terminal and described based on each server The reading and writing data average time of each server within a preset period of time, determines that destination server may include:
The terminal at a distance from the terminal, determines each server and the end based on each server The distance weighting at end;
Reading and writing data average time of the terminal based on each server within a preset period of time determines described every The reading and writing data average time weight of a server within a preset period of time;
The terminal is based on each server with the distance weighting of the terminal and each server pre- If the reading and writing data average time weight in the period, determines the read operation cost value of multiple servers;
Read operation cost value of the terminal based on the multiple server, determines destination server.
In this specification embodiment, the first weighted value and preset time of the distance can be set according to the actual situation Second weighted value of the reading and writing data average time in section;
The terminal at a distance from the terminal, determines each server and the end based on each server The distance weighting at end may include:
The terminal using each server at a distance from the terminal with the product of first weighted value as institute State the distance weighting of each server Yu the terminal.
Reading and writing data average time of the terminal based on each server within a preset period of time determines described every The reading and writing data average time weight of a server within a preset period of time may include:
The terminal weighs the reading and writing data average time and described second of each server within a preset period of time Reading and writing data average time weight of the weight values as each server within a preset period of time.
Specifically, in this specification embodiment, read operation cost value of the terminal based on the multiple server, really The server that sets the goal may include:
The terminal is ranked up the read operation cost value of the multiple server is descending;
The corresponding server of read operation cost value for the last bit that sorts is determined as the destination server by the terminal.
In this specification embodiment, Ceph asks the read operation of client by calculated three OSD of Crush It asks, using distance above and I/O information, designs the reading dispatching algorithm counted based on network distance and IO, be to improve with this The harmony of system access distribution.
Distance algorithm shown in distance algorithm calculates the distance between three OSD selected by client and Crush above, That is the types value of bucket is the integer between 1~10.I/O statistical report is also I/O number average in OSD time Mesh.
It is suitably read out to filter out one from OSD, defines a read operation cost value semanteme here, pass through It is a value two factors quantizations of distance and I/O, is represented using the size of this value required for reading some OSD operation Cost.
Following three step can be divided by reading dispatching algorithm.
Step 1: cryptographic Hash is calculated.A random number is generated using a hash function, used here as in Crush algorithm Widely used Jenkins function, while three parameters: op_id, osd_id and r are passed to, respectively indicate read operation number, OSD Number and constant, under formula shown in.
When the input and output domain generally mapped differs three orders of magnitude or more, data mapping is that comparison is balanced, Jenkins The exactly such function of Hash, can number read operation and number the integer codomain for being mapped to one 32 with OSD, can give birth in this way At a balanced random number.
Hashnum=hash (op_id, osd_id, r)
Step 2: read operation cost value is calculated.Using the cryptographic Hash in step 1 by following formula adjust the distance with I/O into Row quantization;
Osd_cost=hashnum* (λ * distance+ μ * IO/100)
From formula it can be seen that under identical distance, I/O big read operation cost value is high;In the identical situation of I/O, away from It is high from big read operation cost value;Because distance and two factor influence degrees of I/O are different, all different in distance and I/O In the case of, corresponding weight, such as setting λ=0.6 can be set according to their influence degree, and how μ=0.4 specifically sets Optimal access equilibrium can be had reached when testing test by conditional-variable method adjustment weighted value by setting weight, and due to distance With general poor two orders of magnitude of numerical value of I/O, it is adjusted by constant 100.
Step 3: the OSD of target is filtered out.Read operation cost in three OSD is selected according to read operation cost value above It is worth the smallest target OSD as read operation, formula is as follows:
Min_cost=min { osd_costi(i=1,2,3)
If there is the smallest target OSD of more than two read operation cost values, the constant r in set-up procedure one is incremented by 1, then Step 1 and step 2 are recalculated, and is screened until selecting a target OSD.
Dispatching algorithm is read by three step designs above, in conjunction with distance and I/O two because usually finding optimal target OSD。
S209: the terminal sends the read requests of the target data to the destination server.
S2011: read requests of the destination server based on the target data obtain the target data.
In this specification embodiment, the read requests of the target data carry the store path of the target data, Read requests of the destination server based on the target data, obtaining target data includes:
Store path of the destination server based on the target data obtains target data.
S2013: the destination server sends the target data to the terminal.
The method for reading data of the application introduced below and the performance comparison of art methods are tested.
The container mirror image warehouse of cloud computing at present has used Cephfs, the layering mirror cache of container in shared storage Convenient for the High Availabitity in mirror image warehouse, and the reading dispatching algorithm based on distance and I/O load situation is applied on Cephfs.Pass through The load of balanced each OSD, to improve the speed that Cephfs reads data.
In order to test the influence for reading scheduling to access load, need to observe the utilization rate and I/O band of three node cpus Width, the readwrite bandwidth rate and test environment interior joint 1 that each OSD corresponds to disk under observation workload test are in one minute Cpu usage analyze the access loading condition of disk and node, shown in test result is as follows table 2 and Figure 10.Table 2 is existing There are technology and the Cephfs test data contrast table of the application.
Table 2: magnetic disc i/o bandwidth (MB/s)
0 1 2 3 4 5 6 7 8
The prior art 44.92 24.52 4.72 20.32 10.21 8.25 9.81 25.77 32.73
The application 29.19 32.80 20.18 10.34 26.78 21.23 11.67 35.56 13.90
The I/O bandwidth range of former disk is in 4~45MB as can be seen from the above table, read after optimizing scheduling 10~36MB it Between, the variance for optimizing front and back is respectively 13.26 and 9.91, it is seen then that compared with prior art, the variation width of the application I/O bandwidth Degree reduces, the stability enhancing of bandwidth.
Curve 1 is prior art Cephfs test data in Figure 10, and curve 2 is the test data of technical scheme.
The CPU usage range of origin node 1 is between 20%~50% as can be seen from Figure 10, read after optimizing scheduling Between 25%~43%, variance is respectively 8.85 and 7.11;As it can be seen that compared with prior art, the CPU after the application optimization is used The stability of rate enhances.
The technical solution provided by above this specification embodiment is it is found that terminal is in response to target in this specification embodiment The read requests of data, multiple servers where Xiang Suoshu target data send information inquiring request;And based on the multiple Server determines at a distance from local terminal and the multiple server reading and writing data average time within a preset period of time Destination server out;So as to according to server at a distance from terminal and reading and writing data number that server is current, screening The optimum target server of target data is read out, and target data is read by destination server, to improve number of targets According to reading speed.
A kind of specific embodiment of method for reading data of this specification is introduced by executing subject of terminal below, Figure 11 is this The flow diagram for applying for a kind of method for reading data that embodiment provides, specifically, in conjunction with shown in Figure 11, the method can be with Include:
S1101: in response to the read requests of target data, multiple servers where Xiang Suoshu target data send information Inquiry request, the information inquiring request carry the location information of local terminal;
In this specification embodiment, the read requests of the target data carry the storage location letter of the target data Breath, the read requests in response to target data, multiple servers where Xiang Suoshu target data send information inquiry and ask It asks and includes:
Storage location information based on the target data, determines the location information of the multiple server;
Based on the location information of the multiple server, information inquiring request is sent to the multiple server.
S1103: receiving each server according to the information inquiring request, transmission at a distance from the local terminal with And the reading and writing data average time in preset time period;It is described at a distance from the local terminal for each server according to What the location information of the local terminal determined;
S1105: based on each server at a distance from local terminal and each server is in preset time Reading and writing data average time in section, determines destination server;
As shown in figure 12, in this specification embodiment, it is described based on the multiple server at a distance from local terminal And the reading and writing data average time of the multiple server within a preset period of time, determine that destination server may include:
S11051: based on each server at a distance from the local terminal, each server and institute are determined State the distance weighting of local terminal;
S11053: it based on the reading and writing data average time of each server within a preset period of time, determines described every The reading and writing data average time weight of a server within a preset period of time;
S11055: distance weighting and each server based on each server and the local terminal exist Reading and writing data average time weight in preset time period, determines the read operation cost value of multiple servers;
S11057: the read operation cost value based on the multiple server determines destination server.
In this specification embodiment, the read operation cost value based on the multiple server determines destination service Device may include:
It is ranked up the read operation cost value of the multiple server is descending;
The corresponding server of read operation cost value for the last bit that sorts is determined as the destination server.
S1107: Xiang Suoshu destination server sends the read requests of the target data;
S1109: the target data that the destination server is sent according to the read requests is received.
This specification embodiment provides a kind of reading data terminal, and the terminal includes the first application program, the end End includes processor and memory, is stored at least one instruction, at least a Duan Chengxu, code set or instruction in the memory Collection, at least one instruction, an at least Duan Chengxu, the code set or instruction set are loaded and are executed by the processor To realize method for reading data as described above.
A kind of specific embodiment of method for reading data of this specification is introduced by executing subject of server below;Figure 13 is The flow diagram of a kind of method for reading data provided by the embodiments of the present application, specifically, the method can in conjunction with shown in Figure 13 To include:
S1301: the information inquiring request that terminal is sent in response to the read requests of target data, the information inquiry are received Request carries the location information of the terminal;
In this specification embodiment, the information inquiring request includes reading and writing data average time inquiry request, described Method can also include:
Average time inquiry request is read and write based on the data, determines the number of the local server within a preset period of time According to read-write average time.
It is described to read and write average time inquiry request based on the data in this specification embodiment, determine the local The reading and writing data average time of server within a preset period of time includes:
Average time inquiry request is read and write based on the data, determines the local server in the preset time period Data read-write operation sum in be processed and processing;
By data read-write operation sum of the local server in the preset time period divided by preset time period Time difference obtains the reading and writing data average time of the local server within a preset period of time.
S1303: the location information based on the terminal determines local server at a distance from the terminal;
In this specification embodiment, the location information based on the terminal determines the local server and institute The distance for stating terminal may include:
Obtain the location information of the local server;
The location information of location information based on the terminal and the local server, determine the local server with The distance of the terminal.
In this specification embodiment, the position of the location information based on the terminal and the local server is believed Breath, determines that the local server includes: at a distance from the terminal
The location information of location information and the local server based on the terminal, determine the terminal with it is described The nearest public ancestors of local server;
Nearest public ancestors based on the terminal Yu the local server, determine the terminal and the local service The distance of device.
In this specification embodiment, the position of the location information based on the terminal and the local server Information, determines the terminal and the nearest public ancestors of the local server include:
The location information of multiple servers at the place of location information and the target data based on the terminal, really The root node of fixed the multiple server and the terminal;
Root node based on the multiple server Yu the terminal determines that the local server and the terminal arrive Up to the routing information of the root node;
The routing information that the root node is reached based on the local server and the terminal, determine the terminal with The same rhizosphere of minimum of the local server;
The same rhizosphere of minimum based on the terminal and the local server, determines the terminal and the local server Nearest public ancestors.
S1305: Xiang Suoshu terminal sends the local server at a distance from the terminal and the local server Reading and writing data average time within a preset period of time;
S1307: the read requests for the target data that the terminal is sent are received;
S1309: the read requests based on the target data obtain the target data;
S13011: Xiang Suoshu terminal sends the target data.
This specification embodiment provides a kind of reading data server, and the server includes processor and memory, It is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, at least one instruction, An at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize data as described above Read method.
In this specification embodiment, the memory can be used for storing software program and module, and processor passes through operation It is stored in the software program and module of memory, thereby executing various function application and data processing.Memory can be main Including storing program area and storage data area, wherein storing program area can application program needed for storage program area, function Deng;Storage data area, which can be stored, uses created data etc. according to the equipment.In addition, memory may include high speed with Machine access memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or its His volatile solid-state part.Correspondingly, memory can also include Memory Controller, to provide processor to memory Access.
This specification embodiment provides a kind of computer readable storage medium, and at least one is stored in the storage medium Item instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code Collection or instruction set are loaded by processor and are executed to realize method for reading data as described above.
The embodiment of the present application also provides a kind of reading data terminals, and as shown in figure 14, the terminal may include:
Information inquiring request sending module 1410, for the read requests in response to target data, Xiang Suoshu target data Multiple servers at place send information inquiring request, and the information inquiring request carries the location information of local terminal;
Information receiving module 1420, for receiving each server according to the information inquiring request, transmission with it is described The distance of local terminal and the reading and writing data average time in preset time period;Described is institute at a distance from the local terminal State what each server was determined according to the location information of the local terminal;
Destination server determining module 1430, at a distance from local terminal and described based on each server The reading and writing data average time of each server within a preset period of time, determines destination server;
Read requests sending module 1440, for sending the read requests of the target data to the destination server;
Target data receiving module 1450, for receiving the destination server according to read requests transmission Target data.
In some embodiments, the destination server determining module may include:
Distance weighting submodule, at a distance from local terminal, determining each clothes based on each server The distance weighting of business device and local terminal;
Reading and writing data average time weight determines submodule, for based on each server within a preset period of time Reading and writing data average time determines the reading and writing data average time weight of each server within a preset period of time;
Read operation cost value determines submodule, for the distance weighting based on each server and the local terminal And the reading and writing data average time weight of each server within a preset period of time, determine the read operation of multiple servers Cost value;
Destination server determines submodule, for the read operation cost value based on the multiple server, determines that target takes Business device.
In some embodiments, the destination server determines that submodule may include:
Read operation cost value sequencing unit, for arranging the read operation cost value of the multiple server is descending Sequence;
Destination server determination unit, it is described for the corresponding server of read operation cost value for the last bit that sorts to be determined as Destination server.
In some embodiments, the read requests of the target data carry the storage location information of the target data, The information inquiring request sending module may include:
Location information determines submodule, for the storage location information based on the target data, determines the multiple clothes The location information of business device;
Information inquiring request sending submodule, for the location information based on the multiple server, to the multiple clothes Business device sends information inquiring request.
Terminal and embodiment of the method in the terminal embodiment are based on same inventive concept.
The embodiment of the present application also provides a kind of reading data servers, and as shown in figure 15, the server can also wrap It includes:
Information inquiring request receiving module 1510, the letter sent for receiving terminal in response to the read requests of target data Inquiry request is ceased, the information inquiring request carries the location information of the terminal;
Local server and the terminal are determined for the location information based on the terminal apart from determining module 1520 Distance;
Information sending module 1530, for the terminal send the local server at a distance from the terminal and The reading and writing data average time of the local server within a preset period of time;
Read requests receiving module 1540, for receiving the read requests for the target data that the terminal is sent;
Target data obtains module 1550, for the read requests based on the target data, obtains target data;
Target data sending module 1560, for sending the target data to the terminal.
In some embodiments, the information inquiring request includes reading and writing data average time inquiry request, the service Device can also include:
Reading and writing data average time determining module determines institute for reading and writing average time inquiry request based on the data State the reading and writing data average time of local server within a preset period of time.
In some embodiments, the reading and writing data average time determining module may include:
Data read-write operation sum determines submodule, for reading and writing average time inquiry request based on the data, determines Local server data read-write operation sum to be processed in processing in the preset time period;
Reading and writing data average time determines submodule, for the number by the local server in the preset time period According to read-write operation sum divided by the time difference of preset time period, obtains the data of the local server within a preset period of time and read Write average time.
In some embodiments, described to may include: apart from determining module
Location information determines submodule, for obtaining the location information of the local server;
Distance determine submodule, for based on the terminal location information and the local server location information, Determine the local server at a distance from the terminal.
In some embodiments, the distance determines that submodule may include:
Nearest public ancestors' determination unit, the position for location information and the local server based on the terminal Confidence breath, determines the nearest public ancestors of the terminal Yu the local server;
Distance determining unit, for the nearest public ancestors based on the terminal Yu the local server, determine described in Terminal is at a distance from the local server.
In some embodiments, public ancestors' determination unit recently may include:
Root node determines subelement, the place for location information and the target data based on the terminal it is more The location information of a server determines the root node of the multiple server Yu the terminal;
Routing information determines subelement, for the root node based on the multiple server Yu the terminal, determine described in Local server and the terminal reach the routing information of the root node;
Minimum determines subelement with rhizosphere, for reaching the root node based on the local server and the terminal Routing information, determine the same rhizosphere of minimum of the terminal and the local server;
Nearest public ancestors determine subelement, for the same rhizosphere of minimum based on the terminal and the local server, Determine the nearest public ancestors of the terminal Yu the local server.
Server and embodiment of the method in the server example are based on same inventive concept.
On the other hand the application also provides a kind of data reading system, the system comprises terminal and server,
The terminal, multiple servers for the read requests in response to target data, where Xiang Suoshu target data Information inquiring request is sent, the information inquiring request carries the location information of the terminal;And it is based on the multiple service Device determines target at a distance from the terminal and the multiple server reading and writing data average time within a preset period of time Server;And the read requests of the target data are sent to the destination server;
The server determines local server at a distance from the terminal for the location information based on the terminal; And the local server is sent at a distance from the terminal to the terminal and the local server is in preset time Reading and writing data average time in section;And the read requests based on the target data, obtain the target data;And to The terminal sends the target data.
By the implementation of above-mentioned method for reading data provided by the present application, device, server, terminal, storage medium or system Example as it can be seen that in this specification embodiment terminal in response to target data read requests, it is multiple where Xiang Suoshu target data Server sends information inquiring request;And based on the multiple server at a distance from local terminal and the multiple server Reading and writing data average time within a preset period of time, determines destination server;So as to according to server and terminal Distance and the current reading and writing data number of server, filter out the optimum target server for reading target data, and pass through mesh It marks server and reads target data, to improve the reading speed of target data.
It should be understood that above-mentioned the embodiment of the present application sequencing is for illustration only, do not represent the advantages or disadvantages of the embodiments. And above-mentioned this specification specific embodiment is described.Other embodiments are within the scope of the appended claims.One In a little situations, the movement recorded in detail in the claims or step can be executed according to the sequence being different from embodiment and Still desired result may be implemented.In addition, process depicted in the drawing not necessarily requires the particular order shown or company Continuous sequence is just able to achieve desired result.In some embodiments, multitasking and parallel processing it is also possible or It may be advantageous.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device and For server example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to side The part of method embodiment illustrates.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (13)

1. a kind of method for reading data, which is characterized in that the described method includes:
In response to the read requests of target data, multiple servers where Xiang Suoshu target data send information inquiring request, The information inquiring request carries the location information of local terminal;
Each server is received according to the information inquiring request, transmission at a distance from the local terminal and preset time Reading and writing data average time in section;Described is each server at a distance from the local terminal according to described local whole What the location information at end determined;
Based on each server at a distance from local terminal and each server data within a preset period of time Average time is read and write, determines destination server;
The read requests of the target data are sent to the destination server;
Receive the target data that the destination server is sent according to the read requests.
2. the method according to claim 1, wherein it is described based on each server and local terminal away from From and each server reading and writing data average time within a preset period of time, determine that destination server includes:
Based on each server at a distance from the local terminal, each server and the local terminal are determined Distance weighting;
Reading and writing data average time based on each server within a preset period of time determines each server pre- If the reading and writing data average time weight in the period;
Distance weighting and each server based on each server and the local terminal are in preset time period Interior reading and writing data average time weight, determines the read operation cost value of multiple servers;
Read operation cost value based on the multiple server, determines destination server.
3. the method according to claim 1, wherein the read requests of the target data carry the number of targets According to storage location information, the read requests in response to target data, multiple servers where Xiang Suoshu target data Sending information inquiring request includes:
Storage location information based on the target data, determines the location information of the multiple server;
Based on the location information of the multiple server, information inquiring request is sent to the multiple server.
4. according to the method described in claim 2, it is characterized in that, the read operation cost based on the multiple server Value, determines that destination server includes:
It is ranked up the read operation cost value of the multiple server is descending;
The corresponding server of read operation cost value for the last bit that sorts is determined as the destination server.
5. a kind of method for reading data, which is characterized in that the described method includes:
The information inquiring request that terminal is sent in response to the read requests of target data is received, the information inquiring request carries institute State the location information of terminal;
Based on the location information of the terminal, determine local server at a distance from the terminal;
The local server is sent at a distance from the terminal to the terminal and the local server is in preset time Reading and writing data average time in section;
Receive the read requests for the target data that the terminal is sent;
Based on the read requests of the target data, the target data is obtained;
The target data is sent to the terminal.
6. according to the method described in claim 5, it is characterized in that, the information inquiring request includes reading and writing data average time Inquiry request, the method also includes:
Average time inquiry request is read and write based on the data, determines that the data of the local server within a preset period of time are read Write average time.
7. according to the method described in claim 5, it is characterized in that, the location information based on the terminal, determine described in Local server includes: at a distance from the terminal
Obtain the location information of the local server;
The location information of location information based on the terminal and the local server, determine the local server with it is described The distance of terminal.
8. the method according to the description of claim 7 is characterized in that the location information based on the terminal and the local The location information of server determines that the local server includes: at a distance from the terminal
The location information of location information and the local server based on the terminal, determines the terminal and the local The nearest public ancestors of server;
Nearest public ancestors based on the terminal Yu the local server determine the terminal and the local server Distance.
9. according to the method described in claim 8, it is characterized in that, the location information based on the terminal and described The location information of ground server, determines the terminal and the nearest public ancestors of the local server include:
The location information of multiple servers at the place of location information and the target data based on the terminal, determines institute State the root node of multiple servers Yu the terminal;
Root node based on the multiple server Yu the terminal determines that the local server and the terminal reach institute State the routing information of root node;
The routing information that the root node is reached based on the local server and the terminal, determine the terminal with it is described The same rhizosphere of minimum of local server;
The same rhizosphere of minimum based on the terminal and the local server, determines the terminal and the local server most Nearly public ancestors.
10. according to the method described in claim 6, it is characterized in that, the average time inquiry of read-write based on the data is asked It asks, determines that the reading and writing data average time of the local server within a preset period of time includes:
Average time inquiry request is read and write based on the data, determines the local server in the preset time period wait locate Data read-write operation sum in reason and processing;
By data read-write operation sum of the local server in the preset time period divided by the time of preset time period Difference obtains the reading and writing data average time of the local server within a preset period of time.
11. a kind of reading data terminal, which is characterized in that the terminal includes:
Information inquiring request sending module is more where Xiang Suoshu target data for the read requests in response to target data A server sends information inquiring request, and the information inquiring request carries the location information of local terminal;
Information receiving module, for receiving each server according to the information inquiring request, transmission with the local terminal Distance and preset time period in reading and writing data average time;Described is each clothes at a distance from the local terminal It is engaged in what device was determined according to the location information of the local terminal;
Destination server determining module, for based on each server at a distance from local terminal and each service The reading and writing data average time of device within a preset period of time, determines destination server;
Read requests sending module, for sending the read requests of the target data to the destination server;
Target data receiving module, the number of targets sent for receiving the destination server according to the read requests According to.
12. a kind of reading data server, which is characterized in that the server includes:
Information inquiring request receiving module is asked for receiving terminal in response to the information inquiry that the read requests of target data are sent It asks, the information inquiring request carries the location information of the terminal;
Determine local server at a distance from the terminal for the location information based on the terminal apart from determining module;
Information sending module, for sending the local server at a distance from the terminal and the local to the terminal The reading and writing data average time of server within a preset period of time;
Read requests receiving module, for receiving the read requests for the target data that the terminal is sent;
Target data obtains module, for the read requests based on the target data, obtains target data;
Target data sending module, for sending the target data to the terminal.
13. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, extremely in the storage medium A few Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or instruction Collection is loaded by processor and is executed to realize the reading data side as described in claim 1-4 is any or claim 5-10 is any Method.
CN201910653830.7A 2019-07-19 2019-07-19 Data reading method, terminal, server and storage medium Active CN110381136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910653830.7A CN110381136B (en) 2019-07-19 2019-07-19 Data reading method, terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910653830.7A CN110381136B (en) 2019-07-19 2019-07-19 Data reading method, terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN110381136A true CN110381136A (en) 2019-10-25
CN110381136B CN110381136B (en) 2021-12-14

Family

ID=68254149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910653830.7A Active CN110381136B (en) 2019-07-19 2019-07-19 Data reading method, terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN110381136B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866066A (en) * 2019-11-04 2020-03-06 无锡华云数据技术服务有限公司 Service processing method and device
CN111475176A (en) * 2020-04-10 2020-07-31 腾讯科技(深圳)有限公司 Data reading and writing method, related device, system and storage medium
CN113014667A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Configuration method, device and equipment of rack server and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660707A (en) * 2015-03-09 2015-05-27 浙江万朋网络技术有限公司 Geographical location based proxy server equilibrium distributing method
CN107613030A (en) * 2017-11-06 2018-01-19 网宿科技股份有限公司 A kind of method and system of processing business request
US20180101411A1 (en) * 2011-12-02 2018-04-12 International Business Machines Corporation Data relocation in global storage cloud environments

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180101411A1 (en) * 2011-12-02 2018-04-12 International Business Machines Corporation Data relocation in global storage cloud environments
CN104660707A (en) * 2015-03-09 2015-05-27 浙江万朋网络技术有限公司 Geographical location based proxy server equilibrium distributing method
CN107613030A (en) * 2017-11-06 2018-01-19 网宿科技股份有限公司 A kind of method and system of processing business request

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866066A (en) * 2019-11-04 2020-03-06 无锡华云数据技术服务有限公司 Service processing method and device
CN110866066B (en) * 2019-11-04 2023-01-31 华云数据控股集团有限公司 Service processing method and device
CN111475176A (en) * 2020-04-10 2020-07-31 腾讯科技(深圳)有限公司 Data reading and writing method, related device, system and storage medium
CN111475176B (en) * 2020-04-10 2021-08-13 腾讯科技(深圳)有限公司 Data reading and writing method, related device, system and storage medium
CN113014667A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Configuration method, device and equipment of rack server and storage medium
CN113014667B (en) * 2021-03-18 2023-04-07 山东英信计算机技术有限公司 Configuration method, device and equipment of rack server and storage medium

Also Published As

Publication number Publication date
CN110381136B (en) 2021-12-14

Similar Documents

Publication Publication Date Title
US11816126B2 (en) Large scale unstructured database systems
US11580070B2 (en) Utilizing metadata to prune a data set
US9851911B1 (en) Dynamic distribution of replicated data
US10579272B2 (en) Workload aware storage platform
US9244958B1 (en) Detecting and reconciling system resource metadata anomolies in a distributed storage system
US9489443B1 (en) Scheduling of splits and moves of database partitions
US9053167B1 (en) Storage device selection for database partition replicas
CN107247778B (en) System and method for implementing an extensible data storage service
JP5330503B2 (en) Optimize storage performance
US20090307329A1 (en) Adaptive file placement in a distributed file system
US10146814B1 (en) Recommending provisioned throughput capacity for generating a secondary index for an online table
US10853193B2 (en) Database system recovery using non-volatile system memory
US11061930B1 (en) Dynamic management of storage object partitioning
US10158709B1 (en) Identifying data store requests for asynchronous processing
CN108959510B (en) Partition level connection method and device for distributed database
CN110381136A (en) A kind of method for reading data, terminal, server and storage medium
US10747739B1 (en) Implicit checkpoint for generating a secondary index of a table
US10102230B1 (en) Rate-limiting secondary index creation for an online table
US11836132B2 (en) Managing persistent database result sets
US10135703B1 (en) Generating creation performance metrics for a secondary index of a table
US9875270B1 (en) Locking item ranges for creating a secondary index from an online table
US7895247B2 (en) Tracking space usage in a database
US20180060341A1 (en) Querying Data Records Stored On A Distributed File System
US8443369B1 (en) Method and system for dynamically selecting a best resource from each resource collection based on resources dependencies, prior selections and statistics to implement an allocation policy
US9898614B1 (en) Implicit prioritization to rate-limit secondary index creation for an online table

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant