Service resource metering methods and devices, electronic equipment, storage media

By establishing a local metering channel in a near-field communication network, the problem of excessive load on the blockchain network was solved, achieving efficient metering of service resources and improving metering efficiency.

CN115484601BActive Publication Date: 2025-11-14CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211105000.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-11-14
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

In near-field communication networks, as the number of nodes increases, the data carrying capacity of the blockchain network increases, leading to an excessive load on the blockchain for traffic data metering and affecting the efficiency of service resource metering.

Method used

In a near-field communication network, a local metering channel is established between the first and second relay communication devices to collect and reach a consensus on the metering value of service resources. The consensus value is then stored in an off-chain ledger until the termination conditions are met before being uploaded to the blockchain network for settlement, thus reducing the frequent uploading of trivial data to the chain.

Benefits of technology

It reduces the load pressure on the blockchain network, improves the service resource metering efficiency of each node in the near-field communication network, and reduces the data burden on the blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115484601B_ABST
    Figure CN115484601B_ABST
Patent Text Reader

Abstract

This disclosure provides a service resource metering method, apparatus, electronic device, and storage medium, relating to the field of communication technology. The service resource metering method includes: establishing a local metering channel; reaching consensus on a first service resource metering value collected by a first relay device and a second service resource metering value provided by a second relay device based on the local metering channel; storing the consensus-reached first and second service resource metering values ​​in an off-chain ledger; and uploading the off-chain ledger to a blockchain network in response to the local metering channel meeting a termination condition, so that the blockchain network can complete service resource settlement based on the off-chain ledger and close the local metering channel. The technical solution of this disclosure measure the service resources of each relay device in a near-field communication network through an established local metering channel, reducing the blockchain load problem caused by uploading various trivial traffic data to the blockchain and improving the statistical efficiency of service resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and more specifically, to a service resource metering method, a service resource metering device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Near-field communication (NFC) is an emerging communication technology that allows user terminals to connect to other user terminals wirelessly and connect to the Internet by using other user terminals as relay devices. It effectively solves the problem of insufficient mobile communication coverage in certain scenarios and is an important component of the development of 5G and even 6G mobile communication technologies.

[0003] Generally, multiple relay devices may need to be set up between the user terminal and the Internet. In order to ensure that each relay device in the local area communication network can provide stable services, an effective incentive mechanism needs to be established to measure the services provided by the relay devices and give rewards such as points.

[0004] Currently, the common practice is to upload the traffic data generated by relay devices to a blockchain network each time, where smart contracts calculate the specific settlement fees. However, considering the ever-expanding node scale of near-field communication networks, a large amount of traffic data needs to be recorded on the blockchain between adjacent relay nodes, between end users and relay nodes, and between relay nodes and operators, putting significant pressure on the blockchain's data capacity.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a service resource metering method, a service resource metering device, an electronic device, and a computer-readable storage medium, thereby at least to a certain extent reducing the load pressure on the blockchain network and improving the service resource metering efficiency of each node in the near-field communication network.

[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0008] According to a first aspect of the present disclosure, a service resource metering method is provided, performed by a first relay communication device in a near-field communication network, the method comprising:

[0009] Obtain verification information of the second relay communication device accessing the near-field communication network, and establish a local metering channel based on the verification information;

[0010] The local metering channel will be used to reach a consensus on the first service resource metering value and the second service resource metering value provided by the second relay communication device.

[0011] The consensus-reached first service resource metering value is stored in the first off-chain ledger, and at the same time, the second relay communication device stores the consensus-reached second service resource metering value in the second off-chain ledger.

[0012] In response to the local metering channel meeting the termination condition, the first off-chain ledger is uploaded to the blockchain network, and / or the second off-chain ledger is uploaded to the blockchain network by the second relay communication device, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

[0013] In some example embodiments of this disclosure, based on the foregoing scheme, the blockchain network includes smart contracts for managing local metering channels and a public key infrastructure system;

[0014] The step of obtaining verification information of the second relay communication device accessing the near-field communication network and establishing a local metering channel based on the verification information includes:

[0015] Send a channel establishment request to the second relay communication device, the channel establishment request including first smart contract information;

[0016] Receive request response information returned by the second relay communication device in response to the channel establishment request, the request response information including second smart contract information created based on the first smart contract information;

[0017] Obtain the public key information of the second relay communication device from the public key infrastructure system, and verify the signature of the second smart contract information based on the public key information;

[0018] The second smart contract information, after signature verification, is broadcast to the blockchain network, so that the blockchain network can create a local metering channel based on the second smart contract information and the smart contract that manages the local metering channel.

[0019] In some example embodiments of this disclosure, based on the foregoing scheme, the first smart contract information includes the first identity identifier of the first relay communication device, the start time and end time of the local metering channel, the first service resource points available for pledging by the first relay communication device, the metering period, the metering method, and the uplink network information of the first relay communication device. The channel establishment request also includes the digital signature of the first smart contract information by the first relay communication device through the first private key information.

[0020] The second smart contract information includes the first smart contract information verified by the second relay communication device, as well as the second identity identifier of the second relay communication device, the second service resource points available for staking, and the uplink network information of the second relay communication device. The request response information also includes the digital signature of the second smart contract information by the second relay communication device through the second private key information.

[0021] In some example embodiments of this disclosure, based on the foregoing scheme, the consensus reached on the first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel includes:

[0022] Based on the metering period and metering method recorded in the smart contract, the metering value of the first service resource is calculated.

[0023] Obtain the second service resource metering value provided by the second relay communication device, and obtain the metering deviation threshold determined by pre-consensus.

[0024] If it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then the second service resource metering value is digitally signed using the first private key information and returned to the second relay communication device to complete the consensus.

[0025] The first service resource metering value includes the uplink and downlink traffic from the first relay communication device to the second relay communication device; the second service resource metering value includes the uplink and downlink traffic from the second relay communication device to the first relay communication device.

[0026] In some example embodiments of this disclosure, based on the foregoing scheme, the response that the local metering channel meets the termination condition uploads the first off-chain ledger to the blockchain network, and / or the second relay communication device uploads the second off-chain ledger to the blockchain network, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, including:

[0027] In response to a channel interruption request from at least one of the first relay communication device and the second relay communication device, or by triggering the end time of the local metering channel, the first off-chain ledger is uploaded to the off-chain storage location, and / or the second relay communication device uploads the second off-chain ledger to the off-chain storage location;

