[go: up one dir, main page]

CN106713495B - The method for uploading and access method in IP geographical position, device and access system - Google Patents

The method for uploading and access method in IP geographical position, device and access system Download PDF

Info

Publication number
CN106713495B
CN106713495B CN201710051854.6A CN201710051854A CN106713495B CN 106713495 B CN106713495 B CN 106713495B CN 201710051854 A CN201710051854 A CN 201710051854A CN 106713495 B CN106713495 B CN 106713495B
Authority
CN
China
Prior art keywords
server
client
network connection
connection speed
target server
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.)
Active
Application number
CN201710051854.6A
Other languages
Chinese (zh)
Other versions
CN106713495A (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.)
Beijing Haitai Fangyuan High Technology Co Ltd
Original Assignee
Beijing Haitai Fangyuan High Technology 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 Beijing Haitai Fangyuan High Technology Co Ltd filed Critical Beijing Haitai Fangyuan High Technology Co Ltd
Priority to CN201710051854.6A priority Critical patent/CN106713495B/en
Publication of CN106713495A publication Critical patent/CN106713495A/en
Application granted granted Critical
Publication of CN106713495B publication Critical patent/CN106713495B/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses
    • 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/104Peer-to-peer [P2P] networks
    • 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/52Network services specially adapted for the location of the user terminal

Landscapes

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

Abstract

本发明提供了IP地理位置的上传方法及访问方法、装置及访问系统,涉及通信技术领域,用以利用区块链中客户端与服务器端共同维护的特性,准确的确定发送访问请求的客户端的地理位置,避免了通过数据库确定的客户端的地理位置不准确,导致的访问请求到达目标服务器跳转的时间长、次数多的问题。包括:接收客户端发送的访问请求;根据从第一区块链中获取的客户端已上传的地理位置的信息,确定客户端所处的地理位置,并确定可提供访问服务的服务器与客户端的地理位置之间的距离;若该距离符合预设门限值,则确定目标服务器,并将访问请求转给目标服务器;其中,第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。

The present invention provides an upload method, access method, device and access system of an IP geographic location, relates to the field of communication technology, and is used to accurately determine the address of the client sending the access request by utilizing the characteristics of common maintenance of the client and the server in the block chain Geographical location avoids the problem that the client's geographical location determined by the database is inaccurate, resulting in a long time and many jumps for the access request to reach the target server. Including: receiving the access request sent by the client; determining the geographic location of the client according to the uploaded geographic location information of the client obtained from the first block chain, and determining the server that can provide access services and the client's The distance between the geographical locations; if the distance meets the preset threshold value, then determine the target server, and transfer the access request to the target server; wherein, the first block chain is used to store the data uploaded by each client node in the P2P network information about its geographic location.

Description

IP地理位置的上传方法及访问方法、装置及访问系统Upload method and access method, device and access system of IP geographic location

技术领域technical field

本发明涉及通信技术领域,尤其涉及IP地理位置的上传方法及访问方法、装置及访问系统。The invention relates to the field of communication technology, in particular to an upload method and an access method, device and access system of an IP geographic location.

背景技术Background technique

目前,为提高访问的速度,初始服务器针对接收到的客户端发送的访问请求,通过查找IP地理位置信息数据库中IP地址与该客户端的地理位置的映射关系,确定该客户端的地理位置。根据确定的地理位置,确定为该客户端提供服务的目标服务器。一般情况下,IP地理位置信息数据库是由管理服务器的企业通过客户端访问的历史记录或者跟其他企业购买得到的。At present, in order to improve the speed of access, the initial server determines the geographic location of the client by searching the mapping relationship between the IP address and the geographic location of the client in the IP geographic location information database for the access request received from the client. According to the determined geographic location, a target server that provides services for the client is determined. Generally, the IP geographic location information database is obtained by the enterprise that manages the server through historical records of client access or purchased from other enterprises.

然而,现有的IP地理位置信息数据库是根据客户端的历史记录确定的,因此存在数据库中记录的地理位置覆盖面窄,客户端的IP地址标识不准确,IP地址对应的地理位置的映射关系更新不及时等问题,导致确定的目标服务器不准确,再跳转到下一目标服务器,即跳转时间长且次数多,客户端在访问时容易出现等待与卡顿,访问的效率低。However, the existing IP geographic location information database is determined based on the historical records of the client, so the geographical location recorded in the database has a narrow coverage, the client’s IP address identification is inaccurate, and the mapping relationship of the geographic location corresponding to the IP address is not updated in time And other problems, resulting in inaccurate target server, and then jump to the next target server, that is, the jump time is long and the number of times, the client is prone to wait and freeze when accessing, and the access efficiency is low.

综上所述,由于自建或者购买数据库存在的上述问题,导致客户端发起访问请求到达目标服务器,跳转时间长且次数多,客户端在访问时容易出现等待与卡顿,访问的效率低。To sum up, due to the above-mentioned problems in the self-built or purchased database, the client initiates an access request to reach the target server, the jump time is long and the number of times is high, the client is prone to wait and freeze when accessing, and the access efficiency is low .

发明内容Contents of the invention

本发明实施例提供了IP地理位置的上传方法及装置,客户端通过将所处的地理位置上传到第一区块链中,用以解决现有的数据库中IP地理位置信息覆盖面窄,映射关系更新不及时的问题。The embodiment of the present invention provides a method and device for uploading IP geographic location. The client uploads the geographic location to the first block chain to solve the problem of narrow coverage of IP geographic location information in the existing database and the mapping relationship. The problem of not updating in time.

本发明实施例提供的一种IP地理位置的上传方法,该方法包括:A method for uploading an IP geographic location provided by an embodiment of the present invention, the method comprising:

客户端判断从第一区块链中获取的所述客户端主动上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;The client judges whether the actual geographical location of the client is stored in the geographical location information actively uploaded by the client obtained from the first block chain;

若没有,则所述客户端在P2P网络中上传所述客户端所处的地理位置;If not, the client uploads the geographic location of the client in the P2P network;

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

本发明实施例提供了IP地理位置的访问方法及装置,避免了通过数据库确定的客户端的地理位置不准确,导致的访问请求到达目标服务器跳转的时间长、次数多的问题,减少了访问时长,提升了访问效率,减少访问过程中等待时间与卡顿次数。The embodiment of the present invention provides an IP geographic location access method and device, which avoids the problem that the client's geographic location determined by the database is inaccurate, resulting in a long time and many times for the access request to reach the target server, and reduces the access time. , which improves the access efficiency and reduces the waiting time and the number of freezes during the access process.

本发明实施例提供的一种IP地理位置的访问方法,该方法包括:A method for accessing an IP geographic location provided by an embodiment of the present invention, the method comprising:

初始服务器接收客户端发送的访问请求;The initial server receives the access request sent by the client;

所述初始服务器根据从第一区块链中获取的所述客户端主动上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;The initial server determines the geographic location of the client according to the geographic location information actively uploaded by the client obtained from the first block chain, and determines the geographic location of the server that can provide access services and determines The distance of the geographic location of the client;

所述初始服务器若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;If the determined distance of the initial server meets the preset threshold value, then determine the server that can provide the access service as the target server, and transfer the received access request to the determined target server;

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

较佳地,确定所述可提供访问服务的服务器为目标服务器,包括:Preferably, determining the server that can provide the access service as the target server includes:

确定距离所述客户端的地理位置最近的服务器为目标服务器。Determining the server closest to the geographic location of the client as the target server.

较佳地,确定所述可提供访问服务的服务器为目标服务器,包括:Preferably, determining the server that can provide the access service as the target server includes:

若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,并确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。If there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined to be the target server, wherein, The second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

较佳地,确定网络连接速度最快的服务器为目标服务器,包括:Preferably, the server with the fastest network connection speed is determined to be the target server, including:

根据所述符合预设门限值的服务器对应的预设权重,对所述符合预设门限值的服务器的网络连接速度进行加权求平均,得到所述服务器对应的加权后的网络连接速度;Perform weighted averaging on the network connection speeds of the servers meeting the preset threshold according to the preset weights corresponding to the servers meeting the preset threshold to obtain the weighted network connection speed corresponding to the server;

确定加权后的网络连接速度最快的服务器为目标服务器。Determine the server with the fastest weighted network connection speed as the target server.

本发明实施例提供的一种IP地理位置的上传方法,该方法包括:A method for uploading an IP geographic location provided by an embodiment of the present invention, the method comprising:

目标服务器接收初始服务器发送的访问请求;The target server receives the access request sent by the initial server;

所述目标服务器根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;The target server generates the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of access response information;

所述目标服务器将生成的所述目标服务器的网络连接速度上传到用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度的第二区块链中。The target server uploads the generated network connection speed of the target server to the second block chain for storing the network connection speed of the server uploaded by each server node in the P2P network.

较佳地,将生成的所述目标服务器的网络连接速度上传到用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度的第二区块链中,包括:Preferably, the generated network connection speed of the target server is uploaded to the second blockchain for storing the network connection speed of the server uploaded by each server node in the P2P network, including:

若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server digital signature of velocity;

将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record.

本发明实施例提供的一种IP地理位置的上传装置,该装置包括:A device for uploading an IP geographic location provided by an embodiment of the present invention, the device comprising:

判断模块,用于判断从第一区块链中获取的客户端主动上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;A judging module, configured to judge whether the actual geographic location of the client is stored in the geographical location information actively uploaded by the client obtained from the first block chain;

上传模块,用于若没有,则所述客户端在P2P网络中上传所述客户端所处的地理位置;Upload module, for if not, then the client uploads the geographic location of the client in the P2P network;

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

本发明实施例提供的一种IP地理位置的访问装置,该装置包括:An IP geographic location access device provided in an embodiment of the present invention, the device includes:

接收模块,用于接收客户端发送的访问请求;The receiving module is used to receive the access request sent by the client;

距离确定模块,用于根据从第一区块链中获取的所述客户端主动上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;A distance determination module, configured to determine the geographic location of the client according to the geographic location information actively uploaded by the client obtained from the first block chain, and determine the geographic location of a server that can provide access services the distance from the determined geographic location of the client;

切换模块,用于若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;A switching module, configured to determine that the server that can provide the access service is the target server if the determined distance meets the preset threshold value, and transfer the received access request to the determined target server;

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

较佳地,确定所述可提供访问服务的服务器为目标服务器,所述切换模块具体用于:Preferably, it is determined that the server that can provide the access service is the target server, and the switching module is specifically used for:

确定距离所述客户端的地理位置最近的服务器为目标服务器。Determining the server closest to the geographic location of the client as the target server.

较佳地,确定所述可提供访问服务的服务器为目标服务器,所述距离确定模块具体用于:Preferably, it is determined that the server that can provide the access service is the target server, and the distance determination module is specifically used for:

若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。If there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined to be the target server. The second blockchain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

较佳地,确定网络连接速度最快的服务器为目标服务器,所述距离确定模块具体用于:Preferably, it is determined that the server with the fastest network connection speed is the target server, and the distance determination module is specifically used for:

根据所述符合预设门限值的服务器对应的预设权重,对所述符合预设门限值的服务器的网络连接速度进行加权求平均,得到所述服务器对应的加权后的网络连接速度;Perform weighted averaging on the network connection speeds of the servers meeting the preset threshold according to the preset weights corresponding to the servers meeting the preset threshold to obtain the weighted network connection speed corresponding to the server;

