Service registration method, blockchain system, edge node, medium and product

By deploying edge nodes in the overall blockchain system and utilizing the blockchain synchronization mechanism, cross-network service registration and discovery are achieved, and the problem of cross-network registration in the existing technology is solved, and the discoverability and accessibility of services are improved.

CN119561673BActive Publication Date: 2025-05-02INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510096171.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-02
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

The prior art cannot realize cross-network registration of services, resulting in the inability to effectively discover and access services provided by terminal devices between multiple local area networks.

Method used

By deploying edge nodes in the overall blockchain system, using the blockchain synchronization mechanism, service registration information is synchronized to other edge nodes, and service registration and discovery across networks are realized.

Benefits of technology

It realizes service registration and access across LANs, improves service discoverability and accessibility, and solves the problem of service interoperability between LANs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561673B_ABST
    Figure CN119561673B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of Internet of Things technology, and discloses a service registration method, a blockchain system, an edge node, a medium and a product, including: obtaining the total service information and identity information of the target service node, and the external network communication information of the target edge node, the total service information including the communication indication information and service information of at least one service provided by the target service node. According to the external network communication information and the communication indication information of the target service, a first interface address corresponding to the target service is created. According to the communication indication information and service information of the target service, the first interface address, and the identity information of the target service node, the service registration information corresponding to the target service is generated. The service registration information corresponding to the target service is added to the blockchain account book. According to the preset blockchain synchronization mechanism, the service registration information corresponding to the target service is synchronized to the blockchain account books of other edge nodes. The present invention can realize cross-network registration of services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a service registration method, a blockchain system, an edge node, a medium and a product. Background Art

[0002] In the field of IoT technology, each terminal device generates data and provides related services. For example, terminal devices can refer to various sensors, mobile phones, cameras, network devices, etc. Since the location of terminal devices changes in real time, a registration and discovery mechanism needs to be established to allow other devices to access the services provided by the terminal devices.

[0003] When a terminal device is connected to a local area network, the terminal device can notify other devices in the local area network of its own device information and service information. In this way, other devices in the local area network can communicate with the terminal device and call the services provided by the terminal device. For example, when a printer is connected to the local area network, other devices in the local area network can use the printer to provide printing services.

[0004] However, the above registration mechanism is only applicable to local area network scenarios and not to cross-network scenarios. Summary of the invention

[0005] In view of this, the present invention provides a service registration method, device, blockchain system, edge node, storage medium and program product to solve the problem that related technologies cannot realize cross-network service registration.

[0006] In a first aspect, the present invention provides a service registration method, which is applied to a blockchain system, wherein the blockchain system includes multiple local area network systems, each blockchain node is deployed as an edge node in a local area network system, and the method is executed by a target edge node in a target local area network system, wherein the target local area network system is any one of the multiple local area network systems, and the method includes:

[0007] Obtaining total service information and identity information of a target service node, and extranet communication information of a target edge node, wherein the total service information includes communication indication information and service information of at least one service provided by the target service node, and the target service node is a target edge node or a target terminal device newly connected to a target local area network system;

[0008] Creating a first interface address corresponding to the target service according to the external network communication information and the communication indication information of the target service, wherein the target service is any one of the at least one service;

[0009] Generate service registration information corresponding to the target service according to the communication indication information and service information of the target service, the first interface address, and the identity information of the target service node;

[0010] Add the service registration information corresponding to the target service to the pre-built blockchain ledger through the pre-built service registration and discovery contract;

[0011] According to the preset blockchain synchronization mechanism, the service registration information corresponding to the target service is synchronized to other edge nodes in the blockchain system except the target edge node.

[0012] The service registration method provided by the present invention has the following advantages:

[0013] An edge node is deployed in each LAN system. The edge nodes and terminal devices in the LAN system can be devices that provide services (i.e., service nodes). Taking the target LAN system as an example, the target edge node obtains the total service information and identity information of the target service node, as well as its own external network communication information, wherein the total service information may include communication indication information and service information of at least one service provided by the target service node. For the target service, the target edge node can create a first interface address for the target service based on the external network communication information and the communication indication information of the target service. Then, the target edge node can generate service registration information corresponding to the target service based on the service information, the first interface address, and the identity information of the target service node. Finally, the service registration information of the target service is added to the blockchain ledger, and the service registration information of the target service is synchronized to the blockchain ledger of other edge nodes, thereby completing the registration operation of the target service across the network, that is, any edge node can have the service registration information provided by all service nodes in the total blockchain system.

[0014] In an optional implementation, the target service node is a target edge node, and the method further includes:

[0015] Obtain the location information and device information of the target edge node;

[0016] Generate device registration information corresponding to the target edge node according to the location information, device information, and identity information of the target edge node;

[0017] Add the device registration information corresponding to the target edge node to the blockchain ledger;

[0018] According to the blockchain synchronization mechanism, the device registration information corresponding to the target edge node is synchronized to other edge nodes through the pre-built device registration and discovery contract.

[0019] Specifically, by generating device registration information of the edge node, when the service is subsequently called, a suitable edge node can be selected for the service consumption device according to the location information and device information, which is more flexible.

[0020] In an optional implementation, the target service node is a target terminal device of a target local area network system, and the method further includes:

[0021] Obtain the location information and device information of the target terminal device, as well as the identity information of the target edge node;

[0022] Generate device registration information corresponding to the target terminal device according to the location information, device information and identity information of the target terminal device and the identity information of the target edge node;

[0023] Add the device registration information corresponding to the target terminal device to the blockchain ledger;

[0024] According to the blockchain synchronization mechanism, the device registration information corresponding to the target terminal device is synchronized to other edge nodes.

[0025] Specifically, by generating the device registration information of the terminal device, when the service is subsequently called, a suitable terminal device can be selected to provide the service according to the device registration information, which is more flexible.

[0026] In an optional embodiment, the method further includes:

[0027] Obtain the registration request sent by the service consumption device;

[0028] Creating identity information of a service consuming device, wherein the identity information of the service consuming device includes an identity identifier of the service consuming device;

[0029] Add the identity information of the service consuming device to the blockchain ledger through the pre-built device registration and discovery contract;

[0030] According to the blockchain synchronization mechanism, the identity information of the service consumption device is synchronized to other edge nodes;

[0031] And, sending the identity identifier of the service consuming device to the service consuming device so that the service consuming device can access the services provided by the service node in the blockchain system.

[0032] Specifically, by generating the identity information of the service consumption device, it is possible to facilitate the management of the access records of the service consumption device, and add the identity information of the service consumption device to the blockchain ledger and synchronize it to other edge nodes. The service consumption device can access the service at any edge node with the identity information.

[0033] In an optional embodiment, the method further includes:

[0034] Receiving a query instruction sent by a service consumption device;

[0035] Parse the target query condition from the query instruction;

[0036] According to the target query condition, the query object information corresponding to the target query condition is extracted from the blockchain account book;

[0037] The query object information is sent to the service consuming device so that the service consuming device can access the services provided by the service node in the blockchain system.

[0038] Specifically, when the target edge node receives a query instruction sent by any service consumption device, it can parse the query instruction to obtain the target query condition. Then, according to the target query condition, the query object information can be extracted from the blockchain ledger and sent to the service consumption device. In this way, the service consumption device can access the services provided by the corresponding service node in the blockchain system and realize cross-LAN service access operations.

[0039] In an optional implementation manner, the service information of each service includes a service type name, the query instruction is a service query instruction, and the target query condition includes a first service type name;

[0040] According to the target query condition, the query object information corresponding to the target query condition is extracted from the blockchain ledger, including:

[0041] According to the first service type name, determining at least one service registration information corresponding to the first service type name in the blockchain account book;

[0042] Extracting the identity information of the first service node and the first service name from the first service registration information, wherein the first service registration information is any one of the at least one service registration information corresponding to the first service type name;

[0043] The identity information and service name of the service node extracted from each piece of service registration information corresponding to the first service type name are determined as query object information.

