WO2020011012A1 - Computing resource searching method and system for p2p network - Google Patents

Computing resource searching method and system for p2p network Download PDF

Info

Publication number
WO2020011012A1
WO2020011012A1 PCT/CN2019/092682 CN2019092682W WO2020011012A1 WO 2020011012 A1 WO2020011012 A1 WO 2020011012A1 CN 2019092682 W CN2019092682 W CN 2019092682W WO 2020011012 A1 WO2020011012 A1 WO 2020011012A1
Authority
WO
WIPO (PCT)
Prior art keywords
computing
network
computing power
preset
power
Prior art date
Application number
PCT/CN2019/092682
Other languages
French (fr)
Chinese (zh)
Inventor
杨舟
李升林
孙立林
Original Assignee
云图有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 云图有限公司 filed Critical 云图有限公司
Publication of WO2020011012A1 publication Critical patent/WO2020011012A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • 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

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method and system for finding computing resources for a P2P network.
  • the way to find computing resources in a P2P network is a computing platform using computing power or service discovery based on Chord.
  • the former usually requires the application of a centralized service platform, such as BONIC, which requires the same platform.
  • Sign up to use hash power is based on Chord to find the computing power service, forming a ring network through full nodes, and each node must maintain the predecessor node and the successor node at the same time to prevent the entire chain from breaking so that computing resources can be found.
  • a computing platform using a computing power will cause a waste of computing power
  • a method based on Chord to find a computing power service will cause each node to pay a large network overhead in order to maintain a ring network.
  • N is equal to the number of nodes in the ring network).
  • the present application provides a method and system for searching for computing resources for a P2P network, which can effectively reduce the steps of searching for computing resources and improve the searching efficiency of computing resources.
  • the present application provides a computing resource search method for a P2P network.
  • the computing resource search method includes:
  • a corresponding preset computing power is found in the target P2P network based on the RFC7374 protocol, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol in the target P2P network.
  • the computing resource search method further includes:
  • a computing resource corresponding to the computing node is released in a target P2P network.
  • the registering a computing node for providing a computing resource in a target P2P network includes:
  • the obtaining a relay address corresponding to the computing node includes:
  • the computing node correspondingly obtains a relay address.
  • the publishing the computing resources corresponding to the computing node in a target P2P network based on the RFC7374 protocol includes:
  • the computing resource search method further includes:
  • a computing power storage request is sent to a level other than the initial level according to the first preset rule.
  • the sending a computing power storage request to a hierarchy other than the initial hierarchy according to a first preset rule includes:
  • the preset computing power value of the computing node corresponds to the current maximum, minimum, or boundary value of the corresponding spatial position, sending a computing power storage request to the next layer of the initial level and storing the preset computing power In the next level of the initial level;
  • a preset computing power value of the computing node is a unique value in a corresponding spatial position or a boundary value of a layer above the initial level, sending a computing power storage request to a layer above the initial level, and The preset computing power is stored in a layer above the initial level.
  • the searching for the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power includes:
  • a corresponding preset computing power is searched at the spatial position of the initial level.
  • the computing resource search method further includes:
  • a query request is sent to the hierarchy other than the initial hierarchy according to the second preset rule.
  • the sending a query request to a hierarchy other than the initial hierarchy according to a second preset rule includes:
  • the computing resource search method further includes:
  • the required computing power is a boundary value of the spatial position of the initial level, it is determined that a preset computing power corresponding to the required computing power does not exist in the target p2p network, and the search is stopped.
  • the present application provides a computing resource search system for a P2P network.
  • the computing resource search system includes:
  • a computing resource search request receiving module configured to receive a computing resource search request, wherein the computing resource search request includes a required computing power
  • a computing resource search module is configured to find a corresponding preset computing power in a target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is calculated by the computing node based on the RFC7374 protocol at the target Published in P2P networks.
  • the computing resource search system further includes:
  • a computing node registration module configured to register a computing node for providing computing resources in a target P2P network
  • a computing resource issuing module is configured to release a computing resource corresponding to the computing node in a target P2P network based on the RFC7374 protocol.
  • the present application provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor executes the program, the processor for the P2P network is implemented. Steps of a computing resource lookup method.
  • the present application provides a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the method for finding a computing resource for a P2P network.
  • the present application provides a computing resource search method for a P2P network by receiving a computing resource search request, wherein the computing resource search request includes a required computing power; according to the required computing power, Finding the corresponding preset computing power in the target P2P network based on the RFC7374 protocol, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol in the target P2P network, which can effectively reduce the search for computing resources Steps to improve the search efficiency of computing resources, not only can make overall use of computing resources in P2P networks, but also greatly shorten the search cycle of demand side of computing resources in P2P networks, and improve the utilization of computing resources.
  • FIG. 1 is a schematic flowchart of a computing resource search method for a P2P network according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of an example of a ReDiR tree of the present application.
  • FIG. 3 is a schematic diagram of numbering of tree nodes at levels 0-2 in the ReDiR tree of the present application.
  • FIG. 4 is a schematic diagram of the intervals allocated for tree nodes in the ReDiR trees of the level 0 and the level 1 of the present application.
  • FIG. 5 is a schematic flowchart of steps A00 and B00 in a method for finding a computing resource for a P2P network in the present application.
  • FIG. 6 is a schematic flowchart of step A00 in the method for searching for computing resources for a P2P network in this application.
  • FIG. 7 is a schematic flowchart of step A02 in the method for searching for computing resources for a P2P network in the present application.
  • FIG. 8 is a schematic flowchart of step B00 in the method for searching for computing resources for a P2P network in the present application.
  • FIG. 9 is a schematic flowchart of step 200 in a method for finding a computing resource for a P2P network in this application.
  • FIG. 10 is a schematic structural diagram of a computing resource search system for a P2P network according to an embodiment of the present application.
  • FIG. 11 is another schematic structural diagram of a computing resource search system for a P2P network according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • An embodiment of the present application provides a specific implementation manner of a computing resource search method for a P2P network.
  • the computing resource search method for a P2P network specifically includes the following content:
  • Step 100 Receive a computing resource search request, wherein the computing resource search request includes a required computing power.
  • a computing resource search system for a P2P network receives a computing resource search request, wherein the computing resource search request includes a required computing power.
  • the computing resource search system for a P2P network may be embodied as a server of a P2P network, and the hardware composition of the computing resource search system for a P2P network may also include a terminal device.
  • the terminal The device may have a display function.
  • the terminal device may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, and the like.
  • the smart wearable device may include smart glasses, smart watches, smart bracelets, and the like.
  • the first terminal and the second terminal are both one of the foregoing terminal types.
  • the server may communicate with the terminal device.
  • the server and the terminal device may communicate using any suitable network protocol, including a network protocol that has not been developed at the filing date of this application.
  • the network protocol may include, for example, TCP / IP protocol, UDP / IP protocol, HTTP protocol, HTTPS protocol, and the like.
  • the network protocol may also include, for example, an RPC protocol (Remote Procedure Call Protocol), a REST protocol (Representational State Transfer Protocol), etc. used on the above protocol.
  • the required computing power is the computing power required by the computing power service demander, and the required computing power is added to the computing resource search request, and the server corresponding to the target P2P network (that is, the A computing resource search system of a P2P network) sends the computing resource search request, where the computing power is a quantified expression of the computing resource.
  • Step 200 Find the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is published by the computing node in the target P2P network based on the RFC7374 protocol. To get.
  • a computing resource search system for a P2P network receives a computing resource search request sent by the computing power service demander, and reads the computing resource search request to obtain a required computing power corresponding to the computing resource search request. Then according to the required computing power, based on the RFC7374 protocol, find the corresponding preset computing power in the target P2P network.
  • the preset computing power is a computing resource that can be provided by a computing node in the target P2P network, and the preset computing power is the corresponding computing node in the target P2P network based on the RFC7374 protocol. Published in.
  • the RFC7374 protocol is specifically one of RFC (Request For Comments) documents recording basic Internet communication protocols and Internet standards, wherein the RFC document is a series of files arranged by numbers, and the The document gathers information about the Internet, as well as software files for UNIX and the Internet community.
  • the basic Internet communication protocols are specified in RFC documents.
  • the RFC file also adds a number of topics to the standard, such as the Internet's newly developed protocols and all the records in development.
  • the published content of the RFC7374 protocol document is shown in Table 1.
  • the RFC7374 document discloses a service discovery application (Reload) (Service Relocation) for locating and discovering resources (Resource and Location (Reload)), where the resource positioning and discovery (reload) RFC 6940 document does not include
  • the universal service discovery mechanism is defined as part of the basic protocol. Therefore, in order to solve this problem, the RFC7374 document defines how to apply the recursive distributed rendezvous ReDiR (Recursive Distributed Rendezvous) service discovery mechanism in the RELOAD overlay network to provide universal service discovery.
  • a mechanism in which the ReDiR service is embodied in the form of a tree structure, that is, a ReDiR tree.
  • the ReDiR tree is a tree structure of a node that provides a specific service.
  • the node uses the ELOAD storage and acquisition request to embed the ReDiR tree into the RELOAD overlay network.
  • Each tree node in the ReDiR tree is at a certain level in the tree.
  • the root node of the ReDiR tree is at level 0 of the ReDiR tree.
  • the children of the root node are at level 1.
  • the children of a tree node at level 1 are at level 2, and so on.
  • ReDiR tree branch coefficient b The most space of each level in the ReDiR tree is the b ⁇ level tree node.
  • Each tree node in the ReDiR tree is uniquely identified by a pair (lvl, j), where lvl is a level in the ReDiR tree and j is the position of the tree node (from the left) at that level.
  • each tree node in the ReDiR tree is displayed as two horizontal lines, with a vertical line ('
  • the horizontal lines represent the two intervals each node is responsible for.
  • nodes At level 0, only one node (0,0) is responsible for the two intervals, which together cover the entire identifier space of the reload overlay instance.
  • level 1 there are two nodes (1,0) and (1,1), each of which is responsible for half of the identifier space of the RELOAD overlay network.
  • Level 3 there are 8 nodes, each of which is responsible for 1/8 of the identifier space.
  • Figure 3 shows how to number tree nodes at levels 0-2 in the ReDiR tree
  • Figure 4 shows how to In the ReDiR trees of level 0 and level 1, the tree nodes are allocated intervals. For example, a single tree node (0,0) at level 0 is divided into two intervals, each interval covering half of the identifier space. These two intervals are [0,7] and [8,15]. In addition, all the above examples are simplified. In a real ReDiR tree, the default ReDiR branch factor is 10, which means that each tree The nodes are divided into 10 intervals, and each tree node has 10 children.
  • level 1 contains 10 nodes and 100 intervals.
  • Level 2 contains 100 nodes and 1000 intervals,
  • Level 3 contains 1000 nodes and 10,000 intervals, and so on.
  • the minimum identifier space size of the ReDiR tree in a real RELOAD overlay network is 2 ⁇ 128.
  • the embodiments of the present application provide a method for searching for computing resources in a P2P network, which can effectively reduce the steps of searching for computing resources and improve the efficiency of searching for computing resources. Moreover, it can greatly shorten the search period of the demand side of computing resources in the P2P network and improve the utilization rate of computing power resources.
  • the method for finding computing resources for a P2P network in the present application further includes steps A00 and B00, and the steps A00 and B00 may be performed before step 100 or at any time. Executed when a computing node joins the target P2P network.
  • the steps A00 and B00 specifically include the following:
  • Step A00 Register a computing node for providing computing resources in the target P2P network.
  • Step B00 Publishing the computing resources corresponding to the computing nodes in the target P2P network based on the RFC7374 protocol.
  • step A00 specifically includes the following content:
  • Step A01 judging whether the joining position of the computing nodes joining the target P2P network is behind the NAT device. It can be understood that the NAT device is a network address translation (Network Address Translation) device.
  • step A02 If yes, go to step A02; otherwise, go to step A03.
  • Step A02 Obtain a relay address corresponding to the computing node, and register the relay address in the target P2P network.
  • Step A03 Register the IP address of the computing node in the target P2P network.
  • step A02 referring to FIG. 7, the step A02 specifically includes the following content:
  • A02-1 find a TURN service corresponding to the computing node via a service discovery module in the target P2P network;
  • the TURN service is the TURN protocol (RFC5766). If a host is behind a NAT, communication between the two hosts cannot be performed under certain conditions. Under these conditions, it is necessary to use relay services to provide communication.
  • This specification defines a protocol called TURN (using relay traversal NAT), which allows a host to use the relay service to transmit messages with the peer.
  • TURN differs from other relay protocols in that it allows a client to communicate with multiple peers simultaneously using one relay address.
  • the TURN protocol is also part of the ICE (Interactive Connection Establishment) protocol and can also be used alone.
  • A02-2 Obtain a relay address corresponding to the computing node in the found TURN service.
  • step B00 specifically includes the following content:
  • Step B01 selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
  • Step B02 determining a spatial position of the preset computing power of the computing node at the initial level, and generating a first resource ID of the computing node;
  • Step B03 Publish the corresponding first resource ID and the preset computing power to the corresponding spatial locations, and determine whether the preset computing power satisfies the first preset condition, and if so, execute step B04;
  • Step B04 stores the preset computing power in the initial hierarchy.
  • Step B05 According to a first preset rule, a computing power storage request is sent to a hierarchy other than the initial hierarchy.
  • the multi-tree is the aforementioned ReDiR tree.
  • step B05 if the preset computing power value of the computing node is the current maximum, minimum, or boundary value of the corresponding spatial position, sending a computing power storage request to the next layer of the initial level, And store the preset computing power in the next level of the initial level; if the preset computing power value of the computing node is the only value in the corresponding spatial position or the boundary value of the previous level of the initial level , Sending a computing power storage request to a layer above the initial level, and storing a preset computing power in a layer above the initial level.
  • the first preset condition corresponds to the first preset rule, that is, determining whether the preset computing power meets the first preset condition is: determining whether a preset computing power value of the computing node is Is not the current maximum value, minimum value, or boundary value of the corresponding spatial position, or the preset computing power value of the computing node is the only value in the corresponding spatial position or the boundary value of the previous level of the initial level Any one of them.
  • the embodiments of the present application provide a method for finding computing resources for a P2P network, by registering a computing node for providing computing resources in a target P2P network, and in the target P2P network based on the RFC7374 protocol
  • the release of the computing resources corresponding to the computing nodes can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. Not only can the computing resources in the P2P network be used in a unified manner, but also the computing resource requirements in the P2P network can be greatly reduced. Square search cycle, improve the utilization of computing resources.
  • step 200 in the method for searching for computing resources for a P2P network in the present application specifically includes the following content:
  • Step 201 Select an initial level in the multi-tree of the RFC7374 protocol, where the initial level is any level other than the first level of the multi-tree.
  • Step 202 Determine the spatial position of the required computing power at the initial level, and generate a second resource ID corresponding to the required computing power.
  • Step 203 Find a corresponding preset computing power at the spatial position of the initial level according to the second resource ID.
  • Step 204 If the corresponding preset computing power is not found according to the second resource ID at the spatial position of the initial level, then send a query request to other levels except the initial level according to the second preset rule.
  • the sending of a query request to a hierarchy other than the initial hierarchy according to the second preset rule specifically includes the following content:
  • Step 205-1 Determine whether there is a subsequent node in the query result of searching for the corresponding preset computing power in the initial hierarchical spatial position according to the second resource ID;
  • step 205-2 If yes, go to step 205-2; if no, go to step 205-3.
  • Step 205-2 Continue to search for the corresponding preset computing power at the spatial position one level above the initial level;
  • Step 205-3 Continue to search for the corresponding preset computing power at the spatial position of the next level of the initial level.
  • step 200 in the method for finding computing resources in a P2P network further includes step 206:
  • Step 206 If the required computing power is a boundary value of the spatial position of the initial level, determine that a preset computing power corresponding to the required computing power does not exist in the target p2p network, and stop searching.
  • the embodiments of the present application provide a method for finding computing resources for a P2P network. According to the required computing power, the corresponding preset computing power is found in the target P2P network based on the RFC7374 protocol, which can effectively reduce the calculation.
  • the resource search step improves the search efficiency of computing resources. Not only can the computing resources in the P2P network be used in a coordinated way, but it can also greatly shorten the search cycle of the demand side of the computing resources in the P2P network and improve the utilization of computing resources.
  • the present application also provides a specific implementation method of a computing resource search method for a P2P network, which specifically includes the following content:
  • the computing node is registered as the computing power service provider of the target P2P network.
  • the computing node issues computing power services in the target P2P network based on the RFC7374 protocol.
  • the computing power service demander searches for the computing power service in the target P2P network based on the RFC7374 protocol.
  • step S1 specifically includes the following content:
  • S1-1 The computing nodes used to provide computing power services join the target P2P network.
  • S1-2 The computing nodes joining the P2P network apply the STUN (Simple traversal of UDP over NATs) protocol to determine whether their joining position is behind a NAT (Network Address Translation) device;
  • STUN Simple traversal of UDP over NATs
  • NAT Network Address Translation
  • S1-3 Find a TURN (a protocol that uses relay traversing NAT) service through a service discovery module, where the TURN service is used to provide the computing node with a service capability in a target P2P network.
  • TURN a protocol that uses relay traversing NAT
  • the computing node registers the relay Relay address in the target P2P network, that is, it registers itself as the computing power service provider of the target P2P network.
  • S1-6 The computing node registers its own IP address in the target P2P network, that is, it registers itself as the computing power service provider of the target P2P network.
  • step S2 specifically includes the following content:
  • S2-1 Select an initial level in the ReDiR tree of the RFC7374 protocol, where the initial level is any level other than the first level of the ReDiR tree;
  • S2-2 determine the spatial position of the computing power of the computing node at the initial level
  • S2-3 generating a first resource ID of the computing node according to the computing power and the initial level of the computing node, where the resource ID is composed of a namespace, the computing power of the computing node, and the initial level;
  • S2-6 Send a computing power storage request to a hierarchy other than the initial hierarchy according to a first preset rule. And the S2-6 includes:
  • the computing power value of the computing node is the current maximum, minimum, or boundary value of the corresponding spatial position, if it is, send a computing power storage request to the next layer of the specified level, and store the computing power in The next level of the initial level;
  • the computing power value of the computing node is a unique value in a corresponding spatial position or a boundary value of a layer above the initial level
  • a computing power storage request is sent to a layer above the initial level, and the calculation is performed.
  • the force is stored in a layer above the initial level.
  • S2-7 Store the computing power in the initial hierarchy.
  • step S3 specifically includes the following:
  • S3-1 Select an initial level in the ReDiR tree of the RFC7374 protocol, where the initial level is any level other than the first level of the ReDiR tree;
  • S3-3 generating a second resource ID of the required computing power according to the required computing power and the initial level, wherein the second resource ID is composed of a namespace, the computing power of the computing node, and an initial level;
  • S3-4 Find a computing power resource at an initial hierarchical spatial position according to the second resource ID.
  • step S3-6 If no computing power resource is found in the initial hierarchical spatial position according to the second resource ID, step S3-6 is performed.
  • S3-6 Send a query request to layers other than the initial layer according to a second preset rule. And the S3-6 includes:
  • the specific implementation manner of the computing resource search method for a P2P network specifically includes the following content:
  • Computing nodes join the network to provide computing power services. Before registering as computing power service providers, they need to use the STUN protocol to determine whether they are behind a NAT device. If you are behind a NAT device, you need to find a TURN service through service discovery to provide yourself with the service capabilities of the public network. The computing node needs to register its own IP address or the Relay address obtained from the TURN service to the network.
  • the conditions based on:
  • the power value is the current maximum or minimum value of space I (l, power) or the boundary value of space I (l, power), which needs to be stored to the level + 1 layer.
  • the power value is the only value in the current space or the lower boundary value needs to be stored to the level-1 layer.
  • level + 1 continues to search upwards.
  • level-1 continues to search downwards. If power is the boundary value of space I (l, power), the entire network does not exist, and the query is stopped.
  • the application example of the present application provides a method for finding computing resources for P2P networks.
  • DHT Distributed Rendezvous
  • a method for publishing and querying computing resources is designed. This method generates a unique resource ID for each type of computing power value by digitally dividing the computing power and distributes it to the P2P network.
  • a resource ID can be constructed based on the required computing power value to query in the network.
  • the worst method for computing resource discovery in this application requires only L queries (L equals the number of ReDiR layers), and N based on the chord algorithm (N equals the number of nodes in the network).
  • the ReDiR discovery mechanism does not need to actively detect the state between nodes. , Only the service node actively reports. In order to maintain a ring network, chord needs to periodically and actively detect the status of the predecessor and successor nodes. It can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. It can not only make overall use of computing resources in P2P networks, but also greatly shorten the search cycle of demand side of computing resources in P2P networks and improve the utilization of computing resources. Rate, can be applied to blockchain, scientific computing, data services, transportation, medical, network of IoT computing resources and other fields. In the field of blockchain, its efficient publishing and query functions can be used to find and forward blocks. . In the field of scientific computing can be used in the field of scientific computing equipment discovery services. In the direction of the Internet of Things, the field of discovery services among smart devices can be utilized.
  • An embodiment of the present application provides a specific implementation of a computing resource search system for a P2P network capable of realizing all the contents of the computing resource search method for a P2P network.
  • the The computing resource search system specifically includes the following:
  • a computing resource search request receiving module 10 is configured to receive a computing resource search request, wherein the computing resource search request includes a required computing power
  • a computing resource search module 20 is configured to find a corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is calculated by the computing node based on the RFC7374 protocol in the Published in the target P2P network.
  • the computing resource search system further includes:
  • a computing node registration module is used to register a computing node for providing computing resources in a target P2P network.
  • a computing resource issuing module is configured to release a computing resource corresponding to the computing node in a target P2P network based on the RFC7374 protocol.
  • the embodiment of the computing resource search system for a P2P network provided in this application can be specifically used to execute the processing flow of the embodiment of the computing resource search method for a P2P network in the above embodiments. Reference may be made to the detailed description of the foregoing method embodiments.
  • the embodiments of the present application provide a computing resource search system for a P2P network, which can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. Moreover, it can greatly shorten the search period of the demand side of computing resources in the P2P network and improve the utilization rate of computing power resources.
  • An embodiment of the present application further provides a specific implementation of an electronic device capable of implementing all the steps in the method for finding a computing resource for a P2P network in the foregoing embodiment.
  • the electronic device specifically includes the following content:
  • the electronic device may be implemented by referring to the embodiment of the method for computing resource search for P2P networks and the embodiment of the device for searching computing resources for P2P networks, the content of which is incorporated herein and repeated I will not repeat them here.
  • FIG. 12 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present application.
  • the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
  • a computing resource search function for a P2P network may be integrated into the central processing unit 100.
  • the central processor 100 may be configured to perform the following control: Step 100: receiving a computing resource search request, wherein the computing resource search request includes a required computing power; step 200: according to the required computing power, based on RFC7374
  • the protocol searches a corresponding preset computing power in the target P2P network, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol and published in the target P2P network.
  • the embodiments of the present application provide an electronic device that can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources.
  • the search cycle of demand side of computing resources in P2P networks improves the utilization of computing power resources.
  • the computing resource search device for a P2P network may be configured separately from the central processing unit 100.
  • the computing resource search device for a P2P network may be configured as a chip connected to the central processing unit 100, and through the central processing unit, The processor is controlled to implement the computing resource search function for the P2P network.
  • the electronic device 600 may further include a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily need to include all the components shown in FIG. 12; in addition, the electronic device 600 may also include components not shown in FIG. 12, and reference may be made to the prior art.
  • the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices.
  • the central processing unit 100 receives input and controls each of the electronic devices 600 Operation of parts.
  • the memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices.
  • the above-mentioned failure-related information can be stored, and in addition, a program for executing the related information can be stored.
  • the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
  • the input unit 120 provides input to the central processing unit 100.
  • the input unit 120 is, for example, a key input or a touch input device.
  • the power source 170 is used to provide power to the electronic device 600.
  • the display 160 is used for displaying display objects such as images and characters.
  • the display may be, for example, an LCD display, but is not limited thereto.
  • the memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data. An example of this memory is sometimes called EPROM or the like.
  • the memory 140 may also be some other type of device.
  • the memory 140 includes a buffer memory 141 (sometimes referred to as a buffer).
  • the memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
  • the memory 140 may further include a data storage section 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device.
  • the driver storage section 144 of the memory 140 may include various driver programs for the communication function of the electronic device and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
  • the communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111.
  • a communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
  • multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module.
  • the communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions.
  • the audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like.
  • the audio processor 130 is also coupled to the central processing unit 100, thereby enabling recording on the unit through the microphone 132, and enabling sounds stored on the unit to be played through the speaker 131.
  • An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the method for finding a computing resource for a P2P network in the foregoing embodiment.
  • the computer-readable storage medium stores a computer program, and the computer When the program is executed by a processor, all steps of the method for finding a computing resource for a P2P network in the foregoing embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
  • Step 100 Receive a computing resource search request, wherein the computing resource search request includes a required computing power.
  • Step 200 Find the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is published by the computing node in the target P2P network based on the RFC7374 protocol. To get.
  • the embodiments of the present application provide a computer-readable storage medium, which can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. It greatly shortens the search cycle of the demand side of computing resources in P2P networks and improves the utilization of computing power resources.
  • the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, and a tablet.
  • a computer, a wearable device, or a combination of any of these devices may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, and a tablet.
  • a computer, a wearable device, or a combination of any of these devices are examples of any of these devices.
  • each module may be implemented in the same or multiple software and / or hardware, or the module that implements the same function may be implemented by a combination of multiple submodules or subunits.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or integrated.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • controller logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded controllers by logically programming the method steps.
  • Microcontrollers and the like to achieve the same function. Therefore, such a controller can be considered as a hardware component, and the device included in the controller for implementing various functions can also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be regarded as a structure that can be both a software module implementing the method and a hardware component.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
  • the device implements the functions specified in one or more flowcharts 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, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
  • a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
  • processors CPUs
  • input / output interfaces output interfaces
  • network interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes permanent and non-persistent, removable and non-removable media.
  • Information storage can be accomplished by any method or technology.
  • Information may be computer-readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmitting medium may be used to store information that can be accessed by a computing device.
  • computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
  • the embodiments of the present specification may be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • Embodiments of the specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the embodiments of the present specification can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network.
  • program modules may be located in local and remote computer storage media, including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Provided are a computing resource searching method and system for a P2P network. The computing resource searching method comprises: receiving a computing resource search request, wherein the computing resource search request includes a required computing power; and according to the required computing power, searching for a corresponding preset computing power in a target P2P network based on an RFC7374 protocol, wherein the preset computing power is obtained by a computing node performing publishing in the target P2P network based on the RFC7374 protocol. The present invention can effectively reduce the steps of searching for a computing resource and improve efficiency of searching for the computing resource.

Description

用于P2P网络的计算资源查找方法及系统Computing resource search method and system for P2P network 技术领域Technical field
本申请涉及计算机技术领域,具体涉及一种用于P2P网络的计算资源查找方法及系统。The present application relates to the field of computer technology, and in particular, to a method and system for finding computing resources for a P2P network.
背景技术Background technique
随着人工智能的发展,对于P2P网络的算力的需求日益上涨,中心化的算力提供商收取高额费用,而一些闲置的算力资源因为太分散无法被利用,正在被浪费。因此,对P2P网络的中的计算资源(即算力)进行查找,已成为当前p2p网络相关的重要研究课题之一。With the development of artificial intelligence, the demand for computing power of P2P networks is increasing. Centralized computing power providers charge high fees, and some idle computing power resources are too scattered to be used and are being wasted. Therefore, searching for computing resources (ie, computing power) in P2P networks has become one of the important research topics related to current p2p networks.
现有技术中,在P2P网络中查找计算资源的方式为使用算力的计算平台或基于Chord来实现的服务发现,前者通常都需要应用中心化的服务平台,如BONIC等,需要同一到平台去注册来使用算力。后者基于Chord来查找算力服务,通过全节点去形成环状网络,且每个节点要同时维护前驱节点和后继节点,防止整个链断裂来实现计算资源能够被查找。In the prior art, the way to find computing resources in a P2P network is a computing platform using computing power or service discovery based on Chord. The former usually requires the application of a centralized service platform, such as BONIC, which requires the same platform. Sign up to use hash power. The latter is based on Chord to find the computing power service, forming a ring network through full nodes, and each node must maintain the predecessor node and the successor node at the same time to prevent the entire chain from breaking so that computing resources can be found.
然而,现有技术中使用算力的计算平台的方式会造成算力的浪费,而基于Chord来查找算力服务的方式会造成每个节点为了维护环状网络需要付出很大网络开销,且在查找情况下需要在整个环状网络中进行依次查询,甚至可能需要进行N次(N等于环状网络中节点的数量)。However, in the prior art, a computing platform using a computing power will cause a waste of computing power, and a method based on Chord to find a computing power service will cause each node to pay a large network overhead in order to maintain a ring network. In the case of a search, it is necessary to perform a sequential query in the entire ring network, and may even need to be performed N times (N is equal to the number of nodes in the ring network).
发明内容Summary of the invention
针对现有技术中的问题,本申请提供一种用于P2P网络的计算资源查找方法及系统,能够有效减少计算资源的查找步骤,提高计算资源的查找效率。Aiming at the problems in the prior art, the present application provides a method and system for searching for computing resources for a P2P network, which can effectively reduce the steps of searching for computing resources and improve the searching efficiency of computing resources.
为解决上述技术问题,本申请提供以下技术方案:To solve the above technical problems, this application provides the following technical solutions:
第一方面,本申请提供一种用于P2P网络的计算资源查找方法,所述计算资源查找方法包括:In a first aspect, the present application provides a computing resource search method for a P2P network. The computing resource search method includes:
接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;Receiving a computing resource search request, wherein the computing resource search request includes a required computing power;
根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。According to the required computing power, a corresponding preset computing power is found in the target P2P network based on the RFC7374 protocol, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol in the target P2P network.
一实施例中,所述计算资源查找方法还包括:In an embodiment, the computing resource search method further includes:
在目标P2P网络中注册用于提供计算资源的计算节点;Register a computing node for providing computing resources in the target P2P network;
基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。Based on the RFC7374 protocol, a computing resource corresponding to the computing node is released in a target P2P network.
一实施例中,所述在目标P2P网络中注册用于提供计算资源的计算节点,包括:In one embodiment, the registering a computing node for providing a computing resource in a target P2P network includes:
判断加入所述目标P2P网络中的计算节点的加入位置是否位于NAT设备之后;Determining whether a joining position of a computing node joining the target P2P network is behind a NAT device;
若是,则获取所述计算节点对应的中继地址,以及,将该中继地址注册到所述目标P2P网络中;If yes, obtaining a relay address corresponding to the computing node, and registering the relay address in the target P2P network;
否则,将所述计算节点的IP地址注册到所述目标P2P网络中。Otherwise, register the IP address of the computing node in the target P2P network.
一实施例中,所述获取所述计算节点对应的中继地址,包括:In an embodiment, the obtaining a relay address corresponding to the computing node includes:
经由目标P2P网络中的服务发现模块,查找一个所述计算节点对应的TURN服务;Find a TURN service corresponding to the computing node via a service discovery module in the target P2P network;
以及,在查找到的所述TURN服务中所述计算节点对应的获取中继地址。And, in the found TURN service, the computing node correspondingly obtains a relay address.
一实施例中,所述基于RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源,包括:In an embodiment, the publishing the computing resources corresponding to the computing node in a target P2P network based on the RFC7374 protocol includes:
在所述RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级;Selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
确定所述计算节点的预设算力在该初始层级的空间位置,并生成该计算节点的第一资源ID;Determining a spatial position of the preset computing power of the computing node at the initial level, and generating a first resource ID of the computing node;
将对应的第一资源ID及预设算力发布至对应的空间位置中,以及,判断所述预设算力是否满足第一预设条件,若是,则将所述预设算力存储在所述初始层级中。Publishing the corresponding first resource ID and preset computing power to the corresponding spatial location, and determining whether the preset computing power satisfies the first preset condition, and if so, storing the preset computing power in all locations Described in the initial hierarchy.
一实施例中,所述计算资源查找方法还包括:In an embodiment, the computing resource search method further includes:
若所述预设算力未满足第一预设条件,则根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求。If the preset computing power does not satisfy the first preset condition, a computing power storage request is sent to a level other than the initial level according to the first preset rule.
一实施例中,所述根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求,包括:In an embodiment, the sending a computing power storage request to a hierarchy other than the initial hierarchy according to a first preset rule includes:
若所述计算节点的预设算力值为对应空间位置的中当前最大值、最小值或边界值,则向所述初始层级的下一层发送算力存储请求,并将预设算力存储在所述初始层级的下一层中;If the preset computing power value of the computing node corresponds to the current maximum, minimum, or boundary value of the corresponding spatial position, sending a computing power storage request to the next layer of the initial level and storing the preset computing power In the next level of the initial level;
若所述计算节点的预设算力值为对应的空间位置中的唯一值或所述初始层级的上一层的边界值,则向所述初始层级的上一层发送算力存储请求,并将预设算力存储在所述初始层级的上一层中。If a preset computing power value of the computing node is a unique value in a corresponding spatial position or a boundary value of a layer above the initial level, sending a computing power storage request to a layer above the initial level, and The preset computing power is stored in a layer above the initial level.
一实施例中,所述根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,包括:In an embodiment, the searching for the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power includes:
在RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级;Selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
确定所述需求算力在初始层级的空间位置,并生成所述需求算力对应的第二资源ID;Determining a spatial position of the demand computing power at an initial level, and generating a second resource ID corresponding to the demand computing power;
以及,根据所述第二资源ID在初始层级的空间位置查找对应的预设算力。And, according to the second resource ID, a corresponding preset computing power is searched at the spatial position of the initial level.
一实施例中,所述计算资源查找方法还包括:In an embodiment, the computing resource search method further includes:
若根据所述第二资源ID在初始层级的空间位置未查找到对应的预设算力,则根据第二预设规则向除所述初始层级外的其他层级发送查询请求。If the corresponding preset computing power is not found according to the second resource ID in the spatial position of the initial hierarchy, a query request is sent to the hierarchy other than the initial hierarchy according to the second preset rule.
一实施例中,所述根据第二预设规则向除所述初始层级外的其他层级发送查询请求,包括:In an embodiment, the sending a query request to a hierarchy other than the initial hierarchy according to a second preset rule includes:
判断根据所述第二资源ID在初始层级的空间位置查找对应的预设算力的查询结果中是否有后继结点;Judging whether there is a subsequent node in the query result of searching for the corresponding preset computing power in the spatial position of the initial level according to the second resource ID;
若是,则在所述初始层级的上一层的空间位置继续查找对应的预设算力;If yes, continue to find the corresponding preset computing power at the spatial position one level above the initial level;
若否,则在所述初始层级的下一层的空间位置继续查找对应的预设算力。If not, continue to find the corresponding preset computing power at the spatial position of the next level of the initial level.
一实施例中,所述计算资源查找方法还包括:In an embodiment, the computing resource search method further includes:
若所述需求算力为所述初始层级的空间位置的边界值,则确定所述目标p2p网络中不存在所述需求算力对应的预设算力,并停止查找。If the required computing power is a boundary value of the spatial position of the initial level, it is determined that a preset computing power corresponding to the required computing power does not exist in the target p2p network, and the search is stopped.
第二方面,本申请提供一种用于P2P网络的计算资源查找系统,所述计算资源查找系统包括:In a second aspect, the present application provides a computing resource search system for a P2P network. The computing resource search system includes:
计算资源查找请求接收模块,用于接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;A computing resource search request receiving module, configured to receive a computing resource search request, wherein the computing resource search request includes a required computing power;
计算资源查找模块,用于根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。A computing resource search module is configured to find a corresponding preset computing power in a target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is calculated by the computing node based on the RFC7374 protocol at the target Published in P2P networks.
一实施例中,所述计算资源查找系统还包括:In an embodiment, the computing resource search system further includes:
计算节点注册模块,用于在目标P2P网络中注册用于提供计算资源的计算节点;A computing node registration module, configured to register a computing node for providing computing resources in a target P2P network;
计算资源发布模块,用于基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。A computing resource issuing module is configured to release a computing resource corresponding to the computing node in a target P2P network based on the RFC7374 protocol.
第三方面,本申请提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现所述用于P2P网络的计算资源查找方法的步骤。According to a third aspect, the present application provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the processor for the P2P network is implemented. Steps of a computing resource lookup method.
第四方面,本申请提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现所述用于P2P网络的计算资源查找方法的步骤。In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the method for finding a computing resource for a P2P network.
由上述技术方案可知,本申请提供一种用于P2P网络的计算资源查找方法,通过接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基 于所述RFC7374协议在所述目标P2P网络中发布而得,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing technical solution that the present application provides a computing resource search method for a P2P network by receiving a computing resource search request, wherein the computing resource search request includes a required computing power; according to the required computing power, Finding the corresponding preset computing power in the target P2P network based on the RFC7374 protocol, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol in the target P2P network, which can effectively reduce the search for computing resources Steps to improve the search efficiency of computing resources, not only can make overall use of computing resources in P2P networks, but also greatly shorten the search cycle of demand side of computing resources in P2P networks, and improve the utilization of computing resources.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are Some embodiments of the present application, for those of ordinary skill in the art, can obtain other drawings according to these drawings without paying creative labor.
图1为本申请的实施例中的用于P2P网络的计算资源查找方法的流程示意图。FIG. 1 is a schematic flowchart of a computing resource search method for a P2P network according to an embodiment of the present application.
图2为本申请的ReDiR树的举例示意图。FIG. 2 is a schematic diagram of an example of a ReDiR tree of the present application.
图3为本申请的ReDiR树中的0-2层级的树节点的编号示意图。FIG. 3 is a schematic diagram of numbering of tree nodes at levels 0-2 in the ReDiR tree of the present application.
图4为本申请的在层级0和第层级1的ReDiR树中为树节点分配的间隔的示意图。FIG. 4 is a schematic diagram of the intervals allocated for tree nodes in the ReDiR trees of the level 0 and the level 1 of the present application.
图5为本申请的用于P2P网络的计算资源查找方法中步骤A00和B00的流程示意图。FIG. 5 is a schematic flowchart of steps A00 and B00 in a method for finding a computing resource for a P2P network in the present application.
图6为本申请的用于P2P网络的计算资源查找方法中步骤A00的流程示意图。FIG. 6 is a schematic flowchart of step A00 in the method for searching for computing resources for a P2P network in this application.
图7为本申请的用于P2P网络的计算资源查找方法中步骤A02的流程示意图。FIG. 7 is a schematic flowchart of step A02 in the method for searching for computing resources for a P2P network in the present application.
图8为本申请的用于P2P网络的计算资源查找方法中步骤B00的流程示意图。FIG. 8 is a schematic flowchart of step B00 in the method for searching for computing resources for a P2P network in the present application.
图9为本申请的用于P2P网络的计算资源查找方法中步骤200的流程示意图。FIG. 9 is a schematic flowchart of step 200 in a method for finding a computing resource for a P2P network in this application.
图10为本申请的实施例中的用于P2P网络的计算资源查找系统的结构示意图。FIG. 10 is a schematic structural diagram of a computing resource search system for a P2P network according to an embodiment of the present application.
图11为本申请的实施例中的用于P2P网络的计算资源查找系统的另一种结构示意图。FIG. 11 is another schematic structural diagram of a computing resource search system for a P2P network according to an embodiment of the present application.
图12为本申请的实施例中的电子设备的结构示意图。FIG. 12 is a schematic structural diagram of an electronic device in an embodiment of the present application.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚明白,下面结合附图对本发明实施例做进一步详细说明。在此,本发明的示意性实施例及其说明用于解释本发明,但并不作为对本发明的限定。To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and clearer, the embodiments of the present invention are described in further detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and the description thereof are used to explain the present invention, but are not intended to limit the present invention.
本申请的实施例提供一种用于P2P网络的计算资源查找方法的具体实施方式,参见图1,所述用于P2P网络的计算资源查找方法具体包含有如下内容:An embodiment of the present application provides a specific implementation manner of a computing resource search method for a P2P network. Referring to FIG. 1, the computing resource search method for a P2P network specifically includes the following content:
步骤100:接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力。Step 100: Receive a computing resource search request, wherein the computing resource search request includes a required computing power.
在步骤100中,用于P2P网络的计算资源查找系统接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力。可以理解的是,所述用于P2P网络的计算资源查找系 统可以体现为一种P2P网络的服务器,所述用于P2P网络的计算资源查找系统的硬件组成中也可以包括终端设备,所述终端设备可以具有显示功能。具体地,所述终端设备可以包括智能手机、平板电子设备、网络机顶盒、便携式计算机、台式电脑、个人数字助理(PDA)、车载设备、智能穿戴设备等。其中,所述智能穿戴设备可以包括智能眼镜、智能手表、智能手环等。且所述第一终端和第二终端均为前述的终端类型中的一种。In step 100, a computing resource search system for a P2P network receives a computing resource search request, wherein the computing resource search request includes a required computing power. It can be understood that the computing resource search system for a P2P network may be embodied as a server of a P2P network, and the hardware composition of the computing resource search system for a P2P network may also include a terminal device. The terminal The device may have a display function. Specifically, the terminal device may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, and the like. The smart wearable device may include smart glasses, smart watches, smart bracelets, and the like. And the first terminal and the second terminal are both one of the foregoing terminal types.
所述服务器可以与所述终端设备进行通信。所述服务器与所述终端设备之间可以使用任何合适的网络协议进行通信,包括在本申请提交日尚未开发出的网络协议。所述网络协议例如可以包括TCP/IP协议、UDP/IP协议、HTTP协议、HTTPS协议等。当然,所述网络协议例如还可以包括在上述协议之上使用的RPC协议(Remote Procedure Call Protocol,远程过程调用协议)、REST协议(Representational State Transfer,表述性状态转移协议)等。The server may communicate with the terminal device. The server and the terminal device may communicate using any suitable network protocol, including a network protocol that has not been developed at the filing date of this application. The network protocol may include, for example, TCP / IP protocol, UDP / IP protocol, HTTP protocol, HTTPS protocol, and the like. Of course, the network protocol may also include, for example, an RPC protocol (Remote Procedure Call Protocol), a REST protocol (Representational State Transfer Protocol), etc. used on the above protocol.
可以理解的是,所述需求算力为算力服务需求方所需要的算力,并在计算资源查找请求附加该需求算力,并向所述目标P2P网络对应的服务器(即所述用于P2P网络的计算资源查找系统)发送该计算资源查找请求,其中,所述算力即为所述计算资源的量化表述。It can be understood that the required computing power is the computing power required by the computing power service demander, and the required computing power is added to the computing resource search request, and the server corresponding to the target P2P network (that is, the A computing resource search system of a P2P network) sends the computing resource search request, where the computing power is a quantified expression of the computing resource.
步骤200:根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。Step 200: Find the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is published by the computing node in the target P2P network based on the RFC7374 protocol. To get.
在步骤200中,用于P2P网络的计算资源查找系统接收所述算力服务需求方发送的计算资源查找请求,并读取该计算资源查找请求,得到该计算资源查找请求对应的需求算力,而后根据该需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力。可以理解的是,所述预设算力为目标P2P网络中的某一计算节点所能够提供的计算资源,且该预设算力为对应的计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。In step 200, a computing resource search system for a P2P network receives a computing resource search request sent by the computing power service demander, and reads the computing resource search request to obtain a required computing power corresponding to the computing resource search request. Then according to the required computing power, based on the RFC7374 protocol, find the corresponding preset computing power in the target P2P network. It can be understood that the preset computing power is a computing resource that can be provided by a computing node in the target P2P network, and the preset computing power is the corresponding computing node in the target P2P network based on the RFC7374 protocol. Published in.
在上述描述中,所述RFC7374协议具体为记载有基本的互联网通信协议及互联网标准的RFC(Request For Comments)文档中的一种,其中,RFC文档为一系列以编号排定的文件,且该文件收集了有关互联网相关信息,以及UNIX和互联网社区的软件文件。基本的互联网通信协议都有在RFC文件内详细说明。RFC文件还额外加入许多的论题在标准内,例如对于互联网新开发的协议及发展中所有的记录。而RFC7374协议文档的公布内容如表1所示。In the above description, the RFC7374 protocol is specifically one of RFC (Request For Comments) documents recording basic Internet communication protocols and Internet standards, wherein the RFC document is a series of files arranged by numbers, and the The document gathers information about the Internet, as well as software files for UNIX and the Internet community. The basic Internet communication protocols are specified in RFC documents. The RFC file also adds a number of topics to the standard, such as the Internet's newly developed protocols and all the records in development. The published content of the RFC7374 protocol document is shown in Table 1.
表1Table 1
Figure PCTCN2019092682-appb-000001
Figure PCTCN2019092682-appb-000001
Figure PCTCN2019092682-appb-000002
Figure PCTCN2019092682-appb-000002
所述RFC7374文档公开了用于定位和发现资源的服务发现应用(重载RELOAD)(Service Discovery Usage for Resource Location And Discovery(RELOAD)),其中,资源定位和发现(重载)RFC 6940文档没有将通用服务发现机制定义为基本协议的一部分,因此,为解决该问题,所述RFC7374文档定义了如何应用递归分布式会合ReDiR(Recursive Distributed Rendezvous)服务发现机制在RELOAD覆盖网络,以提供通用的服务发现机制,其中,所述ReDiR服务以树状结构的形式体现,即ReDiR树,ReDiR树为提供特定服务的节点的树结构,节点使用ELOAD存储和获取请求将ReDiR树嵌入到RELOAD覆盖网络中。ReDiR树中的每个树节点都在树中的某个层级上。ReDiR树的根节点位于ReDiR树的层级0。根节点的子节点位于层级1。层级1的树节点的子节点位于层级2,以此类推。ReDiR树分支系数b。各层级在ReDiR树中的最多的空间为b^层级树节点。ReDiR树中的每个树节点都由一对(lvl,j)唯一标识,其中lvl是ReDiR树中的一个层级,j是树节点(从左起)在该层级的位置。The RFC7374 document discloses a service discovery application (Reload) (Service Relocation) for locating and discovering resources (Resource and Location (Reload)), where the resource positioning and discovery (reload) RFC 6940 document does not include The universal service discovery mechanism is defined as part of the basic protocol. Therefore, in order to solve this problem, the RFC7374 document defines how to apply the recursive distributed rendezvous ReDiR (Recursive Distributed Rendezvous) service discovery mechanism in the RELOAD overlay network to provide universal service discovery. A mechanism in which the ReDiR service is embodied in the form of a tree structure, that is, a ReDiR tree. The ReDiR tree is a tree structure of a node that provides a specific service. The node uses the ELOAD storage and acquisition request to embed the ReDiR tree into the RELOAD overlay network. Each tree node in the ReDiR tree is at a certain level in the tree. The root node of the ReDiR tree is at level 0 of the ReDiR tree. The children of the root node are at level 1. The children of a tree node at level 1 are at level 2, and so on. ReDiR tree branch coefficient b. The most space of each level in the ReDiR tree is the b ^ level tree node. Each tree node in the ReDiR tree is uniquely identified by a pair (lvl, j), where lvl is a level in the ReDiR tree and j is the position of the tree node (from the left) at that level.
参见图2所示的一个ReDiR树的例子,它的分支系数为2,覆盖层的标识符空间大小为16。ReDiR树中的每一个树节点都显示为两个横线,中间是一个竖线('|')。水平线表示每个节点负责的两个间隔。在第0层级,只有一个节点(0,0)负责两个间隔,它们一起覆盖重新加载覆盖实例的整个标识符空间。在层级1中,有两个节点(1,0)和(1,1),每个节点负责RELOAD覆盖网络的标识符空间的一半。在层级2中,有四个节点。它们每个都拥有四分之一的标识符空间。在层级3中,有8个节点,每个节点负责1/8的标识符空间,图3显示了如何在ReDiR树中对0-2层级的树节点进行编号,以及,图4显示了如何在层级0和第层级1的ReDiR树中为树节点分配间隔。例如,在层级0的单个树节点(0,0)被划分为两个间隔,每个间隔覆盖了标识符空间的一半。这两个区间分别为[0,7]和[8,15],另外,上述的所有示例都是简化的,在真正的ReDiR树中,默认的ReDiR分支因子是10,这意味着每个树节点被分割成10个间隔,每个树节点有10个子节点。在这种ReDiR树中,层级1包含10个节点和100个间隔。层级2包含100个节点和1000个的间隔,层级3包含1000个节点和10000个间隔,等等。此外,真正的RELOAD覆盖网络中ReDiR树的标识符空间大小最低为2^128。Referring to an example of the ReDiR tree shown in FIG. 2, its branch coefficient is 2 and the identifier space size of the overlay is 16. Each tree node in the ReDiR tree is displayed as two horizontal lines, with a vertical line ('|') in the middle. The horizontal lines represent the two intervals each node is responsible for. At level 0, only one node (0,0) is responsible for the two intervals, which together cover the entire identifier space of the reload overlay instance. In level 1, there are two nodes (1,0) and (1,1), each of which is responsible for half of the identifier space of the RELOAD overlay network. In level 2, there are four nodes. They each have a quarter of the identifier space. In level 3, there are 8 nodes, each of which is responsible for 1/8 of the identifier space. Figure 3 shows how to number tree nodes at levels 0-2 in the ReDiR tree, and Figure 4 shows how to In the ReDiR trees of level 0 and level 1, the tree nodes are allocated intervals. For example, a single tree node (0,0) at level 0 is divided into two intervals, each interval covering half of the identifier space. These two intervals are [0,7] and [8,15]. In addition, all the above examples are simplified. In a real ReDiR tree, the default ReDiR branch factor is 10, which means that each tree The nodes are divided into 10 intervals, and each tree node has 10 children. In this ReDiR tree, level 1 contains 10 nodes and 100 intervals. Level 2 contains 100 nodes and 1000 intervals, Level 3 contains 1000 nodes and 10,000 intervals, and so on. In addition, the minimum identifier space size of the ReDiR tree in a real RELOAD overlay network is 2 ^ 128.
从上述描述可知,本申请的实施例提供一种用于P2P网络的计算资源查找方法,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing description that the embodiments of the present application provide a method for searching for computing resources in a P2P network, which can effectively reduce the steps of searching for computing resources and improve the efficiency of searching for computing resources. Moreover, it can greatly shorten the search period of the demand side of computing resources in the P2P network and improve the utilization rate of computing power resources.
在一种具体实施方式中,参见图5,本申请的用于P2P网络的计算资源查找方法中还包含有步骤A00和B00,且该步骤A00和B00可以在步骤100之前执行,也可以在随时有计算节点加入目标P2P网络时执行,所述步骤A00和步骤B00具体包括如下内容:In a specific embodiment, referring to FIG. 5, the method for finding computing resources for a P2P network in the present application further includes steps A00 and B00, and the steps A00 and B00 may be performed before step 100 or at any time. Executed when a computing node joins the target P2P network. The steps A00 and B00 specifically include the following:
步骤A00:在目标P2P网络中注册用于提供计算资源的计算节点。Step A00: Register a computing node for providing computing resources in the target P2P network.
步骤B00:基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。Step B00: Publishing the computing resources corresponding to the computing nodes in the target P2P network based on the RFC7374 protocol.
在上述描述中,参见图6,所述步骤A00具体包括如下内容:In the above description, referring to FIG. 6, the step A00 specifically includes the following content:
步骤A01:判断加入所述目标P2P网络中的计算节点的加入位置是否位于NAT设备之后。可以理解的是,所述NAT设备为网络地址转换(Network Address Translation)设备。Step A01: judging whether the joining position of the computing nodes joining the target P2P network is behind the NAT device. It can be understood that the NAT device is a network address translation (Network Address Translation) device.
若是,则执行步骤A02;否则执行步骤A03。If yes, go to step A02; otherwise, go to step A03.
步骤A02:获取所述计算节点对应的中继地址,以及,将该中继地址注册到所述目标P2P网络中。Step A02: Obtain a relay address corresponding to the computing node, and register the relay address in the target P2P network.
步骤A03:将所述计算节点的IP地址注册到所述目标P2P网络中。Step A03: Register the IP address of the computing node in the target P2P network.
在步骤A02中,参见图7,所述步骤A02具体包括如下内容:In step A02, referring to FIG. 7, the step A02 specifically includes the following content:
A02-1:经由目标P2P网络中的服务发现模块,查找一个所述计算节点对应的TURN服务;A02-1: find a TURN service corresponding to the computing node via a service discovery module in the target P2P network;
在上述描述中,所述TURN服务为TURN协议(RFC5766),如果一台主机处于NAT后面,那么在一定条件下两台主机之间无法进行通讯。在这种条件下,那么使用中继服务提供通讯是有必要的。这个规范定义了一个名为TURN(使用中继穿越NAT)的协议,它允许一台主机使用中继服务与对端进行报文传输。TURN不同于其它中继协议在于它允许客户机使用一个中继地址与多个对端同时进行通讯。TURN协议也是ICE(交互式连接建立)协议的组成部分,也可以单独使用。In the above description, the TURN service is the TURN protocol (RFC5766). If a host is behind a NAT, communication between the two hosts cannot be performed under certain conditions. Under these conditions, it is necessary to use relay services to provide communication. This specification defines a protocol called TURN (using relay traversal NAT), which allows a host to use the relay service to transmit messages with the peer. TURN differs from other relay protocols in that it allows a client to communicate with multiple peers simultaneously using one relay address. The TURN protocol is also part of the ICE (Interactive Connection Establishment) protocol and can also be used alone.
A02-2:在查找到的所述TURN服务中所述计算节点对应的获取中继地址。A02-2: Obtain a relay address corresponding to the computing node in the found TURN service.
在上述描述中,参见图8,所述步骤B00具体包括如下内容:In the above description, referring to FIG. 8, the step B00 specifically includes the following content:
步骤B01:在所述RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级;Step B01: selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
步骤B02:确定所述计算节点的预设算力在该初始层级的空间位置,并生成该计算节点的第一资源ID;Step B02: determining a spatial position of the preset computing power of the computing node at the initial level, and generating a first resource ID of the computing node;
步骤B03:将对应的第一资源ID及预设算力发布至对应的空间位置中,以及,判断所述预设算力是否满足第一预设条件,若是,则执行步骤B04;Step B03: Publish the corresponding first resource ID and the preset computing power to the corresponding spatial locations, and determine whether the preset computing power satisfies the first preset condition, and if so, execute step B04;
否则执行步骤B05。Otherwise, execute step B05.
步骤B04将所述预设算力存储在所述初始层级中。Step B04 stores the preset computing power in the initial hierarchy.
步骤B05:根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求。Step B05: According to a first preset rule, a computing power storage request is sent to a hierarchy other than the initial hierarchy.
可以理解的是。所述多叉树即为前述的ReDiR树。Understandably. The multi-tree is the aforementioned ReDiR tree.
在所述步骤B05中,若所述计算节点的预设算力值为对应空间位置的中当前最大值、最小值或边界值,则向所述初始层级的下一层发送算力存储请求,并将预设算力存储在所述初始层级的下一层中;若所述计算节点的预设算力值为对应的空间位置中的唯一值或所述初始层级的上一层的边界值,则向所述初始层级的上一层发送算力存储请求,并将预设算力存储在所述初始层级的上一层中。In step B05, if the preset computing power value of the computing node is the current maximum, minimum, or boundary value of the corresponding spatial position, sending a computing power storage request to the next layer of the initial level, And store the preset computing power in the next level of the initial level; if the preset computing power value of the computing node is the only value in the corresponding spatial position or the boundary value of the previous level of the initial level , Sending a computing power storage request to a layer above the initial level, and storing a preset computing power in a layer above the initial level.
可以理解的是,第一预设条件与所述第一预设规则相应,即,判断所述预设算力是否满足第一预设条件为:判断所述计算节点的预设算力值是否不是对应空间位置的中当前最大值、最小值或边界值、或者,所述计算节点的预设算力值为对应的空间位置中的唯一值或所述初始层级的上一层的边界值中的任意一个。It can be understood that the first preset condition corresponds to the first preset rule, that is, determining whether the preset computing power meets the first preset condition is: determining whether a preset computing power value of the computing node is Is not the current maximum value, minimum value, or boundary value of the corresponding spatial position, or the preset computing power value of the computing node is the only value in the corresponding spatial position or the boundary value of the previous level of the initial level Any one of them.
从上述描述可知,本申请的实施例提供一种用于P2P网络的计算资源查找方法,通过在目标P2P网络中注册用于提供计算资源的计算节点,以及基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the above description that the embodiments of the present application provide a method for finding computing resources for a P2P network, by registering a computing node for providing computing resources in a target P2P network, and in the target P2P network based on the RFC7374 protocol The release of the computing resources corresponding to the computing nodes can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. Not only can the computing resources in the P2P network be used in a unified manner, but also the computing resource requirements in the P2P network can be greatly reduced. Square search cycle, improve the utilization of computing resources.
在一种具体实施方式中,参见图9,本申请的用于P2P网络的计算资源查找方法中步骤200具体包括如下内容:In a specific embodiment, referring to FIG. 9, step 200 in the method for searching for computing resources for a P2P network in the present application specifically includes the following content:
步骤201:在RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级。Step 201: Select an initial level in the multi-tree of the RFC7374 protocol, where the initial level is any level other than the first level of the multi-tree.
步骤202:确定所述需求算力在初始层级的空间位置,并生成所述需求算力对应的第二资源ID。Step 202: Determine the spatial position of the required computing power at the initial level, and generate a second resource ID corresponding to the required computing power.
步骤203:根据所述第二资源ID在初始层级的空间位置查找对应的预设算力。Step 203: Find a corresponding preset computing power at the spatial position of the initial level according to the second resource ID.
步骤204:若根据所述第二资源ID在初始层级的空间位置未查找到对应的预设算力,则根据第二预设规则向除所述初始层级外的其他层级发送查询请求。Step 204: If the corresponding preset computing power is not found according to the second resource ID at the spatial position of the initial level, then send a query request to other levels except the initial level according to the second preset rule.
可以理解的是,所述根据第二预设规则向除所述初始层级外的其他层级发送查询请求具体包含有如下内容:It can be understood that the sending of a query request to a hierarchy other than the initial hierarchy according to the second preset rule specifically includes the following content:
步骤205-1:判断根据所述第二资源ID在初始层级的空间位置查找对应的预设算力的查询结果中是否有后继结点;Step 205-1: Determine whether there is a subsequent node in the query result of searching for the corresponding preset computing power in the initial hierarchical spatial position according to the second resource ID;
若是,则执行步骤205-2,若否,则执行步骤205-3。If yes, go to step 205-2; if no, go to step 205-3.
步骤205-2:在所述初始层级的上一层的空间位置继续查找对应的预设算力;Step 205-2: Continue to search for the corresponding preset computing power at the spatial position one level above the initial level;
步骤205-3:在所述初始层级的下一层的空间位置继续查找对应的预设算力。Step 205-3: Continue to search for the corresponding preset computing power at the spatial position of the next level of the initial level.
另外,所述于P2P网络的计算资源查找方法中步骤200中还包含有步骤206:In addition, step 200 in the method for finding computing resources in a P2P network further includes step 206:
步骤206:若所述需求算力为所述初始层级的空间位置的边界值,则确定所述目标p2p网络中不存在所述需求算力对应的预设算力,并停止查找。Step 206: If the required computing power is a boundary value of the spatial position of the initial level, determine that a preset computing power corresponding to the required computing power does not exist in the target p2p network, and stop searching.
从上述描述可知,本申请的实施例提供一种用于P2P网络的计算资源查找方法,根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing description that the embodiments of the present application provide a method for finding computing resources for a P2P network. According to the required computing power, the corresponding preset computing power is found in the target P2P network based on the RFC7374 protocol, which can effectively reduce the calculation. The resource search step improves the search efficiency of computing resources. Not only can the computing resources in the P2P network be used in a coordinated way, but it can also greatly shorten the search cycle of the demand side of the computing resources in the P2P network and improve the utilization of computing resources.
为进一步的说明本方案,本申请还提供一种用于P2P网络的计算资源查找方法的具体实施方式,具体包括如下内容:To further illustrate this solution, the present application also provides a specific implementation method of a computing resource search method for a P2P network, which specifically includes the following content:
S1:计算节点注册成为目标P2P网络的算力服务提供方。S1: The computing node is registered as the computing power service provider of the target P2P network.
S2:计算节点基于RFC7374协议在目标P2P网络中发布算力服务。S2: The computing node issues computing power services in the target P2P network based on the RFC7374 protocol.
S3:算力服务需求方基于RFC7374协议在目标P2P网络中查找算力服务。S3: The computing power service demander searches for the computing power service in the target P2P network based on the RFC7374 protocol.
其一,所述步骤S1具体包括如下内容:First, the step S1 specifically includes the following content:
S1-1:用于提供算力服务的计算节点加入目标P2P网络中。S1-1: The computing nodes used to provide computing power services join the target P2P network.
S1-2:加入所述P2P网络中的计算节点应用STUN(Simple Traversal of UDP over NATs,NAT的UDP简单穿越)协议判断自身的加入位置是否位于NAT(Network Address Translation,网络地址转换)设备之后;S1-2: The computing nodes joining the P2P network apply the STUN (Simple traversal of UDP over NATs) protocol to determine whether their joining position is behind a NAT (Network Address Translation) device;
若是,则执行S1-3;若否,则执行S1-6。If yes, execute S1-3; if not, execute S1-6.
S1-3:通过服务发现模块查找一个TURN(使用中继穿越NAT的协议)服务,其中,该TURN服务用于为所述算节点提供在目标P2P网络中的服务能力。S1-3: Find a TURN (a protocol that uses relay traversing NAT) service through a service discovery module, where the TURN service is used to provide the computing node with a service capability in a target P2P network.
S1-4:在查找到的TURN服务中获取中继Relay地址。S1-4: Obtain the relay Relay address from the found TURN service.
S1-5:计算节点将所述中继Relay地址注册到目标P2P网络中,即将自身注册为该目标P2P网络的算力服务提供方。S1-5: The computing node registers the relay Relay address in the target P2P network, that is, it registers itself as the computing power service provider of the target P2P network.
S1-6:计算节点将自身IP地址注册到目标P2P网络中,即将自身注册为该目标P2P网络的算力服务提供方。S1-6: The computing node registers its own IP address in the target P2P network, that is, it registers itself as the computing power service provider of the target P2P network.
其二,所述步骤S2具体包括如下内容:Secondly, the step S2 specifically includes the following content:
S2-1:在RFC7374协议的ReDiR树中选取初始层级,其中,所述初始层级为除ReDiR树的首个层级之外的任一层级;S2-1: Select an initial level in the ReDiR tree of the RFC7374 protocol, where the initial level is any level other than the first level of the ReDiR tree;
S2-2:确定所述计算节点的算力在该初始层级的空间位置;S2-2: determine the spatial position of the computing power of the computing node at the initial level;
S2-3:根据所述计算节点的算力及初始层级,生成所述计算节点的第一资源ID,其中,所述资源ID由命名空间、所述计算节点的算力及初始层级组成;S2-3: generating a first resource ID of the computing node according to the computing power and the initial level of the computing node, where the resource ID is composed of a namespace, the computing power of the computing node, and the initial level;
S2-4:所述计算节点将对应的第一资源ID及算力信息发布至所述空间位置中,以及S2-4: the computing node issues the corresponding first resource ID and computing power information to the spatial location, and
S2-5:判断所述算力是否满足第一预设条件,若否,则执行步骤S2-6,若是,则执行步骤S2-7。S2-5: Determine whether the computing power satisfies the first preset condition; if not, execute step S2-6, and if yes, execute step S2-7.
S2-6:根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求。且所述S2-6包括:S2-6: Send a computing power storage request to a hierarchy other than the initial hierarchy according to a first preset rule. And the S2-6 includes:
若所述计算节点的算力值是否为对应空间位置的中当前最大值、最小值或边界值,若是,则向所述指定层级的下一层发送算力存储请求,将算力存储在所述初始层级的下一层中;If the computing power value of the computing node is the current maximum, minimum, or boundary value of the corresponding spatial position, if it is, send a computing power storage request to the next layer of the specified level, and store the computing power in The next level of the initial level;
若所述计算节点的算力值是否为对应的空间位置中的唯一值或所述初始层级的上一层的边界值,则向所述初始层级的上一层发送算力存储请求,将算力存储在所述初始层级的上一层中。If the computing power value of the computing node is a unique value in a corresponding spatial position or a boundary value of a layer above the initial level, a computing power storage request is sent to a layer above the initial level, and the calculation is performed. The force is stored in a layer above the initial level.
S2-7:将算力存储在所述初始层级中。S2-7: Store the computing power in the initial hierarchy.
其三,所述步骤S3具体包括如下内容:Third, the step S3 specifically includes the following:
S3-1:在RFC7374协议的ReDiR树中选取初始层级,其中,所述初始层级为除ReDiR树的首个层级之外的任一层级;S3-1: Select an initial level in the ReDiR tree of the RFC7374 protocol, where the initial level is any level other than the first level of the ReDiR tree;
S3-2:确定需求算力在初始层级的空间位置;S3-2: Determine the spatial position of the required computing power at the initial level;
S3-3:根据所述需求算力及初始层级,生成所述需求算力的第二资源ID,其中,所述第二资源ID由命名空间、所述计算节点的算力及初始层级组成;S3-3: generating a second resource ID of the required computing power according to the required computing power and the initial level, wherein the second resource ID is composed of a namespace, the computing power of the computing node, and an initial level;
S3-4:根据所述第二资源ID在初始层级的空间位置查找算力资源。S3-4: Find a computing power resource at an initial hierarchical spatial position according to the second resource ID.
S3-5:若根据所述第二资源ID在初始层级的空间位置未查找到算力资源,则执行步骤S3-6。S3-5: If no computing power resource is found in the initial hierarchical spatial position according to the second resource ID, step S3-6 is performed.
S3-6:根据第二预设规则向除所述初始层级外的其他层级发送查询请求。且所述S3-6包括:S3-6: Send a query request to layers other than the initial layer according to a second preset rule. And the S3-6 includes:
判断根据所述第二资源ID在初始层级的空间位置查找算力资源的查询结果中是否有后继结点;Judging whether there is a subsequent node in the query result of searching for a computing power resource in the spatial position of the initial level according to the second resource ID;
若是,则在所述初始层级的上一层的空间位置继续查找算力资源;If yes, continue to search for computing resources at the spatial position one level above the initial level;
若否,则在所述初始层级的下一层的空间位置继续查找算力资源。If not, continue to search for computing power resources at the spatial position of the next level of the initial level.
S3-7:若所述需求算力为所述初始层级的空间位置的边界值,则确定所述目标p2p网络中不存在所述需求算力对应的算力资源,并停止查找算力资源。S3-7: If the required computing power is a boundary value of the spatial position of the initial level, determine that there is no computing power resource corresponding to the required computing power in the target p2p network, and stop searching for computing power resources.
在一种具体举例中,所述用于P2P网络的计算资源查找方法的具体实施方式,具体包括如下内容:In a specific example, the specific implementation manner of the computing resource search method for a P2P network specifically includes the following content:
1.发布算力服务1. Publish computing power service
计算节点加入到网络中提供算力服务,在注册为算力服务提供方之前,需要利用STUN协议来判断出自己是否在NAT设备后面。如果在NAT设备后面,则需要通过服务发现找到一个TURN服务来为自己提供公网的服务能力。计算节点需要把自己的IP地址或从TURN服务获取到的Relay地址注册到网络。Computing nodes join the network to provide computing power services. Before registering as computing power service providers, they need to use the STUN protocol to determine whether they are behind a NAT device. If you are behind a NAT device, you need to find a TURN service through service discovery to provide yourself with the service capabilities of the public network. The computing node needs to register its own IP address or the Relay address obtained from the TURN service to the network.
计算节点在发布算力服务时,选取指定层级l(通常为2)作为我们的起始Level,找到指定power(节点提供的算力)在l层的空间位置I(l,power),生成资源ID(ID=namespace+level+power),将资源ID与算力信息一起发布到空间I(l,power)中。同时根据power判断需不需要向其他Level发送存储请求。依据的条件有:When the computing node publishes the computing power service, it selects the specified level l (usually 2) as our starting level, finds the specified power (the computing power provided by the node) at the spatial position I (l, power) of the level l, and generates resources ID (ID = namespace + level + power), and publish the resource ID and computing power information into the space I (l, power). At the same time, according to the power, it is necessary to send storage requests to other levels. The conditions based on:
power值是空间I(l,power)当前最大、最小值或空间I(l,power)边界值,需要向level+1层进行存储。The power value is the current maximum or minimum value of space I (l, power) or the boundary value of space I (l, power), which needs to be stored to the level + 1 layer.
power值是当前空间的唯一值或者是低一层的边界值则需要向level-1层进行存储。The power value is the only value in the current space or the lower boundary value needs to be stored to the level-1 layer.
2.发现算力服务2. Discover computing power services
在计算时,需要根据算力匹配计算节点,首先选取指定层级l(通常为2)作为我们的起始Level,找到指定power(节点提供的算力)在l层的空间位置I(l,power),生成资源ID(ID=namespace+level+power)。利用资源ID向指定的空间I(l,power)查询。当在l层级没有找到资源,则需要根据power判断需不需要向其他Level发送查询请求。依据的条件有:In the calculation, we need to match the computing nodes according to the computing power. First, we select the specified level l (usually 2) as our starting level, and find the spatial position I (l, power of the specified power (the computing power provided by the node) on the l level. ) To generate a resource ID (ID = namespace + level + power). Use the resource ID to query the specified space I (l, power). When no resources are found at level l, you need to determine whether to send query requests to other levels based on power. The conditions based on:
如果查询结果没有后继结点,说明可能存在于更高的level中,使得level+1向上继续查找。If there are no subsequent nodes in the query result, it may exist in a higher level, so that level + 1 continues to search upwards.
若有后继值说明可能存在于更低的level中,使得level-1向下继续查找如果power为空间I(l,power)的边界值,则整个网络中不存在,停止查询。If there is a subsequent value indicating that it may exist in a lower level, so that level-1 continues to search downwards. If power is the boundary value of space I (l, power), the entire network does not exist, and the query is stopped.
从上述描述可知,本申请的应用实例提供一种用于P2P网络的计算资源查找方法,通过基于ReDiR(Recursive Distributed Rendezvous)[RFC7374],DHT算法,设计出适用于计算资源的发布、查询方法。该方法通过对算力的数字化划分,为每一类算力值生成唯一的资源ID,分发到P2P网络中。对于请求者,可以通过需要的算力值,构造出资源ID来在网络中进行查询。本申请的计算资源发现方法最差仅需要L次查询(L等于ReDiR层数),与基于chord算法则需要N次(N等于网络中节点的数量),ReDiR发现机制不需要主动探测节点间状态,仅有服务节点主动上报。采用chord为了维护环状网络需要定期主动去探测前驱与后继节点状态。能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率,可以应用于区块链,科学计算,数据服务,交通,医疗,物联网计算资源的网络等领域,在区块链领域可以利用其高效的发布,查询功能应用在区块的查找,转发。在科学计算领域可利用在科学计算设备的发现服务领域。在物联网方向可以利用在智能设备间的发现服务领域。As can be seen from the above description, the application example of the present application provides a method for finding computing resources for P2P networks. Based on ReDiR (Recursive Distributed Rendezvous) [RFC7374], DHT algorithm, a method for publishing and querying computing resources is designed. This method generates a unique resource ID for each type of computing power value by digitally dividing the computing power and distributes it to the P2P network. For the requester, a resource ID can be constructed based on the required computing power value to query in the network. The worst method for computing resource discovery in this application requires only L queries (L equals the number of ReDiR layers), and N based on the chord algorithm (N equals the number of nodes in the network). The ReDiR discovery mechanism does not need to actively detect the state between nodes. , Only the service node actively reports. In order to maintain a ring network, chord needs to periodically and actively detect the status of the predecessor and successor nodes. It can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. It can not only make overall use of computing resources in P2P networks, but also greatly shorten the search cycle of demand side of computing resources in P2P networks and improve the utilization of computing resources. Rate, can be applied to blockchain, scientific computing, data services, transportation, medical, network of IoT computing resources and other fields. In the field of blockchain, its efficient publishing and query functions can be used to find and forward blocks. . In the field of scientific computing can be used in the field of scientific computing equipment discovery services. In the direction of the Internet of Things, the field of discovery services among smart devices can be utilized.
本申请的实施例提供能够实现所述用于P2P网络的计算资源查找方法中全部内容的一种用于P2P网络的计算资源查找系统的具体实施方式,参见图10,所述用于P2P网络的计算资源查找系统具体包含有如下内容:An embodiment of the present application provides a specific implementation of a computing resource search system for a P2P network capable of realizing all the contents of the computing resource search method for a P2P network. Referring to FIG. 10, the The computing resource search system specifically includes the following:
计算资源查找请求接收模块10,用于接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;A computing resource search request receiving module 10 is configured to receive a computing resource search request, wherein the computing resource search request includes a required computing power;
计算资源查找模块20,用于根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。A computing resource search module 20 is configured to find a corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is calculated by the computing node based on the RFC7374 protocol in the Published in the target P2P network.
参见图11,所述计算资源查找系统还包括:Referring to FIG. 11, the computing resource search system further includes:
计算节点注册模块,用于在目标P2P网络中注册用于提供计算资源的计算节点。A computing node registration module is used to register a computing node for providing computing resources in a target P2P network.
计算资源发布模块,用于基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。A computing resource issuing module is configured to release a computing resource corresponding to the computing node in a target P2P network based on the RFC7374 protocol.
本申请提供的用于P2P网络的计算资源查找系统的实施例具体可以用于执行上述实施例中的用于P2P网络的计算资源查找方法的实施例的处理流程,其功能在此不再赘述,可以参照上述方法实施例的详细描述。The embodiment of the computing resource search system for a P2P network provided in this application can be specifically used to execute the processing flow of the embodiment of the computing resource search method for a P2P network in the above embodiments. Reference may be made to the detailed description of the foregoing method embodiments.
从上述描述可知,本申请的实施例提供一种用于P2P网络的计算资源查找系统,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进 行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing description that the embodiments of the present application provide a computing resource search system for a P2P network, which can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. Moreover, it can greatly shorten the search period of the demand side of computing resources in the P2P network and improve the utilization rate of computing power resources.
本申请的实施例还提供能够实现上述实施例中的用于P2P网络的计算资源查找方法中全部步骤的一种电子设备的具体实施方式,所述电子设备具体包括如下内容:An embodiment of the present application further provides a specific implementation of an electronic device capable of implementing all the steps in the method for finding a computing resource for a P2P network in the foregoing embodiment. The electronic device specifically includes the following content:
处理器(processor)、存储器(memory)、通信接口(Communications Interface)和总线;其中,所述处理器、存储器、通信接口通过所述总线完成相互间的通信;所述通信接口用于实现用于P2P网络的计算资源查找系统以及用户终端等相关设备之间的信息传输;该电子设备可以是台式计算机、平板电脑及移动终端等,本实施例不限于此。在本实施例中,该电子设备可以参照实施例用于P2P网络的计算资源查找方法的实施例及用于P2P网络的计算资源查找装置的实施例进行实施,其内容被合并于此,重复之处不再赘述。A processor, a memory, a communication interface, and a bus; wherein the processor, the memory, and the communication interface communicate with each other through the bus; the communication interface is used to implement Information transmission between a computing resource search system of a P2P network and related devices such as a user terminal; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, etc. This embodiment is not limited thereto. In this embodiment, the electronic device may be implemented by referring to the embodiment of the method for computing resource search for P2P networks and the embodiment of the device for searching computing resources for P2P networks, the content of which is incorporated herein and repeated I will not repeat them here.
图12为本申请实施例的电子设备600的系统构成的示意框图。如图12所示,该电子设备600可以包括中央处理器100和存储器140;存储器140耦合到中央处理器100。值得注意的是,该图是示例性的;还可以使用其他类型的结构,来补充或代替该结构,以实现电信功能或其他功能。FIG. 12 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present application. As shown in FIG. 12, the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
一实施例中,用于P2P网络的计算资源查找功能可以被集成到中央处理器100中。其中,中央处理器100可以被配置为进行如下控制:步骤100:接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;步骤200:根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。In one embodiment, a computing resource search function for a P2P network may be integrated into the central processing unit 100. The central processor 100 may be configured to perform the following control: Step 100: receiving a computing resource search request, wherein the computing resource search request includes a required computing power; step 200: according to the required computing power, based on RFC7374 The protocol searches a corresponding preset computing power in the target P2P network, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol and published in the target P2P network.
从上述描述可知,本申请的实施例提供一种电子设备,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing description that the embodiments of the present application provide an electronic device that can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. The search cycle of demand side of computing resources in P2P networks improves the utilization of computing power resources.
在另一个实施方式中,用于P2P网络的计算资源查找装置可以与中央处理器100分开配置,例如可以将用于P2P网络的计算资源查找装置配置为与中央处理器100连接的芯片,通过中央处理器的控制来实现用于P2P网络的计算资源查找功能。In another embodiment, the computing resource search device for a P2P network may be configured separately from the central processing unit 100. For example, the computing resource search device for a P2P network may be configured as a chip connected to the central processing unit 100, and through the central processing unit, The processor is controlled to implement the computing resource search function for the P2P network.
如图12所示,该电子设备600还可以包括:通信模块110、输入单元120、音频处理单元130、显示器160、电源170。值得注意的是,电子设备600也并不是必须要包括图12中所示的所有部件;此外,电子设备600还可以包括图12中没有示出的部件,可以参考现有技术。As shown in FIG. 12, the electronic device 600 may further include a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily need to include all the components shown in FIG. 12; in addition, the electronic device 600 may also include components not shown in FIG. 12, and reference may be made to the prior art.
如图12所示,中央处理器100有时也称为控制器或操作控件,可以包括微处理器或其他处理器装置和/或逻辑装置,该中央处理器100接收输入并控制电子设备600的各个部件的操 作。As shown in FIG. 12, the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processing unit 100 receives input and controls each of the electronic devices 600 Operation of parts.
其中,存储器140,例如可以是缓存器、闪存、硬驱、可移动介质、易失性存储器、非易失性存储器或其它合适装置中的一种或更多种。可储存上述与失败有关的信息,此外还可存储执行有关信息的程序。并且中央处理器100可执行该存储器140存储的该程序,以实现信息存储或处理等。The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above-mentioned failure-related information can be stored, and in addition, a program for executing the related information can be stored. In addition, the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
输入单元120向中央处理器100提供输入。该输入单元120例如为按键或触摸输入装置。电源170用于向电子设备600提供电力。显示器160用于进行图像和文字等显示对象的显示。该显示器例如可为LCD显示器,但并不限于此。The input unit 120 provides input to the central processing unit 100. The input unit 120 is, for example, a key input or a touch input device. The power source 170 is used to provide power to the electronic device 600. The display 160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
该存储器140可以是固态存储器,例如,只读存储器(ROM)、随机存取存储器(RAM)、SIM卡等。还可以是这样的存储器,其即使在断电时也保存信息,可被选择性地擦除且设有更多数据,该存储器的示例有时被称为EPROM等。存储器140还可以是某种其它类型的装置。存储器140包括缓冲存储器141(有时被称为缓冲器)。存储器140可以包括应用/功能存储部142,该应用/功能存储部142用于存储应用程序和功能程序或用于通过中央处理器100执行电子设备600的操作的流程。The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data. An example of this memory is sometimes called EPROM or the like. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
存储器140还可以包括数据存储部143,该数据存储部143用于存储数据,例如联系人、数字数据、图片、声音和/或任何其他由电子设备使用的数据。存储器140的驱动程序存储部144可以包括电子设备的用于通信功能和/或用于执行电子设备的其他功能(如消息传送应用、通讯录应用等)的各种驱动程序。The memory 140 may further include a data storage section 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage section 144 of the memory 140 may include various driver programs for the communication function of the electronic device and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
通信模块110即为经由天线111发送和接收信号的发送机/接收机110。通信模块(发送机/接收机)110耦合到中央处理器100,以提供输入信号和接收输出信号,这可以和常规移动通信终端的情况相同。The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. A communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
基于不同的通信技术,在同一电子设备中,可以设置有多个通信模块110,如蜂窝网络模块、蓝牙模块和/或无线局域网模块等。通信模块(发送机/接收机)110还经由音频处理器130耦合到扬声器131和麦克风132,以经由扬声器131提供音频输出,并接收来自麦克风132的音频输入,从而实现通常的电信功能。音频处理器130可以包括任何合适的缓冲器、解码器、放大器等。另外,音频处理器130还耦合到中央处理器100,从而使得可以通过麦克风132能够在本机上录音,且使得可以通过扬声器131来播放本机上存储的声音。Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions. The audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like. In addition, the audio processor 130 is also coupled to the central processing unit 100, thereby enabling recording on the unit through the microphone 132, and enabling sounds stored on the unit to be played through the speaker 131.
本申请的实施例还提供能够实现上述实施例中的用于P2P网络的计算资源查找方法中全部步骤的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中的用于P2P网络的计算资源查找方法的全部步骤,例如,所述处理器执行所述计算机程序时实现下述步骤:An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the method for finding a computing resource for a P2P network in the foregoing embodiment. The computer-readable storage medium stores a computer program, and the computer When the program is executed by a processor, all steps of the method for finding a computing resource for a P2P network in the foregoing embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
步骤100:接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力。Step 100: Receive a computing resource search request, wherein the computing resource search request includes a required computing power.
步骤200:根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。Step 200: Find the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is published by the computing node in the target P2P network based on the RFC7374 protocol. To get.
从上述描述可知,本申请的实施例提供一种计算机可读存储介质,能够有效减少计算资源的查找步骤,提高计算资源的查找效率,不仅能够对P2P网络中计算资源进行统筹利用,而且能够极大的缩短P2P网络中计算资源需求方的查找周期,提高算力资源利用率。It can be known from the foregoing description that the embodiments of the present application provide a computer-readable storage medium, which can effectively reduce the search steps of computing resources and improve the search efficiency of computing resources. It greatly shortens the search cycle of the demand side of computing resources in P2P networks and improves the utilization of computing power resources.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于硬件+程序类实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the related parts, refer to the description of the method embodiment.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The specific embodiments of the present specification have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and the desired result may still be achieved. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
虽然本申请提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的劳动可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或客户端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境)。Although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the steps, and does not represent the only order of execution. When the actual device or client product is executed, it may be executed sequentially or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded environment).
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, and a tablet. A computer, a wearable device, or a combination of any of these devices.
虽然本说明书实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非 排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。Although the embodiments of the specification provide method operation steps as described in the embodiments or flowcharts, conventional or non-creative methods may include more or fewer operation steps. The order of steps listed in the embodiments is only one way of executing the steps, and does not represent the only order of execution. When an actual device or terminal product is executed, it may be executed sequentially or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or multi-threaded environment, or even a distributed data processing environment). The terms "including", "comprising", or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed Elements, or elements that are inherent to such a process, method, product, or device. Without more restrictions, it does not exclude that there are other identical or equivalent elements in the process, method, product or equipment including the elements.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书实施例时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing the embodiments of the present specification, the functions of each module may be implemented in the same or multiple software and / or hardware, or the module that implements the same function may be implemented by a combination of multiple submodules or subunits. The device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. To another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内部包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art also know that, in addition to implementing the controller in pure computer-readable program code, it is entirely possible to make the controller logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded controllers by logically programming the method steps. Microcontrollers and the like to achieve the same function. Therefore, such a controller can be considered as a hardware component, and the device included in the controller for implementing various functions can also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be regarded as a structure that can be both a software module implementing the method and a hardware component.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, so that the instructions generated by the processor of the computer or other programmable data processing device are used to generate instructions Means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions The device implements the functions specified in one or more flowcharts 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, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-persistent, removable and non-removable media. Information storage can be accomplished by any method or technology. Information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmitting medium may be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书的实施例可提供为方法、系统或计算机程序产品。因此,本说明书实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present specification may be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本说明书实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。Embodiments of the specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The embodiments of the present specification can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书实施例的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域 的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, refer to the description of the method embodiment. In the description of this specification, the description with reference to the terms “one embodiment”, “some embodiments”, “examples”, “specific examples”, or “some examples” and the like means specific features described in conjunction with the embodiments or examples , Structure, materials, or features are included in at least one embodiment or example of an embodiment of this specification. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples and features of different embodiments or examples without conflicting one another.
以上所述仅为本说明书实施例的实施例而已,并不用于限制本说明书实施例。对于本领域技术人员来说,本说明书实施例可以有各种更改和变化。凡在本说明书实施例的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本说明书实施例的权利要求范围之内。The above descriptions are merely examples of the embodiments of the present specification, and are not intended to limit the embodiments of the present specification. For those skilled in the art, the embodiments of the present specification may have various modifications and changes. Any modification, equivalent replacement, and improvement made within the spirit and principle of the embodiment of the present specification shall be included in the scope of claims of the embodiment of the present specification.