[0028] Sending liquidation information to the blockchain network enables the verification nodes in the blockchain network to access the first off-chain ledger and / or the second off-chain ledger in the off-chain storage location based on the liquidation information, and complete the service resource liquidation;

[0029] The liquidation information includes the first service resource metering value and the second service resource metering value during the lifecycle of the local metering channel, the off-chain storage address of the complete first off-chain ledger, and the hash value of the complete first off-chain ledger.

[0030] In some example embodiments of this disclosure, based on the foregoing scheme, the verification node is used to obtain the first off-chain ledger and / or the second off-chain ledger from the off-chain storage location according to the off-chain storage address, and to transfer the first service resource points and the second service resource points pledged in the blockchain network by the first relay communication device and the second relay communication device according to the service resource metering values ​​recorded in the first off-chain ledger and / or the second off-chain ledger, thereby completing the service resource settlement.

[0031] In some example embodiments of this disclosure, based on the foregoing scheme, the verification node is further configured to, upon receiving an objection request from the first relay communication device or the second relay communication device, compare the first off-chain ledger and the second off-chain ledger, arbitrate the objection request based on the comparison result, and complete the settlement of service resources.

[0032] According to a second aspect of the present disclosure, a service resource metering device is provided, comprising a first relay communication device disposed in a near-field communication network, the device including:

[0033] The local metering channel establishment module is used to obtain the verification information of the second relay communication device accessing the near-field communication network, and establish a local metering channel based on the verification information.

[0034] The metering consensus module is used to reach a consensus on the statistical first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel.

[0035] The metering value storage module is used to store the consensus-reached first service resource metering value in the first off-chain ledger. At the same time, the second relay communication device stores the consensus-reached second service resource metering value in the second off-chain ledger.

[0036] The service resource clearing module is used to respond to the local metering channel meeting the termination condition by uploading the first off-chain ledger to the blockchain network, and / or by uploading the second off-chain ledger to the blockchain network through the second relay communication device, so that the blockchain network completes service resource clearing based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

[0037] In one exemplary embodiment of this disclosure, based on the foregoing scheme, the blockchain network may include a smart contract for managing local metering channels and a public key infrastructure system; the local metering channel establishment module may be used to: send a channel establishment request to the second relay communication device, the channel establishment request including first smart contract information; receive request response information returned by the second relay communication device in response to the channel establishment request, the request response information including second smart contract information created based on the first smart contract information; obtain the public key information of the second relay communication device from the public key infrastructure system, and perform signature verification on the second smart contract information according to the public key information; broadcast the signature-verified second smart contract information to the blockchain network, so that the blockchain network creates a local metering channel based on the second smart contract information and the smart contract for managing the local metering channel.

[0038] In one exemplary embodiment of this disclosure, based on the foregoing scheme, the first smart contract information includes the first identity identifier of the first relay communication device, the start time and end time of the local metering channel, the first service resource points available for staking by the first relay communication device, the metering period, the metering method, and the uplink network information of the first relay communication device. The channel establishment request also includes the digital signature of the first smart contract information by the first relay communication device using the first private key information. The second smart contract information includes the first smart contract information verified by the signature of the second relay communication device, as well as the second identity identifier of the second relay communication device, the second service resource points available for staking, and the uplink network information of the second relay communication device. The request response information also includes the digital signature of the second smart contract information by the second relay communication device using the second private key information.

[0039] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the metering consensus module can be used to: calculate the first service resource metering value based on the metering period and metering method recorded in the smart contract; obtain the second service resource metering value provided by the second relay communication device, and obtain a metering deviation threshold determined by pre-consensus; if it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then digitally sign the second service resource metering value using the first private key information and return it to the second relay communication device to complete the consensus; wherein, the first service resource metering value includes the uplink traffic and downlink traffic from the first relay communication device to the second relay communication device; the second service resource metering value includes the uplink traffic and downlink traffic from the second relay communication device to the first relay communication device.

[0040] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the service resource clearing module can be used to: respond to a channel interruption request from at least one of the first relay communication device and the second relay communication device, or trigger the end time of the local metering channel, upload the first off-chain ledger to the off-chain storage location, and / or have the second relay communication device upload the second off-chain ledger to the off-chain storage location; send clearing information to the blockchain network, so that the verification nodes in the blockchain network can access the first off-chain ledger and / or the second off-chain ledger in the off-chain storage location according to the clearing information, and complete the service resource clearing; wherein, the clearing information includes the first service resource metering value and the second service resource metering value within the lifecycle of the local metering channel, the complete off-chain storage address of the first off-chain ledger, and the complete hash value of the first off-chain ledger.

[0041] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the verification node is configured to obtain the first off-chain ledger and / or the second off-chain ledger from the off-chain storage location according to the off-chain storage address, and transfer the first service resource points and the second service resource points pledged in the blockchain network by the first relay communication device and the second relay communication device according to the service resource metering values ​​recorded in the first off-chain ledger and / or the second off-chain ledger, thereby completing the service resource settlement.

[0042] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the verification node is further configured to, upon receiving an objection request from the first relay communication device or the second relay communication device, compare the first off-chain ledger and the second off-chain ledger, arbitrate the objection request based on the comparison result, and complete the settlement of service resources.

[0043] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing computer-readable instructions that, when executed by the processor, implement the service resource metering method described in any one of the preceding embodiments.

[0044] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the service resource metering method according to any one of the preceding claims.

[0045] The technical solutions provided in this disclosure can include the following beneficial effects:

[0046] The service resource metering method in the example embodiments of this disclosure can establish a local metering channel between a first relay communication device and a second relay communication device, and reach a consensus on the statistical first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel; store the consensus-reached first service resource metering value in a first off-chain ledger, and simultaneously, the second relay communication device stores the consensus-reached second service resource metering value in a second off-chain ledger; in response to the local metering channel meeting the termination condition, upload the first off-chain ledger to the blockchain network, and / or, the second relay communication device uploads the second off-chain ledger to the blockchain network, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel. A local metering channel can be established between the first and second relay communication devices in a near-field communication network. The frequent traffic between them can be separately recorded and consensused through the local metering channel. When the local metering channel ends, all service resource metering values ​​in all ledgers are settled into a total value and submitted to the blockchain network to complete the final transaction. This effectively reduces the blockchain load problem caused by putting various trivial traffic on the chain, effectively reduces the load pressure on the blockchain network, and improves the service resource metering efficiency of each node in the near-field communication network.

[0047] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0049] Figure 1The diagram illustrates an architecture of a near-field communication network that can be applied to embodiments of this disclosure.