[0044] Specifically, this solution can find all service registration information corresponding to the first service type name in the blockchain account book based on the first service type name, extract the identity information and service name of the service node, and send it to the service consumption device as the query object information, so that the subsequent service consumption device can determine the appropriate service node based on the identity information and service name of the service node, which is more flexible. In addition, only the identity information and service name corresponding to the service node are fed back, rather than all the service registration information, which can reduce the amount of information transmission and increase the query rate.

[0045] In an optional implementation manner, the service information of each service includes a service name, the query instruction is a service query instruction, and the target query condition includes identity information of the second service node;

[0046] According to the target query condition, the query object information corresponding to the target query condition is extracted from the blockchain ledger, including:

[0047] Determining, in the blockchain ledger, service registration information corresponding to at least one service provided by the second service node according to the identity information of the second service node;

[0048] Extracting a second interface address and a second service name from the second service registration information, wherein the second service registration information is any one piece of service registration information corresponding to at least one service provided by the second service node;

[0049] The interface address and service name extracted from the service registration information corresponding to each service provided by the second service node are determined as the query object information.

[0050] Specifically, when querying through the identity information of the device, the interface address and service name can be fed back as the query object information, so that the consumer device can call the service through the target edge node according to the interface address and service name.

[0051] In an optional implementation, the query instruction is a device query instruction, and the target query condition includes identity information of the third service node;

[0052] According to the target query condition, the query object information corresponding to the target query condition is extracted from the blockchain ledger, including:

[0053] According to the identity information of the third service node, searching the blockchain account book for device registration information corresponding to the third service node;

[0054] extracting location information of the third service node from device registration information corresponding to the third service node;

[0055] The location information of the third service node is determined as the query object information.

[0056] Specifically, querying the location information of a device through the identity information of the device can facilitate the service consuming device to select a suitable device for service access according to the location information of the device, which is more flexible and convenient.

[0057] In an optional embodiment, the method further includes:

[0058] Receiving the authentication information application instruction sent by the service consumption device;

[0059] Extracting the identity identifier of the service consumption device and the name of the third service from the authentication information application instruction;

[0060] Determining whether to generate identity authentication information corresponding to the service consuming device according to the identity identifier of the service consuming device and the third service name;

[0061] When it is determined to generate identity authentication information corresponding to the service consuming device, creating a service token corresponding to the service consuming device;

[0062] The service token corresponding to the service consuming device is sent to the service consuming device as the identity authentication information corresponding to the service consuming device, so that the service consuming device can access the service corresponding to the third service name.

[0063] Specifically, by generating identity authentication information, the security of service consumption devices accessing services can be guaranteed, and the flexibility of service management can also be improved.

[0064] In an optional implementation, determining whether to generate identity authentication information corresponding to the service consuming device according to the identity identifier of the service consuming device and the third service name includes:

[0065] According to the third service name, determining in the blockchain ledger a target whitelist that subscribes to the service corresponding to the third service name;

[0066] Determine whether the identity identifier of the service consuming device is in the target whitelist;

[0067] When it is determined that the identity identifier of the service consumption device is in the target whitelist, determining to generate identity authentication information corresponding to the service consumption device;

[0068] or,

[0069] When it is determined that the identity identifier of the service consuming device is not in the target whitelist, it is determined not to generate identity authentication information corresponding to the service consuming device.

[0070] Specifically, by maintaining a target whitelist in the blockchain ledger, ensuring that only verified devices can obtain identity authentication information and access specific services, unauthorized device and service consumption requests can be effectively blocked, reducing potential security risks.

[0071] In an optional implementation, when it is determined not to generate identity authentication information corresponding to the service consumption device, the method further includes:

[0072] An error prompt message is sent to the service consuming device, wherein the error prompt message is used to indicate that the service consuming device cannot access the service corresponding to the third service name.

[0073] Specifically, when identity authentication fails, an error prompt message is sent to the service consumption device, which can ensure that the user can understand the reason for the access failure in a timely manner.

[0074] In an optional embodiment, the method further includes:

[0075] Receiving a service calling instruction sent by a service consuming device, wherein the service calling instruction includes a first interface address;

[0076] The target service is called according to the first interface address and the correspondence between the pre-built communication indication information and the intranet communication information.

[0077] Specifically, after receiving the service call instruction sent by the service consumption device, the target edge node can parse the service call instruction to obtain the first interface address, and then the target edge node can access the target service according to the first interface address and the correspondence between the preset communication indication information and the intranet communication information. In this way, cross-local area network service access operations can be implemented.

[0078] In some optional implementations, the target edge node includes:

[0079] The blockchain basic function module is used to provide the target edge node with the function of becoming a blockchain node in the blockchain system.

[0080] The intra-domain device and service discovery module is used to discover a newly connected target terminal device in the target local area network system and at least one service provided by the target terminal device according to a preset device and service discovery protocol.

[0081] The identity information management module is used to create identity information for target edge nodes, target terminal devices, and service consumption devices.

[0082] The device registration and discovery module is used to register the target service node to the blockchain system based on the smart contract module.

[0083] The service registration and discovery module is used to register the services provided by the target service node to the blockchain system based on the smart contract module.

[0084] The service calling module is used to call the service provided by any service node in the target local area network system for the service consuming device.

[0085] The data forwarding module is used to obtain service data from the target service node and forward it to the service consumption device.

[0086] The smart contract module is used to provide an interface for the device registration and discovery module, the service registration and discovery module, and the service call module to interact with the data included in the blockchain ledger.

[0087] Specifically, through the cooperation between various modules, the service nodes within the local area network system and the various services they provide can be registered in the blockchain system to realize cross-network service registration operations.

[0088] In some optional embodiments, the smart contract module includes:

[0089] The device type management contract submodule is used to provide an interface for managing the device type information of the target service node.

[0090] The device registration and discovery contract submodule is used to provide an interface for registering and querying device registration information.

[0091] The service registration and discovery contract submodule is used to provide an interface for registering and querying service registration information.

[0092] Specifically, by dividing the smart contract module into sub-modules and having the sub-modules provide the interfaces required for various functions, the accuracy of operation execution can be guaranteed.

[0093] In a second aspect, the present invention provides a blockchain system, which includes multiple local area network systems, and each blockchain node is deployed as an edge node in a local area network system;

[0094] The edge node is used to execute the service registration method of the first aspect or any corresponding implementation method thereof.

[0095] In a third aspect, the present invention provides a service registration device, which is applied to a blockchain system, wherein the blockchain system includes multiple local area network systems, each of which includes an edge node, and the device is configured at a target edge node in a target local area network system, wherein the target local area network system is any one of the multiple local area network systems, and the device includes:

[0096] An acquisition module is used to acquire total service information and identity information of a target service node, and extranet communication information of a target edge node, wherein the total service information includes communication indication information and service information of at least one service provided by the target service node, and the target service node is a target edge node or a target terminal device newly connected to a target local area network system;

[0097] A creation module, used to create a first interface address corresponding to a target service according to the external network communication information and the communication indication information of the target service, wherein the target service is any one of the at least one service;

[0098] A generating module, configured to generate service registration information corresponding to the target service according to the service information of the target service, the first interface address, and the identity information of the target service node;

[0099] Add a module to add the service registration information corresponding to the target service to the pre-built blockchain ledger through the pre-built service registration and discovery contract;

[0100] The synchronization module is used to synchronize the service registration information corresponding to the target service to other edge nodes in the blockchain system except the target edge node according to the preset blockchain synchronization mechanism.

[0101] In a fourth aspect, the present invention provides an edge node, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the service registration method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0102] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable an edge node to execute the service registration method of the first aspect or any corresponding embodiment thereof.

[0103] In a sixth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable an edge node to execute the service registration method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0105] Figure 1This is a schematic diagram of the architecture of the overall blockchain system according to an embodiment of the present invention;

[0106] Figure 2 is a schematic diagram of the calling relationship between various modules deployed on the edge node according to an embodiment of the present invention;

[0107] Figure 3 is a flow chart of a service registration method according to an embodiment of the present invention;

