Resource acquisition method and apparatus, electronic device, and storage medium
By introducing multiple access layers and storage clusters into the peer-to-peer network system, and using the local storage cluster to determine the target resource node, the tracker server binding problem is solved, the scope and efficiency of resource acquisition are improved, and the stability and adaptability of the system are enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECH (BEIJING) CO LTD
- Filing Date
- 2022-09-15
- Publication Date
- 2026-06-26
AI Technical Summary
In peer-to-peer network systems, existing technologies bind tracker servers to local computer clusters, which limits the scope of resource acquisition, and server malfunctions affect the effectiveness of resource acquisition.
By introducing multiple access layers and storage clusters into the node service object, the local storage cluster is used to receive resource search requests, extract resource feature information, and determine the node of the target resource based on the resource configuration information, thereby realizing resource acquisition.
It improves the scope and efficiency of resource queries, reduces the impact of expansion or contraction on resource acquisition, and enhances the stability and adaptability of resource acquisition.
Smart Images

Figure CN117749807B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet communication technology, and in particular to a resource acquisition method, apparatus, electronic device and storage medium. Background Technology
[0002] In a peer-to-peer (P2P) networking system, each computer acts as both a requester of network services and a responder to requests from other computers, providing resources, services, and content. To ensure that computers can effectively acquire resources, a tracker server is introduced (which provides tracker functionality, i.e., determines how many people are simultaneously downloading the same file). The tracker server provides computer A with information about computer B that can provide the relevant resources. However, in related technologies, there is often a binding relationship between a tracker server and a local computer cluster; that is, the tracker server serves only that local computer cluster. When a computer in that local computer cluster needs to acquire relevant resources, it queries other computers in that local computer cluster through the tracker server. This limited query scope affects the effectiveness of acquiring relevant resources. Furthermore, if the tracker server serving the local computer cluster malfunctions, it also affects the effectiveness of acquiring relevant resources. Therefore, a stable and effective resource acquisition solution is needed. Summary of the Invention
[0003] To address at least one of the aforementioned technical problems, this application provides a resource acquisition method, apparatus, electronic device, and storage medium:
[0004] According to a first aspect of this application, a resource acquisition method is provided, applied to a node service object, the node service object including multiple access layers and multiple storage clusters, the node service object serving multiple nodes, the multiple nodes executing a peer-to-peer network protocol, the method comprising:
[0005] The resource search request sent by the first node is received by any one of the multiple access layers, and the resource search request is sent to the local storage cluster corresponding to the first node. The first node is any one of the multiple nodes, and the local storage cluster belongs to the multiple storage clusters.
[0006] The local storage cluster is used to extract resource feature information from the resource search request, and the resource configuration information of the local storage cluster is used to determine a second node that can provide the target resource. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The second node is any node among the plurality of nodes other than the first node.
[0007] The local storage cluster is used to send the node information of the second node to the first node, so that the first node can obtain the target resource from the second node.
[0008] According to a second aspect of this application, a resource acquisition device is provided, configured on a node service object, the node service object including multiple access layers and multiple storage clusters, the node service object serving multiple nodes, the multiple nodes executing a peer-to-peer network protocol, the device comprising:
[0009] Response module: used to receive a resource search request sent by a first node using any one of the plurality of access layers, and to send the resource search request to the local storage cluster corresponding to the first node, wherein the first node is any one of the plurality of nodes, and the local storage cluster belongs to the plurality of storage clusters;
[0010] The determining module is used to extract resource feature information from the resource search request using the local storage cluster, and to determine a second node that can provide the target resource based on the resource configuration information of the local storage cluster corresponding to the first node. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The local storage cluster belongs to the node service object, and the second node is any node other than the first node among the plurality of nodes.
[0011] Acquisition module: used to send the node information of the second node to the first node using the local storage cluster, so that the first node can acquire the target resource from the second node.
[0012] According to a third aspect of this application, an electronic device is provided, the electronic device including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the at least one processor to implement the resource acquisition method as described in the first aspect.
[0013] According to a fourth aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or at least one program being loaded and executed by a processor to implement the resource acquisition method as described in the first aspect.
[0014] According to a fifth aspect of this application, a computer program product is provided, the computer program product comprising at least one instruction or at least one program segment, the at least one instruction or at least one program segment being loaded and executed by a processor to implement the resource acquisition method as described in the first aspect.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application.
[0016] Implementing this application will have the following beneficial effects:
[0017] This application defines the connotation of resource configuration information for the local storage cluster in the node service object. This resource configuration information also involves remote nodes. Simultaneously, the local storage cluster provides resource search services for local nodes, thus balancing the increase in the range of searchable nodes with the improvement in resource search efficiency. The resource configuration information involves a first correspondence based on local nodes and a second correspondence based on local resources. The establishment of these two types of correspondences helps to avoid single-machine limitations and also provides conditions for scaling up and down the local storage cluster. This reduces the impact of scaling up and down on resource acquisition, thereby improving the stability and adaptability of resource acquisition. Any one of the multiple access layers can independently process node requests, and each access layer can forward received node requests to downstream services. Thus, the multiple access layers are stateless services, supporting random access and lossless scaling up and down of machines.
[0018] Other features and aspects of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This diagram illustrates an application environment according to an embodiment of the present application.
[0021] Figure 2 A flowchart illustrating a resource acquisition method according to an embodiment of this application is shown;
[0022] Figure 3 This diagram illustrates a process for updating resource configuration information of a storage cluster according to an embodiment of this application.
[0023] Figure 4 A flowchart illustrating a resource acquisition method according to an embodiment of this application is also shown;
[0024] Figure 5 This diagram illustrates the architecture of a node service object according to an embodiment of this application.
[0025] Figure 6 A flowchart illustrating the resource fragmentation system according to an embodiment of this application is shown;
[0026] Figure 7 This diagram illustrates a device block diagram according to an embodiment of the present application;
[0027] Figure 8 A schematic diagram of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0030] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0031] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0032] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0033] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed description. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0034] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0035] Peer: Seed, node.
[0036] Please see Figure 1 , Figure 1The diagram illustrates an application environment according to an embodiment of this application. The application environment may include multiple nodes (e.g., a node in location A, a node in location B) and node service objects. Node service objects may include multiple storage clusters (e.g., a storage cluster in location A, a storage cluster in location B). Nodes and node service objects can be directly or indirectly connected via wired or wireless communication. Nodes can also be directly or indirectly connected to each other via wired or wireless communication. The node service object receives a resource search request from a first node (e.g., a node in location A), extracts resource feature information from the resource search request, and the first node can be any of the multiple nodes. Based on the resource configuration information of the local storage cluster (e.g., the storage cluster in location A) corresponding to the first node, the node service object determines a second node (e.g., a node in location B or another node in location A) that can provide the target resource. The target resource corresponds to the resource feature information, and the resource configuration information represents the first correspondence between the local node and the local resources that can be provided, and the second correspondence between the local resources and the remote nodes that can provide the local resources. The local storage cluster belongs to the node service object, and the second node can be any of the multiple nodes other than the first node. The node service object sends the node information of the second node to the first node so that the first node can obtain the target resource from the second node.
[0037] It should be noted that, Figure 1 This is just one example.
[0038] Nodes can be physical devices such as smartphones, computers (desktops, tablets, laptops), augmented reality (AR) / virtual reality (VR) devices, digital assistants, smart voice interaction devices (such as smart speakers), smart wearable devices, smart home appliances, and in-vehicle terminals. They can also be software running on these physical devices, such as computer programs. The operating system corresponding to a node can be Android, iOS (a mobile operating system developed by Apple), Linux, or Microsoft Windows.
[0039] The node service object can be a server cluster or a distributed system consisting of multiple servers. Servers can be physical servers or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Servers may include network communication units, processors, and memory, etc.
[0040] In practical applications, nodes can be viewed as clients, and node service objects can be viewed as servers providing backend services to clients. The resource acquisition scheme provided in this application can utilize cloud computing technologies. Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." Resources in the "cloud" appear infinitely scalable to users, and can be accessed at any time, used on demand, expanded as needed, and paid for based on usage. As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed within this pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices. Logically, a PaaS (Platform as a Service) layer can be deployed on top of the IaaS layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be directly deployed on top of IaaS. PaaS is a platform for running software, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally, SaaS and PaaS are upper layers compared to IaaS.
[0041] It should be noted that when node information, resource identifiers, etc., which are related to user information, are applied to specific products or technologies in this application embodiment, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0042] Figure 2 This diagram illustrates a flowchart of a resource acquisition method according to an embodiment of this application. Figure 2 As shown, the method includes:
[0043] S201: Receive a resource search request sent by the first node using any one of the multiple access layers, and send the resource search request to the local storage cluster corresponding to the first node, wherein the first node is any one of the multiple nodes, and the local storage cluster belongs to the multiple storage clusters.
[0044] In this embodiment of the application, any one of multiple access layers is used to receive the resource search request sent by the first node, and to send the resource search request to the local storage cluster corresponding to the first node. For example... Figure 1 As shown, the first node is any one of multiple nodes. The multiple nodes execute a peer-to-peer network protocol, meaning each node has equal status. The node service object includes multiple access layers and multiple storage clusters. Any one of the access layers receives a resource search request and then forwards it to the local storage cluster corresponding to the first node. This local storage cluster belongs to multiple storage clusters. The node service object serves multiple nodes, managing the resource status of the current node in the P2P network system and providing resource search services. For example, the node service object stores the correspondence between the current node and the resources it can provide; it receives resource search requests from the current node and returns the search results. In practical applications, the node service object can also provide tracker functionality, determining how many people are simultaneously downloading the same file. The node service object can be derived from improvements to tracker servers in related technologies.
[0045] A resource search request can be generated by the first node based on resource feature information. The first node sends a resource search request to its service objects, aiming to request feedback from the service objects about other nodes that can provide relevant resources. Resource feature information can represent at least one of the resource identifier features and resource content features of the resource to be acquired. To effectively manage resources, resources are often assigned resource identifiers for easy storage and retrieval. Resource identifiers can exist in different dimensions, such as time-based resource identifiers or data format-based resource identifiers. Correspondingly, resource identifier features can be derived from these different dimensions of resource identifiers. Taking a video resource as an example, the resource content features can include at least one of the following: audio content features, image content features, and text content features.
[0046] S202: Extract resource feature information from the resource search request using the local storage cluster, and determine a second node that can provide the target resource based on the resource configuration information of the local storage cluster. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The second node is any node among the plurality of nodes other than the first node.
[0047] In this embodiment, a local storage cluster is used to extract resource feature information from a resource search request, and a second node capable of providing the target resource is determined based on the resource configuration information of the local storage cluster. The local storage cluster stores a first correspondence between the current local node and the local resources that can be provided, and a second correspondence between the local resources and the current remote nodes that can provide the local resources. The target resource is the resource corresponding to the resource feature information. The second node is any node other than the first node among multiple nodes. That is, in response to the resource search request of the first node, the node service object determines other nodes capable of providing the target resource from the currently searchable nodes of the P2P network system (composed of the aforementioned current local node and current remote node).
[0048] For example, the resource to be retrieved can indicate the on-demand resource currently displayed by the first node. It can be understood that a user watches on-demand resource 'a' through the interactive interface provided by the first node, and the resource search request is triggered by the user through the interactive interface. The resource feature information represents at least one of the resource identifier features and resource content features of on-demand resource 'a'. The resource search request is used to request the node service object to provide information from other nodes that can provide on-demand resource 'a'. In practical applications, the resource feature information here can indicate the resource identifier providing on-demand resource 'a'.
[0049] The current nodes in the P2P network system are nodes 1-100 in location A and nodes 1-150 in location B. The storage cluster in location A stores a first correspondence between each node in location A and the resources it can provide (i.e., resources in location A). If all nodes in location A can provide resources 1-1000, and node 1 in location B can provide resource 50 and node 2 in location B can provide resource 500, then the storage cluster in location A also stores a second correspondence between resource 50 and node 1 in location B, and a second correspondence between resource 500 and node 2 in location B. Accordingly, node 1 in location A sends a resource search request to the node service object. If the resource feature information extracted from the resource search request indicates resource 50, then the node service object can determine other nodes in location A and node 1 in location B that can provide resource 50 based on the resource configuration information of the storage cluster in location A.
[0050] The terms "local" and "remote" can be understood as follows: a node and its corresponding local storage cluster are in the same geographical location, while a node and its corresponding remote storage cluster are in different geographical locations. Node i in location A and node j in location A are in the same geographical location. Node A in location A and node B in location B are in different geographical locations. The range of geographical locations can be pre-defined or flexibly adjusted as needed. A node's geographical location can be determined based on its own claimed geographical location or the geographical location of the node's domain name resolution. The geographical location of the storage cluster can be determined based on the geographical location indicated by the storage cluster's configuration information. This geographical location can be the actual geographical location of the physical machines, the first represented geographical location of the virtual machines, or a second represented geographical location combining physical machines and virtual machines.
[0051] A storage cluster can include multiple storage servers. For a local storage cluster comprising multiple local storage servers, if we consider the "first correspondence between the current local node and the local resources it can provide, and the second correspondence between the local resources and the current remote nodes that can provide those local resources" as a whole, then each local storage server can store a portion of this whole's correspondence, and all local storage servers thus implement the storage of this whole. It should be noted that there can be overlap between the correspondences stored by different local storage servers.
[0052] Based on this, the node service object can poll the mapping relationships stored on multiple local storage servers to determine the second node capable of providing the target resource. The order in which the node service object polls the mapping relationships stored on multiple local storage servers can be random. It can choose the first node determined based on the mapping relationship stored on a particular storage server as the second node; or it can first determine at least two candidate nodes capable of providing the target resource, and then, based on the first node, choose the nearest node among the at least two candidate nodes as the second node. The determination time corresponding to the at least two candidate nodes must meet the requirements of a preset time interval, and the geographical location of the domain name resolution node used by the nearest node must be close to the geographical location of the domain name resolution node used by the first node. Alternatively, there can be at least two second nodes.
[0053] In practical applications, if a second node capable of providing the target resource cannot be determined based on the resource configuration information of the local storage cluster, the node service object can also determine the second node capable of providing the target resource based on the resource configuration information of the remote storage cluster. If there are at least two remote storage clusters, the node service object can poll the storage configuration information of each of the at least two remote storage servers to determine the second node capable of providing the target resource.
[0054] S203: Use the local storage cluster to send the node information of the second node to the first node, so that the first node can obtain the target resource from the second node.
[0055] In this embodiment, a local storage cluster is used to send node information of a second node to a first node. The first node can locate the second node belonging to the same P2P network system based on this node information. The first node sends a resource acquisition request indicating the target resource to the second node, and then receives resource data related to the target resource returned by the second node.
[0056] The following sections will introduce how node service objects update the resource configuration information of the storage cluster, how to define resource information to adapt to on-demand scenarios, and how to respond to login requests.
[0057] 1) How do node service objects update the resource configuration information of the storage cluster?
[0058] like Figure 3 As shown, the node service object also includes a synchronization server and multiple storage interface layers. The synchronization server is used to relay data received from the storage interface layers to a remote storage cluster. The method further includes:
[0059] S301: In response to the resource reporting request sent by the first node for the resource to be reported, the third correspondence between the first node and the resource to be reported is recorded using the local storage interface layer corresponding to the first node, wherein the local storage interface layer belongs to the plurality of storage interface layers.
[0060] S302: Use the local storage interface layer to send the third correspondence to the local storage cluster and the synchronization server respectively;
[0061] S303: Update the current resource configuration information using the local storage cluster based on the third correspondence relationship, and update the current resource configuration information using the local storage cluster based on the relay data received from the synchronization server.
[0062] like Figure 5As shown, the synchronization server corresponds to the synchronization center in the diagram, the storage interface layer corresponds to the storage interface layer in the diagram, and the storage cluster corresponds to the storage in the diagram. Taking location A as an example, when node i in location A sends a resource reporting request for resource k, the node service object uses the storage interface layer in location A to record the correspondence ik between node i in location A and resource k. The node service object then uses the storage interface layer in location A to send the correspondence ik to the storage cluster in location A. Finally, the node service object uses the storage interface layer in location A to send the correspondence ik to the synchronization server.
[0063] Storage cluster A updates its current resource configuration information based on the corresponding relationship ik. This can be understood as storage cluster A adding the corresponding relationship ik to a list of relationships maintained by storage cluster A. This list can include two sublists: a first sublist and a second sublist. The first sublist records the first correspondence based on the local node, and the second sublist records the second correspondence based on the local resources. Here, storage cluster A adds the corresponding relationship ik to the first sublist.
[0064] Storage cluster A updates its current resource configuration information based on relay data received from the synchronization server. For example, the synchronization server receives a mapping relationship jt sent by the storage interface layer of storage cluster B. Mapping relationship jt represents the mapping relationship between node j and resource t in storage cluster B. The synchronization server forwards mapping relationship jt to storage cluster A. Storage cluster A searches its maintained mapping relationship list. If resource t is found, mapping relationship jt is added to the mapping relationship list maintained by storage cluster A. Here, storage cluster A adds mapping relationship jt to the second sublist. The establishment of the first and second sublists allows for better maintenance of mapping relationships, improving the accuracy and efficiency of locating relevant resources and nodes.
[0065] The above provides the update logic for the resource configuration information of the local storage cluster. This helps to avoid the limitations of a single machine and ensures the information content of the resource configuration information of the local storage cluster, thereby improving the accuracy and efficiency of locating available nodes to a certain extent.
[0066] In practical applications, the resource configuration information of a local storage cluster represents not only the first correspondence between local nodes and the local resources they can provide, and the second correspondence between local resources and remote nodes that can provide local resources, but also the correspondence between remote resources and remote nodes that can provide remote resources. The correspondence between remote resources and remote nodes that can provide remote resources generally comes from relay data sent by the synchronization server. This ensures that each storage cluster maintains the resource status of all global nodes, which helps improve the speed of locating available nodes. Available nodes can be quickly located regardless of whether the resource to be acquired is local or remote. Combining the first and second sublists mentioned above, the correspondence list maintained by the storage cluster can also include a third sublist, which records the correspondence between remote resources and remote nodes that can provide remote resources. When locating an available node that can provide the resource to be acquired, the storage cluster first searches the first and second sublists; if the search fails, it then searches the third sublist.
[0067] Furthermore, 1) the local storage cluster includes multiple local storage servers, and the step of sending the third correspondence to the local storage cluster using the local storage interface layer may include the following steps: First, using the local storage interface layer to determine the target local storage server corresponding to the resource identifier of the resource to be reported from the multiple local storage servers according to the consistent hashing algorithm; then, using the local storage interface layer to send the third correspondence to the target local storage server.
[0068] Considering the potentially large amount of data requiring storage of correspondences, a consistent hashing algorithm can be used to evenly distribute this data across local storage servers. Specifically, a consistent hashing ring can be constructed, which can be 2... 32The hash space corresponding to -1 corresponds to a ring. For multiple local storage servers, the device identifiers of the local storage servers can be hashed to obtain device hash values, which are then used to map the local storage servers to the consistent hash ring. The resource identifiers of the resources to be reported can be hashed to obtain resource hash values; then, based on the resource hash values, associated device hash values can be determined on the consistent hash ring, and the local storage server corresponding to the associated device hash value is determined as the target local storage server. If a device hash value equal to the resource hash value exists, then that device hash value is used as the associated device hash value. If no device hash value equal to the resource hash value exists, then the device hash value adjacent to the resource hash value in the clockwise direction on the consistent hash ring is used as the associated device hash value. Furthermore, combining the first and second sublists mentioned above, the application of the consistent hash algorithm here uses resource identifiers, which also facilitates more accurate and efficient processing of relay data from the synchronization server.
[0069] 2) The local storage cluster includes multiple local storage servers, and the method may further include the following steps: First, in response to a storage data update request from a target object, determine the target local storage server and update type for which the storage data update request is directed, wherein the target local storage server belongs to the multiple local storage servers; then, from multiple processes running on the target local storage server, determine the target process corresponding to the update type, wherein each process is responsible for maintaining the execution of an internal thread; furthermore, generate update operation guidance information based on the internal thread of the target process, wherein the update operation guidance information is used to guide the target object to perform storage data update using the internal thread of the target process.
[0070] This provides the conditions for target objects (such as staff) to participate in the maintenance of stored data (such as correspondences and correspondence lists). This form of stored data maintenance allows for timely anomaly detection and handling. Storage data update requests can represent the target object's intention to read or write resource information, or its intention to read or write node information. Considering the potential for a large number of read / write operations on resource or node information, errors can occur if multiple threads write to the same memory block. To avoid these errors, the storage server adopts a multi-process, single-threaded approach. Multiple processes exist on a single machine, each with one thread. This ensures that the write operations performed by each thread do not overlap or interfere with each other, guaranteeing staggered execution of write operations by each process, thereby ensuring the stability of each process and the stability of stored data updates.
[0071] For a local storage server, each of the multiple processes corresponds to an update type. This can be understood as a set of update types, including update types at the node information level and update types at the resource information level. In practical applications, if a storage data update request is a write operation on node x, the update type can be determined as node x - write operation type, and the target process can be routed to it based on node x. If a storage data update request is a write operation on resource y, the update type can be determined as resource y - write operation type, and the target process can be routed to it based on resource y.
[0072] (ii) How should node service objects define resource information to adapt to on-demand scenarios?
[0073] The on-demand playback scenario is characterized by a large resource information database, no concept of latency, and low aggregation of viewing segments on the client (corresponding to the aforementioned nodes). For example, if a video episode is 40 minutes long or a movie is 2 hours long, determining the corresponding video or movie segments based on the entire episode or movie would result in low certainty, impacting resource acquisition efficiency. To address this issue, this application's embodiments define resource information adapted to the on-demand playback scenario and apply this to the resource acquisition process. This resource information definition for the on-demand playback scenario introduces the concept of resource fragmentation, which improves the granularity of resource management and the efficiency of locating resources to be acquired.
[0074] For applications that define resource information to suit on-demand playback scenarios, taking the process of responding to resource reporting requests as an example, the node service object receives a resource reporting request sent by the first node for the resource to be reported. Then, when the resource to be reported consists of multiple fragments, a corresponding fragment identifier is configured for each fragment. Furthermore, based on the resource identifier of the resource to be reported, the fragment identifier corresponding to each fragment, and the content feature information corresponding to each fragment, the information of the resource to be reported is obtained. If the resource to be reported is resource z, and resource z consists of fragments 1-20, a fragment identifier m is configured for fragment m, where m is 1-20. The information of resource z includes the resource identifier of resource z, fragment identifiers 1-20, and the content feature information corresponding to each of fragments 1-20.
[0075] like Figure 4As shown, the resource configuration information also includes information about each of the multiple reported resources constituting the local resource. The information for each reported resource includes the resource identifier of the reported resource, the fragment identifier corresponding to each of the multiple fragments constituting the reported resource, and content feature information. The step of using the local storage cluster to determine the second node capable of providing the target resource based on the resource configuration information of the local storage cluster includes:
[0076] S401: Using the local storage cluster based on the information of each of the multiple reported resources, determine the target shard corresponding to the resource feature information and the target reported resource to which the target shard belongs;
[0077] S402: Using the local storage cluster based on the first correspondence and the second correspondence, determine the second node that can provide the resources reported by the target;
[0078] Accordingly, sending the node information of the second node to the first node using the local storage cluster includes: sending the node information of the second node, the fragment identifier of the target fragment, and the resource identifier of the target reported resources to the first node using the local storage cluster.
[0079] Taking fragment w of resource u as the resource to be acquired as an example, fragment w can be the on-demand resource currently displayed by the first node. A) If the resource feature information includes the resource identifier feature and resource content feature of fragment w, and the resource identifier feature indicates the fragment identifier of fragment w, and the resource content feature indicates the content feature information of fragment w, then the target fragment can be located by the fragment identifier and / or the content feature information of fragment w, thereby determining the target reported resource to which the target fragment belongs. B) If the resource feature information includes the resource content feature of fragment w, and the resource content feature indicates the content feature information of fragment w, then the target fragment can be located by the content feature information of fragment w, thereby determining the target reported resource to which the target fragment belongs. C) If the resource feature information includes the resource identifier feature of fragment w, and the resource identifier feature indicates the fragment identifier of fragment w, then the target fragment can be located by the fragment identifier of fragment w, thereby determining the target reported resource to which the target fragment belongs.
[0080] The target fragment is located using the fragment identifier of fragment w. This involves identifying the fragment identifier that matches the fragment identifier of fragment w from the information of multiple reported resources, and then determining the fragment corresponding to the matching fragment identifier as the target fragment. Alternatively, the target fragment can be located using the content feature information of fragment w. This involves identifying the content feature information that matches the content feature information of fragment w from the information of multiple reported resources, and then determining the fragment corresponding to the matching content feature information as the target fragment.
[0081] Based on the identified target reported resources, and according to the corresponding relationships within the local storage cluster, a second node capable of providing the target reported resources is determined. At least two second nodes can consist of the current local node and / or the current remote node. The node service object sends the node information of the second node, the fragment identifier of the target fragment, and the resource identifier of the target reported resource to the first node. The first node can locate the second node belonging to the same P2P network system based on the node information of the second node. The first node can generate a resource acquisition request based on the fragment identifier of the target fragment and the resource identifier of the target reported resource. The first node sends the resource acquisition request to the second node and then receives the resource data related to the target resource returned by the second node.
[0082] Furthermore, after sending the node information of the second node, the fragment identifier of the target fragment, and the resource identifier of the target reported resources to the first node, the method may further include the following steps: First, receiving a resource acquisition failure notification sent by the first node, the resource acquisition failure notification being generated based on the situation that the first node has failed to successfully acquire the target resource from the second node; then, generating supplementary resource information based on the resource acquisition failure notification.
[0083] Timely feedback after a node fails to acquire a resource is beneficial for the maintenance of the P2P network system. The reason a node fails to acquire a resource could be that the second node was offline before the first node sent the resource acquisition request, the second node went offline while returning resource data about the target resource to the first node, or the second node deleted the target resource from its local machine. Resource replenishment information can instruct the node service object to send node information about a current node capable of providing the target resource back to the first node.
[0084] In practical applications, such as Figure 6As shown, a resource fragmentation system can be introduced to divide a video file into multiple P2P files (corresponding to the fragmentation mentioned above). This divides the same video file into multiple P2P files, each assigned a P2P file ID (identifier). This process can be called video seeding. The production stage of on-demand resources is video transcoding, which produces multiple fragments. The seeding tool is an auxiliary process to video transcoding; it can be deployed on each transcoding machine. After transcoding into multiple fragments, the seeding tool reads the file information and sends it to the seeding system's write service for processing. The file information includes, but is not limited to, the video file ID (identifier), file size, and number of fragments. The write service request for file information indicates that each fragment of the same video file should be assigned a P2P file ID, meaning multiple P2P file IDs correspond to one video file ID. Upon receiving the request, the seeding system's write service calls the number distribution service, binds the P2P file ID with the "write service request for file information," and writes it to the database for storage. The number distribution service is responsible for generating different P2P file IDs and ensuring that the production results do not conflict or affect each other in the case of multi-machine deployment.
[0085] The client (corresponding to the aforementioned nodes) primarily interacts with the seeding system's read service. This service returns the P2P file ID and related video information for the requested video file ID, which the client uses for subsequent P2P download verification and seed checking. The content returned by the seeding system's read service is the content stored in the database. When the seeding system's read service fails to retrieve the relevant information from the database, it reports it to the message middleware. The statistics service reads and consumes messages from the message middleware in real time and sorts them by top, typically sending the top N messages to the seeding service. This top sorting can be understood as sorting the frequency of occurrence of the video file indicated by the message. The seeding service obtains the video file ID based on the reported message content, downloads the video file using the video file ID, and then calls the seeding tool deployed on the same machine to complete the seeding process.
[0086] (iii) How node service objects respond to login requests:
[0087] The node service objects include multiple identifier allocation servers. These multiple identifier allocation servers allocate mutually exclusive identifiers to the multiple nodes based on a distributed lock mechanism. Before receiving the resource search request sent by the first node using the target access layer, the method may further include the following steps: First, receiving the login request sent by the first node using any one of the multiple access layers, and sending the login request to the target identifier allocation server, where the target identifier allocation server is any one of the multiple identifier allocation servers; then, using the target identifier allocation server to allocate a corresponding identifier to the first node based on the login request.
[0088] The first node sends a login request to the node service object. The login request is received by any one of the multiple access servers of the node service object. The access server then forwards the login request to the target identifier allocation server, which is any one of the multiple identifier allocation servers.
[0089] When the target identifier allocation server assigns an identifier to the first node based on a login request, it can be understood that there exists an identifier pool, where all identifiers are unique. The identifier allocation server's assignment of an identifier is equivalent to retrieving an identifier from this pool. When the target identifier allocation server assigns an identifier to the first node, it locks the identifier pool, preventing other identifier allocation servers from retrieving identifiers from it. After the target identifier allocation server has assigned an identifier to the first node—meaning it has retrieved an identifier from the pool for the first node—it releases the lock on the identifier pool. Multiple identifier allocation servers form a multi-machine deployment, which improves the efficiency of identifier allocation. Furthermore, the use of a distributed lock mechanism ensures that the identifier allocation results of each machine do not conflict and do not affect each other.
[0090] The assigned identifier, combined with heartbeats, can be used to mark node status. In a P2P network system, a current node generally refers to a node that is online. Introducing heartbeats to mark node status reduces the number of data transmission connections established, thereby reducing the system's computational resource consumption. In response to a heartbeat packet sent by the first node, the node service object marks the first node as online. The first node sending a heartbeat packet to the node service object indicates that it has logged into the P2P network system, and simultaneously shows that it has no intention of logging out. The node service object can mark the first node as online based on the receipt of this heartbeat packet.
[0091] Furthermore, the node service object also includes multiple online servers. "In response to the heartbeat packet sent by the first node, the node service object marks the first node as being online" may include the following steps: 1) Receive the heartbeat packet sent by the first node using any one of the multiple access layers. The heartbeat packet carries the identifier corresponding to the first node; 2) Forward the heartbeat packet to the target online server based on a mapping relationship using any one of the multiple access layers. The mapping relationship represents the relationship between the identifier corresponding to the first node and the target online server. The target online server is the online server corresponding to the identifier corresponding to the first node determined from multiple online servers according to a consistent hashing algorithm; 3) Mark the first node as being online using the heartbeat packet using the target online server.
[0092] The identifier corresponding to the first node can be regarded as the account (such as a unique UIN) assigned to the first node when requesting to log in to the P2P network system. This mapping relationship can be saved by a mapping relationship storage module, which can store multiple mapping relationships, each corresponding to a node. The mapping relationship storage module can also provide a name service (corresponding to the identifier allocation service mentioned above). This name service is mainly used to implement consistent hash routing, and the hash key value of the route is the UIN corresponding to the node. This ensures that the relationship between the node and the online machine (corresponding to the online server mentioned above) remains locked and unchanged.
[0093] Considering that the process of marking node states may involve multiple heartbeat packets, and that multiple online servers can participate in node state marking, a consistent hashing algorithm is used to ensure that a single online server is responsible for marking the state of related nodes. Having a single online server responsible for marking the state of related nodes improves the accuracy of node state marking.
[0094] A consistent hashing ring can be constructed, which can be a ring corresponding to the hash space. For multiple online servers, the device identifiers of the online servers can be hashed to obtain device hash values, which are then used to map the online servers to the consistent hashing ring. The identifier of the first node can be hashed to obtain a node hash value; then, based on the node hash value, the associated device hash value can be determined on the consistent hashing ring, and the online server corresponding to the associated device hash value can be identified as the target online server. The method for determining the associated device hash value can be found in the relevant descriptions of applying the consistent hashing algorithm to determine the target local storage server, and will not be repeated here.
[0095] The resource acquisition scheme provided in this application embodiment is applied to node service objects. For example... Figure 5 As shown, the node service object involves a three-layer architecture, totaling 10 services. The first layer is mainly used for access, divided into login service, logout service, heartbeat service, reporting service, and seed query service. The second layer is used for relay, aggregation, and processing, divided into number distribution service, online service, storage interface layer service (corresponding to the storage interface layer mentioned above), and synchronization center service (corresponding to the synchronization server mentioned above). The third layer is used for storage, providing storage services (corresponding to the storage cluster mentioned above), which exposes read services, write services, node information services, and management services to the outside world.
[0096] The node service object primarily responds to five types of signaling sent by the client (corresponding to the aforementioned node): login (corresponding to the login request), logout, heartbeat (corresponding to the heartbeat packet), reporting (corresponding to the resource reporting request), and seeding (corresponding to the resource search request). Login is the signaling to join the P2P network system, responding with an identifier (such as a unique UIN) and the corresponding password (such as a token). Logout is the signaling to exit the P2P network system, informing the node service object to update relevant client information, such as deleting relevant client information or indicating that the relevant client is offline. The purpose of the heartbeat is to maintain the online status of the relevant client in the P2P network system. Reporting informs the node service object which resources it can provide for other clients to download. Seeding queries the P2P network system to find out which clients are available to download a specific resource.
[0097] In the first-layer architecture, the login service handles login requests. Simultaneously, it calls the number distribution service to obtain an identifier (such as a unique UIN) and the corresponding password (such as a token), returning them to the client. The login request is then complete. The logout service and heartbeat service handle logout and heartbeat requests respectively, forwarding the request information to the online service. If a response is received from the online service, the logout and heartbeat requests are complete. The reporting and seed-checking services handle reporting and seed-checking requests respectively, forwarding the request information to the storage interface layer service. If a response is received from the storage interface layer service, the reporting and seed-checking requests are complete. Additionally, the seed-checking service handles seed-checking requests and can also forward the request information to the storage service. If a response is received from the storage service, the seed-checking request is complete.
[0098] In the second-layer architecture, the number allocation service only provides number segment distribution, ensuring that different clients are allocated number segments without conflict. The online service stores online information for a portion of clients and updates (including deprecation) the online client list on the online service machines in real time. Each online service machine only stores a portion of client information; the union of the client information stored by all online service machines represents all client information across the entire network. The storage interface layer service temporarily stores the mapping between resources reported by clients and the corresponding client information. Each storage interface layer service machine only stores the resource-client mapping for a portion of clients; the union of the resource-client mappings stored by all storage interface layer service machines represents all resource-client mappings across the entire network. These temporarily stored resource-client mappings are periodically synchronized to downstream storage services for final storage. After synchronization, the storage interface layer service reaches the next synchronization cycle and deletes the previously synchronized data. The synchronization center service performs cross-regional relay functionality, synchronizing resource-client mappings between different locations to the local storage service.
[0099] In the second-layer architecture, the storage service is responsible for receiving and processing requests from online services, storage interface layer services, and synchronization center services, and updating storage configuration information. The storage service also provides read and write interfaces to the storage interface layer. The read interface indexes user information (corresponding to clients and nodes) through file information (corresponding to resources) and returns the relevant content as a list. The write interface uses the file information and user information provided by the storage interface layer to establish an index, thus completing the write operation. The storage service also provides a user information update interface for online services, including writing and deleting user information, meeting the real-time update requirements of user information. The storage service also provides a management interface that periodically scans the machine's storage content and provides monitoring data for analysis and maintenance.
[0100] The client needs to resolve the domain name of the node service object. Based on the client's source IP address, it obtains the nearest external IP address according to the domain name rules. This external IP address indicates the IP address of the traffic distribution module. This traffic distribution module is used to provide traffic distribution services. This traffic distribution module belongs to the node service object and is responsible for randomly and evenly forwarding traffic to the services in the first-layer architecture. This is beneficial for load balancing of the services in the first-layer architecture.
[0101] It should be noted that: 1) The services in the first-layer architecture are all stateless, supporting random access and lossless scaling of machines. 2) For the services in the second-layer architecture, the number allocation service is deployed on multiple machines, therefore a distributed lock-like approach needs to be considered to ensure that the number allocation results of each machine do not conflict and do not affect each other. The online service is deployed on multiple machines, with each online service machine only serving a subset of clients. For heartbeat requests and logout requests from upstream, a mapping relationship between the identifiers of each online service machine and the client needs to be stored. A consistent hashing algorithm can be used to determine this mapping relationship. Upon receiving a request, the online service processes it asynchronously, storing the received request information in its own shared memory or message queue. The client's logout request and the first heartbeat request are added to the message queue and written to shared memory; the rest are only written to shared memory. Afterwards, processing is divided into two methods: periodic processing and real-time processing. Client information in its own shared memory is periodically synchronized to the storage service, and messages in the message queue are consumed and processed in real-time. In addition, the online service itself has an automatic elimination function, which periodically scans the data in shared memory. If no heartbeat information is received within a timeout period, the relevant client is marked as offline and synchronized to the downstream storage service. 3) Where there are fixed routes between services, such as those between online services and storage services, this routing relationship can also be supported using static routing.
[0102] The resource acquisition solution provided in this application addresses the issues of single-machine capacity expansion, full network node queryability, and high availability in video-on-demand scenarios. This application provides a seed search system for P2P video-on-demand scenarios that supports tens of millions of users online simultaneously, achieving an optimal solution for single-machine capacity limits and functional metrics through its architecture. The final result allows users to query all user nodes across the entire network, with high-quality nodes returned in real time.
[0103] This application's embodiments address the issue of parallel scaling across various services. Most services support lossless scaling up and down. Scaling up or down storage services and online services by one machine affects a range of 1 / N, where N is the total number of machines for the current service after scaling up or down. Clients can query the entire network for nodes that can provide the same resource as the currently viewed resource; this means scanning all nodes across the network and always selecting the locally optimal node. Clients can access services based on proximity. When a domain name resolves to a service in the first-layer architecture, the nearest machine is selected based on the client's IP address, and the storage service prioritizes returning the node with the closest network distance, thus improving P2P download speeds. The system architecture provides a geographically distributed active-active function, enhancing the overall system's disaster recovery capabilities.
[0104] The resource acquisition scheme provided in this application embodiment can reasonably provide P2P network system search functionality for video-on-demand playback. Furthermore, the architecture of the node service objects involved in this application embodiment can be deployed on various machine types, supporting, but not limited to, physical machines, cloud servers, and containers. In addition, the resource acquisition scheme provided in this application embodiment can also be applied to scenarios involving data storage and search.
[0105] As can be seen from the technical solutions provided in the embodiments of this application above, the embodiments of this application specify the connotation of resource configuration information of the local storage cluster in the node service object. The resource configuration information also involves remote nodes. At the same time, the local storage cluster provides resource search services for local nodes, thus taking into account both the increase in the range of searchable nodes and the improvement of resource search efficiency. The resource configuration information involves a first correspondence based on local nodes and a second correspondence based on local resources. The setting of these two types of correspondences helps to avoid the single-machine limit problem and also provides conditions for the expansion and contraction of the local storage cluster. It can reduce the impact of expansion and contraction on the resource acquisition effect, thereby improving the stability and adaptability of resource acquisition. Any one of the multiple access layers can independently process node requests, and each access layer can forward the received node requests to downstream services. In this way, the multiple access layers are stateless services, supporting random access and lossless expansion and contraction of machines.
[0106] This application also provides a resource acquisition device, such as... Figure 7As shown, the resource acquisition device 70 is configured on a node service object, which includes multiple access layers and multiple storage clusters. The node service object serves multiple nodes, and the multiple nodes execute a peer-to-peer network protocol. The resource acquisition device 70 includes:
[0107] Response module 701: is used to receive a resource search request sent by a first node using any one of the plurality of access layers, and to send the resource search request to the local storage cluster corresponding to the first node, wherein the first node is any one of the plurality of nodes, and the local storage cluster belongs to the plurality of storage clusters;
[0108] Determining module 702: used to extract resource feature information from the resource search request using the local storage cluster, and to determine a second node that can provide the target resource based on the resource configuration information of the local storage cluster corresponding to the first node. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The local storage cluster belongs to the node service object, and the second node is any node among the plurality of nodes other than the first node.
[0109] Acquisition module 703: Used to send the node information of the second node to the first node using the local storage cluster, so that the first node can acquire the target resource from the second node.
[0110] It should be noted that the apparatus and method embodiments described in the device embodiments are based on the same inventive concept.
[0111] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0112] This application also provides a computer-readable storage medium storing at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the above-described method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0113] This application also provides an electronic device, which includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the at least one processor to implement the above method.
[0114] Electronic devices can be provided as terminals, servers, or other forms of devices.
[0115] Figure 8 A block diagram of an electronic device according to an embodiment of this application is shown. For example, electronic device 1900 may be provided as a server. (Refer to...) Figure 8 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0116] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0117] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.
[0118] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.
[0119] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0120] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0121] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C+, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0122] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0123] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0124] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions specified in the blocks may occur in a different order than those specified in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0126] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technological improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for acquiring resources, characterized in that, Applied to a node service object, the node service object including multiple access layers and multiple storage clusters, the node service object serving multiple nodes, the multiple nodes executing a peer-to-peer network protocol, the method includes: The resource search request sent by the first node is received by any one of the multiple access layers, and the resource search request is sent to the local storage cluster corresponding to the first node. The first node is any one of the multiple nodes, and the local storage cluster belongs to the multiple storage clusters. The local storage cluster is used to extract resource feature information from the resource search request, and the resource configuration information of the local storage cluster is used to determine a second node that can provide the target resource. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The second node is any node among the plurality of nodes other than the first node. The local storage cluster is used to send the node information of the second node to the first node, so that the first node can obtain the target resource from the second node.
2. The method according to claim 1, characterized in that, The node service objects include multiple identifier allocation servers, which allocate mutually exclusive identifiers to the multiple nodes based on a distributed lock mechanism. Before receiving the resource search request sent by the first node using any of the multiple access layers, the method further includes: The system utilizes any one of the plurality of access layers to receive the login request sent by the first node and to send the login request to the target identifier allocation server, wherein the target identifier allocation server is any one of the plurality of identifier allocation servers. The target identifier allocation server assigns a corresponding identifier to the first node based on the login request.
3. The method according to claim 1 or 2, characterized in that, The node service object also includes a synchronization server and multiple storage interface layers. The synchronization server is used to relay data received from the storage interface layers to a remote storage cluster. The method further includes: In response to the resource reporting request sent by the first node for the resource to be reported, the third correspondence between the first node and the resource to be reported is recorded using the local storage interface layer corresponding to the first node, wherein the local storage interface layer belongs to the plurality of storage interface layers. The third correspondence is sent to the local storage cluster and the synchronization server respectively using the local storage interface layer; The local storage cluster updates the current resource configuration information based on the third correspondence, and the local storage cluster updates the current resource configuration information based on the relay data received from the synchronization server.
4. The method according to claim 3, characterized in that, The local storage cluster includes multiple local storage servers, and sending the third correspondence to the local storage cluster using the local storage interface layer includes: Using the local storage interface layer and a consistent hashing algorithm, the target local storage server corresponding to the resource identifier of the resource to be reported is determined from the plurality of local storage servers; The third correspondence is sent to the target local storage server using the local storage interface layer.
5. The method according to claim 3, characterized in that, The local storage cluster includes multiple local storage servers, and the method further includes: In response to a storage data update request for a target object, the target local storage server to which the storage data update request is directed and the update type are determined, wherein the target local storage server belongs to the plurality of local storage servers; From the multiple processes running on the target local storage server, a target process corresponding to the update type is determined, and each process is responsible for maintaining the execution of an internal thread; Update operation guidance information is generated based on the internal thread of the target process. The update operation guidance information is used to guide the target object to update the stored data using the internal thread of the target process.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Receive the resource reporting request sent by the first node for the resource to be reported; When the resource to be reported consists of multiple fragments, a corresponding fragment identifier is configured for each fragment. Based on the resource identifier of the resource to be reported, the fragment identifier corresponding to each fragment, and the content feature information corresponding to each fragment, the information of the resource to be reported is obtained.
7. The method according to claim 1, characterized in that, The resource configuration information also includes information about each of the multiple reported resources that constitute the local resource. The information of each reported resource includes the resource identifier of the reported resource, the fragment identifier corresponding to each of the multiple fragments that constitute the reported resource, and content feature information. The step of determining a second node capable of providing the target resources based on the resource configuration information of the local storage cluster includes: Using the local storage cluster, based on the information of each of the multiple reported resources, the target shard corresponding to the resource feature information and the target reported resource to which the target shard belongs are determined; Based on the first and second correspondences, the local storage cluster is used to determine a second node that can provide the resources reported by the target. The step of sending the node information of the second node to the first node using the local storage cluster includes: The local storage cluster is used to send the node information of the second node, the fragment identifier of the target fragment, and the resource identifier of the target reported resources to the first node.
8. The method according to claim 7, characterized in that, After sending the node information of the second node, the fragment identifier of the target fragment, and the resource identifier of the target reported resources to the first node using the local storage cluster, the method further includes: Receive a resource acquisition failure notification sent by the first node, the resource acquisition failure notification being generated based on the first node's failure to successfully acquire the target resource from the second node; Resource supplement information is generated based on the resource acquisition failure notification.
9. A resource acquisition device, characterized in that, A device configured to serve multiple nodes, including multiple access layers and multiple storage clusters, wherein the node service object serves multiple nodes and the multiple nodes execute a peer-to-peer network protocol, the device comprising: Response module: used to receive a resource search request sent by a first node using any one of the plurality of access layers, and to send the resource search request to the local storage cluster corresponding to the first node, wherein the first node is any one of the plurality of nodes, and the local storage cluster belongs to the plurality of storage clusters; The determining module is used to extract resource feature information from the resource search request using the local storage cluster, and to determine a second node that can provide the target resource based on the resource configuration information of the local storage cluster corresponding to the first node. The target resource corresponds to the resource feature information. The resource configuration information represents a first correspondence between the local node and the local resource that can be provided, and a second correspondence between the local resource and the remote node that can provide the local resource. The local storage cluster belongs to the node service object, and the second node is any node other than the first node among the plurality of nodes. Acquisition module: used to send the node information of the second node to the first node using the local storage cluster, so that the first node can acquire the target resource from the second node.
10. An electronic device, characterized in that, The electronic device includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the at least one processor to implement the resource acquisition method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the resource acquisition method as described in any one of claims 1-8.