[0050] Figure 2 The schematic diagram illustrates a process flow diagram of a service resource metering method according to some embodiments of the present disclosure;

[0051] Figure 3 The illustration schematically shows a process diagram for creating a local metering channel according to some embodiments of the present disclosure;

[0052] Figure 4 This illustration schematically depicts a process diagram of achieving consensus on service resource metering values ​​through a local metering channel according to some embodiments of this disclosure;

[0053] Figure 5 This schematic diagram illustrates a framework of a service resource metering system that can be applied to embodiments of this disclosure.

[0054] Figure 6 The illustration schematically shows a diagram of the state transition of a local metering channel in a smart contract according to some embodiments of the present disclosure;

[0055] Figure 7 A schematic diagram of a service resource metering device according to some embodiments of the present disclosure is shown;

[0056] Figure 8 The schematic diagram illustrates the structural schematic of a computer system of an electronic device according to some embodiments of the present disclosure;

[0057] Figure 9 A schematic diagram of a computer-readable storage medium according to some embodiments of the present disclosure is shown.

[0058] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0059] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0060] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0061] Furthermore, the accompanying drawings are for illustrative purposes only and are not necessarily drawn to scale. The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0062] Figure 1 The diagram schematically illustrates an architecture of a near-field communication network that can be used in embodiments of this disclosure.

[0063] refer to Figure 1 As shown, the near-field communication network can be composed of at least user terminal 101, user terminal 102, relay communication device 103, relay communication device 104, and relay communication device 105. Relay communication device 103 can be connected to the uplink network via mobile base station 106, relay communication device 104 can be connected to the uplink network via mobile base station 107, and relay communication device 105 can be connected to the uplink network via broadband network 108. Of course, the connection methods between user terminals and relay communication devices, between relay communication devices, and between relay communication devices and the Internet are merely illustrative and can be any other arbitrary connection methods, and should not impose any special limitations on this example embodiment.

[0064] Generally, a near-field communication (NFC) system mainly includes two types of participating nodes. One type consists of terminal devices that provide network connectivity services, called relay communication devices, such as relay communication devices 103, 104, and 105. The other type consists of user terminals connected to the internet through relay communication devices, such as user terminals 101 and 102. Typically, the simplest NFC network configuration involves relay communication devices directly connecting to the internet via cellular mobile communication. User terminals then connect to the relay communication devices via wireless technologies such as Wi-Fi, and subsequently connect to the internet through the cellular communication or broadband network connected by the relay communication devices. For example, user terminal 101 connects to relay communication device 103, and relay communication device 103 connects to mobile base station 106, enabling user terminal 101 to connect to the internet. This is the most typical and simplest networking method, which is most evident in the early stages of technology and business development. As NFC technology develops, it will continuously expand and upgrade in various dimensions, specifically in several aspects:

[0065] (1) Number of relay hops. As the business develops, the demand for areas lacking wireless network access will increase, or due to major emergencies, there will be more and more scenarios where a large number of accesses will suddenly increase in a specific area. Therefore, single-hop relays often cannot fully meet the needs of the business, and multiple relay communication devices will be connected in series to jointly serve a single user's Internet access.

[0066] (2) Relay Type. With the continuous development of near-domain service traffic, simply using mobile terminals such as smartphones as relay communication devices often cannot meet users' demands for high-quality services. For example, insufficient battery power, unstable signals due to frequent movement, overheating under high traffic volumes, and high costs are common problems. In this situation, professionals will set up more specialized relay communication equipment to provide services and earn relay service fees. For example, this professional relay type might be a hardware box fixed in a specific location, retaining only the necessary relay communication functions and blockchain wallet functions, achieving low cost, high stability, and high bandwidth simultaneously.

[0067] (3) Uplink network. Near-field communication is no longer limited to allowing relay equipment to access cellular mobile networks. It is possible to simultaneously access broadband networks or even satellite networks. Relay communication equipment can choose to access faster networks to provide services to user terminals.

[0068] With these changes, more users will join local area communication networks to act as relay communication devices long-term and stably, providing professional relay services similar to those of mobile operators, thereby generating service revenue. However, due to cost limitations, these relay services will gradually develop a division of labor in terms of coverage. For example, relay communication device 103 or 104 may be closer to mobile base station 106 or 107, while another relay communication device 105 may be closer to broadband network 108 (such as providing broadband via Wi-Fi). Relay communication devices 103 or 104 can establish a connection channel with relay communication device 105 to bridge their traffic. Thus, when a user accesses a website, if the cellular network is faster, they can directly access the website through relay communication device 103 or 104; if the broadband network is faster, they can connect to relay communication device 105 through relay communication device 103 or 104 to access the website. This situation will occur frequently, especially during sudden surges in live streaming traffic. Distributing traffic across different networks will significantly increase access volume and reduce congestion on various access networks. In addition to coverage division, as relay communication equipment becomes more stable and relay bandwidth continues to increase, expanding internet coverage through multi-hops is a highly cost-effective approach, greatly reducing the costs for operators to build base stations and lay fiber optic cables.

[0069] This type of network, formed by the self-organizing connection of relay devices, is similar in network topology and traffic routing to a network formed by the interconnection of various routers from an operator. It is very common for relays to provide services to each other, acting as upstream and downstream partners. For example... Figure 1 As shown, relay communication devices 103, 104 and 105 are connected to different uplink networks, and they are connected in series to form a self-organizing network. User terminal 101 and user terminal 102 can connect to the Internet through adjacent relay communication devices, and can also communicate with each other through this self-organizing network.

[0070] To ensure stable service provision by relay communication devices in a near-field communication network, an effective incentive mechanism is needed to measure the service resources provided by these devices and award points or similar rewards based on the measured values. Blockchain can record service measurement data confirmed by multiple parties through a consensus mechanism, automatically distributing point rewards without requiring trust in a third party. In a blockchain-based model, the number of services provided by relay communication devices to downstream user terminals will be measured, and the measured service quantity will be written into the blockchain. A blockchain smart contract will then provide the specific settlement fee, and points will be sent to the relay service provider's blockchain account at the same time. The services measured here mainly refer to common traffic services or time-based services, with traffic services being the most common measurement method; the following descriptions will primarily use traffic services.