[0108] Figure 4 is a flow chart of an edge node registration method according to an embodiment of the present invention;

[0109] Figure 5 is a flow chart of a terminal device registration method according to an embodiment of the present invention;

[0110] Figure 6 is a flow chart of a method for registering a service consumption device according to an embodiment of the present invention;

[0111] Figure 7 is a flow chart of a service query method according to an embodiment of the present invention;

[0112] Figure 8 is a flow chart of another service query method according to an embodiment of the present invention;

[0113] Fig. 9 is a flow chart of a service authentication method according to an embodiment of the present invention;

[0114] Fig.10 is a structural block diagram of a service registration device according to an embodiment of the present invention;

[0115] Fig.11 It is a schematic diagram of the hardware structure of the edge node according to an embodiment of the present invention. DETAILED DESCRIPTION

[0116] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0117] The professional terms involved in the embodiments of the present invention are explained below.

[0118] Internet of Things: A network of physical devices, vehicles, appliances, and other items embedded with sensors, software, and other technologies that are able to connect and exchange data over the internet.

[0119] Blockchain: It is a distributed database or ledger technology that stores information in the form of a set of immutable, chronologically arranged data records (called "blocks"). Each block contains information such as the encrypted hash value, timestamp and transaction data of the previous block, and the security and integrity of this data are guaranteed by cryptographic algorithms. The main features of blockchain include data tamper-proof, open and transparent, traceable, and third-party trust-free. It is used in many fields such as finance, supply chain management, Internet of Things, and healthcare.

[0120] Consortium chain: It is a special type of blockchain that combines the characteristics of public chain and private chain. In a consortium chain, only authorized nodes can join the network and participate in the accounting process. The following explanation takes blockchain as a consortium chain.

[0121] The embodiment of the present invention provides a blockchain system, which may include multiple local area network systems, and each blockchain node is deployed as an edge node in a local area network system. When a new terminal device is connected to the local area network system, the local area network system may also include the newly connected terminal device.

[0122] For example, in Figure 1 The blockchain system shown in the figure includes n local area network systems. Each local area network system includes an edge node, or the local area network system may also include a terminal device connected to the edge node. The edge node can be a gateway server of the local area network, a network address translation (NAT) server, or a common multi-Internet Protocol (IP) address host. The terminal device can be a camera, a temperature and humidity sensor, a gyroscope sensor, a vehicle automatic driving sensor, a mobile phone, a WiFi device, etc.

[0123] The edge node can communicate with the terminal devices in the local area network system to which it belongs through its own intranet communication information, or it can access the external network and communicate with other edge nodes in the blockchain system through external network communication information.

[0124] The edge nodes can be deployed with various modules to implement different functions, including identity information management module, device registration and discovery module, service registration and discovery module, service call module, smart contract module, intra-domain device and service discovery module, data forwarding module, blockchain basic function module, etc. Figure 2 The figure is a schematic diagram of the calling relationship between the modules deployed on the edge node. The functions and calling relationships of the modules are described below.

[0125] Among them, the blockchain basic function module is responsible for providing the edge nodes with the underlying support functions required to become blockchain nodes. For example, the blockchain basic function module can be a consortium chain basic function module, which can be specifically divided into the basic layer, core layer, management layer and interface layer.

[0126] The intra-domain device and service discovery module can be used to realize the automatic discovery function of terminal devices or services in the LAN according to the preset device and service discovery protocol in the LAN. For example, the discovery protocol can be the Simple Service Discovery Protocol (SSDP), the Multicast Domain Name System (mDNS), the Network Service Discovery using DNS-SD (NS-SD), etc.

[0127] The identity information management module can be a decentralized identifier (DID) identity information management module. Among them, the identity information management service module is responsible for creating identity information for all service nodes (including edge nodes and terminal devices) and service consumption devices in the local area network system. When the device and service discovery module in the domain discovers that a new device is connected to the local area network, the identity information management module can be called to create identity information for the discovered new terminal device. The DID identity information can include the DID identity identifier and the DID document. The DID document includes the creation and update time of the DID identity information, the public key list and the encryption algorithm.

[0128] The device registration and discovery module can realize the device registration and discovery functions based on the smart contract module. When the device and service discovery module in the domain discovers a new terminal device connected to the LAN system, the device registration and discovery module can be called to complete the device registration and chain operation.

[0129] The service registration and discovery module is used to implement the registration and discovery functions of services based on the smart contract module. When the devices in the domain and the service discovery module discover that a new terminal device is connected to the local area network, the service registration and discovery module can be called to complete the registration and chain operation of the service provided by the new terminal device.

[0130] The service calling module can be used to provide the service consuming device with a service function of calling a service node in the local area network system to which the current edge node belongs.

[0131] The data forwarding module can be used to obtain service data from the service node in the local area network system to which it belongs, and forward it to the service consumption device.

[0132] The service consumption device can be a user's device, for example, a computer, a mobile phone, etc. The service consumption device can install a decentralized application module (Decentralized Application, D App), and the D App can call the smart contract module to communicate with the edge node in the blockchain system to complete the registration, query and service call operations of the service consumption device. The service consumption device can be a terminal device connected to any local area network system in the above-mentioned blockchain system, or it can also be a terminal device outside the blockchain system.

[0133] The smart contract module may include multiple sub-modules, which may be a device type management contract sub-module, a device registration and discovery contract sub-module, and a service registration and discovery contract sub-module.

[0134] The name of the device type management contract submodule may be "Device Factory Contract", and the device type management contract submodule may define the following multiple interfaces:

[0135] First, the Create Category interface is used to create a new device type. The input parameters may include a device type name, device type description information, etc.

[0136] Second, the List All Categories interface is used to obtain a list of created device types and has no input parameters.

[0137] Third, the Find Category interface is used to query whether a specified device type exists. The input parameter is a device type name.

[0138] The name of the device registration and discovery contract submodule may be "Device Reg Discovery Contract", and the device registration and discovery contract submodule may define the following multiple interfaces:

[0139] First, the Register interface is used to register a new service node. The input parameters include the service node's identity information, device type (including device type name and device type description information), status (including available, unavailable, faulty, etc.), the identity information of the edge node to which it belongs, and device object information (an XML or JSCON string that contains other information about the device, such as location information, device description information, collected data description information, etc.).

[0140] Second, the List All Device interface is used to obtain a list of registered service nodes (including device registration information of registered service nodes) without input parameters.

[0141] Third, the Query By Category interface is used to obtain a list of service nodes of a specified device type (including device registration information of service nodes of a specified device type). The input parameter is a device type name.

[0142] Fourth, the Query By ID interface is used to query the service registration information of the service node with a specified ID. The input parameter can be the identity identifier of the service node.

[0143] Fifth, the Query By Edge interface is used to obtain a list of terminal devices belonging to a specified edge node (including device registration information of terminal devices belonging to a specified edge node). The input parameter is an edge node identifier.

[0144] The name of the service registration and discovery contract submodule can be "Server Reg Discovery Contract". The service registration and discovery contract submodule can define the following multiple interfaces:

[0145] First, the Add Service Category interface is used to add a new service category. The input parameters are the service category name and service category description information.

[0146] Second, the List All Service interface is used to obtain all registered service types and has no input parameters.

[0147] Third, the Register interface is used to register services. The input parameters include the identity information of the service node, service type (including service type name and service type description information), service name, interface address, service status (such as busy, idle, etc.), service description information, etc.

[0148] Fourth, the Update interface is used to update the service information of a specified device. The input parameters include the device's identity information, service type, service name, interface address, service status, service description information, etc.

[0149] Fifth, the Query Service By Category interface is used to query the list of all services of a specified service type (including service registration information of the specified service type). The input parameter is the service type name.

[0150] Sixth, the Query Service By ID interface is used to query the service list provided by the specified device, and the input parameter is the identity identifier of the specified device.

[0151] Seventh, the Query Service By Edge interface is used to query the service list provided by the devices belonging to the specified edge node. The input parameter is the identity identifier of an edge node.