确定加权后的网络连接速度最快的服务器为目标服务器。Determine the server with the fastest weighted network connection speed as the target server.

本发明实施例提供的一种IP地理位置的上传装置,该装置包括:A device for uploading an IP geographic location provided by an embodiment of the present invention, the device comprising:

接收模块,用于接收初始服务器发送的访问请求;A receiving module, configured to receive the access request sent by the initial server;

确定模块,用于根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成目标服务器的网络连接速度;A determining module, configured to generate the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of information in the access response;

上传模块,用于将生成的所述目标服务器的网络连接速度上传到第二区块链中;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。An upload module, configured to upload the generated network connection speed of the target server to the second block chain; wherein, the second block chain is used to store the network speed of the server uploaded by each server node in the P2P network connection speed.

所述上传模块,具体用于:The upload module is specifically used for:

若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server digital signature of velocity;

将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record.

本发明实施例提供的一种IP地理位置的访问系统,该系统包括:客户端、初始服务器以及目标服务器;An IP geographic location access system provided in an embodiment of the present invention, the system includes: a client, an initial server, and a target server;

其中,所述客户端用于判断从第一区块链中获取的所述客户端主动上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;若没有,则在P2P网络中上传所述客户端所处的地理位置;其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息;Wherein, the client is used to determine whether the actual geographical location of the client is stored in the geographic location information actively uploaded by the client obtained from the first block chain; uploading the geographic location of the client in the P2P network; wherein, the first block chain is used to store the information of the geographic location uploaded by each client node in the P2P network;

所述初始服务器用于根据从第一区块链中获取的所述客户端主动上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;The initial server is used to determine the geographic location of the client according to the geographic location information actively uploaded by the client obtained from the first block chain, and determine the geographic location of a server that can provide access services The distance from the determined geographic location of the client; if the determined distance meets the preset threshold value, then determine that the server that can provide access services is the target server, and forward the received access request to the determined the target server;

所述目标服务器用于接收初始服务器发送的访问请求;根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;将生成的所述目标服务器的网络连接速度上传到第二区块链中;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。The target server is used to receive the access request sent by the initial server; generate the network connection speed of the target server according to the time of receiving the access request, the time of the end of the access, and the amount of access response information; The network connection speed of the target server is uploaded to the second block chain; wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

本发明实施例中,通过引入区块链技术,即通过去中心化网络的存储方式,对客户端对应的地理位置进行存储更新,从而实现对存储客户端对应的地理位置的数据库的实时更新,避免了现有技术中自建或购买数据库存在的问题,也就避免了客户端发起访问请求到达目标服务器的时间长,跳转次数多的问题,减少了访问时长。In the embodiment of the present invention, by introducing blockchain technology, that is, through the storage mode of the decentralized network, the geographical location corresponding to the client is stored and updated, so as to realize the real-time update of the database storing the geographical location corresponding to the client, It avoids the problems of self-built or purchased databases in the prior art, and also avoids the problems of long time for the client to initiate an access request to reach the target server and many jumps, and reduces the access time.

附图说明Description of drawings

图1为本发明实施例一提供的客户端侧的一种IP地理位置的上传方法的流程示意图;FIG. 1 is a schematic flowchart of a method for uploading an IP geographic location on the client side provided in Embodiment 1 of the present invention;

图2为本发明实施例二提供的初始服务器侧的一种IP地理位置的访问方法的流程示意图;FIG. 2 is a schematic flowchart of a method for accessing an IP geographic location on the initial server side according to Embodiment 2 of the present invention;

图3为本发明实施例三提供的目标服务器侧的一种IP地理位置的上传方法的流程示意图;FIG. 3 is a schematic flowchart of a method for uploading an IP geographic location on the target server side according to Embodiment 3 of the present invention;

图4为本发明实施例四提供的客户端侧的一种IP地理位置的上传装置的结构示意图;FIG. 4 is a schematic structural diagram of a device for uploading an IP geographic location on the client side provided in Embodiment 4 of the present invention;

图5为本发明实施例五提供的初始服务器侧的一种IP地理位置的访问装置的结构示意图;FIG. 5 is a schematic structural diagram of an IP geographic location access device on the initial server side provided in Embodiment 5 of the present invention;

图6为本发明实施例六提供的目标服务器侧的一种IP地理位置的上传装置的结构示意图;6 is a schematic structural diagram of an IP geographic location uploading device on the target server side provided in Embodiment 6 of the present invention;

图7为本发明实施例七提供的一种IP地理位置的访问系统的结构示意图。FIG. 7 is a schematic structural diagram of an IP geographic location access system provided by Embodiment 7 of the present invention.

具体实施方式Detailed ways

本发明实施例提供了IP地理位置的上传方法及访问方法、装置及访问系统,用以通过引入区块链技术,即通过去中心化网络的存储方式,对客户端对应的地理位置进行存储更新,从而实现对存储客户端对应的地理位置的数据库的实时更新,避免了现有技术中自建或购买数据库存在的问题,也就避免了客户端发起访问请求到达目标服务器的时间长,跳转次数多的问题,减少了访问时长,提升了访问效率,减少访问过程中等待时间与卡顿次数。The embodiment of the present invention provides an IP geographic location upload method, access method, device, and access system, which are used to store and update the corresponding geographic location of the client by introducing blockchain technology, that is, through the storage method of a decentralized network , so as to realize the real-time update of the database storing the corresponding geographical location of the client, avoiding the problems existing in the self-built or purchased database in the prior art, and also avoiding the long time for the client to initiate an access request to reach the target server, and jumping The problem of frequent visits reduces the length of visits, improves visit efficiency, and reduces waiting time and the number of freezes during visits.

下面将结合本发明实施例中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

实施例一:Embodiment one:

参见图1,在客户端侧,本发明实施例一提供了一种IP地理位置的上传方法,该方法包括:Referring to Fig. 1, on the client side, Embodiment 1 of the present invention provides a method for uploading an IP geographic location, the method comprising:

S101、判断从第一区块链中获取的所述客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;S101. Determine whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain;

S102、若没有,则所述客户端在P2P网络中上传所述客户端所处的地理位置。S102. If not, the client uploads the geographic location of the client in the P2P network.

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

步骤S102中包括两种情况,新加入的客户端的情况,与所处的地理位置发生变化的客户端的情况。其中,新加入的客户端的情况,即为所述第一区块链中未记录所述客户端对应的地理位置;所处的地理位置发生变化的客户端的情况,即为所述客户端实际所处的地理位置与第一区块链中获取的所述客户端已上传的地理位置不同。Step S102 includes two cases, the case of a newly added client, and the case of a client whose geographic location has changed. Wherein, the case of a newly added client means that the geographical location corresponding to the client is not recorded in the first block chain; the case of a client whose geographical location changes means that the client is actually The geographic location at is different from the uploaded geographic location of the client obtained in the first block chain.

针对上述两种情况,均由客户端以广播的形式上传该客户端当前所处的地理位置信息。其中,所述地理位置信息包括,通过客户端私钥签名后的地理位置以及客户端证书,其中所述客户端证书中包括客户端公钥。For the above two cases, the client uploads the current geographic location information of the client in the form of broadcast. Wherein, the geographic location information includes the geographic location signed by the client private key and the client certificate, wherein the client certificate includes the client public key.

实施例二:Embodiment two:

参见图2,在初始服务器侧,本发明实施例二提供了一种IP地理位置的访问方法,该方法包括:Referring to Fig. 2, on the initial server side, Embodiment 2 of the present invention provides a method for accessing an IP geographic location, the method comprising:

S201、接收客户端发送的访问请求;S201. Receive an access request sent by the client;

S202、根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;S202. Determine the geographic location of the client according to the uploaded geographic location information of the client obtained from the first block chain, and determine the geographic location of the server that can provide access services and the determined geographic location. The distance of the geographic location of the client;

S203、若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器。S203. If the determined distance meets the preset threshold value, determine that the server that can provide the access service is the target server, and forward the received access request to the determined target server.

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

在步骤S202之前,该方法还包括:Before step S202, the method also includes:

确定可为所述客户端可提供访问服务的访问服务器;Determining an access server that can provide access services to the client;

此时,步骤S202具体包括:At this point, step S202 specifically includes:

根据所述客户端所处的地理位置以及确定的访问服务器的地理位置,确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离。According to the geographic location of the client and the determined geographic location of the access server, determine the distance between the geographic location of the server that can provide the access service and the determined geographic location of the client.

其中,步骤S203具体包括:Wherein, step S203 specifically includes:

若存在多个与所述客户端所处的距离符合预设门限值的服务器,则确定距离所述客户端的地理位置最近的服务器为目标服务器;If there are multiple servers whose distance from the client meets the preset threshold value, then determine that the server closest to the geographic location of the client is the target server;

或者,若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,并确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。Or, if there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined as the target server, Wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

由于第二区块链中包括有多个存储有所述可提供访问服务的服务器的相关信息的区块,因此,步骤S203中确定所述可提供访问服务的服务器为目标服务器具体包括:Since the second block chain includes a plurality of blocks storing the relevant information of the server that can provide the access service, therefore, in step S203, determining that the server that can provide the access service is the target server specifically includes:

根据每一区块中存储的所述符合预设门限值的服务器对应的预设权重,利用公式一,对每一区块中存储的符合预设门限值的服务器的网络连接速度进行加权求平均计算,得到所述服务器的加权后的网络连接速度;According to the preset weight corresponding to the server meeting the preset threshold value stored in each block, use formula 1 to weight the network connection speed of the server meeting the preset threshold value stored in each block Calculate the average to obtain the weighted network connection speed of the server;

其中,T[n]为第n台加权后的服务器的连接速度;m为第二区块链中存储的第n台服务器相关信息的区块的个数;R[i]为第i个区块中存储的第n台服务器的连接速度;W[i]为第i个区块中存储的第n台服务器的连接速度对应的权重;i为正整数。Among them, T[n] is the connection speed of the n-th weighted server; m is the number of blocks of information related to the n-th server stored in the second blockchain; R[i] is the i-th block The connection speed of the nth server stored in the block; W[i] is the weight corresponding to the connection speed of the nth server stored in the ith block; i is a positive integer.

根据所述服务器的加权后的网络连接速度,确定加权后的网络连接速度最快的服务器为目标服务器。According to the weighted network connection speed of the server, the server with the fastest weighted network connection speed is determined as the target server.

实施例三:Embodiment three:

参见图3,在目标服务器侧,本发明实施例三提供了一种IP地理位置的上传方法,该方法包括:Referring to Fig. 3, on the target server side, Embodiment 3 of the present invention provides a method for uploading an IP geographic location, the method comprising:

S301、接收初始服务器发送的访问请求;S301. Receive an access request sent by the initial server;

S302、根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;S302. Generate the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of access response information;

S303、将生成的所述目标服务器的网络连接速度上传到第二区块链中。S303. Upload the generated network connection speed of the target server to the second blockchain.

其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。Wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

其中,步骤S302具体包括:Wherein, step S302 specifically includes:

将根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,通过公式二,生成所述目标服务器的连接速度;The connection speed of the target server will be generated by formula 2 according to the time when the access request is received, the time when the access ends, and the amount of access response information;

R=V/(T2-T1) 公式二R=V/(T2-T1) Formula 2