Claims (15)

  1. 一种用于P2P网络的计算资源查找方法,其特征在于,所述计算资源查找方法包括:A computing resource search method for a P2P network is characterized in that the computing resource search method includes:
    接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;Receiving a computing resource search request, wherein the computing resource search request includes a required computing power;
    根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。According to the required computing power, a corresponding preset computing power is found in the target P2P network based on the RFC7374 protocol, wherein the preset computing power is obtained by a computing node based on the RFC7374 protocol in the target P2P network.
  2. 根据权利要求1所述的计算资源查找方法,其特征在于,所述计算资源查找方法还包括:The computing resource search method according to claim 1, wherein the computing resource search method further comprises:
    在目标P2P网络中注册用于提供计算资源的计算节点;Register a computing node for providing computing resources in the target P2P network;
    基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。Based on the RFC7374 protocol, a computing resource corresponding to the computing node is released in a target P2P network.
  3. 根据权利要求2所述的计算资源查找方法,其特征在于,所述在目标P2P网络中注册用于提供计算资源的计算节点,包括:The method for finding computing resources according to claim 2, wherein the registering a computing node for providing computing resources in a target P2P network comprises:
    判断加入所述目标P2P网络中的计算节点的加入位置是否位于NAT设备之后;Determining whether a joining position of a computing node joining the target P2P network is behind a NAT device;
    若是,则获取所述计算节点对应的中继地址,以及,将该中继地址注册到所述目标P2P网络中;If yes, obtaining a relay address corresponding to the computing node, and registering the relay address in the target P2P network;
    否则,将所述计算节点的IP地址注册到所述目标P2P网络中。Otherwise, register the IP address of the computing node in the target P2P network.
  4. 根据权利要求3所述的计算资源查找方法,其特征在于,所述获取所述计算节点对应的中继地址,包括:The method for searching for a computing resource according to claim 3, wherein the obtaining a relay address corresponding to the computing node comprises:
    经由目标P2P网络中的服务发现模块,查找一个所述计算节点对应的TURN服务;Find a TURN service corresponding to the computing node via a service discovery module in the target P2P network;
    以及,在查找到的所述TURN服务中所述计算节点对应的获取中继地址。And, in the found TURN service, the computing node correspondingly obtains a relay address.
  5. 根据权利要求2所述的计算资源查找方法,其特征在于,所述基于RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源,包括:The method for searching for computing resources according to claim 2, wherein the publishing the computing resources corresponding to the computing nodes in a target P2P network based on the RFC7374 protocol comprises:
    在所述RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级;Selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
    确定所述计算节点的预设算力在该初始层级的空间位置,并生成该计算节点的第一资源ID;Determining a spatial position of the preset computing power of the computing node at the initial level, and generating a first resource ID of the computing node;
    将对应的第一资源ID及预设算力发布至对应的空间位置中,以及,判断所述预设算力是否满足第一预设条件,若是,则将所述预设算力存储在所述初始层级中。Publishing the corresponding first resource ID and preset computing power to the corresponding spatial location, and determining whether the preset computing power satisfies the first preset condition, and if so, storing the preset computing power in all locations Described in the initial hierarchy.
  6. 根据权利要求5所述的计算资源查找方法,其特征在于,所述计算资源查找方法还包括:The computing resource search method according to claim 5, wherein the computing resource search method further comprises:
    若所述预设算力未满足第一预设条件,则根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求。If the preset computing power does not satisfy the first preset condition, a computing power storage request is sent to a level other than the initial level according to the first preset rule.
  7. 根据权利要求6所述的计算资源查找方法,其特征在于,所述根据第一预设规则向除所述初始层级外的其他层级发送算力存储请求,包括:The method for searching for a computing resource according to claim 6, wherein the sending a computing power storage request to a hierarchy other than the initial hierarchy according to a first preset rule comprises:
    若所述计算节点的预设算力值为对应空间位置的中当前最大值、最小值或边界值,则向所述初始层级的下一层发送算力存储请求,并将预设算力存储在所述初始层级的下一层中;If the preset computing power value of the computing node corresponds to the current maximum, minimum, or boundary value of the corresponding spatial position, sending a computing power storage request to the next layer of the initial level and storing the preset computing power In the next level of the initial level;
    若所述计算节点的预设算力值为对应的空间位置中的唯一值或所述初始层级的上一层的边界值,则向所述初始层级的上一层发送算力存储请求,并将预设算力存储在所述初始层级的上一层中。If a preset computing power value of the computing node is a unique value in a corresponding spatial position or a boundary value of a layer above the initial level, sending a computing power storage request to a layer above the initial level, and The preset computing power is stored in a layer above the initial level.
  8. 根据权利要求1所述的计算资源查找方法,其特征在于,所述根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,包括:The method for searching for computing resources according to claim 1, wherein the searching for the corresponding preset computing power in the target P2P network based on the RFC7374 protocol according to the required computing power comprises:
    在RFC7374协议的多叉树中选取初始层级,其中,所述初始层级为除多叉树的首个层级之外的任一层级;Selecting an initial level in the multi-tree of the RFC7374 protocol, wherein the initial level is any level other than the first level of the multi-tree;
    确定所述需求算力在初始层级的空间位置,并生成所述需求算力对应的第二资源ID;Determining a spatial position of the demand computing power at an initial level, and generating a second resource ID corresponding to the demand computing power;
    以及,根据所述第二资源ID在初始层级的空间位置查找对应的预设算力。And, according to the second resource ID, a corresponding preset computing power is searched at the spatial position of the initial level.
  9. 根据权利要求8所述的计算资源查找方法,其特征在于,所述计算资源查找方法还包括:The computing resource search method according to claim 8, wherein the computing resource search method further comprises:
    若根据所述第二资源ID在初始层级的空间位置未查找到对应的预设算力,则根据第二预设规则向除所述初始层级外的其他层级发送查询请求。If the corresponding preset computing power is not found according to the second resource ID in the spatial position of the initial hierarchy, a query request is sent to the hierarchy other than the initial hierarchy according to the second preset rule.
  10. 根据权利要求9所述的计算资源查找方法,其特征在于,所述根据第二预设规则向除所述初始层级外的其他层级发送查询请求,包括:The method for searching for computing resources according to claim 9, wherein the sending a query request to a layer other than the initial layer according to a second preset rule comprises:
    判断根据所述第二资源ID在初始层级的空间位置查找对应的预设算力的查询结果中是否有后继结点;Judging whether there is a subsequent node in the query result of searching for the corresponding preset computing power in the spatial position of the initial level according to the second resource ID;
    若是,则在所述初始层级的上一层的空间位置继续查找对应的预设算力;If yes, continue to find the corresponding preset computing power at the spatial position one level above the initial level;
    若否,则在所述初始层级的下一层的空间位置继续查找对应的预设算力。If not, continue to find the corresponding preset computing power at the spatial position of the next level of the initial level.
  11. 根据权利要求8所述的计算资源查找方法,其特征在于,所述计算资源查找方法还包括:The computing resource search method according to claim 8, wherein the computing resource search method further comprises:
    若所述需求算力为所述初始层级的空间位置的边界值,则确定所述目标p2p网络中不存在所述需求算力对应的预设算力,并停止查找。If the required computing power is a boundary value of the spatial position of the initial level, it is determined that a preset computing power corresponding to the required computing power does not exist in the target p2p network, and the search is stopped.
  12. 一种用于P2P网络的计算资源查找系统,其特征在于,所述计算资源查找系统包括:A computing resource search system for a P2P network is characterized in that the computing resource search system includes:
    计算资源查找请求接收模块,用于接收计算资源查找请求,其中,所述计算资源查找请求中包含有需求算力;A computing resource search request receiving module, configured to receive a computing resource search request, wherein the computing resource search request includes a required computing power;
    计算资源查找模块,用于根据所述需求算力,基于RFC7374协议在目标P2P网络中查找对应的预设算力,其中,所述预设算力由计算节点基于所述RFC7374协议在所述目标P2P网络中发布而得。A computing resource search module is configured to find a corresponding preset computing power in a target P2P network based on the RFC7374 protocol according to the required computing power, wherein the preset computing power is calculated by the computing node based on the RFC7374 protocol at the target Published in P2P networks.
  13. 根据权利要求12所述的计算资源查找系统,其特征在于,所述计算资源查找系统还包括:The computing resource search system according to claim 12, wherein the computing resource search system further comprises:
    计算节点注册模块,用于在目标P2P网络中注册用于提供计算资源的计算节点;A computing node registration module, configured to register a computing node for providing computing resources in a target P2P network;
    计算资源发布模块,用于基于所述RFC7374协议在目标P2P网络中发布所述计算节点对应的计算资源。A computing resource issuing module is configured to release a computing resource corresponding to the computing node in a target P2P network based on the RFC7374 protocol.
  14. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1至11任一项所述用于P2P网络的计算资源查找方法的步骤。An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements any one of claims 1 to 11 when executing the program. Steps of a computing resource finding method for a P2P network.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1至11任一项所述用于P2P网络的计算资源查找方法的步骤。A computer-readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method for searching for a computing resource for a P2P network according to any one of claims 1 to 11.