[0152] Eighth, Apply interface, its purpose is to provide an identity authentication information for a specified service consumption device, and the input parameters include multiple information such as the identity identifier of the service node, the identity identifier of the service consumption device, and the service name, etc. The output result includes one of the identity authentication information or the error prompt information.

[0153] When the edge node calls each of the above interfaces, it can generate and execute instructions according to the address, name, submodule name, interface name and input parameters of the smart contract module to achieve the function corresponding to the interface. For example, in a blockchain, the address and name of the smart contract module can be fixed. When creating a device type, the submodule name in the instruction is "Device Factory Contract", the interface name in the instruction is "Create Category", and when the input parameter is "Edge Server", the instruction is used to instruct the creation of an edge node device type. When the input parameter is "Live Stream", the instruction is used to instruct the creation of a camera device type.

[0154] An embodiment of the present invention provides a service registration method. By setting an edge node in a local area network system and adding the edge node to a blockchain system, the edge node can complete the registration operation of the service in the local area network, and synchronize the registration information to other edge nodes of the blockchain system through a blockchain synchronization mechanism to realize cross-network service registration operations.

[0155] According to an embodiment of the present invention, a service registration method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0156] In this embodiment, a service registration method is provided, which can be executed by a target edge node. Figure 3 is a flow chart of a service registration method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0157] Step S301, obtaining the total service information and identity information of the target service node, and the external network communication information of the target edge node.

[0158] Among them, the total service information may include communication indication information and service information of at least one service provided by the target service node, and the target service node may be a target edge node or a newly connected target terminal device in the target local area network system. The service information may include service name, service description information, service type, service status, etc. For example, the target edge node may provide edge computing services, and the service information of the edge computing service may include the computing power of the target edge node, the registered computing power service name, and the computing power service specification. The identity information may be the above-mentioned DID identity information. The external network communication information may include an IP address. The communication indication information may be the identification information of the service.

[0159] Specifically, after the target edge node obtains the installation package of the blockchain basic function module, it can modify the node configuration file of the target edge node in the operating system of the target edge node according to the blockchain basic function module (for example, add the communication information of some edge nodes in the blockchain system to the node configuration file), start the blockchain node process, and then add the target edge node to the blockchain system.

[0160] Then, the target edge node can use the above-mentioned identity information management module to create a unique identity information for itself. Figure 4 The steps shown register the target edge node into the blockchain system:

[0161] Step 1: Obtain the location information and device information of the target edge node.

[0162] The device information of the target edge node may include device type, status, device description information, manufacturer, model, hardware configuration information, etc.

[0163] Step 2: Generate device registration information corresponding to the target edge node based on the location information, device information, and identity information of the target edge node.

[0164] Step 3: Add the device registration information corresponding to the target edge node to the blockchain ledger through the pre-built device registration and discovery contract.

[0165] Step 4: According to the blockchain synchronization mechanism, the device registration information corresponding to the target edge node is synchronized to other edge nodes.

[0166] Specifically, after the target edge node obtains its own location information and device information by using the device and service discovery module within the domain, it can call the Register interface of the device registration and discovery contract submodule (including the content of the device registration and discovery contract), and use its own location information, device information, and identity information as input parameters of the Register interface of the device registration and discovery contract submodule to generate device registration information corresponding to the target edge node, and register it in the blockchain system, that is, add it to its own blockchain ledger, and synchronize it to the blockchain ledgers of other edge nodes.

[0167] In addition, the target edge node can deploy various services, and after deploying various services, the service information of at least one service provided by the target edge node can be obtained. In this way, the target edge node can register the service it provides to the blockchain system (for specific operations, see subsequent steps S302 to S305).

[0168] When a target terminal device is newly connected to the target LAN system, the target edge node can use the device and service discovery module in the domain to discover the target terminal device and call the identity information management module to create a unique identity information for the target terminal device. Figure 5 The steps shown will register the target terminal device into the blockchain system:

[0169] Step 1: Obtain the location information and device information of the target terminal device, as well as the identity information of the target edge node.

[0170] The device information of the target terminal device may include device type, status, device description information, collected data description information, etc.

[0171] Step 2: Generate device registration information corresponding to the target terminal device based on the location information, device information and identity information of the target terminal device and the identity information of the target edge node.

[0172] Step 3: Add the device registration information corresponding to the target terminal device to the blockchain ledger through the pre-built device registration and discovery contract.

[0173] Step 4: According to the blockchain synchronization mechanism, the device registration information corresponding to the target terminal device is synchronized to other edge nodes.

[0174] Specifically, after the target edge node obtains the location information and device information of the target terminal device by using the intra-domain device and service discovery module, it can call the Register interface of the device registration and discovery contract sub-module, and use the location information, device information and identity information of the target terminal device, as well as the identity information of the target edge node as input parameters of the Register interface of the device registration and discovery contract sub-module, generate device registration information corresponding to the target terminal device, and register it in the blockchain system, that is, add it to its own blockchain ledger, and synchronize it to the blockchain ledgers of other edge nodes.

[0175] In addition, when the target edge node can discover the target terminal device using the intra-domain device and the service discovery module, the target edge node can obtain service information of at least one service provided by the target terminal device from the target terminal device. In this way, the target edge node can register the service provided by the target terminal device into the blockchain system (for specific operations, see subsequent steps S302 to S305).

[0176] Wherein, obtaining communication indication information of at least one service may include:

[0177] For each service, the target edge node may allocate a unique identification information for each service. For example, according to the number of services registered in the target edge node, an identification information is allocated to the target service as communication indication information. The target service is any one of the at least one service.

[0178] In some optional implementations, obtaining the device type of the target terminal device may specifically include:

[0179] When the target terminal device is discovered, the device information of the target terminal device obtained may include the target device type name and the corresponding device type description information. The target edge node may call the List All Categories interface of the device type management contract submodule to obtain the list of device types currently created by the target edge node, and call the Find Category interface of the device type management contract submodule to determine whether there is a device type including the target device type name in the device type list. If so, the device type including the target device type name may be directly obtained as the device type of the target terminal device. If not, the Create Category interface of the device type management contract submodule may be called, and the target device type name and the corresponding device type description information may be used as input parameters of the Create Category interface of the device type management contract submodule to create the device type of the target terminal device.

[0180] In this way, a new device type is created only when needed, avoiding unnecessary resource consumption, and can quickly match existing device types, improving processing efficiency.

[0181] In some optional implementations, obtaining the service type of the target service may specifically include:

[0182] The service information of the target service obtained may include the first service type name and the corresponding service type description information. The target edge node can call the List All Service interface of the service registration and discovery contract sub-module to obtain the list of service types currently created by the target edge node, and determine whether there is a service type including the first service type name in the service type list. If so, the service type including the first service type name can be directly obtained as the service type of the target service. If not, the AddService Category interface of the service registration and discovery contract sub-module can be called, and the first service type name and the corresponding service type description information can be used as input parameters of the Add Service Category interface of the service registration and discovery contract sub-module to create the service type of the target service.

[0183] In this way, new service types are created only when needed, avoiding unnecessary resource consumption, and can quickly match existing device types, improving processing efficiency.

[0184] Step S302: Create a first interface address corresponding to the target service according to the external network communication information and the communication indication information of the target service.

[0185] The first interface address may be a Uniform Resource Locator (URL) address.

[0186] Specifically, the target edge node may call the service calling module to generate the first interface address according to the above-mentioned external network communication information and the communication indication information of the target service.

[0187] Step S303: Generate service registration information corresponding to the target service according to the service information of the target service, the first interface address, and the identity information of the target service node.

[0188] Step S304: Add the service registration information corresponding to the target service to the pre-built blockchain account book through the pre-built service registration and discovery contract.

[0189] Specifically, the target edge node can call the Register interface of the service registration and discovery contract submodule in the service registration and discovery contract module (the service registration and discovery contract is the content in this module), and use the service information of the target service, the first interface address, and the identity information of the target service node as input parameters of the Register interface of the service registration and discovery contract submodule to perform the registration operation. In this way, the target edge node can generate the service registration information corresponding to the target service and add it to the blockchain account book.