其中,R为服务器的连接速度;V为访问应答信息量的大小,单位为字节;T2为访问结束的时间;T1为接收到所述访问请求的时间。Wherein, R is the connection speed of the server; V is the size of the access response information in bytes; T2 is the time when the access ends; T1 is the time when the access request is received.

具体地,在步骤S302和步骤S303之间,该方法还包括:Specifically, between step S302 and step S303, the method further includes:

若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server A digital signature of the speed; wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network;

步骤S303具体包括:Step S303 specifically includes:

将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record.

实施例四:Embodiment four:

参见图4,本发明实施例四提供了一种IP地理位置的上传装置,该装置包括:Referring to Fig. 4, Embodiment 4 of the present invention provides an IP geographic location uploading device, which includes:

判断模块401,用于判断从第一区块链中获取的客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;A judging module 401, configured to judge whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain;

上传模块402,用于若没有,则所述客户端在所述P2P网络中上传所述客户端所处的地理位置。The uploading module 402 is configured to upload the geographic location of the client in the P2P network if not available.

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

具体地,本发明实施例中所述判断模块401和所述上传模块402均可由处理器实现。Specifically, both the judging module 401 and the uploading module 402 in the embodiment of the present invention can be implemented by a processor.

具体地,所述上传装置可以为客户端或者用户设备或者用户节点。Specifically, the uploading means may be a client or a user equipment or a user node.

实施例五:Embodiment five:

参见图5,本发明实施例五提供了一种IP地理位置的访问装置,该装置包括:Referring to Fig. 5, Embodiment 5 of the present invention provides an IP geographic location access device, which includes:

接收模块501,用于接收客户端发送的访问请求;A receiving module 501, configured to receive an access request sent by a client;

距离确定模块502,用于根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;The distance determining module 502 is configured to determine the geographic location of the client and determine the geographic location of the server that can provide the access service according to the uploaded geographic location information of the client obtained from the first block chain The distance between the location and the determined geographic location of the client;

切换模块503,用于若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器。The switching module 503 is configured to determine that the server that can provide the access service is the target server if the determined distance meets the preset threshold value, and forward the received access request to the determined target server.

其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network.

其中,确定所述可提供访问服务的服务器为目标服务器,所述切换模块503具体用于:Wherein, it is determined that the server that can provide the access service is the target server, and the switching module 503 is specifically used for:

确定距离所述客户端的地理位置最近的服务器为目标服务器。Determining the server closest to the geographic location of the client as the target server.

其中,确定所述可提供访问服务的服务器为目标服务器,所述距离确定模块502具体用于:Wherein, it is determined that the server that can provide the access service is the target server, and the distance determining module 502 is specifically used for:

若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。If there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined to be the target server. The second blockchain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

其中,确定网络连接速度最快的服务器为目标服务器,所述距离确定模块502具体用于:Wherein, it is determined that the server with the fastest network connection speed is the target server, and the distance determining module 502 is specifically used for:

根据所述符合预设门限值的服务器对应的预设权重,对所述符合预设门限值的服务器的网络连接速度进行加权求平均,得到所述服务器对应的加权后的网络连接速度;Perform weighted averaging on the network connection speeds of the servers meeting the preset threshold according to the preset weights corresponding to the servers meeting the preset threshold to obtain the weighted network connection speed corresponding to the server;

确定加权后的网络连接速度最快的服务器为目标服务器。Determine the server with the fastest weighted network connection speed as the target server.

具体地,本发明实施例中所述接收模块501、距离确定模块502以及切换模块503均可由处理器实现。Specifically, the receiving module 501, the distance determining module 502, and the switching module 503 in the embodiment of the present invention can all be implemented by a processor.

具体地,所述IP地理位置的访问装置可以为初始服务器。Specifically, the device for accessing the IP geographic location may be an initial server.

实施例六:Embodiment six:

参见图6,本发明实施例六提供了一种IP地理位置的上传装置,该装置包括:Referring to FIG. 6, Embodiment 6 of the present invention provides an IP geographic location uploading device, which includes:

接收模块601,用于接收初始服务器发送的访问请求;A receiving module 601, configured to receive an access request sent by an initial server;

确定模块602,用于根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;A determination module 602, configured to generate the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of access response information;

上传模块603,用于将生成的目标服务器的网络连接速度上传到第二区块链中。Upload module 603, configured to upload the generated network connection speed of the target server to the second block chain.

其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。Wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.

具体地,所述上传模块603,具体用于:Specifically, the upload module 603 is specifically used for:

若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server A digital signature of the speed; wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network;

将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record.

具体地,本发明实施例中所述接收模块601、确定模块602以及上传模块603均可由处理器实现。Specifically, the receiving module 601, the determining module 602, and the uploading module 603 in the embodiment of the present invention can all be implemented by a processor.

具体地,所述上传装置可以为目标服务器。Specifically, the uploading device may be a target server.

实施例七:Embodiment seven:

参见图7,本发明实施例七提供了一种IP地理位置的访问系统,该系统包括:客户端701、初始服务器702以及目标服务器703;Referring to FIG. 7 , Embodiment 7 of the present invention provides an IP geographic location access system, which includes: a client 701, an initial server 702, and a target server 703;

其中,所述客户端701用于判断从第一区块链中获取的所述客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;若没有,则在P2P网络中上传所述客户端所处的地理位置;其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息;Wherein, the client 701 is used to determine whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain; if not, then Upload the geographic location of the client in the P2P network; wherein, the first block chain is used to store the information of the geographic location uploaded by each client node in the P2P network;

所述初始服务器702用于接收客户端发送的访问请求;根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;The initial server 702 is used to receive the access request sent by the client; determine the geographic location of the client according to the uploaded geographic location information of the client obtained from the first block chain, and determine The distance between the geographic location of the server that can provide the access service and the determined geographic location of the client; if the determined distance meets the preset threshold value, then determine that the server that can provide the access service is the target server, and Transfer the received access request to the determined target server;

