Message forwarding method and device, equipment and storage medium
Based on the incentive method of dynamic pricing in the social perception network, the problem of low network performance caused by the selfish behavior caused by nodes is solved, and the incentive node of the incentive node of the virtual currency bargaining trading incentive nodes is realized to improve the network performance.
Patent Information
- Application Number
- CN202411370916.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In social perceptual networks, nodes exhibit selfish behavior due to factors such as resource constraints and social associations, resulting in low network performance.
Putting a method of message forwarding, by the attributes of the message to be repost, the delivery urgency, location correlation, participation contribution, and the generated reposting function and receiving function of the asset status are calculated and received The cost is higher than the receiving cost.
Through the abstraction of the message as the transaction process, the virtual currency uses the virtual currency for bargaining transactions, inspiring the selfish node to actively participate in the message forwarding and improve the network performance.
Smart Images

Figure CN119383188A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information transmission technology, and in particular to a message forwarding method, device, equipment and storage medium. Background Art
[0002] In social-aware networks, nodes often exhibit selfish behaviors due to factors such as limited resources and social connections, resulting in poor network performance. Summary of the invention
[0003] The main purpose of this application is to provide a message forwarding method, which aims to solve the technical problem that in social perception networks, nodes usually exhibit selfish behaviors due to factors such as limited resources and social connections, resulting in low network performance.
[0004] To achieve the above object, the present application proposes a message forwarding method, which includes:
[0005] Generate a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generate a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node;
[0006] Perform calculation based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost;
[0007] When the first sending cost is greater than or equal to the first receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
[0008] Optionally, after the step of calculating based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost, the step further includes:
[0009] When the first sending cost is less than the first receiving cost, comparing the asset status of the sending node with the asset status of the receiving node;
[0010] If the asset status of the sending node is greater than the asset status of the receiving node, adjusting the first sending cost according to the cooperation degree, average contribution degree and position relevance of the sending node to obtain a second sending cost;
[0011] When the second sending cost is greater than or equal to the first receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
[0012] Optionally, after the step of comparing the asset status of the sending node with the asset status of the receiving node when the first sending cost is less than the first receiving cost, the method further includes:
[0013] If the asset status of the sending node is less than or equal to the asset status of the receiving node, adjusting the first receiving cost according to the cooperation degree, average contribution degree and social association degree of the receiving node to obtain a second receiving cost;
[0014] When the first sending cost is greater than or equal to the second receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
[0015] Optionally, before the step of generating a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generating a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node, the step further includes:
[0016] Upon receiving the information to be forwarded by the sending node, detecting whether the message to be forwarded is a local message generated by the sending node itself;
[0017] If yes, obtaining the forced forwarding value of the current sending node, and comparing the forced forwarding value with a preset forwarding threshold;
[0018] When the forced forwarding value is greater than the preset forwarding threshold, the sending node is prohibited from forwarding the local message.
[0019] Optionally, after the step of prohibiting the sending node from forwarding the local message when the forced forwarding value is greater than the preset forwarding threshold, the method further includes:
[0020] Based on the cooperation degree and contribution value of the sending node, the forced forwarding value is updated periodically with a statistical time period as a period;
[0021] When it is detected that the forced forwarding value is less than or equal to the preset forwarding threshold, the sending node is allowed to forward the local message.
[0022] Optionally, after the step of forwarding the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost, the method further includes:
[0023] allocating the assets of the sending node to the receiving node based on the determined sending cost;
[0024] Calculate the hash value of each item in the forwarding information according to the hash function, and sign the first hash value of the sending cost based on the private key of the sending node to obtain a signature value;
[0025] The forwarding information, the hash values of the items and the signature value are packaged into a target block, and the target block is broadcast to the entire network.
[0026] Optionally, after the step of packaging the forwarding information, the hash value of each item and the signature value into a target block and broadcasting the target block to the entire network, the step further includes:
[0027] Calculating a second hash value of the sending cost based on the public key of the sending node and the signature value, and verifying the signature value according to the first hash value and the second hash value to obtain verification information;
[0028] Receive the forwarding validity information sent by each node in the network after checking;
[0029] When the number of forwarded valid information reaches a preset valid threshold and the verification information is passed, the target block is set to be valid and added to the blockchain.
[0030] In addition, to achieve the above purpose, the present application also proposes a message forwarding device, the message forwarding device comprising:
[0031] A function determination module, used to generate a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and to generate a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node;
[0032] A cost generation module, configured to generate a first sending cost and a first receiving cost by performing calculation based on the forwarding function and the receiving function;
[0033] A message forwarding module is used to forward the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost.
[0034] In addition, to achieve the above objectives, the present application also proposes a message forwarding device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the message forwarding method described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the message forwarding method described above are implemented.
[0036] The present application discloses generating a forwarding function according to the attributes of a message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of a sending node; generating a receiving function according to the attributes of the message to be forwarded and the delivery urgency, participation contribution, social relevance and asset status of a receiving node; performing calculations based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost; forwarding the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost. Since the present application abstracts the message forwarding between encountering nodes into a transaction process, and uses virtual currency as a transaction medium to negotiate the forwarding service, the two parties use the bargaining rules to ensure that the forwarding service is traded at a reasonable price, thereby incentivizing selfish nodes to actively participate in message forwarding and improving network performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 This is a flow chart of the first embodiment of the message forwarding method of the present application;
[0040] Figure 2 This is a flow chart of the second embodiment of the message forwarding method of the present application;
[0041] Figure 3 This is a message transaction flow chart of the message forwarding method of this application;
[0042] Figure 4 This is a flow chart of the third embodiment of the message forwarding method of the present application;
[0043] Figure 5 This is a flow chart of the fourth embodiment of the message forwarding method of the present application;
[0044] Figure 6 A schematic diagram of the blockchain for the message forwarding method of this application;
[0045] Figure 7 This is a schematic diagram of the module structure of the message forwarding device according to an embodiment of the present application;
[0046] Figure 8 A schematic diagram of the device structure of the hardware operating environment involved in the message forwarding method in the embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] The main solution of the embodiment of the present application is: generate a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node; generate a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node; calculate based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost; when the first sending cost is greater than or equal to the first receiving cost, forward the message to be forwarded from the sending node to the receiving node.
[0051] In social perception networks, nodes are usually unwilling to participate in message forwarding of other nodes due to factors such as limited resources and social connections, but only want to forward local messages of their own nodes. This factor causes nodes to exhibit selfish behavior, resulting in low network performance.
[0052] Therefore, this application provides an incentive method based on dynamic pricing of messages, in which message forwarding between encountering nodes is abstracted into a transaction process, and virtual currency is used as a transaction medium to negotiate the forwarding service, thereby incentivizing selfish nodes to actively participate in message forwarding and improve network performance.
[0053] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a computer, or an electronic device capable of implementing the above functions. The following takes a message forwarding device as an example to illustrate this embodiment and the following embodiments.
[0054] Based on this, the embodiment of the present application provides a message forwarding method, referring to Figure 1 , Figure 1This is a flow chart of the first embodiment of the message forwarding method of the present application.
[0055] In this embodiment, the message forwarding method includes:
[0056] Step S10, generating a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generating a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node.
[0057] It should be noted that the delivery urgency of a node refers to the urgency with which the node can receive and forward messages, which is mainly determined by the node's own remaining cache space, remaining energy, and the remaining survival time of the message, and can be represented by the available state index. The location relevance of a node refers to the distance correlation between the node and the destination node of the message. The location attribute function of the node can be normalized using the Gaussian similarity function and used as a measure of the node's location attribute, where the node's location attribute mainly includes the node's moving speed, the angle with the destination node, and the distance. The participation contribution value of a node refers to the degree of participation and contribution of the node in the message transmission process. The asset status of a node is also called the wealth status of the node, which is used to indicate the amount of virtual currency owned by the current node. The social relevance of a node refers to the closeness of the interaction between nodes in the network or the strength of the relationship.
[0058] In addition, it should be noted that the forwarding function, also known as the buyer's valuation function, refers to the expenditure function of the sending node to price the forwarding service according to its own attributes and the attributes of the message to be forwarded. The receiving function, also known as the seller's valuation function, refers to the revenue function of the receiving node to price the forwarding service according to its own attributes and the attributes of the message to be forwarded.
[0059] It should be understood that in order to ensure that the message can be sent smoothly to the next-hop node, the buyer (i.e., the sending node) must comprehensively consider its own wealth reserves, the urgency of delivery, and the attributes of the message carried, so as to determine a reasonable expenditure price as a reward for providing forwarding services to the next-hop node.
[0060] It is understandable that when the buyer's wealth reserves are sufficient, the buyer will give a reasonable price based on his delivery urgency and wealth reserves; when the buyer's wealth reserves are insufficient, as time goes by, the message survival time and the remaining cache and energy of the node will gradually decrease, and the buyer's delivery urgency will increase, so in order to reduce his own pressure, he will give a higher transaction price. When the buyer's participation contribution is high, it will be beneficial for the buyer to purchase forwarding services. When the message carried by the node is large, the energy and cache consumed by forwarding will also increase, which will affect the buyer's bid for the forwarding service. In addition, when the buyer has a high correlation with the location of the destination node of the message, it means that the time it takes to reach the destination node is shorter.
[0061] It should be understood that when receiving a message carried by a buyer, the seller (i.e., the receiving node) also needs to consider its own wealth reserves, the urgency of delivery, and the pricing of the message attributes carried to maximize its own income.
[0062] It is understandable that when the seller's wealth reserves are sufficient, the node's willingness to provide message forwarding will decrease, so it is necessary to combine the seller's delivery urgency to make reasonable pricing. When the seller's wealth reserves are insufficient, it needs to obtain virtual currency from elsewhere at a lower price, and its willingness to provide message forwarding will increase. When the seller has a higher participation contribution, it will be more conducive to forwarding messages. In addition, the size of the message is proportional to the energy and cache required for message forwarding. When the message is large, the energy and cache consumption for the seller providing forwarding services is also increasing, which in turn affects pricing. In addition, the seller must also consider the social connection between nodes. If the correlation between nodes is high, it means that the relationship between the two nodes is good. At this time, the seller is more willing to forward the message and the bid will be relatively low; conversely, if the correlation between nodes is low, the sending node bid will be relatively high.
[0063] For ease of understanding, the following examples are given, but are not intended to limit the present application. In one example, the attributes of a node are defined as follows:
[0064] 1. Node delivery urgency
[0065] Delivery urgency of node i at time h It can be defined as:
[0066]
[0067] Among them, α, β, and γ are introduced as weight values to balance different optimization objectives. The weight values between different instances will have a significant impact on the performance of the algorithm. They represent the remaining cache space, remaining energy value and remaining survival time of message m of node i at time h, They represent the initial total cache space, initial total energy value and initial lifetime of message m of node i respectively.
[0068] 2. Node location relevance
[0069] The node location attribute function loc(i,d) is defined as:
[0070]
[0071] Among them, v i represents the moving speed of node i. Assume that the position coordinates of node i and destination node d are (a i , b i ) and (a d , b d ),but
[0072]
[0073] Where A represents the angle between node i and the destination node. D(i,d) represents the Euclidean distance between node i and the destination node. Use the Gaussian similarity function to normalize the above node location attribute function loc(i,d) and calculate the node location correlation as follows:
[0074]
[0075] Where (σ=1) is the proportional parameter. When the node position attribute function of node i is smaller, the value of g(i) is closer to 1, which means that the time from node i to the destination node is shorter.
[0076] 3. Node participation and contribution
[0077] The cooperation degree X of node i at time h i (h) is defined as:
[0078]
[0079] Among them, F i represents the total number of messages forwarded by node i that are not generated by itself. When node i successfully forwards a message that is not generated by itself, F i +1;M i Represents the number of times node i encounters other nodes. When node i encounters other nodes, M i +1.
[0080] When the message successfully delivered to the destination node with the help of a node, the algorithm assigns contribution values according to the order of the nodes on the forwarding path. The first relay node on the delivery path is given the maximum contribution value; the last relay node is given a relatively large contribution value; other relay nodes on the delivery path gradually reduce their contribution values according to their positions on the forwarding path. The contribution value C(i,n) assigned to node i on the nth path is defined as:
[0081]
[0082] where r(0 < r < 1) represents the contribution value distribution ratio factor; L represents the total number of relay nodes on this path. Whenever a message is successfully delivered to the destination node, the contribution value of node i is accumulated according to the above distribution scheme, and then the average contribution value avgC of node i is calculated i 。
[0083] The algorithm measures the degree of participation and contribution of nodes in the message delivery process through the cooperation degree and average contribution degree of nodes. Then the participation contribution degree PC of node i i is expressed as:
[0084] PC i (h) = ρ * X i (h) + (1 - ρ) * avgC i ,
[0085] where ρ is the weight factor that affects PC i (h) and avgC i and ρ ∈ [0, 1]. i
[0086] 4. Asset Status of Nodes
[0087] In the network, according to the existing virtual currency amount of nodes, three different virtual currency states can be divided: sufficient state, general state, and insufficient state. When V i (h) > V max , the node is in the sufficient virtual currency state, and at this time C i (h) > 1; when V i (h) < V min , the node is in the insufficient virtual currency state, and at this time C i (h) < 1; when V min ≤ V i (h) ≤ V max , the node is in the general virtual currency state, and at this time C i (h) = 1. The relevant calculations are as follows:
[0088]
[0089] Among them, V i (h) represents the amount of virtual currency owned by node i at time h. Virtual currency threshold V max and V min They represent the highest and lowest values of the amount of virtual currency owned by the node.
[0090] 5. Social connections between nodes
[0091] In a network, the social connection of a node is determined by the social overlap of the node and the degree of contact between the nodes. The social overlap between node i and node j is ij for:
[0092]
[0093] Among them, com ij Indicates the number of common neighbor nodes between nodes i and j, neigh i and neigh j Represents the number of all neighbor nodes of node i and j respectively.
[0094] The contact degree between nodes is to quantify the closeness of the connection between nodes by analyzing the frequency and time of encounter between nodes. ij represents the connection degree between nodes i and j, which is calculated as follows:
[0095]
[0096] Among them, Nmc ij represents the number of times nodes i and j have met so far, Tm ij represents the sum of all encounter times between nodes i and j so far, N represents the number of nodes in the current network, and accurateT represents the current time.
[0097] Therefore, the social connection between nodes SC ij The calculation is as follows:
[0098]
[0099] in, is overlap ij and contact ij About SC ij Influential weighting factors, and
[0100] In summary, the expenditure function (i.e., expenditure function) of buyer x forwarding message m at time h is BN px (h) is defined as:
[0101]
[0102] Among them, M size represents the size of m, g(x) represents the position relevance of x, σ1 is the weight of the node position relevance, and satisfies α+β+γ+σ1=1. x (h) represents the wealth of x at time h, PC x (h) represents the participation contribution of x at time h.
[0103] The income function (i.e., receiving function) of seller y receiving information m at time h is high when the correlation between nodes is high, i.e., SC xy ≥SC xy_min , defined as follows:
[0104]
[0105] When the correlation between nodes is low, that is, SC xy <SC xy_min , defined as follows:
[0106]
[0107] Among them, M size Indicates the size of m, SC xy represents the social connection between x and y, σ2 represents the weight of the social connection between x and y, and satisfies α+β+γ+σ2=1. SC xy_min represents the minimum threshold of social connection between x and y, C y (h) represents the wealth of y at time h, PC y (h) represents the participation contribution of y at time h.
[0108] Step S20: Calculate based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost.
[0109] It should be noted that the first sending cost refers to the initial buyer pricing of the data forwarding service by the sending node based on the attributes of the message to be forwarded and the forwarding function. The first receiving cost is the initial seller pricing of the data forwarding service by the receiving node based on the attributes of the message to be forwarded and the receiving function.
[0110] It should be understood that the calculation of the message to be forwarded based on the forwarding function and the receiving function may be to generate a first sending cost (i.e., a first buyer's bid) according to the attributes of the message to be forwarded, the delivery urgency of the sending node, the location relevance, the participation contribution, and the asset status, and to generate a first receiving cost (i.e., a first seller's bid) according to the attributes of the message to be forwarded, the delivery urgency, the social relevance, the participation contribution, and the asset status of the receiving node, wherein the first sending cost and the first receiving cost may be determined based on the size of the message to be forwarded based on the attributes of the message to be forwarded, or may be priced based on the type of the message to be forwarded (such as text, video, image, etc.). Of course, in order to increase the speed of forwarding critical information, the calculation of the message to be forwarded based on the forwarding function and the receiving function may also be to generate a first sending cost and a first receiving cost based on the importance of the message to be forwarded.
[0111] Step S30: when the first sending cost is greater than or equal to the first receiving cost, forwarding the message to be forwarded from the sending node to the receiving node.
[0112] It should be understood that the first sending cost is the pricing of the data forwarding service by the sending node (i.e., the buyer), and the first receiving cost is the pricing of the data forwarding service by the receiving node (i.e., the seller). When the first sending cost is greater than or equal to the first receiving cost, that is, the price offered by the buyer is greater than or equal to the seller's price, the first negotiation between the buyer and the seller is successful and the message can be forwarded successfully.
[0113] For ease of understanding, the following examples are provided, but are not intended to limit this application. In one example, before a transaction begins, both the buyer and the seller need to inform each other of the message pricing and wealth status. After the transaction begins, the spending price given by buyer x is BN px (h), the price offered by seller y is SN py (h). If BN px (h)≥SN py (h) Message m is successfully forwarded, and the next message forwarding transaction can be carried out. px (h) <SN py (h), the first negotiation forwarding fails.
[0114] In this embodiment, it is disclosed that a forwarding function is generated according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node; a receiving function is generated according to the attributes of the message to be forwarded and the delivery urgency, participation contribution, social relevance and asset status of the receiving node; a first sending cost and a first receiving cost are calculated based on the forwarding function and the receiving function; when the first sending cost is greater than or equal to the first receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node. Due to this application: message forwarding between nodes is abstracted as a transaction process, and virtual currency is used as a transaction medium to negotiate the forwarding service. Both parties use bargaining rules to ensure that the forwarding service is traded at a reasonable price, thereby motivating selfish nodes to actively participate in message forwarding.
[0115] Reference Figure 2 , Figure 2 This is a flow chart of the second embodiment of the message forwarding method of this application, based on the above Figure 1 The first embodiment shown proposes a second embodiment of the message forwarding method of the present application.
[0116] In this embodiment, after step S30, the following steps are further included:
[0117] Step S401: When the first sending cost is less than the first receiving cost, compare the asset status of the sending node and the asset status of the receiving node.
[0118] It is understandable that when the first negotiation between the two parties fails and they enter the second bargaining stage, the first sending cost and the first receiving cost need to be adjusted. The buyer needs to increase the price of the message forwarding service, while the seller node needs to reduce the price of the message forwarding service. Of course, in order to make the buyer and seller get satisfactory pricing as much as possible, it is also necessary to determine the party that adjusts the price by comparing the wealth (i.e., asset) of both parties.
[0119] For ease of understanding, the following examples are provided, but are not intended to limit the present application. Figure 3 , Figure 3 This is the message transaction flow chart of the message forwarding method of this application. Both the buyer and the seller need to inform each other of the message pricing and wealth status.
[0120] After the transaction begins, the spending price given by buyer x is BN px (h), the price offered by seller y is SN py (h). If BN px (h)≥SN py (h) Message m is successfully forwarded, and the next message forwarding transaction can be carried out. px (h) <SNpy (h), the first negotiation forwarding fails.
[0121] If the buyer and seller fail in the first negotiation, they will enter the second negotiation stage. By comparing the wealth of both parties, they will readjust their respective prices. x (h)>C y (h), then SN py (h) remains unchanged, according to the formula BN px (h) = BN px (h)*(1+k1) for adjustment; if C y (h)≥C x (h), then BN px (h) remains unchanged, according to the formula SN py (h) = SN py (h)*(1-k2) is adjusted.
[0122] If the two nodes reach a consensus again after two rounds of bargaining, that is, BN px (h)≥SN py (h), the message will be forwarded; otherwise, the transaction will be abandoned and the next transaction will be continued.
[0123] Step S402: If the asset status of the sending node is greater than the asset status of the receiving node, the first sending cost is adjusted according to the cooperation degree, average contribution degree and position relevance of the sending node to obtain a second sending cost.
[0124] It should be understood that when the assets of the sending node are greater than those of the receiving node, the buyer has sufficient wealth reserves. Therefore, for the sake of the seller's rights and interests, the buyer should comprehensively consider its own degree of collaboration, average contribution and location relevance to adjust the first sending cost and increase the buyer's price.
[0125] For ease of understanding, the following examples are provided, but are not intended to limit the present application. x (h)>C y (h), then SN py (h) remains unchanged, according to the formula BN px (h) = BN px (h)*(1+k1), where k1 is the adjustment factor, calculated as follows:
[0126] k1=ω1*X x (h)+ω2*avgC x +ω3*g(x),
[0127] Among them, X x (h) represents the degree of cooperation of x, avgC xrepresents the average contribution of x, and g(x) represents the position relevance of node x. ω1, ω2 and ω3 are weights, which respectively represent the influence of collaboration, average contribution and node position relevance on adjustment factor k1, and the sum of the three is 1. Here, the weight is dynamically adjusted by adaptive weighting, and the weight value is calculated as follows:
[0128]
[0129] Step S403: when the second sending cost is greater than or equal to the first receiving cost, forwarding the message to be forwarded from the sending node to the receiving node.
[0130] It can be understood that when the adjusted sending cost is greater than the receiving cost, the second negotiation is successful and the message can be forwarded. Otherwise, the transaction will be abandoned and the next transaction will be continued.
[0131] Furthermore, in order to ensure that the forwarding service is traded at a reasonable price, after step S403, it also includes: if the asset status of the sending node is less than or equal to the asset status of the receiving node, adjusting the first receiving cost according to the cooperation degree, average contribution degree and social association degree of the receiving node to obtain the second receiving cost; when the first sending cost is greater than or equal to the second receiving cost, forwarding the message to be forwarded from the sending node to the receiving node.
[0132] It should be understood that when the assets of the sending node are less than the assets of the receiving node, the buyer node cannot pay the price of the message forwarding service provided by the current seller node, and the seller needs to adjust the first income cost based on its own degree of collaboration, average contribution and social connection between nodes.
[0133] For ease of understanding, the following examples are provided, but are not intended to limit the present application. y (h)≥C x (h), then BN px (h) remains unchanged, according to the formula SN py (h) = SN py (h)*(1-k2), where k2 is calculated as follows:
[0134] k2=θ1*X y (h)+θ2*avgC y +θ3*SC xy ,
[0135] Among them, X y (h) represents the degree of cooperation of y, avgC y represents the average contribution of y, SC xyRepresents the social connection between nodes x and y. θ1, θ2 and θ3 are weights, which respectively represent the influence of collaboration, average contribution and social connection between nodes on adjustment factor k2. The sum of the three is 1. The weight values are calculated as follows:
[0136]
[0137] In this embodiment, when the first negotiation between the two parties at the node fails, they enter the secondary bargaining stage. By comparing the wealth of both parties, their respective prices are readjusted. If the buyer's wealth is greater than the seller's, the buyer increases the expenditure price; if the buyer's wealth is less than the seller's, the income price is reduced, ensuring that the forwarding service is traded at a reasonable price.
[0138] Reference Figure 4 , Figure 4 This is a flow chart of the third embodiment of the message forwarding method of this application, based on the above Figure 2 The second embodiment shown proposes a third embodiment of the message forwarding method of the present application.
[0139] In this embodiment, before step S10, the method further includes:
[0140] Step S01: upon receiving information to be forwarded by the sending node, detecting whether the message to be forwarded is a local message generated by the sending node itself.
[0141] It should be noted that local messages refer to information generated by the node itself. Since the nodes in the network have limited energy and cache, they tend to give priority to forwarding their own messages or refuse to forward non-local messages to ensure that their own messages can be delivered smoothly.
[0142] It should be understood that the detection of whether the message to be forwarded is a local message generated by the sending node itself can be based on the production node information identifier attached when the message is generated, or it can be detected based on the message lifetime of the message. The message lifetime will decrease with each forwarding. If the message lifetime of a node's message to be forwarded is equal to the initial survival threshold, the message to be forwarded is the node's own local message.
[0143] Step S02: If yes, obtain the forced forwarding value of the current sending node, and compare the forced forwarding value with a preset forwarding threshold.
[0144] It should be noted that the mandatory forwarding value is a specific value or attribute related to the sending node, indicating the number of received messages that the sending node must forward under certain conditions. The preset forwarding threshold is a condition pre-set by the system. By comparing the mandatory forwarding value and the preset forwarding threshold, the system can determine the behavior of the sending node, such as whether to perform a forwarding operation, adjust the forwarding strategy, etc.
[0145] For ease of understanding, the following examples are given, but are not intended to limit the present application. In one example, the mandatory forwarding value CF of node i is i The size of i is determined by its cooperation degree X i (h) and contribution value C(i,n), the specific calculation method is as follows:
[0146]
[0147] Step S03: when the forced forwarding value is greater than the preset forwarding threshold, prohibiting the sending node from forwarding the local message.
[0148] Furthermore, in order to remove the restriction on nodes forwarding local messages, after step S03, it also includes: updating the forced forwarding value periodically based on the cooperation degree and contribution value of the sending node with a statistical time period as a period; when it is detected that the forced forwarding value is less than or equal to the preset forwarding threshold, allowing the sending node to forward the local message.
[0149] It should be understood that the mandatory forwarding value is automatically updated at a fixed frequency to ensure that the forwarding behavior of the node can be monitored and adjusted at certain time points. When the mandatory forwarding value is greater than the preset forwarding threshold, the node must forward messages generated by other nodes equal to the mandatory forwarding value before it can forward its own messages. When a node is restricted from forwarding, in order to smoothly forward its own messages, it can only improve its cooperation by participating in forwarding messages generated by other nodes, thereby gradually reducing its own mandatory forwarding value until it finally restores its normal message forwarding capability.
[0150] In this embodiment, a forced forwarding strategy is set to force selfish nodes that are unwilling to participate in forwarding messages of other nodes to forward a certain number of non-local messages, thereby motivating nodes with low cooperation to participate in cooperation.
[0151] Reference Figure 5 , Figure 5 This is a flow chart of the fourth embodiment of the message forwarding method of this application, based on the above Figure 4 The third embodiment shown proposes the fourth embodiment of the message forwarding method of the present application.
[0152] In this embodiment, after step S30, the following steps are further included:
[0153] Step S501: allocating the assets of the sending node to the receiving node based on the determined sending cost.
[0154] It should be noted that the sending cost refers to the final price of the forwarding service determined by the sending node and the receiving node through bargaining.
[0155] Step S502: Calculate the hash value of each item in the forwarding information according to the hash function, and sign the first hash value of the sending cost based on the private key of the sending node to obtain a signature value.
[0156] It should be noted that a hash function is a function that transforms an input of any length into an output of fixed length through a certain algorithm. This transformation process is irreversible, and the original input data cannot be deduced from the hash value. The hash value is the fixed-length data output by the hash function. For a given hash function and input data, the hash value is unique. Private key signing involves combining the hash value of the data with the private key to generate a signature value through a specific algorithm. This signature value can be verified by anyone with the corresponding public key to confirm the source and integrity of the message.
[0157] It should be understood that when storing transaction data, each node in the network will generate a public key and a private key through a public key encryption algorithm. Among them, the private key is securely stored by the node, while the public key is published on the network. In order to ensure the security of the transaction process and prevent false quotations, it is necessary to verify the transaction records generated between the initiator (buyer) and the recipient (seller) of a transaction, which contain information about both parties to the transaction, the transaction price, etc.
[0158] Step S503: Pack the forwarding information, the hash value of each item and the signature value into a target block, and broadcast the target block to the entire network.
[0159] Furthermore, in order to ensure the consensus and consistency of the transaction history of the entire network, after step S503, it also includes: calculating the second hash value of the sending cost based on the public key of the sending node and the signature value, and verifying the signature value according to the first hash value and the second hash value to obtain verification information; receiving the forwarding valid information sent by each node in the network after checking; when the number of forwarding valid information reaches a preset valid threshold and the verification information is passed, setting the target block to valid and adding it to the blockchain.
[0160] Specifically, once the target block is built, it will be broadcast to the entire blockchain network. After receiving the block, the nodes in the network will verify it. The verification process includes checking the legitimacy of the block (such as whether it complies with the protocol rules of the blockchain), verifying the signature of the transaction in the block, and confirming whether the hash value of the block matches. At the same time, in the blockchain network, the hash algorithm is used to ensure the immutability of transaction data. Each new block contains the hash value of the previous block, and any tampering with the transaction data will change its hash value.
[0161] For ease of understanding, the following examples are provided, but are not intended to limit the present application. Figure 6 , Figure 6 This is a schematic diagram of the blockchain for the message forwarding method of this application. The information in the diagram is as follows:
[0162] PreviousHash is the hash value of the previous block linked to the current block. Data is the actual data content stored in the block. Timestamp is the timestamp, which records the exact time when the block was created (or the transaction was packaged into the block). HostID is the identifier of the buyer (message sender), and OtherID is the identifier of the seller (message receiver). Cost (transaction price) refers to the price or fee of the message forwarding service agreed upon by the transaction parties. Hash (hash value) is a fixed-length output obtained by encrypting the data in the block through a hash function.
[0163] Once a new block obtains the consensus of the whole network, it will be added to the end of the blockchain. Each new block contains the hash value of the previous block, and any tampering with the transaction data will change its hash value. At the same time, all nodes follow the longest chain principle, that is, when there are multiple competing branch chains, the node will choose to join the longest valid chain as the main chain.
[0164] In this embodiment, the transaction records that have passed verification are written into blocks and added to the blockchain, thereby achieving transparency and credibility of transaction data. Any node participating in the network can access and verify these transaction records, ensuring the consensus and consistency of the entire network on the transaction history.
[0165] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the message forwarding method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0166] This application also provides a message forwarding device, please refer to Figure 7 , the message forwarding device comprises:
[0167] A function determination module 10, for generating a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generating a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node;
[0168] A cost generating module 20, configured to generate a first sending cost and a first receiving cost by performing calculation based on the forwarding function and the receiving function;
[0169] The message forwarding module 30 is configured to forward the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost.
[0170] The message forwarding device provided by the present application adopts the message forwarding method in the above embodiment, which can solve the technical problem that in social perception networks, nodes usually exhibit selfish behaviors due to factors such as limited resources and social connections, resulting in low network performance. Compared with the prior art, the beneficial effects of the message forwarding device provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, and other technical features in the message forwarding device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0171] The present application provides a message forwarding device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message forwarding method in the above-mentioned embodiment one.
[0172] Reference below Figure 8 , which shows a schematic diagram of the structure of a message forwarding device suitable for implementing an embodiment of the present application. The message forwarding device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The message forwarding device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0173] like Figure 8As shown, the message forwarding device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the message forwarding device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the message forwarding device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a message forwarding device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0174] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0175] The message forwarding device provided by the present application adopts the message forwarding method in the above embodiment, which can solve the technical problem that nodes in social perception networks usually exhibit selfish behaviors due to factors such as limited resources and social connections, resulting in low network performance. Compared with the prior art, the beneficial effects of the message forwarding device provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above embodiment, and the other technical features in the message forwarding device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0176] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0177] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0178] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the message forwarding method in the above-mentioned embodiment.
[0179] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0180] The computer-readable storage medium may be included in the message forwarding device; or may exist independently without being assembled into the message forwarding device.
[0181] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the message forwarding device, the message forwarding device implements the message forwarding method described above.
[0182] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through 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).
[0183] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0184] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0185] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned message forwarding method, and can solve the technical problem that nodes in social perception networks usually exhibit selfish behaviors due to factors such as limited resources and social connections, resulting in low network performance. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the message forwarding method provided by the above-mentioned embodiment, and will not be repeated here.
[0186] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A message forwarding method, characterized in that: The message forwarding method comprises: Generate a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generate a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node; Perform calculation based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost; When the first sending cost is greater than or equal to the first receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
2. The message forwarding method according to claim 1, characterized in that: After the step of calculating based on the forwarding function and the receiving function to generate a first sending cost and a first receiving cost, the method further includes: When the first sending cost is less than the first receiving cost, comparing the asset status of the sending node with the asset status of the receiving node; If the asset status of the sending node is greater than the asset status of the receiving node, adjusting the first sending cost according to the cooperation degree, average contribution degree and position relevance of the sending node to obtain a second sending cost; When the second sending cost is greater than or equal to the first receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
3. The message forwarding method according to claim 2, characterized in that: After the step of comparing the asset status of the sending node with the asset status of the receiving node when the first sending cost is less than the first receiving cost, the method further includes: If the asset status of the sending node is less than or equal to the asset status of the receiving node, adjusting the first receiving cost according to the cooperation degree, average contribution degree and social association degree of the receiving node to obtain a second receiving cost; When the first sending cost is greater than or equal to the second receiving cost, the message to be forwarded is forwarded from the sending node to the receiving node.
4. The message forwarding method according to claim 1, characterized in that: Before the steps of generating a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and generating a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node, the method further includes: Upon receiving the information to be forwarded by the sending node, detecting whether the message to be forwarded is a local message generated by the sending node itself; If yes, obtaining the forced forwarding value of the current sending node, and comparing the forced forwarding value with a preset forwarding threshold; When the forced forwarding value is greater than the preset forwarding threshold, the sending node is prohibited from forwarding the local message.
5. The message forwarding method according to claim 4, characterized in that: After the step of prohibiting the sending node from forwarding the local message when the forced forwarding value is greater than the preset forwarding threshold, the method further includes: Based on the cooperation degree and contribution value of the sending node, the forced forwarding value is updated periodically with a statistical time period as a period; When it is detected that the forced forwarding value is less than or equal to the preset forwarding threshold, the sending node is allowed to forward the local message.
6. The message forwarding method according to any one of claims 1 to 3, characterized in that: After the step of forwarding the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost, the method further includes: allocating the asset of the sending node to the receiving node based on the determined sending cost; Calculate the hash value of each item in the forwarding information according to the hash function, and sign the first hash value of the sending cost based on the private key of the sending node to obtain a signature value; The forwarding information, the hash values of the items and the signature value are packaged into a target block, and the target block is broadcast to the entire network.
7. The message forwarding method according to claim 6, characterized in that: After the step of packaging the forwarding information, the hash values of the items and the signature value into a target block and broadcasting the target block to the entire network, the method further includes: Calculating a second hash value of the sending cost based on the public key of the sending node and the signature value, and verifying the signature value according to the first hash value and the second hash value to obtain verification information; Receive the forwarding validity information sent by each node in the network after checking; When the number of forwarded valid information reaches a preset valid threshold and the verification information is passed, the target block is set to be valid and added to the blockchain.
8. A message forwarding device, characterized in that: The message forwarding device comprises: A function determination module, used to generate a forwarding function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution and asset status of the sending node, and to generate a receiving function according to the attributes of the message to be forwarded and the delivery urgency, location relevance, participation contribution, social relevance and asset status of the receiving node; A cost generation module, configured to generate a first sending cost and a first receiving cost by performing calculation based on the forwarding function and the receiving function; A message forwarding module is used to forward the message to be forwarded from the sending node to the receiving node when the first sending cost is greater than or equal to the first receiving cost.
9. A message forwarding device, characterized in that: The message forwarding device comprises: a memory, a processor, and a message forwarding program stored in the memory and executable on the processor, wherein the message forwarding program implements the message forwarding method according to any one of claims 1 to 7 when executed by the processor.
10. A storage medium, characterized in that: The storage medium stores a message forwarding program, and when the message forwarding program is executed by the processor, the message forwarding method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Message transmission method and system, terminal equipment and computer readable storage medium
CN111629416A
Transaction consensus method and device based on block chains and equipment
CN112381649A
Social awareness network incentive method, device, equipment and storage medium
CN117829927A
Method and apparatus for managing the delivery and return of goods
US20030135432A1