[0190] Step S305: According to the preset blockchain synchronization mechanism, the service registration information corresponding to the target service is synchronized to other edge nodes in the blockchain system except the target edge node.

[0191] Specifically, after adding the service registration information to the blockchain ledger, the target edge node uses the blockchain basic function module to synchronize the newly added service registration information in the blockchain ledger to the blockchain ledgers on other edge nodes according to the blockchain synchronization mechanism. In this way, any edge node of the blockchain system can include all service registration information of the blockchain system.

[0192] Under the above service registration mechanism, the target edge node can serve as an information transfer station for service consumption devices and terminal devices to provide services for service consumption devices, which can be specifically as follows:

[0193] Step 1: Receive a service call instruction sent by a service consuming device.

[0194] The service calling instruction may include a first interface address corresponding to the target service.

[0195] Step 2: Call the target service according to the first interface address and the correspondence between the pre-built communication indication information and the intranet communication information.

[0196] Specifically, the service consumption device may parse the first interface address corresponding to the target service to obtain the external network communication address of the target edge node, and then send a service call instruction to the target edge node according to the external network communication address of the target edge node.

[0197] Specifically, when receiving the service call instruction, the target edge node can parse the service call instruction to obtain the first interface address, and further, the first interface address can be split according to the preset splitting rule to obtain the communication indication information of the target service. Finally, the target edge node can determine the intranet communication information corresponding to the service node providing the target service based on the communication indication information of the target service and the correspondence between the pre-built communication indication information and the intranet communication information. In this way, the target edge node can obtain service data from the service node providing the target service based on the determined intranet communication information, and forward it to the service consumption device to provide the target service to the service consumption device.

[0198] The service registration method provided in this embodiment deploys an edge node in each local area network system, and the edge nodes and terminal devices in the local area network system can be devices that provide services (i.e., service nodes). Taking the target local area network system as an example, the target edge node obtains the total service information and identity information of the target service node, as well as its own external network communication information, wherein the total service information may include communication indication information and service information of at least one service provided by the target service node. For the target service, the target edge node can create a first interface address for the target service based on the external network communication information and the communication indication information of the target service. Then, the target edge node can generate service registration information corresponding to the target service based on the service information of the target service, the first interface address, and the identity information of the target service node. Finally, the service registration information of the target service is added to the blockchain ledger, and the service registration information of the target service is synchronized to the blockchain ledger of other edge nodes, so that the registration operation of the target service across the network is completed, that is, any edge node can have the registration information of the services provided by all service nodes in the total blockchain system.

[0199] Moreover, based on the above cross-network service registration scheme, the service consumption device can communicate with any edge node to obtain service registration information, and through the external network communication information of the edge node of the service registration information, ensure that the service consumption device can access the edge node of the local area network system where the required access service is located, and then, according to the identity information of the service node and the identification information of the service, it can be ensured that the service consumption device can access the service provided by the service node through the edge node. In this way, in the case of the above cross-network registration, the service consumption device can call the service provided by any service node in the blockchain system.

[0200] In the current service registration scheme, there is another scheme that registers and updates the service information of the service provider through the deployed registration center. The client communicates with the registration center in real time to obtain the latest service registration information list, and the client selects the service provider according to the preset algorithm. In this way, the client needs to interact with the registration center continuously, and the processing logic is complex, which leads to greater pressure on the client. However, this scheme transfers the service registration operation to each edge node through decentralization. The edge node only needs to update the service registration information of the service node in its own local area network system, and the pressure on the edge node is relatively small. In addition, under the scheme provided by the relevant technology, the registration center is deployed in a server or a server cluster. If any server fails, the service registration operation cannot be realized and the service cannot be provided. In this scheme, if any edge node fails, it will only affect the execution of the service registration and service call tasks in the local area network system where it is located, reducing the impact of equipment failure on service registration and call operations.

[0201] Alternatively, when the registration center is deployed in a server cluster and uses the distributed protocol service components currently on the market to provide registration services, the service registration information needs to be synchronized on each server in real time, resulting in a long data delay. This solution uses a blockchain synchronization mechanism to reduce data delay time.

[0202] When a user needs to use any service provided by any service node in the blockchain system, he can first perform a registration operation through the service consumption device to obtain the permission to query or call the service. Accordingly, this embodiment provides a service consumption device registration method, which can be executed by the above-mentioned target edge node to implement the registration operation of the service consumption device. Figure 6 is a flow chart of a service consumption device registration method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:

[0203] Step S601: obtaining a registration request sent by a service consuming device.

[0204] Specifically, the DApp of the service consumption device may store the communication information of at least one edge node in the blockchain system (including the communication information of the target edge node). When performing the registration operation, the service consumption device may select the communication information of an edge node from the communication information of at least one edge node according to a preset selection rule (for example, random selection), and send a registration request according to the communication information of the selected edge node. When the selected edge node is the target edge node, the target edge node may receive the registration request sent by the service consumption device.

[0205] Step S602: Create identity information of the service consumption device.

[0206] The identity information of the service consumption device includes an identity identifier of the service consumption device.

[0207] Specifically, the target edge node can use the identity information management module to create identity information corresponding to the service consumption device for the service consumption device, and call the smart contract module to add the identity information of the service consumption device to the blockchain account book. After the target edge node adds the identity information corresponding to the service consumption device to the blockchain account book, it uses the blockchain basic function module to synchronize the newly added identity information corresponding to the service consumption device in the blockchain to other edge nodes according to the blockchain synchronization mechanism. In this way, the service consumption device can subsequently call the services in the blockchain system on any edge node.

[0208] Step S603: Add the identity information of the service consumption device to the blockchain ledger.

[0209] Step S604: synchronize the identity information corresponding to the service consumption device to other edge nodes according to the blockchain synchronization mechanism.

[0210] Step S605, sending the identity identifier of the service consuming device to the service consuming device, so that the service consuming device can access the services provided by the service node in the blockchain system.

[0211] Specifically, the target edge node can send the identity identifier in the identity information of the service consumption device to the service consumption device, and the service consumption device can complete the registration. Subsequently, it can access the services provided by the service node in the blockchain system through its own identity identifier.

[0212] The service consumption device registration method provided in this embodiment can facilitate the management of the access record of the service consumption device by generating the identity information of the service consumption device, and add the identity information of the service consumption device to the blockchain ledger, and synchronize it to other edge nodes. The service consumption device can access the service at any edge node with the identity information.

[0213] In completing Figure 6 After the registration operation shown, the user can query the services he needs through the service consumption device. In this embodiment, a service query method is provided, which can be executed by the above-mentioned target edge node. Figure 7 is a flow chart of a service query method according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:

[0214] Step S701: receiving a query instruction sent by a service consumption device.

[0215] The query instruction may be a service query instruction or a device query instruction.

[0216] Step S702: parse the target query condition from the query instruction.

[0217] Step S703: extracting query object information corresponding to the target query condition from the blockchain account book according to the target query condition.

[0218] Specifically, depending on the query instructions and the target query conditions, the operations for extracting the query object information are different, for example, the following three situations may be included:

[0219] In case 1, the service information of each service includes a service type, the query instruction is a service query instruction, and the target query condition includes a first service type name. According to the target service type, at least one service registration information corresponding to the first service type name is determined in the blockchain account book. The identity information and the first service name corresponding to the first service node are extracted from the first service registration information, wherein the first service registration information is any service registration information of the at least one service registration information corresponding to the first service type name. The identity information and service name of the service node extracted from each service registration information corresponding to the first service type name are determined as the query object information.

[0220] Specifically, the target edge node can call the Query Service ByCategory interface of the service registration and discovery contract submodule, and use the first service type name as the input parameter of the Query ServiceBy Category interface of the service registration and discovery contract submodule, and can obtain at least one service registration information corresponding to the first service type name. For each service registration information corresponding to the target service type, the target edge node can extract the identity information and service name of the service node as the query object information.

