Network resource allocation method, apparatus, terminal device, and computer program product
By obtaining staking information and calculating user weights in the blockchain network, the problem of unfair allocation of network resources is solved, more efficient resource allocation is achieved, and the utilization efficiency of network resources is improved.
Patent Information
- Application Number
- CN202411887153.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The blockchain network suffers from unfair resource allocation, which leads to long processing times for ordinary users' transactions and reduces the efficiency of network resource utilization.
By obtaining the staking information of target users in the blockchain network, a weight calculation model is used to determine the user's final target weight, and network resources are allocated to the user based on this weight. The weight relationship between staking amount and staking time is considered, and users who have made greater long-term contributions are given preference.
It improves the efficiency of network resource utilization in the blockchain network, prevents resources from being monopolized by a few users, ensures that long-term contributing users receive more resources, and reduces transaction congestion.
Smart Images

Figure CN119814547B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of blockchain technology, and in particular relates to a network resource allocation method, apparatus, terminal equipment and computer program product. Background Technology
[0002] In blockchain networks, especially in some high-performance public chains (such as Solana), there is an issue of unfair allocation of network resources. For example, when the network load is high, ordinary users' transactions may be overwhelmed by a large number of bot transactions or spam transactions, preventing them from completing their transactions in a timely manner.
[0003] Currently, the allocation of network resources in blockchain networks often relies on a fixed transaction fee mechanism, which employs a uniform transaction fee standard and dynamically adjusts transaction fees based on network load. However, this approach can lead to users with high instant payment capabilities monopolizing network resources, resulting in ordinary users' transactions being delayed for extended periods, causing transaction congestion, and ultimately reducing the efficiency of network resource utilization.
[0004] Currently, no effective solution has been proposed to address the issue of low network resource utilization efficiency in blockchain networks. Summary of the Invention
[0005] This application provides a network resource allocation method, apparatus, terminal device, and computer program product to at least solve the problem of low network resource utilization efficiency in blockchain networks in related technologies.
[0006] In a first aspect, embodiments of this application provide a network resource allocation method, comprising: obtaining staking information of a target user in a blockchain network, wherein the staking information includes the staking amount and the staking time; inputting the staking information into a preset weight calculation model to obtain a first weight and a second weight output by the weight calculation model, wherein the staking amount is directly proportional to the first weight and the staking time is logarithmically related to the second weight; determining the target final weight of the target user based on the first weight and the second weight; and configuring target network resources for the target user based on the target final weight and the current network resources of the blockchain network.
[0007] In some embodiments, the pledge information further includes a lock-up period; determining the target final weight of the target user based on the first weight and the second weight includes: multiplying the first weight by a first correction factor to obtain a third weight, wherein the first correction factor is calculated by the weight calculation model based on the lock-up period, and the lock-up period and the first correction factor have a piecewise constant relationship; determining the target final weight of the target user based on the second weight and the third weight.
[0008] In some embodiments, determining the target final weight of a target user based on the second weight and the third weight includes: multiplying both the second weight and the third weight by a second correction factor to obtain a fourth weight corresponding to the second weight and a fifth weight corresponding to the third weight, wherein the second correction factor is calculated by the weight calculation model based on the staking time, and the staking time has a piecewise constant relationship with the second correction factor; and determining the target final weight of the target user based on the fourth weight and the fifth weight.
[0009] In some embodiments, multiplying both the second weight and the third weight by a second correction factor to obtain a fourth weight corresponding to the second weight and a fifth weight corresponding to the third weight includes: determining whether the second correction factor is less than a preset threshold; if the second correction factor is greater than or equal to the preset threshold, multiplying both the second weight and the third weight by the second correction factor to obtain the fourth weight and the fifth weight; if the second correction factor is less than the preset threshold, using the preset threshold as the second correction factor, multiplying both the second weight and the third weight by the second correction factor to obtain the fourth weight and the fifth weight.
[0010] In some embodiments, configuring target network resources for a target user based on the target final weight and the current network resources of the blockchain network includes: configuring target network resources for the target user based on the ratio of the target final weight to the total weight of the blockchain network and the current network resources, wherein the total weight is the sum of the final weights of all users in the blockchain network.
[0011] In some embodiments, configuring target network resources for a target user based on the ratio of the target final weight to the total weight of the blockchain network and the current network resources includes: obtaining the current time; if the current time is within a preset first time period, reserving a preset proportion of buffer network resources from the total network resources of the blockchain network; using the remaining network resources of the blockchain network as the current network resources, and configuring target network resources for the target user based on the ratio of the target final weight to the total weight and the current network resources.
[0012] In some embodiments, after obtaining the current time, the method further includes: if the current time is within a preset second time phase, determining a third correction factor corresponding to the target final weight based on the position of the target final weight among the final weights of all users in the blockchain network; determining an initial network resource corresponding to the target user based on the ratio of the target final weight to the total weight and the current network resources; and configuring target network resources for the target user based on the initial network resources and the third correction factor, wherein the target network resource is the product of the initial network resources and the third correction factor.
[0013] Secondly, embodiments of this application provide a network resource allocation device, comprising: an acquisition module for acquiring staking information of a target user in a blockchain network, wherein the staking information includes the staking amount and the staking time; a calculation module for inputting the staking information into a preset weight calculation model to obtain a first weight and a second weight output by the weight calculation model, wherein the staking amount is directly proportional to the first weight and the staking time is logarithmically related to the second weight; a determination module for determining the target final weight of the target user based on the first weight and the second weight; and a configuration module for configuring target network resources for the target user based on the target final weight and the current network resources of the blockchain network.
[0014] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the network resource allocation method of any one of the first aspects described above.
[0015] Fourthly, embodiments of this application provide a computer program product, including a computer program, which, when run, causes the network resource allocation method described in any one of the first aspects to be executed.
[0016] Compared to related technologies, the network resource allocation method, apparatus, terminal device, and computer program product provided in this application, by acquiring the staking information of a target user in the blockchain network—which can serve as a basis for evaluating the target user's long-term contribution to the blockchain network—and inputting the staking information into a weight calculation model, can obtain a first weight corresponding to the staking amount and a second weight corresponding to the staking time. Based on the first and second weights, the target user's final target weight is determined, and network resources can then be allocated to the target user according to their final target target weight. This method of allocating network resources pays more attention to the user's long-term contribution to the blockchain network. Simultaneously, since the staking time has a logarithmic relationship with the second weight, network resources can be tilted towards users with significant long-term contributions, rather than concentrating network resources on these users, thereby preventing network resources from being monopolized by a few users and reducing the efficiency of network resource utilization. This application solves the problem of low network resource utilization efficiency in blockchain networks in related technologies, achieving the technical effect of improving the efficiency of network resource utilization in blockchain networks.
[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, 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.
[0019] Figure 1 This is a flowchart of a network resource allocation method according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of the curve of pledge time versus second weight according to one embodiment of this application;
[0021] Figure 3 This is a schematic diagram of the curve of pledge time versus second correction factor according to one embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the structure of a network resource allocation device according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the structure of a terminal device according to an embodiment of this application. Detailed Implementation
[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0030] In blockchain networks, especially in some high-performance public chains (such as Solana), there is an issue of unfair allocation of network resources. For example, when the network load is high, ordinary users' transactions may be overwhelmed by a large number of bot transactions or spam transactions, preventing them from completing their transactions in a timely manner.
[0031] Currently, the allocation of network resources in blockchain networks often relies on a fixed transaction fee mechanism, which employs a uniform transaction fee standard and dynamically adjusts transaction fees based on network load. However, this approach can lead to users with high instant payment capabilities monopolizing network resources, resulting in ordinary users' transactions being delayed for extended periods, causing transaction congestion, and ultimately reducing the efficiency of network resource utilization.
[0032] Furthermore, some network resource allocation methods prioritize transactions based on transaction fees or follow a first-come, first-served principle. However, these methods fail to reflect a user's long-term contribution to the blockchain network and may also lead to prolonged delays in processing transactions for ordinary users, causing transaction congestion.
[0033] In addition, some network resource allocation methods also implement flow control, such as limiting the transaction frequency of individual addresses and setting a global transaction processing limit. However, these methods are less flexible, cannot adapt to the actual needs of different users, and lack incentive mechanisms for long-term supporters of the blockchain network. They also cannot effectively prevent spam transactions, which leads to unfair allocation of network resources and reduces the efficiency of network resource utilization.
[0034] Currently, no effective solution has been proposed to address the issue of low network resource utilization efficiency in blockchain networks.
[0035] In view of this, embodiments of this application provide a network resource allocation method. By obtaining the staking information of a target user in a blockchain network, which can serve as a basis for evaluating the target user's long-term contribution to the blockchain network, the staking information is input into a weight calculation model to obtain a first weight corresponding to the staking amount and a second weight corresponding to the staking time. Based on the first and second weights, the target user's final target weight is determined. Subsequently, network resources can be allocated to the target user according to their final target target weight. Allocating network resources in this way pays more attention to the user's long-term contribution to the blockchain network. Simultaneously, since the staking time has a logarithmic relationship with the second weight, network resources can be tilted towards users with significant long-term contributions, rather than concentrating network resources on these users, thereby preventing network resources from being monopolized by a few users and reducing the efficiency of network resource utilization. This application solves the problem of low network resource utilization efficiency in blockchain networks in related technologies, achieving the technical effect of improving the efficiency of network resource utilization in blockchain networks.
[0036] One embodiment of this application provides a network resource allocation method that can be applied to a communication system, which may include a server, terminal devices, and blockchain nodes. The server can establish connections with the terminal devices and blockchain nodes via wired or wireless networks. The terminal devices can establish connections with the blockchain nodes via wired or wireless networks.
[0037] The server can be used to receive requests from terminal devices and allocate network resources (including uplink and downlink resources) to the terminal devices based on the network resource allocation method provided in one embodiment of this application. In some embodiments, the server can be a base station.
[0038] The server can also be used to send resource allocation information to blockchain nodes. The resource allocation information includes the network resources allocated by the server to each terminal device within a target time period.
[0039] In some embodiments, the server can be a single server, or it can be a server cluster consisting of multiple servers (or microservers). The server cluster can also be a distributed cluster. This application does not limit the specific implementation of the server.
[0040] Terminal devices can be used to send requests to the server and receive network resources returned by the server.
[0041] In some embodiments, the terminal device can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc., which can install and use content community applications. This application does not limit the specific implementation of the terminal device. It can interact with users through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction, or handwriting device.
[0042] Optionally, the server may connect to at least one terminal device and at least one blockchain node. This application does not impose any limitations on the number or type of terminal devices and blockchain nodes.
[0043] In practical implementation, both the server and the terminal device can adopt... Figure 5 The composition results shown may include Figure 5 The components shown. Figure 5 This is a schematic diagram of the structure of a terminal device according to an embodiment of the present application. When the terminal device 5 has the functions of the server described in the embodiment of the present application, the terminal device 5 can be a server or a chip or system on a chip in the server.
[0044] The following will combine Figure 1 For an explanation of a network resource allocation method provided in one embodiment of this application, please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a flowchart of a network resource allocation method according to an embodiment of this application, such as... Figure 1 As shown, the method includes:
[0045] Step S101: Obtain the target user's staking information in the blockchain network, wherein the staking information includes the staking amount and staking time.
[0046] In this embodiment, the staking time can be the period from the time when the target user first stakes in the blockchain network until the current time, and the blockchain network can be a high-performance public chain such as Solana.
[0047] The amount and duration of a target user's staking can be used as metrics to measure their "credit" or "contribution" in the blockchain network, thereby determining the target user's priority, network resource allocation, and service quality within the blockchain network.
[0048] Allocating network resources based on the target user's staking information not only focuses on the user's immediate payment ability (e.g., traditional on-demand payment methods) but also emphasizes the user's long-term contribution to the blockchain network. This gives higher priority and more network resources to users who have long participated in, maintained, and supported the blockchain network, avoiding transaction congestion caused by a large number of bot transactions or spam transactions crowding out bandwidth, thereby improving the efficiency of the blockchain network's resource utilization.
[0049] Step S102: Input the pledge information into the preset weight calculation model to obtain the first weight and the second weight output by the weight calculation model. The pledge amount is directly proportional to the first weight, and the pledge time is logarithmically related to the second weight.
[0050] In this embodiment, the weight calculation model may include multiple weight calculation sub-models to output the first weight and the second weight respectively.
[0051] Specifically, the weight calculation model can include a first weight calculation sub-model and a second weight calculation sub-model. The first weight calculation sub-model is used to calculate the first weight based on the amount of collateral, and the second weight calculation sub-model is used to calculate the second weight based on the collateral time.
[0052] The first weight can be directly proportional to the amount of the target user's stake. That is, the higher the amount of the target user's stake, the higher the corresponding first weight, thus ensuring that users with a higher degree of participation in the blockchain network can obtain higher priority and more network resources.
[0053] The second weight calculation sub-model can calculate the second weight based on a preset logarithmic relationship. For example, see... Figure 2 , Figure 2 This is a schematic diagram of the pledging time versus the second weight according to one embodiment of this application, as shown below. Figure 2As shown, in one embodiment, a logarithmic decay model can be used to prevent early users of the blockchain network from gaining an excessive advantage: when the staking time is between 0 and 30 days, the second weight grows rapidly, and this stage of the design can incentivize users to participate early and quickly invest in the blockchain network; when the staking time is between 31 and 180 days, the growth rate of the second weight slows down, and this stage of the design can balance the participation of early and late users, avoiding reliance solely on the advantage of early participants; when the staking time is greater than 180 days, the second weight tends to level off, and this stage of the design can prevent users who participate for a long time from gaining an excessively large second weight through time accumulation, thus preventing them from monopolizing the network resources of the blockchain network.
[0054] Specifically, the second weight calculation sub-model can be represented as:
[0055] W2(t) = log(t+1) × k;
[0056] Where W2 is the second weight, t is the staking time, and k is a preset adjustment factor used to adjust the initial weight increase.
[0057] In addition, an upper limit can be set for the second weight to avoid the Matthew effect (that is, early users of the blockchain network gain disproportionate benefits due to the accumulation of time and the growth of weight).
[0058] It should be noted that the second weight calculation sub-model can be set according to the application scenario and actual needs of the network resource allocation method provided in the embodiments of this application, and this application does not limit the specific implementation form of the second weight calculation sub-model.
[0059] Step S103: Determine the target final weight of the target user based on the first weight and the second weight.
[0060] In one embodiment, the staking information also includes a lock-up period; determining the target user's final target weight based on a first weight and a second weight includes the following steps:
[0061] Step 1: Multiply the first weight by the first correction factor to obtain the third weight. The first correction factor is calculated by the weight calculation model based on the lock-up period, and the lock-up period has a piecewise constant relationship with the first correction factor.
[0062] Step 2: Determine the target final weight for the target user based on the second and third weights.
[0063] In this embodiment, the lock-up period of a user's staked assets can also be included in evaluating the user's contribution to the blockchain network. Specifically, users with longer lock-up periods are typically given higher weighting to encourage their long-term participation in the blockchain network.
[0064] Therefore, a first correction factor can be set, which is related to the lock-up period; the longer the lock-up period, the higher the first correction factor. The weight calculation model can also include a first correction factor calculation model, which adopts a step-growth model, and this step-growth model can be expressed as:
[0065] a. Lock-up period is between 0 and 30 days: First correction factor is 1.0;
[0066] b. Lock-up period between 31 and 90 days: First correction factor is 1.2;
[0067] c. Lock-up period is between 91 and 180 days: First correction factor is 1.5;
[0068] d. Lock-up period between 181 and 365 days: First correction factor is 2.0;
[0069] e. Lock-up period greater than 365 days: First correction factor is 2.5.
[0070] In the first correction factor calculation model, users can obtain additional weights based on the different lock-in periods. This first correction factor calculation model encourages users to lock in for a long time, thereby improving the incentive effect of long-term participation.
[0071] It should be noted that the first correction factor calculation model can be set according to the application scenario and actual needs of the network resource allocation method provided in the embodiments of this application, and this application does not limit the specific implementation form of the first correction factor calculation model.
[0072] In one embodiment, determining the target final weight of the target user based on the second weight and the third weight includes: multiplying both the second weight and the third weight by a second correction factor to obtain a fourth weight corresponding to the second weight and a fifth weight corresponding to the third weight, wherein the second correction factor is calculated by the weight calculation model based on the staking time, and the staking time has a piecewise constant relationship with the second correction factor; and determining the target final weight of the target user based on the fourth weight and the fifth weight.
[0073] In this embodiment, to avoid the concentration of network resources in users who have participated in the blockchain network for a long time, a second correction factor can be introduced. The longer a user has staked, the lower the second correction factor becomes. Based on the time decay mechanism, the fair allocation of network resources in the blockchain network is balanced, preventing excessive concentration of network resources.
[0074] Specifically, the weight calculation model may also include a second correction factor calculation model, which employs a step-down reduction model. For example, see [link to example]. Figure 3 , Figure 3This is a schematic diagram of the curve of pledge time versus second correction factor according to one embodiment of this application, as shown below. Figure 3 As shown, in one embodiment, the pledging time and the second correction factor have a piecewise constant relationship, which can be expressed as:
[0075] a. Pledge period is between 0 and 30 days: Second correction factor is 1.00;
[0076] b. Pledge period is between 31 and 60 days: the second correction factor is 0.98;
[0077] c. Pledge period is between 61 and 90 days: the second correction factor is 0.96;
[0078] d. Pledge period is between 91 and 120 days: the second correction factor is 0.94;
[0079] e. Pledge duration is between 121 and 150 days: the second correction factor is 0.92;
[0080] ...
[0081] In other words, the second correction factor decreases by 0.02 every 30 days of staking. In this way, it is possible to further prevent users who participate for a long time from gaining excessive second and third weights through time accumulation, thereby avoiding their monopoly of the blockchain network resources and avoiding the Matthew effect (that is, early users of the blockchain network gain disproportionate benefits due to the accumulation of time and the increase of weight).
[0082] In this embodiment, the sum of the fourth weight and the fifth weight can be used as the target final weight of the target user, or the fourth weight can be multiplied by a preset first adjustment parameter, the fifth weight can be multiplied by a preset second adjustment parameter, and their sum can be used as the target final weight of the target user, thereby adapting to different application scenarios and user needs.
[0083] It should be noted that the second correction factor calculation model can be set according to the application scenario and actual needs of the network resource allocation method provided in the embodiments of this application, and this application does not limit the specific implementation form of the second correction factor calculation model.
[0084] Furthermore, a lower limit can be set for the second correction factor to ensure the basic rights and interests of users who participate in the blockchain network long-term. Specifically, multiplying both the second and third weights by the second correction factor to obtain the fourth weight corresponding to the second weight and the fifth weight corresponding to the third weight involves the following steps:
[0085] Step 1: Determine whether the second correction factor is less than the preset threshold.
[0086] Step 2: If the second correction factor is greater than or equal to the preset threshold, multiply the second weight and the third weight by the second correction factor to obtain the fourth weight and the fifth weight.
[0087] Step 3: If the second correction factor is less than the preset threshold, the preset threshold is used as the second correction factor. The second weight and the third weight are both multiplied by the second correction factor to obtain the fourth weight and the fifth weight.
[0088] In this embodiment, the preset threshold can be 0.40, 0.50, or 0.60. It should be noted that the preset threshold can be set according to the application scenario and actual needs of the network resource allocation method provided in this application embodiment, and this application does not limit the specific size of the preset threshold.
[0089] In this embodiment, by introducing a time decay mechanism and setting a minimum protection threshold (i.e., a preset threshold), both excessive concentration of network resources and the basic rights and interests of users who participate in the blockchain network long-term can be prevented. Furthermore, a periodic reset mechanism can be provided to users, asking them annually whether they wish to reset their time weights. This offers users a flexible rights management solution and encourages them to remain active over shorter time periods, thereby increasing user stickiness in the blockchain network.
[0090] Step S104: Configure target network resources for the target user based on the target final weight and the current network resources of the blockchain network.
[0091] In this embodiment, a basic network resource package can first be allocated to the target user based on the ratio of the target's final weight to the total weight of the blockchain network. Then, the overall load of the blockchain network is considered, and the parameters in the above weight calculation model are dynamically adjusted in real time.
[0092] Specifically, configuring target network resources for target users based on the target's final weight and the current network resources of the blockchain network includes: configuring target network resources for target users based on the ratio of the target's final weight to the total weight of the blockchain network and the current network resources, where the total weight is the sum of the final weights of all users in the blockchain network.
[0093] In this embodiment, configuring target network resources for a target user based on the ratio of the target's final weight to the total weight of the blockchain network and the current network resources includes the following steps:
[0094] Step 1: Get the current time.
[0095] Step 2: If the current time falls within a preset first time phase, reserve a preset proportion of buffer network resources from the total network resources of the blockchain network; use the remaining network resources of the blockchain network as the current network resources, and configure target network resources for the target user based on the ratio of the target final weight to the total weight and the current network resources; if the current time falls within a preset second time phase, determine the third correction factor corresponding to the target final weight based on the position of the target final weight among the final weights of all users in the blockchain network; determine the initial network resources corresponding to the target user based on the ratio of the target final weight to the total weight and the current network resources; configure target network resources for the target user based on the initial network resources and the third correction factor, wherein the target network resources are the product of the initial network resources and the third correction factor.
[0096] In this embodiment, the first time period can be a period of low network load on the blockchain network determined based on historical data of the blockchain network. Therefore, during the first time period, network resources can be allocated according to the weight ratio of the target users. In addition, a preset ratio (e.g., 10%) of network resources can be reserved as a buffer to cope with short-term bursts of traffic.
[0097] The second time period can be defined as the peak period of high network load and traffic on the blockchain network, determined based on historical data. Therefore, during this second time period, priority queues and tiered rate limiting mechanisms can be implemented. Users with higher final weights (i.e., those whose target final weight ranks higher among all users in the blockchain network) can be given higher priority and receive a higher third correction factor (generally no greater than 1). Conversely, users with lower final weights (i.e., those whose target final weight ranks lower among all users in the blockchain network) can be given lower priority and receive a lower third correction factor. This ensures that the basic needs of high-weight users are met, while low-weight users may face some resource constraints. This approach ensures that high-weight users receive priority service during network congestion. Furthermore, a lower limit for the third correction factor can be set to guarantee the minimum needs of low-weight users.
[0098] In this way, a differentiated network resource allocation strategy can be implemented for the normal and peak periods of the blockchain network, further improving the efficiency of network resource utilization and the blockchain network's ability to cope with emergencies.
[0099] It should be noted that the first time period, the second time period, and the third correction factor mentioned above can be set according to the application scenario and actual needs of the network resource allocation method provided in the embodiments of this application. This application does not limit the specific implementation of the first time period, the second time period, and the third correction factor.
[0100] In one embodiment, the network resource allocation method provided in this application can also be used for transaction security monitoring. For example, based on the target network resources configured for the target user, the transaction level of the target user can be monitored, and abnormal transaction patterns can be monitored in real time; or, malicious operations can be intelligently identified and protection mechanisms can be automatically triggered; and account-level management (such as a credit scoring system) can also be performed.
[0101] Furthermore, the network resource allocation method provided in this application can also be used for emergency response mechanisms. For example, when the network load of the blockchain network exceeds a set value, an automatic circuit breaker mechanism can be triggered; or, different measures can be taken according to the degree of anomaly of the blockchain network resources; and an effective recovery mechanism can also be established. By constructing a complete security protection network, a graded processing strategy based on the degree of anomaly can be implemented to ensure that appropriate responses can be made when facing threats of different levels.
[0102] Through steps S101 to S104 above, by obtaining the staking information of the target user in the blockchain network, this staking information can serve as a basis for evaluating the target user's long-term contribution to the blockchain network. Inputting the staking information into a weight calculation model yields a first weight corresponding to the staking amount and a second weight corresponding to the staking time. Based on the first and second weights, the target user's final target weight is determined. Subsequently, network resources can be allocated to the target user according to their final target target weight. Allocating network resources in this way focuses more on the user's long-term contribution to the blockchain network. Simultaneously, since the staking time has a logarithmic relationship with the second weight, network resources can be tilted towards users with significant long-term contributions, rather than concentrating network resources on these users, thereby preventing network resources from being monopolized by a few users and reducing the efficiency of network resource utilization. This application solves the problem of low network resource utilization efficiency in blockchain networks in related technologies, achieving the technical effect of improving the efficiency of network resource utilization in blockchain networks.
[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0104] Corresponding to the network resource allocation method described in the above embodiments, Figure 4 A schematic diagram of a network resource allocation device according to an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0105] Please see Figure 4The network resource allocation device 4 includes: an acquisition module 40, used to acquire the staking information of a target user in the blockchain network, wherein the staking information includes the staking amount and the staking time; a calculation module 41, used to input the staking information into a preset weight calculation model to obtain a first weight and a second weight output by the weight calculation model, wherein the staking amount is directly proportional to the first weight and the staking time is logarithmically related to the second weight; a determination module 42, used to determine the target final weight of the target user based on the first weight and the second weight; and a configuration module 43, used to configure target network resources for the target user based on the target final weight and the current network resources of the blockchain network.
[0106] In one embodiment, the pledge information also includes a lock-up period; the determining module 42 is further configured to multiply the first weight by the first correction factor to obtain the third weight, wherein the first correction factor is calculated by the weight calculation model based on the lock-up period, and the lock-up period and the first correction factor have a piecewise constant relationship; and determine the target final weight of the target user based on the second weight and the third weight.
[0107] In one embodiment, the determining module 42 is further configured to multiply both the second weight and the third weight by the second correction factor to obtain a fourth weight corresponding to the second weight and a fifth weight corresponding to the third weight, wherein the second correction factor is calculated by the weight calculation model based on the staking time, and the staking time and the second correction factor have a piecewise constant relationship; and based on the fourth weight and the fifth weight, determine the target final weight of the target user.
[0108] In one embodiment, the determining module 42 is further configured to determine whether the second correction factor is less than a preset threshold; if the second correction factor is greater than or equal to the preset threshold, the second weight and the third weight are both multiplied by the second correction factor to obtain the fourth weight and the fifth weight; if the second correction factor is less than the preset threshold, the preset threshold is used as the second correction factor, and the second weight and the third weight are both multiplied by the second correction factor to obtain the fourth weight and the fifth weight.
[0109] In one embodiment, the configuration module 43 is further configured to configure target network resources for the target user based on the ratio of the target final weight to the total weight of the blockchain network and the current network resources, wherein the total weight is the sum of the final weights of all users in the blockchain network.
[0110] In one embodiment, the configuration module 43 is further configured to obtain the current time; if the current time is within a preset first time phase, reserve a preset proportion of buffer network resources from the total network resources of the blockchain network; use the remaining network resources of the blockchain network as the current network resources, and configure target network resources for the target user based on the ratio of the target final weight to the total weight and the current network resources.
[0111] In one embodiment, the configuration module 43 is further configured to, when the current time is within a preset second time phase, determine a third correction factor corresponding to the target final weight based on the position of the target final weight among the final weights of all users in the blockchain network; determine the initial network resources corresponding to the target user based on the ratio of the target final weight to the total weight and the current network resources; and configure target network resources for the target user based on the initial network resources and the third correction factor, wherein the target network resources are the product of the initial network resources and the third correction factor.
[0112] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0113] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0114] Figure 5 This is a schematic diagram of the structure of a terminal device according to an embodiment of this application. Figure 5 As shown, the terminal device 5 includes: at least one processor 50 ( Figure 5 (Only one is shown in the image) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the steps in any of the above-described network resource allocation method embodiments.
[0115] Terminal device 5 can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. Terminal device 5 may include, but is not limited to, processor 50 and memory 51. Those skilled in the art will understand that... Figure 5This is merely an example of terminal device 5 and does not constitute a limitation on terminal device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0116] The processor 50 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0117] In some embodiments, memory 51 may be an internal storage unit of terminal device 5, such as a hard disk or memory of terminal device 5. In other embodiments, memory 51 may be an external storage device of terminal device 5, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on terminal device 5. In other embodiments, memory 51 may include both internal storage units and external storage devices of terminal device 5. Memory 51 is used to store operating system, application programs, bootloader, data, and other programs, such as the program code of computer program 52. Memory 51 may also be used to temporarily store data that has been output or will be output.
[0118] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the above-described network resource allocation method embodiments.
[0119] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described network resource allocation method embodiments.
[0120] This application implements all or part of the processes in the methods of the above embodiments, which can be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, such as a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0121] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0122] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0123] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0124] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0125] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for allocating network resources, characterized in that, include: Obtain the staking information of the target user in the blockchain network, wherein the staking information includes the staking amount and the staking time; The pledge information is input into a preset weight calculation model to obtain a first weight and a second weight output by the weight calculation model. The pledge amount is directly proportional to the first weight, and the pledge time is logarithmically related to the second weight. Based on the first weight and the second weight, the target final weight of the target user is determined; Based on the target final weight and the current network resources of the blockchain network, target network resources are configured for the target user.
2. The method according to claim 1, characterized in that, The pledge information also includes a lock-up period; Based on the first weight and the second weight, determining the target user's final target weight includes: The first weight is multiplied by the first correction factor to obtain the third weight, wherein the first correction factor is calculated by the weight calculation model based on the lock-up period, and the lock-up period has a piecewise constant relationship with the first correction factor. Based on the second weight and the third weight, the target final weight of the target user is determined.
3. The method according to claim 2, characterized in that, Determining the target final weight of the target user based on the second weight and the third weight includes: The second weight and the third weight are both multiplied by the second correction factor to obtain the fourth weight corresponding to the second weight and the fifth weight corresponding to the third weight. The second correction factor is calculated by the weight calculation model based on the staking time, and the staking time has a piecewise constant relationship with the second correction factor. Based on the fourth weight and the fifth weight, the target final weight of the target user is determined.
4. The method according to claim 3, characterized in that, Multiplying both the second weight and the third weight by the second correction factor yields a fourth weight corresponding to the second weight and a fifth weight corresponding to the third weight, including: Determine whether the second correction factor is less than a preset threshold; If the second correction factor is greater than or equal to the preset threshold, the second weight and the third weight are both multiplied by the second correction factor to obtain the fourth weight and the fifth weight; If the second correction factor is less than the preset threshold, the preset threshold is used as the second correction factor, and the second weight and the third weight are multiplied by the second correction factor to obtain the fourth weight and the fifth weight.
5. The method according to any one of claims 1 to 4, characterized in that, Based on the target final weight and the current network resources of the blockchain network, configuring target network resources for the target user includes: Based on the ratio of the target final weight to the total weight of the blockchain network and the current network resources, the target network resources are configured for the target user, wherein the total weight is the sum of the final weights of all users in the blockchain network.
6. The method according to claim 5, characterized in that, Based on the ratio of the target final weight to the total weight of the blockchain network, and the current network resources, configuring the target network resources for the target user includes: Get the current time; If the current time is within a preset first time period, a preset proportion of buffer network resources are reserved from the total network resources of the blockchain network; the remaining network resources of the blockchain network are used as the current network resources, and the target network resources are configured for the target user based on the ratio of the target final weight to the total weight and the current network resources.
7. The method according to claim 6, characterized in that, After obtaining the current time, the method further includes: When the current time falls within a preset second time phase, a third correction factor corresponding to the target final weight is determined based on the position of the target final weight among the final weights of all users in the blockchain network; an initial network resource corresponding to the target user is determined based on the ratio of the target final weight to the total weight and the current network resources; and the target network resource is configured for the target user based on the initial network resource and the third correction factor, wherein the target network resource is the product of the initial network resource and the third correction factor.
8. A network resource allocation device, characterized in that, include: The acquisition module is used to acquire the staking information of the target user in the blockchain network, wherein the staking information includes the staking amount and the staking time; The calculation module is used to input the pledge information into a preset weight calculation model to obtain a first weight and a second weight output by the weight calculation model, wherein the pledge amount is directly proportional to the first weight and the pledge time is logarithmically related to the second weight; The determining module is configured to determine the target final weight of the target user based on the first weight and the second weight; The configuration module is used to configure target network resources for the target user based on the target final weight and the current network resources of the blockchain network.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the network resource allocation method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program, which, when run, causes the network resource allocation method as described in any one of claims 1 to 7 to be executed.
Citation Information
Patent Citations
Virtual reward resource allocation method and device, storage medium and electronic equipment
CN118503250A
Resource optimization method and device of cloud game system, terminal equipment and medium
CN118708332A