[0071] Blockchain technology is an immutable technology; all data recorded on the blockchain network is preserved. As metering data is periodically written to the blockchain, the amount of data on the blockchain continuously expands. Considering the ever-expanding scale of nodes in near-field communication networks, there will be a constant flow of metering data that needs to be uploaded to the blockchain between adjacent relay nodes, between end users and relay nodes, and between relay nodes and operators. This places significant pressure on the blockchain network. Furthermore, since blockchain ledger resources are inherently scarce, and metering data often loses value over time, utilizing various optimization techniques to improve blockchain efficiency while ensuring fairness among all participants in near-field communication networks is an important research direction.

[0072] Based on this, in this example embodiment, a service resource metering method is first provided. This service resource metering method can be executed by a first relay communication device in a near-field communication network, such as by... Figure 1 The relay communication equipment 103, relay communication equipment 104 or relay communication equipment 105.

[0073] Figure 2 A schematic flowchart illustrating a service resource metering method according to some embodiments of the present disclosure is shown below. Figure 2 The steps in this example further illustrate the service resource metering method in this embodiment.

[0074] In step S210, the verification information of the second relay communication device accessing the near-field communication network is obtained, and a local metering channel is established based on the verification information.

[0075] In one example embodiment of this disclosure, the second relay communication device refers to a terminal device near the first relay communication device that can provide network relay services. For example, the first relay communication device may be... Figure 1The relay communication device 103 in the middle, the second relay communication device can be Figure 1 The relay communication device 104 or relay communication device 105 can be used, or it can be both relay communication device 104 and relay communication device 105. This example embodiment does not make any special limitation on this. The first relay communication device can search for the second relay communication device within a certain range through wireless signals or wireless search services.

[0076] It should be noted that in this embodiment, the terms "first" and "second" in "first relay communication device" and "second relay communication device" are only used to distinguish different relay communication devices and have no special meaning. They should not impose any special limitations on this example embodiment.

[0077] Verification information refers to data used to prove the identity of the second relay communication device. For example, verification information can be the identity document (unique identifier) ​​of the second relay communication device or the public key address of the second relay communication device. This example embodiment does not impose any special limitations on this.

[0078] A Public Key Infrastructure (PKI) system can be pre-created on the blockchain network to perform real-name user authentication for each relay communication device and user terminal accessing the near-field communication network. The identity document (ID) and corresponding public key address of each relay communication device and user terminal are recorded on the blockchain network. After the first relay communication device detects the second relay communication device, it can obtain the verification information corresponding to the second relay communication device through the PKI system on the blockchain network.

[0079] A local metering channel refers to an off-chain channel created to statistically analyze the service resource values ​​provided by relay communication devices during cooperation. By establishing local metering channels between relay communication device nodes, the service resources provided by the cooperating relay communication devices are effectively measured, while ensuring that the measured service resource values ​​do not cause a large data load on the blockchain network.

[0080] In step S220, consensus is reached on the first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel.

[0081] In one example embodiment of this disclosure, the first service resource metering value refers to the service resource provision value statistically calculated locally by the first relay communication device. The first service resource metering value may include the uplink and downlink traffic from the first relay communication device to the second relay communication device. The second service resource metering value refers to the service resource provision value statistically calculated locally by the second relay communication device. The second service resource metering value may include the uplink and downlink traffic from the second relay communication device to the first relay communication device.

[0082] A predetermined metering period and method can be used to statistically analyze the first service resource metering value and obtain the second service resource metering value provided by the second relay communication device, as well as a pre-determined metering deviation threshold. Then, when the deviation between the first and second service resource metering values ​​is within an acceptable tolerance range, the second service resource metering value is digitally signed using private key information and returned to the second relay communication device for storage in the corresponding second off-chain ledger, thus completing the consensus on the second service resource metering value. Similarly, the second relay communication device can also statistically analyze the second service resource metering value and obtain the first service resource metering value provided by the first relay communication device. When the deviation between the first and second service resource metering values ​​is within an acceptable tolerance range, the first service resource metering value is digitally signed using private key information and returned to the first relay communication device for storage in the corresponding first off-chain ledger, thus completing the consensus on the first service resource metering value.

[0083] In step S230, the consensus-reached first service resource meter value is stored in the first off-chain ledger, and at the same time, the second relay communication device stores the consensus-reached second service resource meter value in the second off-chain ledger.

[0084] In one example embodiment of this disclosure, the first off-chain ledger refers to the local ledger corresponding to the first relay communication device, and the second off-chain ledger refers to the local ledger corresponding to the second relay communication device. After reaching consensus on the first service resource metering value and the second service resource metering value each time, the service resource metering value is consensused through the local metering channel and does not need to be uploaded to the blockchain network. Only after the current service ends and the local metering channel ends is the aggregated service resource metering value uploaded to the blockchain network for service resource settlement. This effectively reduces the problem of uploading fragmented service resource data to the blockchain network multiple times, reduces the load pressure on the blockchain network, and improves the metering efficiency of service resources.

[0085] In step S240, in response to the local metering channel meeting the termination condition, the first off-chain ledger is uploaded to the blockchain network, and / or the second off-chain ledger is uploaded to the blockchain network by the second relay communication device, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

[0086] In one example embodiment of this disclosure, the termination condition of the local metering channel may be the arrival of the local metering channel's termination time, or the receipt of a request from the first relay communication device or the second relay communication device to actively interrupt the local metering channel. Of course, other types of termination conditions may also apply, and this example embodiment is not limited thereto.

[0087] When the termination condition is the arrival of the local metering channel's end time, the first relay communication device and the second relay communication device can simultaneously upload the first off-chain ledger and the second off-chain ledger to the blockchain network; when the termination condition is the first relay communication device actively interrupting the local metering channel's request, the first relay communication device can upload the first off-chain ledger to the blockchain network; when the termination condition is the second relay communication device actively interrupting the local metering channel's request, the second relay communication device can upload the second off-chain ledger to the blockchain network; this embodiment does not impose special limitations on the method of uploading the off-chain ledger.

[0088] The blockchain network can verify the service resource incentives based on the uploaded first and / or second off-chain ledgers. After successful verification of the first and / or second off-chain ledgers, the transfer of service resource incentives can be determined based on the first and / or second service resource measurement values ​​recorded in the first and / or second off-chain ledgers. For example, the service resource incentives can be service resource points or other service incentives that can be transferred in the blockchain wallet. This example embodiment does not impose any special limitations on the type of service resource incentives.

[0089] Steps S210 to S240 will be described in detail below.

[0090] In one example embodiment of this disclosure, the blockchain network may include smart contracts for managing local metering channels, and a public key infrastructure system; specifically, it can be achieved through... Figure 3 The steps in the document are as follows to establish a local metering channel:

[0091] Step S310: Send a channel establishment request to the second relay communication device, the channel establishment request including first smart contract information;

[0092] Step S320: Receive request response information returned by the second relay communication device in response to the channel establishment request, wherein the request response information includes second smart contract information created based on the first smart contract information;

[0093] Step S330: Obtain the public key information of the second relay communication device from the public key infrastructure system, and verify the signature of the second smart contract information based on the public key information;

[0094] Step S340: Broadcast the second smart contract information after signature verification to the blockchain network, so that the blockchain network can create a local metering channel based on the second smart contract information and the smart contract for managing the local metering channel.

[0095] The channel establishment request may include first smart contract information, and a digital signature of the first smart contract information by the first relay communication device using the first private key information.

[0096] Specifically, the first smart contract information may include the first identity identifier of the first relay communication device, the start and end time of the local metering channel, the first service resource points available for pledging by the first relay communication device, the metering period, the metering method, and the uplink network information of the first relay communication device.

[0097] The request response information may include second smart contract information created based on the first smart contract information, and a digital signature of the second smart contract information by the second relay communication device using the second private key information.

[0098] Specifically, the second smart contract information may include the first smart contract information verified by the second relay communication device (refer to the description of the first smart contract information in the channel establishment request, which will not be repeated here), as well as the second identity identifier of the second relay communication device, the second service resource points available for staking, and the uplink network information of the second relay communication device. The request response information also includes the digital signature of the second smart contract information by the second relay communication device through the second private key information.

[0099] The first relay communication device can search for a second relay communication device within a certain range using wireless signals or a wireless search service. Upon determining that a local metering channel needs to be established with the second relay communication device, it can send a channel establishment request to the second relay communication device and receive a response from the second relay communication device. It can obtain the public key information of the second relay communication device from the public key infrastructure system, and then verify the signature of the second smart contract information in the response information based on the public key information. Furthermore, it can broadcast the verified second smart contract information to the blockchain network, enabling the blockchain network to create a local metering channel based on the second smart contract information and the smart contract managing the local metering channel.

[0100] In one example embodiment of this disclosure, it can be achieved through Figure 4 The steps in the process achieve consensus on the statistical values ​​of the first service resource and the second service resource provided by the second relay communication device based on the local metering channel, referencing... Figure 4 As shown, it can specifically include:

[0101] Step S410: Based on the metering period and metering method recorded in the smart contract, calculate the metering value of the first service resource;

[0102] Step S420: Obtain the second service resource metering value provided by the second relay communication device, and obtain the metering deviation threshold determined by pre-consensus.

[0103] Step S430: If it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then the second service resource metering value is digitally signed using the first private key information and returned to the second relay communication device to complete the consensus.

[0104] The metering period refers to the pre-set periodic statistical service resource value data. For example, the metering period can be 1 hour or 30 minutes, and this example embodiment does not make any special limitation on it. The metering method refers to the pre-set type of statistical service resource value. For example, the metering method can be based on traffic data or based on service duration, and this example embodiment does not make any special limitation on it.

[0105] The metering deviation threshold refers to a pre-set tolerable deviation range. For example, the metering deviation threshold can be the deviation range of service resource values, such as 10% or 5%. Of course, the metering deviation threshold can also be a specific difference threshold of service resource values, such as 100MB of traffic or 50MB of traffic. The specific threshold can be agreed upon according to the actual application situation. This example embodiment does not make any special limitations on this.

[0106] The first service resource metering value includes the uplink and downlink traffic from the first relay communication device to the second relay communication device. Of course, if data redundancy is not considered, the first service resource metering value may also include the uplink and downlink traffic from the second relay communication device to the first relay communication device. This example embodiment does not make any special limitation on this.

[0107] The second service resource metering value includes the uplink and downlink traffic from the second relay communication device to the first relay communication device. Of course, if data redundancy is not considered, the second service resource metering value may also include the uplink and downlink traffic from the first relay communication device to the second relay communication device. This example embodiment does not make any special limitation on this.

[0108] For example, assuming the billing cycle agreed upon between the first and second relay communication devices is one hour, and the billing method is traffic-based billing, then every hour, both the first and second relay communication devices will calculate the uplink traffic F(AB↑) from the first relay communication device to the second relay communication device within that hour. The second relay communication device will digitally sign the calculated traffic value (via wireless communication through its local metering channel) and send it to the first relay communication device. The first relay communication device will compare this value with its locally recorded traffic value. If the difference is within acceptable limits, it will sign the value again and send it to the second relay communication device. The second relay communication device will store the signed value from the first relay communication device in its local second off-chain ledger, and the first relay communication device will also store the signed value from the second relay communication device in its local first off-chain ledger. If the first relay communication device finds a significant difference between the value sent by the second relay communication device and its locally recorded traffic value, it will choose to renegotiate with the second relay communication device or terminate the local channel according to its local policy. Similarly, every hour, the first and second relay communication devices will calculate the downlink traffic F(AB↓) from the first relay communication device to the second relay communication device, the uplink traffic F(BA↑) from the second relay communication device to the first relay communication device, and the downlink traffic F(BA↓) from the second relay communication device to the first relay communication device within the hour. After reaching a consensus in the aforementioned manner, they will store the data in their local off-chain ledger.

[0109] In one example embodiment of this disclosure, the liquidation of service resources can be achieved through the following steps:

[0110] It can respond to a channel interruption request from at least one of the first and second relay communication devices, or trigger the end time of the local metering channel, to upload the first off-chain ledger to the off-chain storage location, and / or have the second relay communication device upload the second off-chain ledger to the off-chain storage location; then it can send settlement information to the blockchain network so that the verification nodes in the blockchain network can access the first and / or second off-chain ledgers in the off-chain storage location according to the settlement information and complete the service resource settlement;

[0111] The liquidation information may include the first and second service resource metering values ​​within the lifecycle of the local metering channel, the complete off-chain storage address of the first off-chain ledger, and the complete hash value of the first off-chain ledger. Alternatively, if the liquidation information is initiated by a second relay communication device, it may include the first and second service resource metering values ​​within the lifecycle of the local metering channel, the complete off-chain storage address of the second off-chain ledger, and the complete hash value of the second off-chain ledger. The specific liquidation information is related to the initiating device, and this example embodiment does not impose any special limitations on it.

[0112] Off-chain storage location refers to the storage location that can be accessed by the verification nodes in the blockchain network. For example, off-chain storage location can be a centralized storage location or a decentralized storage location. This example embodiment does not make any special limitation on this.