所述目标服务器703用于接收初始服务器发送的访问请求;根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;将生成的所述目标服务器的网络连接速度上传到用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度的第二区块链中。The target server 703 is used to receive the access request sent by the initial server; generate the network connection speed of the target server according to the time of receiving the access request, the time of the end of the visit, and the amount of access response information; the generated The network connection speed of the target server is uploaded to the second blockchain for storing the network connection speed of the server uploaded by each server node in the P2P network.

综上所述,本发明实施例提供了IP地理位置的上传及访问方法、装置及访问系统,用以通过引入区块链技术,即通过去中心化网络的存储方式,对客户端对应的地理位置进行存储更新,从而实现对存储客户端对应的地理位置的数据库的实时更新,避免了现有技术中自建或购买数据库存在的问题,也就避免了客户端发起访问请求到达目标服务器的时间长,跳转次数多的问题,减少了访问时长。To sum up, the embodiment of the present invention provides an IP geographic location upload and access method, device, and access system, which are used to update the geographical location corresponding to the client through the introduction of blockchain technology, that is, through the storage method of the decentralized network. The location is stored and updated, so as to realize the real-time update of the database that stores the corresponding geographic location of the client, avoiding the problems of self-built or purchased databases in the prior art, and also avoiding the time for the client to initiate an access request to reach the target server The problem of long and high number of jumps reduces the visit time.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (15)