PCT/CN2019/092682 2018-07-10 2019-06-25 Computing resource searching method and system for p2p network WO2020011012A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810750370.5A CN109062687A (en) 2018-07-10 2018-07-10 Computing resource lookup method and device for P2P network
CN201810750370.5 2018-07-10

Publications (1)

Publication Number Publication Date
WO2020011012A1 true WO2020011012A1 (en) 2020-01-16

Family

ID=64819334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092682 WO2020011012A1 (en) 2018-07-10 2019-06-25 Computing resource searching method and system for p2p network

Country Status (2)

Country Link
CN (1) CN109062687A (en)
WO (1) WO2020011012A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111869303A (en) * 2020-06-03 2020-10-30 北京小米移动软件有限公司 Resource scheduling method, device, communication equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062687A (en) * 2018-07-10 2018-12-21 矩阵元技术(深圳)有限公司 Computing resource lookup method and device for P2P network
CN110532092A (en) * 2019-08-21 2019-12-03 云湾科技(嘉兴)有限公司 Reso urce matching method, device and equipment
CN113765942A (en) * 2020-06-01 2021-12-07 杭州嘉楠耘智信息科技有限公司 Cloud computing power distribution method, user terminal, cloud computing power platform and system
CN112702390B (en) * 2020-12-07 2022-04-15 北京大学 Block chain-based networking method and device for intelligent contract resources
CN114691349A (en) * 2020-12-31 2022-07-01 维沃移动通信有限公司 Information processing method, device, equipment and storage medium
CN114691352A (en) * 2020-12-31 2022-07-01 维沃移动通信有限公司 Information processing method, device, equipment and storage medium
CN115604106A (en) * 2021-06-28 2023-01-13 华为技术有限公司(Cn) Calculation power distribution method, calculation power updating method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101969681A (en) * 2010-11-08 2011-02-09 中国人民解放军空军工程大学 Realization method of router of large-scale mobile self-organizing network
WO2014086252A1 (en) * 2012-12-04 2014-06-12 华为终端有限公司 Device association method, apparatus, and system
CN109062687A (en) * 2018-07-10 2018-12-21 矩阵元技术(深圳)有限公司 Computing resource lookup method and device for P2P network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170572A (en) * 2006-10-23 2008-04-30 日电(中国)有限公司 Multimedia network communication system based on P2P SIP technology
CN100484040C (en) * 2007-04-20 2009-04-29 北京航空航天大学 System and method for implementing network resource adaptive
CN101355473B (en) * 2007-07-27 2010-09-22 华为技术有限公司 Method for publishing and searching mobile self-networking resource as well as mobile self-networking network node equipment
CN101964970B (en) * 2009-07-24 2014-12-10 中兴通讯股份有限公司 Method and system for acquiring network node address by using relay node
CN103347087B (en) * 2013-07-16 2016-12-28 桂林电子科技大学 The service registry of a kind of structural P 2 P and UDDI and lookup method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101969681A (en) * 2010-11-08 2011-02-09 中国人民解放军空军工程大学 Realization method of router of large-scale mobile self-organizing network
WO2014086252A1 (en) * 2012-12-04 2014-06-12 华为终端有限公司 Device association method, apparatus, and system
CN109062687A (en) * 2018-07-10 2018-12-21 矩阵元技术(深圳)有限公司 Computing resource lookup method and device for P2P network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
J. MAENPAA ET AL.: "Service Discovery Usage for REsource LOcation And Discovery (RELOAD)", INTERNET ENGINEERING TASK FORCE (IETF) RFC7374, 31 October 2014 (2014-10-31), pages 9, XP015104482, Retrieved from the Internet <URL:https://tools.ietf.org/pdf/rfc7374.pdf> *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111869303A (en) * 2020-06-03 2020-10-30 北京小米移动软件有限公司 Resource scheduling method, device, communication equipment and storage medium
WO2021243618A1 (en) * 2020-06-03 2021-12-09 北京小米移动软件有限公司 Resource scheduling method and apparatus, and communication device and storage medium
CN111869303B (en) * 2020-06-03 2023-10-17 北京小米移动软件有限公司 Resource scheduling method, device, communication equipment and storage medium