[0113] For example, suppose the first relay communication device wants to interrupt its local channel with the second relay communication device for some reason (such as distrust of the second relay communication device's service metering data or inability to continue providing service due to its own reasons). The first relay communication device sends a channel interruption request to the blockchain network. The smart contract managing the local metering channel in the blockchain network will, based on the first relay communication device's request, change the relevant local metering channel from a normal established state to a liquidation state. In the liquidation state, both the first and second relay communication devices can submit necessary liquidation information to the blockchain network's smart contract. For example, the first relay communication device can first store the complete first off-chain ledger, which records the metering values ​​of each service resource (F(AB↑), F(AB↓), F(BA↑), and F_(BA↓)) (each containing the signatures of both parties), in an off-chain storage location accessible to the verification nodes of the blockchain network (this can be a centralized or decentralized storage location; considering data security and fairness, the latter is generally chosen). Then, it submits some necessary settlement information, digitally signed by the first relay communication device, to the blockchain smart contract. The settlement information can include: the total of all traffic for F(AB↑), F(AB↓), F(BA↑), and F(BA↓) during the entire local channel lifecycle (4 values); the off-chain storage address corresponding to the complete first off-chain ledger; and the hash value of the complete first off-chain ledger.

[0114] Optionally, the verification nodes in the blockchain network can be used to obtain the first off-chain ledger and / or the second off-chain ledger from the off-chain storage location according to the off-chain storage address in the liquidation information, and transfer the first service resource points and the second service resource points pledged in the blockchain network by the first relay communication device and the second relay communication device according to the first service resource measurement value and / or the second service resource measurement value recorded in the first off-chain ledger and / or the second off-chain ledger, thereby completing the service resource liquidation.

[0115] Optionally, the verification nodes in the blockchain network can also be used to compare the first off-chain ledger and the second off-chain ledger when they receive an objection request from the first relay communication device or the second relay communication device, and arbitrate the objection request based on the comparison result, and complete the settlement of service resources.

[0116] For example, during the settlement phase, if the second relay communication device disagrees with the traffic total information of the first relay communication device, it can raise an objection during this period. Assuming the second relay communication device sees the interruption request from the first relay communication device before the settlement phase ends, and disagrees with the traffic total information submitted by the first relay communication device, it can also store the complete second off-chain ledger, recording each value of F(AB↑), F(AB↓), F(BA↑), and F(BA↓) (each containing the signatures of both parties), in an off-chain storage location accessible to validator nodes in the blockchain network. Then, it provides the smart contract with the four traffic totals mentioned above, the ledger storage address of the complete second off-chain ledger, and the hash value of the complete second off-chain ledger. Upon discovering a dispute between the first and second relay communication devices, the validator nodes retrieve the corresponding complete first or second off-chain ledger through the provided ledger storage address, compare the off-chain ledgers, and determine the party with more complete ledger information wins, thus completing the arbitration of the dispute and the final settlement of points.

[0117] During the settlement period, the first relay communication device, which actively interrupts the local metering channel, can provide settlement information first. If the second relay communication device agrees, it does not need to submit settlement information again; it can end the settlement period by directly submitting a message of agreement to the blockchain or wait until the maximum waiting time ends. After the settlement period ends, the blockchain network directly calculates the net flow value and corresponding final point change value in each network data transmission direction between the first and second relay communication devices based on the settlement information provided by the first relay communication device. It then completes the transfer of these changed points between the accounts of the first and second relay communication devices, unlocks the staked points in each account, and terminates the local metering channel. If the second relay communication device disagrees with the first relay communication device's settlement information during the settlement period, it will submit its own settlement information separately. After the settlement period ends, the blockchain network will compare the complete ledgers provided by both parties to determine whose information is more accurate, and then complete the point transfer based on this information, terminating the local channel. If the first relay communication device delays submitting settlement information during the settlement period, the second relay communication device can also submit its own settlement information first to ensure effective settlement. If neither the first relay communication device nor the second relay communication device submits settlement information during the settlement period, the points in both accounts will be automatically unlocked, and no points will be transferred.

[0118] Figure 5 The diagram illustrates a framework of a service resource metering system that can be applied to embodiments of this disclosure.

[0119] refer to Figure 5As shown, the service resource metering system may consist of a blockchain network, relay communication device A, relay communication device B, a local metering channel between relay communication device A and relay communication device B, and off-chain storage locations.

[0120] The blockchain network can include smart contracts that manage local metering channels and a public key infrastructure (PKI) system. Relay communication devices A and B can obtain status information related to the local metering channels from the blockchain network and create local metering channels using the status information. They can also send transaction information related to the operation of local metering channels to the blockchain network. For example, transaction information can include channel interruption requests, objection requests, and settlement information. When the local metering channel meets the termination conditions, relay communication devices A and B upload their local off-chain ledgers to the off-chain storage location. The verification nodes of the blockchain network then retrieve the complete off-chain ledger from the off-chain storage location based on the ledger storage address in the settlement information and complete the settlement or arbitration objection request for service resources between relay communication devices A and B.

[0121] Figure 6 The illustration shows a schematic diagram of the state transition of a local metering channel in a smart contract according to some embodiments of the present disclosure.

[0122] refer to Figure 6 As shown, in this embodiment, the states set by the blockchain smart contract for the local metering channel can include initial state 601, establishment state 602, settlement state 603, and deletion state 604. After the blockchain network receives a transaction message in which both parties have signed and agreed to establish a local metering channel, the initial state 601 is transitioned to the establishment state 602; when at least one party sends a request to actively terminate the local metering channel or the agreed end time of the local metering channel is reached, the establishment state 602 is transitioned to the settlement state 603; when the maximum waiting time for settlement expires or both parties agree to actively end the settlement phase, the settlement state 603 is transitioned to the deletion state 604, and the current local metering channel is terminated.

[0123] In summary, the service resource metering method in this example embodiment can establish a local metering channel between the first and second relay communication devices in a near-field communication network. This local metering channel is used to separately record and reach consensus on frequent traffic flows between them. Once the local metering channel is closed, all service resource metering values ​​in all ledgers are settled into a single total value and submitted to the blockchain network to complete the final transaction. This effectively reduces the blockchain load caused by uploading various fragmented traffic flows to the blockchain, effectively reduces the load pressure on the blockchain network, and improves the service resource metering efficiency of each node in the near-field communication network.

[0124] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0125] Furthermore, in this example embodiment, a service resource metering device is also provided, which is installed in a first relay communication device in a near-field communication network. (Refer to...) Figure 7 As shown, the service resource metering device 700 includes: a local metering channel establishment module 710, a metering value consensus module 720, a metering value storage module 730, and a service resource clearing module 740. Wherein:

[0126] The local metering channel establishment module 710 is used to obtain the verification information of the second relay communication device accessing the near-field communication network, and establish a local metering channel based on the verification information;

[0127] The metering consensus module 720 is used to reach a consensus on the statistical first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel.

[0128] The metering value storage module 730 is used to store the first service resource metering value after consensus into the first off-chain ledger. At the same time, the second relay communication device stores the second service resource metering value after consensus into the second off-chain ledger.

[0129] The service resource clearing module 740 is used to respond to the local metering channel meeting the termination condition by uploading the first off-chain ledger to the blockchain network, and / or by uploading the second off-chain ledger to the blockchain network by the second relay communication device, so that the blockchain network completes service resource clearing based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

[0130] In one exemplary embodiment of this disclosure, based on the foregoing scheme, the blockchain network may include smart contracts for managing local metering channels and a public key infrastructure system;

[0131] The local metering channel establishment module 710 can be used for:

[0132] Send a channel establishment request to the second relay communication device, the channel establishment request including first smart contract information;

[0133] Receive request response information returned by the second relay communication device in response to the channel establishment request, the request response information including second smart contract information created based on the first smart contract information;

[0134] Obtain the public key information of the second relay communication device from the public key infrastructure system, and verify the signature of the second smart contract information based on the public key information;

[0135] The second smart contract information, after signature verification, is broadcast to the blockchain network, so that the blockchain network can create a local metering channel based on the second smart contract information and the smart contract that manages the local metering channel.

[0136] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the first smart contract information includes the first identity identifier of the first relay communication device, the start time and end time of the local metering channel, the first service resource points available for pledging by the first relay communication device, the metering period, the metering method, and the uplink network information of the first relay communication device. The channel establishment request also includes the digital signature of the first smart contract information by the first relay communication device through the first private key information.

[0137] The second smart contract information includes the first smart contract information verified by the second relay communication device, as well as the second identity identifier of the second relay communication device, the second service resource points available for staking, and the uplink network information of the second relay communication device. The request response information also includes the digital signature of the second smart contract information by the second relay communication device through the second private key information.

[0138] In one exemplary embodiment of this disclosure, based on the foregoing scheme, the measurement value consensus module 720 can be used for:

[0139] Based on the metering period and metering method recorded in the smart contract, the metering value of the first service resource is calculated.

[0140] Obtain the second service resource metering value provided by the second relay communication device, and obtain the metering deviation threshold determined by pre-consensus.

[0141] If it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then the second service resource metering value is digitally signed using the first private key information and returned to the second relay communication device to complete the consensus.

[0142] The first service resource metering value includes the uplink and downlink traffic from the first relay communication device to the second relay communication device; the second service resource metering value includes the uplink and downlink traffic from the second relay communication device to the first relay communication device.

[0143] In one exemplary embodiment of this disclosure, based on the foregoing solution, the service resource clearing module 740 can be used to:

[0144] In response to a channel interruption request from at least one of the first relay communication device and the second relay communication device, or by triggering the end time of the local metering channel, the first off-chain ledger is uploaded to the off-chain storage location, and / or the second relay communication device uploads the second off-chain ledger to the off-chain storage location;

[0145] Sending liquidation information to the blockchain network enables the verification nodes in the blockchain network to access the first off-chain ledger and / or the second off-chain ledger in the off-chain storage location based on the liquidation information, and complete the service resource liquidation;

[0146] The liquidation information includes the first service resource metering value and the second service resource metering value during the lifecycle of the local metering channel, the off-chain storage address of the complete first off-chain ledger, and the hash value of the complete first off-chain ledger.

[0147] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the verification node is configured to obtain the first off-chain ledger and / or the second off-chain ledger from the off-chain storage location according to the off-chain storage address, and transfer the first service resource points and the second service resource points pledged in the blockchain network by the first relay communication device and the second relay communication device according to the service resource metering values ​​recorded in the first off-chain ledger and / or the second off-chain ledger, thereby completing the service resource settlement.

[0148] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the verification node is further configured to, upon receiving an objection request from the first relay communication device or the second relay communication device, compare the first off-chain ledger and the second off-chain ledger, arbitrate the objection request based on the comparison result, and complete the settlement of service resources.

[0149] The specific details of each module of the service resource metering device mentioned above have been described in detail in the corresponding service resource metering methods, so they will not be repeated here.

[0150] It should be noted that although several modules or units of the service resource metering device have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0151] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described service resource metering method is also provided.

[0152] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be embodied in the following forms: a completely hardware embodiment, a completely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0153] The following reference Figure 8 The electronic device 800 according to such an embodiment of the present disclosure is described herein. The electronic device 800 shown in FIG8 is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present disclosure.

[0154] like Figure 8 As shown, the electronic device 800 is presented in the form of a general-purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including storage unit 820 and processing unit 810), and a display unit 840.

[0155] The storage unit stores program code that can be executed by the processing unit 810, causing the processing unit 810 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 810 can perform actions such as... Figure 2In step S210, the verification information of the second relay communication device accessing the near-field communication network is obtained, and a local metering channel is established based on the verification information; in step S220, consensus is reached on the statistical first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel; in step S230, the consensus-reached first service resource metering value is stored in the first off-chain ledger, and simultaneously, the second relay communication device stores the consensus-reached second service resource metering value in the second off-chain ledger; in step S240, in response to the local metering channel meeting the termination condition, the first off-chain ledger is uploaded to the blockchain network, and / or the second relay communication device uploads the second off-chain ledger to the blockchain network, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

[0156] Storage unit 820 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 821 and / or cache memory 822, and may further include a read-only memory (ROM) 823.