1.一种IP地理位置的上传方法,其特征在于,该方法包括:1. A method for uploading an IP geographic location, characterized in that the method comprises: 客户端判断从第一区块链中获取的所述客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;The client judges whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain; 若没有,则所述客户端在P2P网络中上传所述客户端所处的地理位置;If not, the client uploads the geographic location of the client in the P2P network; 其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network. 2.一种IP地理位置的访问方法,其特征在于,该方法包括:2. A method for accessing an IP geographic location, characterized in that the method comprises: 初始服务器接收客户端发送的访问请求;The initial server receives the access request sent by the client; 所述初始服务器根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;The initial server determines the geographic location of the client according to the uploaded geographic location information of the client obtained from the first block chain, and determines the geographic location of the server that can provide access services and determines The distance of the geographic location of the client; 所述初始服务器若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;If the determined distance of the initial server meets the preset threshold value, then determine the server that can provide the access service as the target server, and transfer the received access request to the determined target server; 其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network. 3.根据权利要求2所述的方法,其特征在于,确定所述可提供访问服务的服务器为目标服务器,包括:3. The method according to claim 2, wherein determining the server that can provide the access service as the target server comprises: 确定距离所述客户端的地理位置最近的服务器为目标服务器。Determining the server closest to the geographic location of the client as the target server. 4.根据权利要求2所述的方法,其特征在于,确定所述可提供访问服务的服务器为目标服务器,包括:4. The method according to claim 2, wherein determining the server that can provide the access service as the target server comprises: 若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,并确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。If there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined to be the target server, wherein, The second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network. 5.根据权利要求4所述的方法,其特征在于,确定网络连接速度最快的服务器为目标服务器,包括:5. The method according to claim 4, wherein determining that the server with the fastest network connection speed is the target server comprises: 根据所述符合预设门限值的服务器对应的预设权重,对所述符合预设门限值的服务器的网络连接速度进行加权求平均,得到所述服务器对应的加权后的网络连接速度;Perform weighted averaging on the network connection speeds of the servers meeting the preset threshold according to the preset weights corresponding to the servers meeting the preset threshold to obtain the weighted network connection speed corresponding to the server; 确定加权后的网络连接速度最快的服务器为目标服务器。Determine the server with the fastest weighted network connection speed as the target server. 6.一种IP地理位置的上传方法,其特征在于,该方法包括:6. A method for uploading an IP geographic location, characterized in that the method comprises: 目标服务器接收初始服务器发送的访问请求;The target server receives the access request sent by the initial server; 所述目标服务器根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;The target server generates the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of access response information; 所述目标服务器将生成的所述目标服务器的网络连接速度上传到第二区块链中,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。The target server uploads the generated network connection speed of the target server to the second block chain, wherein the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network. speed. 7.根据权利要求6所述的方法,其特征在于,将生成的所述目标服务器的网络连接速度上传到第二区块链中,包括:7. The method according to claim 6, wherein uploading the generated network connection speed of the target server to the second blockchain includes: 若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server digital signature of velocity; 将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record. 8.一种IP地理位置的上传装置,其特征在于,该装置包括:8. A device for uploading an IP geographic location, characterized in that the device comprises: 判断模块,用于判断从第一区块链中获取的客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;A judging module, configured to judge whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain; 上传模块,用于若没有,则所述客户端在P2P网络中上传所述客户端所处的地理位置;Upload module, for if not, then the client uploads the geographic location of the client in the P2P network; 其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network. 9.一种IP地理位置的访问装置,其特征在于,该装置包括:9. An access device for IP geographic location, characterized in that the device comprises: 接收模块,用于接收客户端发送的访问请求;The receiving module is used to receive the access request sent by the client; 距离确定模块,用于根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;A distance determination module, configured to determine the geographic location of the client according to the uploaded geographic location information of the client obtained from the first block chain, and determine the geographic location of a server that can provide access services the distance from the determined geographic location of the client; 切换模块,用于若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;A switching module, configured to determine that the server that can provide the access service is the target server if the determined distance meets the preset threshold value, and transfer the received access request to the determined target server; 其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息。Wherein, the first block chain is used to store the geographical location information uploaded by each client node in the P2P network. 10.根据权利要求9所述的装置,其特征在于,确定所述可提供访问服务的服务器为目标服务器,所述切换模块具体用于:10. The device according to claim 9, wherein the server that can provide the access service is determined to be the target server, and the switching module is specifically used for: 确定距离所述客户端的地理位置最近的服务器为目标服务器。Determining the server closest to the geographic location of the client as the target server. 11.根据权利要求9所述的装置,其特征在于,确定所述可提供访问服务的服务器为目标服务器,所述距离确定模块具体用于:11. The device according to claim 9, wherein the server that can provide the access service is determined to be the target server, and the distance determining module is specifically used for: 若存在多个符合预设门限值的服务器,则从第二区块链中获取符合预设门限值的服务器的网络连接速度,确定网络连接速度最快的服务器为目标服务器,其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。If there are multiple servers that meet the preset threshold value, the network connection speed of the server that meets the preset threshold value is obtained from the second block chain, and the server with the fastest network connection speed is determined to be the target server. The second blockchain is used to store the network connection speed of the server uploaded by each server node in the P2P network. 12.根据权利要求11所述的装置,其特征在于,确定网络连接速度最快的服务器为目标服务器,所述距离确定模块具体用于:12. The device according to claim 11, wherein the server with the fastest network connection speed is determined to be the target server, and the distance determining module is specifically used for: 根据所述符合预设门限值的服务器对应的预设权重,对所述符合预设门限值的服务器的网络连接速度进行加权求平均,得到所述服务器对应的加权后的网络连接速度;Perform weighted averaging on the network connection speeds of the servers meeting the preset threshold according to the preset weights corresponding to the servers meeting the preset threshold to obtain the weighted network connection speed corresponding to the server; 确定加权后的网络连接速度最快的服务器为目标服务器。Determine the server with the fastest weighted network connection speed as the target server. 13.一种IP地理位置的上传装置,其特征在于,该装置包括:13. A device for uploading an IP geographic location, characterized in that the device comprises: 接收模块,用于接收初始服务器发送的访问请求;A receiving module, configured to receive the access request sent by the initial server; 确定模块,用于根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成目标服务器的网络连接速度;A determining module, configured to generate the network connection speed of the target server according to the time when the access request is received, the time when the access ends, and the amount of information in the access response; 上传模块,用于将生成的所述目标服务器的网络连接速度上传到第二区块链中;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。An upload module, configured to upload the generated network connection speed of the target server to the second block chain; wherein, the second block chain is used to store the network speed of the server uploaded by each server node in the P2P network connection speed. 14.根据权利要求13所述的装置,其特征在于,所述上传模块,具体用于:14. The device according to claim 13, wherein the upload module is specifically used for: 若生成的网络连接速度与第二区块链中所述目标服务器的网络连接速度不同,则根据所述目标服务器的私钥对生成的网络连接速度进行签名处理,得到所述目标服务器的网络连接速度的数字签名;If the generated network connection speed is different from the network connection speed of the target server in the second block chain, the generated network connection speed is signed according to the private key of the target server to obtain the network connection speed of the target server digital signature of velocity; 将生成的所述目标服务器的网络连接速度及其数字签名作为记录上传到所述第二区块链中。Upload the generated network connection speed and digital signature of the target server to the second block chain as a record. 15.一种IP地理位置的访问系统,其特征在于,该系统包括:客户端、初始服务器以及目标服务器;15. An access system of an IP geographic location, characterized in that the system comprises: a client, an initial server and a target server; 其中,所述客户端用于判断从第一区块链中获取的所述客户端已上传的地理位置的信息中,是否存储有所述客户端实际所处的地理位置;若没有,则在P2P网络中上传所述客户端所处的地理位置;其中,所述第一区块链用于存储P2P网络中每一客户端节点上传的其所处的地理位置的信息;Wherein, the client is used to determine whether the actual geographical location of the client is stored in the information of the geographical location uploaded by the client obtained from the first block chain; if not, then in uploading the geographic location of the client in the P2P network; wherein, the first block chain is used to store the information of the geographic location uploaded by each client node in the P2P network; 所述初始服务器用于接收客户端发送的访问请求;根据从第一区块链中获取的所述客户端已上传的地理位置的信息,确定所述客户端所处的地理位置,并确定可提供访问服务的服务器的地理位置与确定的所述客户端所处的地理位置的距离;若确定的距离符合预设门限值,则确定所述可提供访问服务的服务器为目标服务器,并将接收到的访问请求转给确定的目标服务器;The initial server is used to receive the access request sent by the client; determine the geographical location of the client according to the information of the geographical location uploaded by the client obtained from the first block chain, and determine the available The distance between the geographic location of the server providing the access service and the determined geographic location of the client; if the determined distance meets the preset threshold value, it is determined that the server that can provide the access service is the target server, and The received access request is forwarded to the determined target server; 所述目标服务器用于接收初始服务器发送的访问请求;根据接收到所述访问请求的时间、访问结束的时间以及访问应答信息量的大小,生成所述目标服务器的网络连接速度;将生成的所述目标服务器的网络连接速度上传到第二区块链中;其中,所述第二区块链用于存储P2P网络中每一服务器节点上传的该服务器的网络连接速度。The target server is used to receive the access request sent by the initial server; generate the network connection speed of the target server according to the time of receiving the access request, the time of the end of the access, and the amount of access response information; The network connection speed of the target server is uploaded to the second block chain; wherein, the second block chain is used to store the network connection speed of the server uploaded by each server node in the P2P network.
CN201710051854.6A 2017-01-20 2017-01-20 The method for uploading and access method in IP geographical position, device and access system Active CN106713495B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710051854.6A CN106713495B (en) 2017-01-20 2017-01-20 The method for uploading and access method in IP geographical position, device and access system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710051854.6A CN106713495B (en) 2017-01-20 2017-01-20 The method for uploading and access method in IP geographical position, device and access system