Also Published As

Publication number Publication date
CN109062687A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
WO2020011012A1 (en) Computing resource searching method and system for p2p network
US10187463B2 (en) Using a shared data store for peer discovery
KR102566892B1 (en) Blockchain consensus method, device and system
EP2005709B1 (en) Service registry and relevant system and method
Bandara et al. Collaborative applications over peer-to-peer systems–challenges and solutions
US20210176160A1 (en) Method and device for synchronizing node of blockchain
JP5907709B2 (en) Energy efficient content caching with custodian-based routing in content-centric networks
US10235384B2 (en) Servicing database operations using a messaging server
KR20120062845A (en) Chunked downloads over a content delivery network
US8768886B2 (en) Using AMQP for replication
JP2020102189A (en) Method, apparatus and system for processing data
US9628559B2 (en) Optimizing resource downloads or streams using a collection of trusted network connected endpoints
WO2020024648A1 (en) Data processing method and device, client, and server
Elgazzar et al. Mobile web services: state of the art and challenges
EP4121931A1 (en) Using secure multi-party computation and probabilistic data structures to protect access to information
US11012506B2 (en) Node and cluster management on distributed self-governed ecosystem
WO2023231343A1 (en) Method for running consortium chain network, and consortium chain network and node device for consortium chain network
WO2020031157A1 (en) Method and apparatus for network function selection scheme in service based architecture of communication network
US20220263759A1 (en) Addressing method, addressing system, and addressing apparatus
CN110168513A (en) The part of big file is stored in different storage systems
WO2020024649A1 (en) Data processing method and apparatus, and server
US20240106889A1 (en) Data resource storage method and apparatus, data resource query method and apparatus, and electronic device
JP2005234878A (en) Resource retrieval system and method
US20220247803A1 (en) Dynamic data stream processing for apache kafka using graphql
Antoine et al. Multiple order-preserving hash functions for load balancing in P2P networks

Legal Events

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

Ref document number: 19834262

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19834262

Country of ref document: EP

Kind code of ref document: A1