[0157] The storage unit 820 may also include a program / utility 824 having a set (at least one) of program modules 825, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0158] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0159] Electronic device 800 can also communicate with one or more external devices 870 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 800, and / or with any device that enables electronic device 800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 850. Furthermore, electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of electronic device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0160] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0161] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0162] refer to Figure 9 As shown, a program product 900 for implementing the above-described service resource metering method according to an embodiment of the present disclosure is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0163] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0164] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0165] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0166] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0167] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0168] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0169] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0170] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for measuring service resources, characterized in that, Performed by a first relay communication device in a near-field communication network, the method includes: The verification information of the second relay communication device accessing the near-field communication network is obtained, and a local metering channel is established based on the verification information; the local metering channel is an off-chain channel used to calculate the service resource value provided by each relay communication device when cooperating. The local metering channel will be used to reach a consensus on the first service resource metering value and the second service resource metering value provided by the second relay communication device. The consensus-building process based on the first service resource metering value and the second service resource metering value provided by the second relay communication device, according to the local metering channel, includes: Based on the metering period and metering method recorded in the smart contract, the metering value of the first service resource is calculated. Obtain the second service resource metering value provided by the second relay communication device, and obtain the metering deviation threshold determined by pre-consensus. If it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then the second service resource metering value is digitally signed using the first private key information and returned to the second relay communication device to complete the consensus. Wherein, the first service resource metering value includes the uplink traffic and downlink traffic from the first relay communication device to the second relay communication device; the second service resource metering value includes the uplink traffic and downlink traffic from the second relay communication device to the first relay communication device; The consensus-reached first service resource metering value is stored in the first off-chain ledger, and at the same time, the second relay communication device stores the consensus-reached second service resource metering value in the second off-chain ledger. In response to the local metering channel meeting the termination condition, the first off-chain ledger is uploaded to the blockchain network, and / or the second off-chain ledger is uploaded to the blockchain network by the second relay communication device, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

2. The service resource measurement method according to claim 1, characterized in that, The blockchain network includes smart contracts that manage local metering channels, as well as a public key infrastructure system; The step of obtaining verification information of the second relay communication device accessing the near-field communication network and establishing a local metering channel based on the verification information includes: Send a channel establishment request to the second relay communication device, the channel establishment request including first smart contract information; Receive request response information returned by the second relay communication device in response to the channel establishment request, the request response information including second smart contract information created based on the first smart contract information; Obtain the public key information of the second relay communication device from the public key infrastructure system, and verify the signature of the second smart contract information based on the public key information; The second smart contract information, after signature verification, is broadcast to the blockchain network, so that the blockchain network can create a local metering channel based on the second smart contract information and the smart contract that manages the local metering channel.

3. The service resource measurement method according to claim 2, characterized in that, The first smart contract information includes the first identity identifier of the first relay communication device, the start time and end time of the local metering channel, the first service resource points available for staking by the first relay communication device, the metering period, the metering method, and the uplink network information of the first relay communication device. The channel establishment request also includes the digital signature of the first smart contract information by the first relay communication device through the first private key information. The second smart contract information includes the first smart contract information verified by the second relay communication device, as well as the second identity identifier of the second relay communication device, the second service resource points available for staking, and the uplink network information of the second relay communication device. The request response information also includes the digital signature of the second smart contract information by the second relay communication device through the second private key information.

4. The service resource measurement method according to claim 1, characterized in that, The response that the local metering channel meets the termination condition involves uploading the first off-chain ledger to the blockchain network, and / or having the second relay communication device upload the second off-chain ledger to the blockchain network, so that the blockchain network completes service resource settlement based on the first off-chain ledger and / or the second off-chain ledger, including: In response to a channel interruption request from at least one of the first relay communication device and the second relay communication device, or by triggering the end time of the local metering channel, the first off-chain ledger is uploaded to the off-chain storage location, and / or the second relay communication device uploads the second off-chain ledger to the off-chain storage location; Sending liquidation information to the blockchain network enables the verification nodes in the blockchain network to access the first off-chain ledger and / or the second off-chain ledger in the off-chain storage location based on the liquidation information, and complete the service resource liquidation; The liquidation information includes the first service resource metering value and the second service resource metering value during the lifecycle of the local metering channel, the off-chain storage address of the complete first off-chain ledger, and the hash value of the complete first off-chain ledger.

5. The service resource measurement method according to claim 4, characterized in that, The verification node is used to obtain the first off-chain ledger and / or the second off-chain ledger from the off-chain storage location according to the off-chain storage address, and to transfer the first service resource points and the second service resource points pledged in the blockchain network by the first relay communication device and the second relay communication device according to the service resource metering value recorded in the first off-chain ledger and / or the second off-chain ledger, thereby completing the service resource settlement.

6. The service resource measurement method according to claim 5, characterized in that, The verification node is also used to, upon receiving an objection request from the first relay communication device or the second relay communication device, compare the first off-chain ledger and the second off-chain ledger, arbitrate the objection request based on the comparison result, and complete the settlement of service resources.

7. A service resource metering device, characterized in that, A first relay communication device installed in a near-field communication network, the device comprising: A local metering channel establishment module is used to obtain verification information of the second relay communication device accessing the near-field communication network, and establish a local metering channel based on the verification information; the local metering channel is an off-chain channel used to count the service resource values ​​provided by each relay communication device when cooperating. The metering consensus module is used to reach a consensus on the statistical first service resource metering value and the second service resource metering value provided by the second relay communication device based on the local metering channel. The metering consensus module is used to calculate the metering value of the first service resource based on the metering period and metering method recorded in the smart contract. Obtain the second service resource metering value provided by the second relay communication device, and obtain the metering deviation threshold determined by pre-consensus. If it is determined that the deviation between the first service resource metering value and the second service resource metering value is less than or equal to the metering deviation threshold, then the second service resource metering value is digitally signed using the first private key information and returned to the second relay communication device to complete the consensus. Wherein, the first service resource metering value includes the uplink traffic and downlink traffic from the first relay communication device to the second relay communication device; the second service resource metering value includes the uplink traffic and downlink traffic from the second relay communication device to the first relay communication device; The metering value storage module is used to store the consensus-reached first service resource metering value in the first off-chain ledger. At the same time, the second relay communication device stores the consensus-reached second service resource metering value in the second off-chain ledger. The service resource clearing module is used to respond to the local metering channel meeting the termination condition by uploading the first off-chain ledger to the blockchain network, and / or by uploading the second off-chain ledger to the blockchain network through the second relay communication device, so that the blockchain network completes service resource clearing based on the first off-chain ledger and / or the second off-chain ledger, and closes the local metering channel.

8. An electronic device, comprising: processor; as well as A memory storing computer-readable instructions that, when executed by the processor, implement the service resource metering method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the service resource metering method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Block chain network transaction method and device and storage medium

    CN111210344A

  • On-chain and off-chain collaborative resource transaction method based on state channel

    CN113411338A

  • Communication control method and device, electronic equipment and storage medium

    CN114286416A