Publications (2)

Publication Number Publication Date
CN106713495A CN106713495A (en) 2017-05-24
CN106713495B true CN106713495B (en) 2018-04-06

Family

ID=58909552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710051854.6A Active CN106713495B (en) 2017-01-20 2017-01-20 The method for uploading and access method in IP geographical position, device and access system

Country Status (1)

Country Link
CN (1) CN106713495B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109756530B (en) * 2017-11-02 2022-02-25 北京金山安全软件有限公司 Target application server and method and device for determining geographic position information
CN109040337B (en) * 2018-07-19 2021-06-04 网宿科技股份有限公司 Information query method, edge server and information query system
CN108833610B (en) * 2018-07-19 2021-08-31 网宿科技股份有限公司 An information update method, device and system
CN109308410A (en) * 2018-10-16 2019-02-05 翟红鹰 Obtain method, system and the computer readable storage medium of block chain data
CN110032581A (en) * 2019-01-18 2019-07-19 阿里巴巴集团控股有限公司 A kind of service scripts storage method and device based on block chain
CN110933160A (en) * 2019-11-27 2020-03-27 北京字节跳动网络技术有限公司 Data access method, server, terminal and storage medium
CN111083243B (en) * 2019-12-31 2022-07-12 北京奇艺世纪科技有限公司 File uploading method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667509A (en) * 2009-10-08 2012-09-12 霍乐网络有限公司 System and method for providing faster and more efficient data communication
CN104735164A (en) * 2015-04-10 2015-06-24 网易(杭州)网络有限公司 Method and device for saving file information
CN104735616A (en) * 2015-02-13 2015-06-24 北京集奥聚合科技有限公司 Method and system for sending information on basis of geographic position
CN106095975A (en) * 2016-06-20 2016-11-09 罗东涛 A kind of Quick Response Code based on electronic chart generates system and two-dimensional code generation method thereof
CN106295401A (en) * 2016-08-13 2017-01-04 深圳市樊溪电子有限公司 A kind of read-only secure file storage system and method for block chain

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582062B (en) * 2008-05-12 2013-04-03 深圳市莱科电子技术有限公司 Photo management system based on position information
CN101841553B (en) * 2009-03-17 2014-03-12 日电(中国)有限公司 Method, user node and server for requesting location information of resources on network
CN102065065A (en) * 2009-11-17 2011-05-18 财团法人工业技术研究院 Vector data transmission system and method based on sensing component assisted positioning technology
US9569771B2 (en) * 2011-04-29 2017-02-14 Stephen Lesavich Method and system for storage and retrieval of blockchain blocks using galois fields
CN105933945B (en) * 2016-04-01 2019-05-24 西安交通大学 The data of P2P sharing mechanism are supported to download Route Design Method in D2D network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667509A (en) * 2009-10-08 2012-09-12 霍乐网络有限公司 System and method for providing faster and more efficient data communication
CN104735616A (en) * 2015-02-13 2015-06-24 北京集奥聚合科技有限公司 Method and system for sending information on basis of geographic position
CN104735164A (en) * 2015-04-10 2015-06-24 网易(杭州)网络有限公司 Method and device for saving file information
CN106095975A (en) * 2016-06-20 2016-11-09 罗东涛 A kind of Quick Response Code based on electronic chart generates system and two-dimensional code generation method thereof
CN106295401A (en) * 2016-08-13 2017-01-04 深圳市樊溪电子有限公司 A kind of read-only secure file storage system and method for block chain

Also Published As

Publication number Publication date
CN106713495A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106713495B (en) The method for uploading and access method in IP geographical position, device and access system
US11922366B2 (en) System and method for dynamic pairing function optimization
CN102263825B (en) Cloud-position-based hybrid cloud storage system data transmission method
US10231102B2 (en) Techniques for mobility-aware dynamic service placement in mobile clouds
US9285232B2 (en) Determining a patrol path
CN111352577B (en) Object storage method and device
CN107819829A (en) Access method, system, block chain node device and the user terminal of block chain
CN109995866B (en) Distributed file verification method and device, computer device and storage medium
US9641598B1 (en) Contextually unique identifier generation service
WO2017181587A1 (en) Method and electronic equipment for managing nodes in cdn
CN110780912B (en) Hierarchical spanning tree software patch with segment support
CN110050439A (en) The service contribution degree computing system and method for the network node of dispersion
US20140188801A1 (en) Method and system for intelligent load balancing
US9560127B2 (en) Systems, methods and algorithms for logical movement of data objects
CN109522462B (en) Cloud query method, device, equipment and storage medium based on block chain
US9792339B2 (en) Automatic content replication
CN110402567B (en) Centrality-Based Caching in Information-Centric Networks
US10129358B2 (en) Partitioned serialized caching and delivery of large files
CN104917800B (en) Establish the method and device of the redundancy link for virtual machine
JP7305990B2 (en) Transfer program, transfer method, and information processing device
US20210026808A1 (en) Distributed file cache
CN110601978A (en) Flow distribution control method and device
CN116074323B (en) Edge computing node selection method, device, computer equipment and medium
CN115567591A (en) Content resource distribution method, content distribution network, cluster and medium
CN113301126B (en) Edge computing method suitable for heterogeneous networking gateway

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No. 611, 6th Floor, No. 9 Shangdi 9th Street, Haidian District, Beijing 100085

Patentee after: BEIJING HAITAI FANGYUAN HIGH TECHNOLOGY Co.,Ltd.

Country or region after: China

Address before: 100094 Beijing Haidian District, North East Wangxi Road 8 Zhongguancun Software Park 9 Building International Software Building E, 1st and 2nd floors

Patentee before: BEIJING HAITAI FANGYUAN HIGH TECHNOLOGY Co.,Ltd.

Country or region before: China