[0221] In case 2, the service information of each service includes a service name, the query instruction is a service query instruction, and the target query condition includes the identity information of the second service node. According to the identity information of the second service node, the service registration information corresponding to at least one service provided by the second service node is determined in the blockchain account book. The second interface address and the second service name are extracted from the second service registration information, wherein the second service registration information is any service registration information corresponding to at least one service provided by the second service node. The interface address and service name extracted from the service registration information corresponding to each service provided by the second service node are determined as the query object information.

[0222] Specifically, the target edge node can call the Query Service ByID interface of the service registration and discovery contract submodule, and use the identity identifier of the second service node as the input parameter of the QueryService By ID interface of the service registration and discovery contract submodule, and can obtain the service list of the second service node, that is, obtain the service registration information corresponding to at least one service provided by the second service node. Then, the target edge node can extract the interface address and service name (or, it can also include the identity information of the service node) from the service registration information corresponding to each service provided by the second service node as the query object information.

[0223] Case 3: The query instruction is a device query instruction, and the target query condition includes the identity information of the third service node. According to the identity information of the third service node, the device registration information corresponding to the third service node is searched in the blockchain account book. The location information of the third service node is extracted from the device registration information corresponding to the third service node. The location information of the third service node is determined as the query object information.

[0224] Specifically, the target edge node can call the Query By ID interface of the device registration and discovery contract submodule, and use the identity information of the third service node as the input parameter of the Query By ID interface of the device registration and discovery contract submodule, and can obtain the device registration information corresponding to the third service node. The target edge node can extract the location information of the third service node from the device registration information corresponding to the third service node as the query object information.

[0225] Step S704, sending the query object information to the service consuming device so that the service consuming device can access the services provided by the service node in the blockchain system.

[0226] Specifically, the target edge node may send the query object information to the service consuming device so that the service consuming device performs the next operation.

[0227] The above three situations may be three completely independent query operations or interrelated query operations.

[0228] When the above three situations are interrelated query operations, for example, Figure 8In the operation steps shown, the user can input the description information of the required service in the D App of the service consumption device, so that the service consumption device can parse the description information of the service to obtain the first service type name, and then the service consumption device can send a query instruction including the first service type name to the target edge node. The target edge node can determine the service registration information corresponding to the first service type name from the blockchain ledger according to the processing of situation one, and extract the identity information and service name of the service node from the service registration information corresponding to the first service type name, and feed it back to the service consumption device.

[0229] The service consumption device can generate a corresponding query instruction based on the identity information of each service node received, and send it to the target edge node (for example, the identity information of the third service node can be the identity information of the service node extracted from any service registration information corresponding to the first service type name in situation one, that is, the identity information of any service node received by the service consumption device). The target edge node can obtain the location information of each service node according to the identity information of each service node in accordance with the processing of situation three, and feed it back to the service consumption device, corresponding to the above situation three. Then, the service consumption device can determine the service node closest to itself (for example, the second service node) based on the location information of each service node and its own location information.

[0230] The service consumption device can generate a corresponding query instruction based on the identity information of the second service node and send it to the target edge node. The target edge node can obtain the interface address and service name of at least one service provided by the second service node based on the identity information of the second service node and send it to the service consumption device.

[0231] Finally, the service consumption device may access the service provided by the second service node according to the interface address and service name of at least one service provided by the second service node.

[0232] In this way, after obtaining the identity information of each service node, their location information is further queried, so that the service consumption device can select the service node closest to itself, thereby reducing network latency and improving service quality. In addition, this solution decouples the query operation, with some operations performed by the target edge node and some operations performed by the service consumption device, which can reduce the load on the target edge node. At the same time, the service consumption device only needs to perform simple analysis operations, rather than updating the service registration information in real time as in related technologies. In addition, by dividing the query operation into multiple layers, the amount of data transmission can be reduced, that is, when querying at each layer, part of the information is transmitted (for example, only the service name and the identity information of the service node are transmitted when querying at the first layer), rather than sending all the information to the service consumption device in one operation, and the service consumption device bears a heavier task.

[0233] In the service query method provided in this embodiment, when the target edge node receives a query instruction sent by any service consumption device, the query instruction can be parsed to obtain the target query condition. Furthermore, according to the target query condition, the query object information can be extracted from the blockchain account book and sent to the service consumption device. In this way, the service consumption device can access the services provided by the corresponding service node in the blockchain system, and realize the service access operation across the local area network.

[0234] In order to achieve more flexible management, for example, only users who subscribe to the service can access the service. Accordingly, a service authentication method is provided in this embodiment, which can be executed by the target edge node mentioned above. Fig. 9 is a flow chart of a service authentication method according to an embodiment of the present invention. Fig. 9 As shown, the process includes the following steps:

[0235] Step S901: receiving an authentication information application instruction sent by a service consumption device.

[0236] Step S902: extracting the identity identifier of the service consumption device and the third service name from the authentication information application instruction.

[0237] Specifically, before the service consumption device calls a service, the service consumption device may send an authentication information application instruction to the target edge node. When the target edge node receives the authentication information application instruction, it may extract the identity identifier corresponding to the service consumption device and the third service name.

[0238] Step S903: determining whether to generate identity authentication information corresponding to the service consuming device according to the identity identifier of the service consuming device and the third service name.

[0239] Specifically, the target edge node can call the Apply interface of the service registration and discovery contract submodule, and use the identity identifier corresponding to the service consumption device and the third service name as input parameters of the Apply interface of the service registration and discovery contract submodule. Accordingly, the target edge node can determine whether to generate the identity authentication information of the service consumption device in the following manner:

[0240] Step 1: According to the third service name, a target whitelist subscribing to the service corresponding to the third service name is determined in the blockchain ledger.

[0241] Step 2: Determine whether the identity identifier of the service consumption device is in the target whitelist.

[0242] Step three: when it is determined that the identity identifier of the service consuming device is in the target whitelist, determine to generate identity authentication information corresponding to the service consuming device.

[0243] or,

[0244] Step 4: when it is determined that the identity identifier of the service consuming device is not in the target whitelist, it is determined not to generate identity authentication information corresponding to the service consuming device.

[0245] Step S904: when it is determined to generate identity authentication information corresponding to the service consuming device, a service token corresponding to the service consuming device is created.

[0246] Among them, the service token can be Token.

[0247] Specifically, when it is determined to generate identity authentication information corresponding to the service consumption device, the Apply interface will output the service token corresponding to the service consumption device. When it is determined not to generate identity authentication information, the Apply interface will output error prompt information.

[0248] In some optional implementations, when it is determined not to generate identity authentication information, an error prompt information is sent to the service consuming device, wherein the error prompt information is used to indicate that the service consuming device cannot access the third service.

[0249] Step S905: sending the service token corresponding to the service consuming device as the identity authentication information corresponding to the service consuming device to the service consuming device, so that the service consuming device can access the service corresponding to the third service name.

[0250] The service authentication method provided in this embodiment can ensure the security of service consumption devices accessing services by generating identity authentication information, and can also improve the flexibility of service management.

[0251] In this embodiment, a service registration device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software (e.g., various programs deployed by edge nodes) and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0252] This embodiment provides a service registration device, such as Fig.10 As shown, including:

[0253] The acquisition module 1001 is used to acquire the total service information and identity information of the target service node and the extranet communication information of the target edge node, wherein the total service information includes the communication indication information and service information of at least one service provided by the target service node, and the target service node is the target edge node or the target terminal device newly connected in the target local area network system;

[0254] A creation module 1002, configured to create a first interface address corresponding to a target service according to the external network communication information and the communication indication information of the target service, wherein the target service is any one of the at least one service;

[0255] A generating module 1003, configured to generate service registration information corresponding to the target service according to the service information of the target service, the first interface address, and the identity information of the target service node;

[0256] An adding module 1004 is used to add the service registration information corresponding to the target service to the pre-built blockchain ledger through a pre-built service registration and discovery contract;

[0257] The synchronization module 1005 is used to synchronize the service registration information corresponding to the target service to other edge nodes in the blockchain system except the target edge node according to the preset blockchain synchronization mechanism.

[0258] In some optional implementations, the target service node is a target edge node;

[0259] The acquisition module 1001 is also used to acquire the location information and device information of the target edge node;

[0260] The generating module 1003 is further used to generate device registration information corresponding to the target edge node according to the location information, device information, and identity information of the target edge node;

[0261] The adding module 1004 is further used to add the device registration information corresponding to the target edge node to the blockchain ledger through a pre-built device registration and discovery contract;

[0262] The synchronization module 1005 is also used to synchronize the device registration information corresponding to the target edge node to other edge nodes according to the blockchain synchronization mechanism.

[0263] In some optional implementations, the target service node is a target terminal device;

[0264] The acquisition module 1001 is further used to acquire the location information and device information of the target terminal device, and the identity information of the target edge node;

[0265] The generating module 1003 is further used to generate device registration information corresponding to the target terminal device according to the location information, device information and identity information of the target terminal device and the identity information of the target edge node;

[0266] The adding module 1004 is further used to add the device registration information corresponding to the target terminal device to the blockchain ledger through a pre-built device registration and discovery contract;

[0267] The synchronization module 1005 is also used to synchronize the device registration information corresponding to the target terminal device to other edge nodes according to the blockchain synchronization mechanism.

[0268] In some optional implementations, the apparatus further includes a sending module 1006;

[0269] The acquisition module 1001 is also used to acquire a registration request sent by the service consumption device;

[0270] The creation module 1002 is further used to create identity information of the service consumption device, wherein the identity information of the service consumption device includes an identity identifier of the service consumption device;

[0271] The adding module 1004 is further used to add the identity information of the service consumption device to the blockchain ledger;

[0272] The synchronization module 1005 is also used to synchronize the identity information of the service consumption device to other edge nodes according to the blockchain synchronization mechanism;

[0273] The sending module 1006 is used to send the identity identifier of the service consumption device to the service consumption device, so that the service consumption device can access the services provided by the service node in the blockchain system.

[0274] In some optional implementations, the apparatus further includes a receiving module 1007, a parsing module 1008, an extracting module 1009, and a query module 1010;

[0275] The receiving module 1007 is used to receive the query instruction sent by the service consumption device;

[0276] The parsing module 1008 is used to parse the target query condition from the query instruction;

[0277] The extraction module 1009 is used to extract the query object information corresponding to the target query condition from the blockchain account book according to the target query condition;

[0278] The query module 1010 is used to send the query object information to the service consumption device so that the service consumption device can access the services provided by the service node in the blockchain system.

[0279] In some optional implementations, the service information of each service includes a service type name, the query instruction is a service query instruction, and the target query condition includes a first service type name;

[0280] The extraction module 1009 is specifically used for:

[0281] According to the first service type name, determining at least one service registration information corresponding to the first service type name in the blockchain account book;

[0282] Extracting the identity information of the first service node and the first service name from the first service registration information, wherein the first service registration information is any one of the at least one service registration information corresponding to the first service type name;

[0283] The identity information and service name of the service node extracted from each piece of service registration information corresponding to the first service type name are determined as query object information.

[0284] In some optional implementations, the service information of each service includes a service name, the query instruction is a service query instruction, and the target query condition includes identity information of the second service node;

[0285] The extraction module 1009 is specifically used for:

[0286] Determining, in the blockchain ledger, service registration information corresponding to at least one service provided by the second service node according to the identity information of the second service node;

[0287] Extracting a second interface address and a second service name from the second service registration information, wherein the second service registration information is any one piece of service registration information corresponding to at least one service provided by the second service node;

[0288] The interface address and service name extracted from the service registration information corresponding to each service provided by the second service node are determined as the query object information.

[0289] In some optional implementations, the query instruction is a device query instruction, and the target query condition includes identity information of the third service node;

[0290] The extraction module 1009 is specifically used for:

[0291] According to the identity information of the third service node, searching the blockchain account book for device registration information corresponding to the third service node;

[0292] extracting location information of the third service node from device registration information corresponding to the third service node;

[0293] The location information of the third service node is determined as the query object information.

[0294] In some optional implementations, the device further includes a determination module 1011;

[0295] The receiving module 1007 is further used to receive the authentication information application instruction sent by the service consumption device;

[0296] The extraction module 1009 is further used to extract the identity identifier of the service consumption device and the third service name from the authentication information application instruction;

[0297] The determination module 1011 is used to determine whether to generate identity authentication information corresponding to the service consumption device according to the identity identifier of the service consumption device and the third service name;

[0298] The creation module 1002 is further used to create a service token corresponding to the service consumption device when it is determined to generate identity authentication information corresponding to the service consumption device;

[0299] The sending module 1006 is further configured to send the service token corresponding to the service consuming device as the identity authentication information corresponding to the service consuming device to the service consuming device, so that the service consuming device can access the service corresponding to the third service name.

[0300] In some optional implementations, the determination module 1011 is specifically configured to:

[0301] According to the third service name, determining in the blockchain ledger a target whitelist that subscribes to the service corresponding to the third service name;

[0302] Determine whether the identity identifier of the service consuming device is in the target whitelist;

[0303] When it is determined that the identity identifier of the service consumption device is in the target whitelist, determining to generate identity authentication information corresponding to the service consumption device;

[0304] or,

[0305] When it is determined that the identity identifier of the service consuming device is not in the target whitelist, it is determined not to generate identity authentication information corresponding to the service consuming device.

[0306] In some optional implementations, the sending module 1006 is further configured to:

[0307] When it is determined that the identity authentication information corresponding to the service consuming device is not generated, an error prompt information is sent to the service consuming device, wherein the error prompt information is used to indicate that the service consuming device cannot access the service corresponding to the third service name.

[0308] In some optional implementations, the apparatus further includes a calling module 1012;

[0309] The receiving module 1007 is further configured to receive a service calling instruction sent by the service consuming device, wherein the service calling instruction includes the first interface address;

[0310] The calling module 1012 is used to call the target service according to the first interface address and the correspondence between the pre-built communication indication information and the intranet communication information.

[0311] In some optional implementations, the modules included in the above service registration device may be renamed as follows:

[0312] The blockchain basic function module is used to provide the target edge node with the function of becoming a blockchain node in the blockchain system.

[0313] The intra-domain device and service discovery module is used to discover a newly connected target terminal device in the target local area network system and at least one service provided by the target terminal device according to a preset device and service discovery protocol.

[0314] The identity information management module is used to create identity information for target edge nodes, target terminal devices, and service consumption devices.

[0315] The device registration and discovery module is used to register the target service node to the blockchain system based on the smart contract module.

[0316] The service registration and discovery module is used to register the services provided by the target service node to the blockchain system based on the smart contract module.

[0317] The service calling module is used to call the service provided by any service node in the target local area network system for the service consuming device.

[0318] The data forwarding module is used to obtain service data from the target service node and forward it to the service consumption device.

[0319] The smart contract module is used to provide an interface for the device registration and discovery module, the service registration and discovery module, and the service call module to interact with the data included in the blockchain ledger.

[0320] In some optional embodiments, the smart contract module includes:

[0321] The device type management contract submodule is used to provide an interface for managing the device type information of the target service node.

[0322] The device registration and discovery contract submodule is used to provide an interface for registering and querying device registration information.

[0323] The service registration and discovery contract submodule is used to provide an interface for registering and querying service registration information.

[0324] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0325] The embodiment of the present invention also provides an edge node having the above Fig.10 The service registration device shown.

[0326] See also Fig.11 , Fig.11 is a schematic diagram of the structure of an edge node provided by an optional embodiment of the present invention, such as Fig.11 As shown, the edge node includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the edge node, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 10 is taken as an example.

[0327] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0328] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0329] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the edge node, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the edge node via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0330] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0331] The edge node also includes a communication interface 30, which is used for the edge node to communicate with other devices or communication networks.

[0332] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0333] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by an edge node, can call or provide the method and / or technical solution according to the present invention through the operation of the edge node. Those skilled in the art should understand that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instructions are executed by the computer includes, but is not limited to: the edge node directly executes the instruction, or the edge node compiles the instruction and then executes the corresponding compiled program, or the edge node reads and executes the instruction, or the edge node reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0334] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A service registration method, characterized in that: The method is applied to a blockchain system, which includes multiple local area network systems. Each blockchain node is deployed as an edge node in a local area network system. The method is executed by a target edge node in a target local area network system. The target local area network system is any one of the multiple local area network systems. The method includes: Acquire total service information and identity information of a target service node, and extranet communication information of the target edge node, wherein the total service information includes communication indication information and service information of at least one service provided by the target service node, and the target service node is the target edge node or a newly connected target terminal device in the target local area network system; Creating a first interface address corresponding to the target service according to the external network communication information and the communication indication information of the target service, wherein the target service is any one of at least one of the services; Generate service registration information corresponding to the target service according to the service information of the target service, the first interface address, and the identity information of the target service node; Adding the service registration information corresponding to the target service to the pre-built blockchain ledger through a pre-built service registration and discovery contract; According to a preset blockchain synchronization mechanism, the service registration information corresponding to the target service is synchronized to other edge nodes in the blockchain system except the target edge node.

2. The method according to claim 1, characterized in that The target service node is the target edge node, and the method further includes: Obtaining location information and device information of the target edge node; Generate device registration information corresponding to the target edge node according to the location information, device information, and identity information of the target edge node; Adding device registration information corresponding to the target edge node to the blockchain ledger through a pre-built device registration and discovery contract; According to the blockchain synchronization mechanism, the device registration information corresponding to the target edge node is synchronized to the other edge nodes.

3. The method according to claim 1, characterized in that The target service node is the target terminal device, and the method further includes: Acquire location information and device information of the target terminal device, and identity information of the target edge node; Generate device registration information corresponding to the target terminal device according to the location information, device information and identity information of the target terminal device and the identity information of the target edge node; Adding device registration information corresponding to the target terminal device to the blockchain ledger through a pre-built device registration and discovery contract; According to the blockchain synchronization mechanism, the device registration information corresponding to the target terminal device is synchronized to the other edge nodes.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtain the registration request sent by the service consumption device; Creating identity information of the service consuming device, wherein the identity information of the service consuming device includes an identity identifier of the service consuming device; Adding the identity information of the service consumption device to the blockchain ledger; According to the blockchain synchronization mechanism, the identity information of the service consumption device is synchronized to the other edge nodes; And, sending the identity identifier of the service consumption device to the service consumption device, so that the service consumption device can access the services provided by the service node in the blockchain system.

5. The method according to claim 4, characterized in that The method further comprises: Receiving a query instruction sent by the service consumption device; Parsing a target query condition from the query instruction; According to the target query condition, extracting query object information corresponding to the target query condition from the blockchain account book; The query object information is sent to the service consumption device so that the service consumption device can access the service provided by the service node in the blockchain system.

6. The method according to claim 5, characterized in that The service information of each service includes a service type name, the query instruction is a service query instruction, and the target query condition includes a first service type name; The step of extracting query object information corresponding to the target query condition from the blockchain account book according to the target query condition includes: According to the first service type name, determining at least one service registration information corresponding to the first service type name in the blockchain account book; Extracting the identity information of the first service node and the first service name from the first service registration information, wherein the first service registration information is any one of the at least one service registration information corresponding to the first service type name; The identity information and service name of the service node extracted from each piece of the service registration information corresponding to the first service type name are determined as the query object information.

7. The method according to claim 5, characterized in that The service information of each service includes a service name, the query instruction is a service query instruction, and the target query condition includes identity information of the second service node; The step of extracting query object information corresponding to the target query condition from the blockchain account book according to the target query condition includes: Determining, in the blockchain ledger, service registration information corresponding to at least one service provided by the second service node according to the identity information of the second service node; Extracting a second interface address and a second service name from the second service registration information, wherein the second service registration information is any one of the service registration information corresponding to at least one service provided by the second service node; The interface address and service name extracted from the service registration information corresponding to each service provided by the second service node are determined as the query object information.

8. The method according to claim 5, characterized in that The query instruction is a device query instruction, and the target query condition includes identity information of a third service node; The step of extracting query object information corresponding to the target query condition from the blockchain account book according to the target query condition includes: According to the identity information of the third service node, searching the blockchain account book for device registration information corresponding to the third service node; Extracting location information of the third service node from device registration information corresponding to the third service node; The location information of the third service node is determined as the query object information.

9. The method according to claim 4, characterized in that The method further comprises: Receiving an authentication information application instruction sent by the service consumption device; Extracting the identity identifier of the service consumption device and the third service name from the authentication information application instruction; Determining whether to generate identity authentication information corresponding to the service consuming device according to the identity identifier of the service consuming device and the third service name; When it is determined to generate identity authentication information corresponding to the service consuming device, creating a service token corresponding to the service consuming device; The service token corresponding to the service consuming device is sent to the service consuming device as the identity authentication information corresponding to the service consuming device, so that the service consuming device can access the service corresponding to the third service name.

10. The method according to claim 9, characterized in that The determining whether to generate identity authentication information corresponding to the service consuming device according to the identity identifier of the service consuming device and the third service name includes: According to the third service name, determining in the blockchain ledger a target whitelist of subscriptions to a service corresponding to the third service name; determining whether the identity identifier of the service consumption device is in the target whitelist; When it is determined that the identity identifier of the service consumption device is in the target whitelist, determining to generate identity authentication information corresponding to the service consumption device; or, When it is determined that the identity identifier of the service consuming device is not in the target whitelist, it is determined not to generate identity authentication information corresponding to the service consuming device.

11. The method according to claim 10, characterized in that When it is determined not to generate identity authentication information corresponding to the service consumption device, the method further includes: Sending error prompt information to the service consuming device, wherein the error prompt information is used to indicate that the service consuming device cannot access the service corresponding to the third service name.

12. The method according to claim 4, characterized in that The method further comprises: receiving a service calling instruction sent by the service consuming device, wherein the service calling instruction includes the first interface address; The target service is called according to the first interface address and the correspondence between the pre-built communication indication information and the intranet communication information.

13. The method according to claim 8, characterized in that The target edge node includes: A blockchain basic function module, used to provide the target edge node with the function of becoming a blockchain node in the blockchain overall system; An intra-domain device and service discovery module, used to discover the target terminal device newly connected to the target local area network system and at least one service provided by the target terminal device according to a preset device and service discovery protocol; An identity information management module, used to create identity information for the target edge node, the target terminal device, and the service consumption device; A device registration and discovery module, used to register the target service node to the blockchain system based on the smart contract module; A service registration and discovery module, used to register the service provided by the target service node to the blockchain system based on the smart contract module; A service calling module, used for calling a service provided by any service node in the target local area network system for the service consuming device; A data forwarding module, used to obtain service data from the target service node and forward it to the service consumption device; The smart contract module is used to provide an interface for the device registration and discovery module, the service registration and discovery module, and the service call module to interact with the data included in the blockchain ledger.

14. The method according to claim 13, characterized in that The smart contract module includes: The device type management contract submodule is used to provide an interface for managing the device type information of the target service node; The device registration and discovery contract submodule is used to provide an interface for registering and querying device registration information; The service registration and discovery contract submodule is used to provide an interface for registering and querying service registration information.

15. A blockchain system, characterized in that: The blockchain system includes multiple local area network systems, and each blockchain node is deployed as an edge node in a local area network system; The edge node is used to execute the service registration method according to any one of claims 1 to 14.

16. An edge node, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the service registration method according to any one of claims 1 to 14 by executing the computer instructions.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the edge node to execute the service registration method according to any one of claims 1 to 14.

18. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable an edge node to execute the service registration method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Game data processing method, device and system, electronic equipment and storage medium

    CN113181634A

  • Blockchain-based interaction method and system for edge computing service

    US20230040149A1