Routing processing method and device for computing services
By implementing the routing processing method in the computing device, determining the third access path of the computing service based on the application identifier, the problem of the complexity of routing management of different DAPP computing services and the impact of port number changes in the blockchain system is solved, and the computing device association is realized Accurate access and stability of the service.
Patent Information
- Application Number
- CN202211143461.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In blockchain systems, computing services for different distributed applications (DAPPs) need to disclose different domain name addresses or combinations of IP addresses and port numbers, resulting in computing devices or gateways need to maintain a large amount of routing information, and port numbers may change. Impact access stability.
By implementing the routing processing method in the computing device, receiving the access request of the target device, determining the third access path of the computing service based on the application identification in the request, and accurately routing the access request to the corresponding computing service, avoiding the disclosure of a large number of domain names to the outside world A combination of an address or IP address and a port number.
The target device can accurately access the computing services associated with the computing device, without maintaining a large amount of routing information for the computing services of different DAPPs, and the change of the port number of the computing service will not affect the access stability.
Smart Images

Figure CN115529352B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of blockchain technology, and more particularly, to a routing processing method and device for computing services. Background Art
[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time sequence, and cryptography is used to ensure that the data cannot be tampered with or forged. Due to the characteristics of decentralization, information cannot be tampered with, and autonomy, blockchain has also received more and more attention and application. According to different application scenarios and user needs, blockchain can generally be divided into three categories: public blockchain, private blockchain, and consortium blockchain. Summary of the invention
[0003] The embodiments of this specification are intended to provide a method and device for routing processing of computing services.
[0004] In the first aspect, a routing processing method for a computing service is provided, the method being executed by a first computing device, the first computing device being associated with a number of computing services, the number of computing services corresponding to a number of first smart contracts deployed in a blockchain system, a single computing service being used to support a target device invoking a first smart contract corresponding thereto, the mutually corresponding computing services and the first smart contract belonging to the same distributed application. The method comprises: receiving an access request from the target device, the access request comprising a first access path corresponding to a first computing service, the first access path comprising an application identifier of a distributed application to which the first computing service belongs and a second access path for supporting the target device to access the first computing device, the first computing service belonging to the number of computing services; determining a third access path corresponding to the first computing service according to the application identifier; providing the access request to the first computing service according to the third access path corresponding to the first computing service.
[0005] In a possible implementation, the method further includes: obtaining an application identifier of a distributed application to which the computing service belongs, obtaining a first access path corresponding to the computing service based on the second access path and the application identifier corresponding to the computing service, and associating the application identifier corresponding to the computing service with a third access path corresponding to the computing service.
[0006] In a possible implementation, the second access path includes: a domain name address publicly disclosed by the first computing device, and / or an Internet Protocol IP address and a port number corresponding to the domain name address.
[0007] In a possible implementation, the plurality of computing services are run in the first computing device. The third access path corresponding to the computing service includes: a port number assigned by the first computing device to the computing service; or an IP address of a computing node to which the computing service belongs and a port number assigned by the computing node to the computing service.
[0008] In a possible implementation, the blockchain system is a consortium chain, the plurality of computing services are run on multiple computing devices in a cluster to which the first computing device belongs, and the cluster belongs to a single participant of the consortium chain. The third access path corresponding to the computing service includes: the IP address of the computing device running the computing service and the port number allocated to the computing service.
[0009] In a possible implementation, the method further includes: obtaining application information of the first distributed application from the blockchain system, which includes connection information of the second computing device and an application identifier of the first distributed application, and the application information is published to the blockchain system by the second computing device; obtaining an installation package corresponding to the first distributed application from the second computing device according to the connection information, and deploying and running a computing service belonging to the first distributed application based on the installation package corresponding to the first distributed application.
[0010] In the second aspect, a routing processing device for a computing service is provided, the device is deployed in a first computing device, the first computing device is associated with a number of computing services, the several computing services correspond to a number of first smart contracts deployed in a blockchain system, a single computing service is used to support a target device to call a first smart contract corresponding to it, and the mutually corresponding computing services and the first smart contract belong to the same distributed application. The device includes: a request receiving unit, configured to receive an access request from the target device, the access request includes a first access path corresponding to a first computing service, the first access path includes an application identifier of a distributed application to which the first computing service belongs and a second access path for supporting the target device to access the first computing device, the first computing service belongs to the several computing services; a path determination unit, configured to determine a third access path corresponding to the first computing service according to the application identifier; an access processing unit, configured to provide the access request to the first computing service according to the third access path corresponding to the first computing service.
[0011] In a possible implementation, the device also includes: a path configuration unit, configured to obtain an application identifier of a distributed application to which the computing service belongs, obtain a first access path corresponding to the computing service based on the second access path and the application identifier corresponding to the computing service, and associate the application identifier corresponding to the computing service with a third access path corresponding to the computing service.
[0012] In a possible implementation, the second access path includes: a domain name address publicly disclosed by the first computing device, and / or an Internet Protocol IP address and a port number corresponding to the domain name address.
[0013] In a possible implementation, the plurality of computing services are run in the first computing device. The third access path corresponding to the computing service includes: a port number assigned by the first computing device to the computing service; or an IP address of a computing node to which the computing service belongs and a port number assigned by the computing node to the computing service.
[0014] In a possible implementation, the blockchain system is a consortium chain, the plurality of computing services are run on multiple computing devices in a cluster to which the first computing device belongs, and the cluster belongs to a single participant of the consortium chain. The third access path corresponding to the computing service includes: the IP address of the computing device running the computing service and the port number allocated to the computing service.
[0015] In a possible implementation, the device further includes: an information acquisition unit, configured to acquire application information of the first distributed application from the blockchain system, which includes connection information of the second computing device and an application identifier of the first distributed application, and the application information is published to the blockchain system by the second computing device; a service deployment unit, configured to acquire an installation package corresponding to the first distributed application from the second computing device according to the connection information, and deploy and run a computing service belonging to the first distributed application based on the installation package corresponding to the first distributed application.
[0016] In a third aspect, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed in a computing device, the computing device executes the method described in the first aspect above.
[0017] In a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores a computer program / instructions, and when the processor executes the computer program / instructions, the method described in the first aspect is implemented.
[0018] Through the method and apparatus provided in one or more embodiments of the present specification, when a computing device is associated with several computing services belonging to different DAPPs and a target device expects to access a first computing service among them, the access request sent by the target device to the computing device includes a second access path for supporting the target device to accurately access the computing device and an application identifier of the DAPP to which the first computing service belongs, and the second access path can support the access request to be accurately routed to the computing device, and the computing device can determine the third access path corresponding to the first computing service based on the application identifier contained in the access request, and accurately route the access request to the corresponding first computing service according to the determined third access path. In this way, it is not necessary to maintain publicly disclosed domain name addresses or a combination of IP addresses and port numbers corresponding to the domain name addresses for computing services belonging to different DAPPs in the computing device and / or its connected gateway, so as to ensure that the target device can accurately access the computing service associated with the computing device; in addition, since the target device uses the application identifier of the DAPP to which the computing service belongs to access the computing service, it does not directly pay attention to the port number corresponding to the computing service, and even if the port number corresponding to a computing service changes, it will not affect the normal access of the target device to the computing service. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 This is a system architecture diagram of a blockchain system exemplarily provided in the embodiments of this specification;
[0021] Figure 2 is a schematic diagram of the relationship between a computing device and its associated computing services exemplarily provided in an embodiment of this specification;
[0022] Figure 3 It is one of the flow charts of a routing processing method for a computing service provided in an embodiment of this specification;
[0023] Figure 4 This is the second flowchart of a routing processing method for a computing service provided in an embodiment of this specification;
[0024] Figure 5 It is a schematic diagram of a routing processing device for a computing service provided in an embodiment of this specification. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0026] The blockchain system is a distributed network built by multiple nodes. Any two nodes in the blockchain can communicate with each other at the application layer through a peer-to-peer (P2P) network. Figure 1 As shown, the blockchain system may include nodes 1 to 5, and any two nodes among nodes 1 to 5 can realize communication connection at the application layer through the P2P network. The blockchain system uses a decentralized (or multi-centralized) distributed ledger constructed by a chain block structure, which is stored on each node (or most nodes) in the distributed blockchain network. Therefore, the blockchain system needs to solve the problem of consistency and correctness of the ledger data on multiple decentralized (or multi-centralized) nodes. The blockchain program is running on each node of the blockchain system. Under the design of certain fault tolerance requirements, the consensus mechanism is used to ensure that all loyal nodes have the same transactions, thereby ensuring that all loyal nodes have consistent execution results for the same transaction, and multiple transactions arranged in sequence are packaged into blocks and the world state is updated based on the execution results of the multiple transactions. The current mainstream consensus mechanisms include but are not limited to: Proof of Work (POW), Proof of Stake (POS), Practical Byzantine Fault Tolerance (PBFT) algorithm, HoneyBadgerBFT algorithm, etc.
[0027] A transaction in a blockchain system may refer to a task unit executed and recorded in the blockchain system. A transaction generally includes a send field (From), a receive field (To), and a data field (Data). In the case where the transaction is a transfer transaction, the From field indicates the account address that initiates the transaction (i.e., initiates a transfer task to another account), the To field indicates the account address that receives the transaction (i.e., receives the transfer), and the Data field includes the transfer amount. In the case where a transaction calls a smart contract in a blockchain system, the From field indicates the account address that initiates the transaction, the To field indicates the account address of the contract called by the exchange, and the Data field includes the function name in the calling contract, and the incoming parameters of the function, etc., which are used to obtain the code of the function from the blockchain system and execute the code of the function when the transaction is executed.
[0028] Smart contracts in blockchain systems are contracts that can be triggered and executed by transactions. Smart contracts can be defined in the form of code. For example, calling a smart contract in a consortium chain is to initiate a transaction pointing to the smart contract address, so that each node in the consortium chain network can run the smart contract code in a distributed manner. It should be noted that in addition to being able to create smart contracts by users, smart contracts can also be set by the system in the genesis block. This type of contract is generally called a genesis contract. Generally, some blockchain system data structures, parameters, properties and methods can be set in the genesis contract. In addition, accounts with system administrator privileges can create system-level contracts or modify system-level contracts (referred to as system contracts).
[0029] In the scenario of deploying smart contracts, a transaction containing smart contract creation information (i.e., a transaction used to create a smart contract) can be sent to the blockchain system. The from field of the transaction is the account address of the transaction initiator, the data field of the transaction includes the code of the smart contract to be created (such as bytecode or machine code), and the to field of the transaction is empty to indicate that the transaction is used to deploy the contract. After the nodes reach an agreement through the consensus mechanism, the contract address of the contract is determined, the contract account corresponding to the contract address of the smart contract is added to the state database, the state storage corresponding to the contract account is allocated, and the contract code is saved in the state storage of the smart contract.
[0030] In the scenario of calling a contract, a transaction for calling a smart contract can be sent to the blockchain system. The from field of the transaction is the account address of the transaction initiator, the to field is the contract address of the smart contract being called, and the data field of the transaction includes the method and parameters for calling the smart contract. After consensus is reached on the transaction in the blockchain system, each node can execute the transaction separately, thereby executing the smart contract separately, and completing the update of the status database corresponding to the execution of the smart contract.
[0031] It should be noted that contract accounts usually also have some states, which are defined by the state variables in the smart contract and generate new values when the smart contract is created and executed. Among them, the contract account can be used to store the states related to the smart contract. Once an event triggers the terms in the smart contract (meets the execution conditions), the code can be automatically executed. In the blockchain system, the relevant states of the smart contract are stored in the storage trie, and the hash value of the root node of the storage trie is stored in storage_root, so that all states of the contract are locked to the contract account through hash. The storage tree is an MPT tree structure that stores the key-value mapping from the state address to the state value. From the root node to the leaf node of the storage tree, the address of a state variable is stored, and a leaf node stores the value of a state variable.
[0032] Please continue to refer to the above Figure 1 Different nodes in the blockchain system can be responsible for docking with different computing devices, for example, node 1 docks with computing device 10, and node 2 docks with computing device 20. The computing device can perform computational processing on the data and transmit the processed results to the nodes in the blockchain system docked with it in the form of transactions. Different computing devices can establish communication connections through BTN (Blockchain Transmission Network, blockchain high-speed communication network) and the like.
[0033] Distributed applications (DAPP) based on blockchain can be divided into two parts: user interface (UI) and smart contract. The entire UI of DAPP usually needs to be managed by the computing service belonging to the DAPP. Therefore, DAPP based on blockchain essentially includes two parts: smart contract and computing service for managing UI. The aforementioned UI is an interactive page that can be directly presented to users through terminals such as personal computers and mobile phones. The UI of DAPP can be implemented through technologies such as JAVA, REACT, and VUE. Users can access the computing service belonging to DAPP through their terminals, obtain the UI returned by the computing service, and perform corresponding interactive operations based on the UI, so that the terminal held by the user sends a request to the blockchain system to call the transaction of the smart contract belonging to DAPP, thereby completing the corresponding transaction.
[0034] Let's continue with the above Figure 1 , exemplarily describing the process of deploying and running a computing service 1 in a computing device 20, wherein the aforementioned computing service 1 belongs to a distributed application DAPP1 based on blockchain.
[0035] Industry application middleware can be deployed on both computing device 10 and computing device 20. For example, the developer of DAPP1 can log in to the publishing website of DAPP through the industry application middleware on computing device 10 and publish DAPP1; in addition, the developer of DAPP1 can also send transaction Tx1 to the blockchain system to deploy the smart contract C1 belonging to DAPP1 in the blockchain system. For example, the user of DAPP1 can log in to the subscription website of DAPP through the industry application middleware on computing device 20 to subscribe to DAPP1, and then complete the deployment and operation of the computing service 1 for managing the UI in DAPP1 in computing device 20.
[0036] Exemplarily, when a developer releases DAPP1, the application information of DAPP1 can be uploaded to the blockchain system through the computing device 10, for example, by sending a request to the blockchain system to call the transaction Tx2 of the smart contract C2, so as to store the application information of DAPP1 in the contract state of the smart contract C2; in addition, the developer can also store the installation package corresponding to the computing service 1 belonging to DAPP1 on the computing device 10. The application information of DAPP1 may include, but is not limited to, the connection information of the computing device 10 and the application identification of DAPP1, for example, it may also include the authorization information of DAPP1 to the computing device 20, the data structure of the business data associated with DAPP1 and to be uploaded to the chain, the strategy for the circulation of the business data associated with DAPP1, etc.
[0037] Exemplarily, when a user subscribes to DAPP1, the user can obtain the application information of all DAPPs that the computing device 20 can subscribe from the blockchain system through the computing device 20; for example, a transaction Tx3 requesting to call the smart contract C2 is sent to the blockchain system, so that the blockchain system can filter the application information authorized to the computing device 20 from the contract status of the smart contract C2. If the authorization information for the computing device 20 contained in the application information of DAPP1 can indicate that DAPP1 is authorized to the computing device 20, the blockchain system will filter out the application information of DAPP1 from the contract status of the smart contract C2, and return the filtered application information of DAPP1 to the computing device 20. Furthermore, the computing device 20 can communicate with the computing device 10 that publishes DAPP1 based on the connection information of the computing device 10 contained in the application information of DAPP1, so as to obtain the installation package of the computing service 1 belonging to DAPP1, and deploy and run the computing service 1 belonging to DAPP1 in the computing device 20 according to the installation package. It should be noted that the computing service 1 can run directly in the computing device 20, or it can run in a computing node that depends on the computing device 20, such as a virtual machine (VM) or other type of virtual computing node in the computing device 20, so as to securely isolate different computing services.
[0038] A single computing device connected to a node in the blockchain system may be associated with multiple computing services belonging to different DAPPs. In one possible scenario, multiple computing services belonging to different DAPPs may be running in a single computing device; for example, see Figure 2 As shown, in addition to running computing service 1 belonging to DAPP1, computing device 20 may also run computing service 2 belonging to distributed application DAPP2. In another possible scenario, the aforementioned blockchain system is a consortium chain, and the computing device connected to a node in the consortium chain is used as the entrance to cluster P, which belongs to a single participant in the consortium chain, that is, multiple computing devices in cluster P are maintained by one of the multiple participants participating in building the consortium chain, and multiple computing services belonging to different DAPPs are running on multiple computing devices in cluster P; for example, please continue to refer to Figure 2 As shown, node 2 in the blockchain system belongs to participant A of the alliance chain, and the computing device 20 connected to node 2 is used as the entrance to cluster P belonging to participant A. Cluster P also includes computing devices 30 and 40 in addition to computing device 20. Computing service 3 belonging to distributed application DAPP3 runs in computing device 30, and computing service 4 belonging to distributed application DAPP4 runs in computing device 40.
[0039] The computing service usually needs to open an interface or UI that is accessible to the target device through its corresponding access path, so that the target device can access the computing service through a specific access path. The aforementioned access path is, for example, a specific domain name address or a combination of an IP address and a port number corresponding to the domain name address. The aforementioned target device can be, for example, a terminal held by a user or a gateway connected to a computing device. Computing services belonging to different DAPPs usually correspond to different access paths.
[0040] Given that different DAPP computing services correspond to different access paths, different DAPP computing services may need to disclose different domain name addresses or combinations of IP addresses and port numbers corresponding to domain name addresses. As the number of DAPPs increases, a large number of computing services belonging to different DAPPs need to be run in a single computing device or a cluster containing multiple computing devices, which results in the need to maintain a large number of domain name addresses or combinations of IP addresses and port numbers corresponding to domain name addresses for computing services in a single computing device or in a gateway connected to the computing device. In addition, if the port number corresponding to a computing service changes, it may also cause the outside world to be unable to continue to access the computing service normally through the domain name address or combination of IP address and port number corresponding to the computing service that has been disclosed to the outside.
[0041] In the embodiments of this specification, at least one method and device for routing computing services is provided. When a computing device is associated with several computing services belonging to different DAPPs and a target device expects to access a first computing service, the access request sent by the target device to the computing device includes a second access path for supporting the target device to accurately access the computing device and an application identifier of the DAPP to which the first computing service belongs. The second access path can support the access request to be accurately routed to the computing device, and the computing device can determine the third access path corresponding to the first computing service based on the application identifier contained in the access request, and accurately route the access request to the corresponding first computing service according to the determined third access path. In this way, there is no need to maintain publicly disclosed domain name addresses or a combination of IP addresses and port numbers corresponding to the domain name addresses for computing services belonging to different DAPPs in the computing device and / or its connected gateway, so as to ensure that the target device can accurately access the computing service associated with the computing device; in addition, since the target device uses the application identifier of the DAPP to which the computing service belongs to access the computing service, it does not directly pay attention to the port number corresponding to the computing service, and even if the port number corresponding to a computing service changes, it will not affect the target device's normal access to the computing service.
[0042] Figure 3 This is one of the flowcharts of a routing processing method for a computing service provided in an embodiment of this specification. The method is executed by a computing device 20 associated with several computing services. The method exemplarily describes the routing configuration process performed by the computing device 20 on the computing service associated with it and belonging to a certain DAPP. It can be understood that the computing device 20 can perform the corresponding routing configuration process on each computing service associated with it through a similar method. Figure 3 The routing configuration process of the computing device 20 for a single computing service may include but is not limited to the following steps 31 to 33.
[0043] Step 31, obtain the application identifier of the DAPP to which the computing service belongs.
[0044] The computing device 20 may, for example, obtain the application identifier of the DAPP to which the computing service belongs from the application information of the DAPP to which the computing service belongs. The manner in which the computing device 20 obtains the application information of the DAPP may be referred to as described above and will not be repeated here.
[0045] Step 33, based on the second access path used to support the target device to access the computing device 20 and the application identifier of the DAPP to which the computing service belongs, obtain the first access path used to support the target device to access the computing service, and associate the application identifier of the DAPP to which the computing service belongs with the third access path used to support the computing device 20 to access the computing service.
[0046] The second access path may be, for example, a domain name address publicly disclosed by the computing device 20, or a combination of an IP address and a port number corresponding to the domain name address. In the first access path corresponding to the computing service, the application identifier of the DAPP to which the computing service belongs may be used as a subpath of the second access path for supporting the target device to access the computing device 20. Exemplarily, the domain name address publicly disclosed by the computing device 20 is recorded as Unique domain, and its corresponding combination of IP address and port number is recorded as "192.168.xx:8080", and the application identifier of DAPP1 to which the exemplary computing service 1 belongs is recorded as dapp1, then the first access path corresponding to the computing service 1 may be, for example, "Unique domain / dapp1", or may be "192.168.xx:8080 / dapp1".
[0047] The first access path corresponding to the computing service can be distributed by the computing device 20 or distributed through other means, so that the first access path corresponding to the computing service can be applied to various specific business scenarios. For example, for the page marked as index in DAPP1, Hyper Text Markup Language (HTML) can be supported, and some interface services (interface services), web user interfaces (Website User Interface, WebUI) or gateways (Gateway) connected to the computing device 20 may contain access paths such as "Unique domain / dapp1 / index.html" generated based on the first access path "Unique domain / dapp1" corresponding to the computing service 1. The aforementioned interface service, WebUI and Gateway may all initiate access requests containing the access path "Unique domain / dapp1 / index.html".
[0048] Referring to the foregoing, there may be multiple situations for the computing service associated with the computing device 20, for example, the computing service may be directly run in the computing device 20, or the computing service may be run in a computing node that depends on the computing device 20, or the computing service may be run in other computing devices in the cluster to which the computing device 20 belongs. Assuming that the computing service 1 associated with the computing device 20 is directly run in the computing device 20, the third access path corresponding to the computing service 1 may be the port number assigned by the computing device 20 to the computing service 1. Assuming that the computing service 2 associated with the computing device 20 is run in a virtual computing node that depends on the computing device 20, the third access path corresponding to the computing service 2 may be the IP address corresponding to the virtual computing node and the port number assigned by the virtual computing node to the computing service 2. Assuming that the computing service 3 associated with the computing device 20 is run in the computing device 30, the third access path corresponding to the computing service 3 may be the IP address of the computing device 30 and the port number assigned by the computing service 3. Assuming that the computing service 4 associated with the computing device 20 runs in the computing device 40 , the third access path corresponding to the computing service 4 may be the IP address of the computing device 40 and the port number allocated to the computing service 4 .
[0049] Through the aforementioned Figure 3 After the method shown completes the routing configuration for each computing service associated with the computing device 20, the computing device 20 can support the target device to accurately access each computing service associated with it, for example, support the target device to accurately access its associated computing service 1, computing service 2, computing service 3 and computing service 4.
[0050] Figure 4 This is a flowchart of a second method for routing a computing service provided in an embodiment of this specification. The method is executed by a computing device 20 associated with a plurality of computing services belonging to different DAPPs. The method exemplarily describes a process in which the computing device 20 supports a target device to access a first computing service belonging to a certain DAPP. Figure 4 The process in which the computing device 20 supports the target device to access the first computing service belonging to a certain DAPP may include but is not limited to the following steps 41 to 43.
[0051] Step 41, receiving an access request from a target device, wherein the access request includes a first access path corresponding to a first computing service, the first access path includes an application identifier of a DAPP to which the first computing service belongs and a second access path for supporting the target device to access the computing device 20, and the first computing service belongs to several computing services associated with the computing device 20.
[0052] The target device is, for example, a terminal held by a user. The user can trigger the terminal to issue the aforementioned access request through some interface services or WebUIs running on the terminal. For example, the interface service or WebUI can have an access path "Unique domain / dapp1 / index.html" corresponding to the page index belonging to DAPP1 built in, so that the user can trigger the interface service or WebUI running on the terminal to issue a request containing the access path "Unique domain / dapp1 / index.html".
[0053] The target device may also be a gateway to which the computing device 20 is connected. The gateway may perform specific processing on a certain access request received by it to obtain an access request to be sent to the computing device 20.
[0054] Since the access request includes a second access path for supporting the target device to access the computing device 20, such as the domain name address Unique domain publicly disclosed by the computing device 20 or the IP address and port number corresponding to the domain name address, the access request can be accurately routed to the computing device 20.
[0055] Step 43: Determine a third access path corresponding to the first computing service according to the application identifier of the DAPP in the access request.
[0056] Step 45: Provide an access request to the first computing service according to the third access path corresponding to the first computing service.
[0057] For the computing service 1 in the above example, since it runs directly in the computing device 20, the third access path corresponding to the computing service 1 is the port number assigned to the computing service 1 by the computing device 20. In step 45, the access request obtained in step 41 can be provided to the process corresponding to the port number assigned to the computing service 1, thereby completing the provision of the access request to the computing service 1.
[0058] For the computing service 2 in the above example, since it runs in a virtual computing node that relies on the computing device 20, the third access path corresponding to the computing service 2 is the IP address of the virtual computing node and the port number allocated to the computing service 2. In step 45, the access request obtained in step 41 can be sent to the computing service 2 running in the virtual computing node based on the IP address of the virtual computing node and the port number allocated to the computing service 3.
[0059] For the computing service 3 in the above example, since it runs in the computing device 30 connected to the computing device 20, the third access path corresponding to the computing service 3 is the IP address of the computing device 30 and the port number assigned to the computing service 3. In step 45, the access request obtained in step 41 can be sent to the computing service 3 running in the computing device 30 based on the IP address of the computing device 30 and the port number assigned to the computing service 3. In addition, the process of the computing device 20 providing the access request to the computing service 4 is similar to the process of the computing device 20 providing the access request to the computing service 3, which will not be repeated.
[0060] Based on the same concept as the aforementioned method embodiment, the embodiment of this specification also provides a routing processing device for computing services, which is deployed in a first computing device. The first computing device is associated with a number of computing services, which correspond to a number of first smart contracts deployed in the blockchain system. A single computing service is used to support the target device to call the first smart contract corresponding to it. The corresponding computing services and the first smart contracts belong to the same distributed application. Figure 5 As shown, the apparatus includes: a request receiving unit 501, configured to receive an access request from the target device, the access request including a first access path corresponding to a first computing service, the first access path including an application identifier of a distributed application to which the first computing service belongs and a second access path for supporting the target device to access the first computing device, the first computing service belonging to the several computing services; a path determination unit 502, configured to determine a third access path corresponding to the first computing service according to the application identifier; an access processing unit 503, configured to provide the access request to the first computing service according to the third access path corresponding to the first computing service.
[0061] In a possible implementation, the device also includes: a path configuration unit 504, configured to obtain an application identifier of a distributed application to which the computing service belongs, obtain a first access path corresponding to the computing service based on the second access path and the application identifier corresponding to the computing service, and associate the application identifier corresponding to the computing service with a third access path corresponding to the computing service.
[0062] In a possible implementation, the second access path includes: a domain name address publicly disclosed by the first computing device, and / or an Internet Protocol IP address and a port number corresponding to the domain name address.
[0063] In a possible implementation, the plurality of computing services are run in the first computing device; and the third access path corresponding to the computing service includes: a port number assigned by the first computing device to the computing service; or an IP address of a virtual computing node to which the computing service belongs and a port number assigned by the virtual computing node to the computing service.
[0064] In a possible implementation, the device also includes: an information acquisition unit 505, configured to obtain application information of the first distributed application from the blockchain system, which includes connection information of the second computing device and an application identifier of the first distributed application, and the application information is published to the blockchain system by the second computing device; a service deployment unit 506, configured to obtain an installation package corresponding to the first distributed application from the second computing device according to the connection information, and deploy and run a computing service belonging to the first distributed application based on the installation package corresponding to the first distributed application.
[0065] In one possible implementation, the application information is located in the contract state of the second smart contract, and the application information also includes authorization information of the first distributed application authorizing the first computing device; wherein the information acquisition unit 505 is specifically configured to send a target transaction for calling the second smart contract to the blockchain system, so that the blockchain system filters the application information authorized to the first computing device from the contract state of the second smart contract, and returns the filtered application information.
[0066] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0067] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0068] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0069] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0070] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0071] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0074] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0075] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0077] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0079] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0080] The above description is only an example of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. For those skilled in the art, one or more embodiments of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims.
Claims
1. A routing processing method for a computing service, the method being executed by a first computing device, the first computing device being associated with a plurality of computing services, the plurality of computing services being run on a plurality of computing devices in a cluster to which the first computing device belongs, the plurality of computing services corresponding to a plurality of first smart contracts deployed in a blockchain system, a single computing service being used to support a target device invoking a first smart contract corresponding thereto, the mutually corresponding computing services and the first smart contract belonging to the same distributed application, the method comprising: receiving an access request from the target device, the access request including a first access path corresponding to a first computing service, the first access path including an application identifier of a distributed application to which the first computing service belongs and a second access path for supporting the target device to access the first computing device, the first computing service belonging to the multiple computing services; Determine, according to the application identifier, a third access path corresponding to the first computing service, the third access path comprising an Internet Protocol address and / or a port number allocated to the first computing service by a computing device running the first computing service; The access request is provided to the first computing service according to a third access path corresponding to the first computing service.
2. The method according to claim 1, further comprising: Obtain an application identifier of a distributed application to which the computing service belongs, obtain a first access path corresponding to the computing service according to the second access path and the application identifier corresponding to the computing service, and associate the application identifier corresponding to the computing service with a third access path corresponding to the computing service.
3. The method according to claim 1, wherein the second access path comprises: The domain name address publicly disclosed by the first computing device, and / or the Internet Protocol IP address and port number corresponding to the domain name address.
4. The method according to claim 1, wherein the plurality of computing services are run in the first computing device; The third access path corresponding to the computing service includes: a port number assigned by the first computing device to the computing service; Alternatively, the IP address of the computing node to which the computing service belongs and the port number allocated by the computing node to the computing service.
5. According to the method of claim 1, the blockchain system is a consortium chain, the multiple computing services are run on multiple computing devices in a cluster to which the first computing device belongs, and the cluster belongs to a single participant of the consortium chain; The third access path corresponding to the computing service includes: The IP address of the computing device running the computing service and the port number allocated by the computing device for the computing service.
6. The method according to any one of claims 1 to 5, further comprising: Acquire application information of a first distributed application from the blockchain system, which includes connection information of a second computing device and an application identifier of the first distributed application, wherein the application information is published to the blockchain system by the second computing device; The installation package corresponding to the first distributed application is obtained from the second computing device according to the connection information, and the computing service belonging to the first distributed application is deployed and run based on the installation package corresponding to the first distributed application.
7. A routing processing device for a computing service, the device is deployed in a first computing device, the first computing device is associated with multiple computing services, the multiple computing services are run on multiple computing devices in a cluster to which the first computing device belongs, the multiple computing services correspond to several first smart contracts deployed in a blockchain system, a single computing service is used to support a target device to call a first smart contract corresponding to it, the corresponding computing services and the first smart contract belong to the same distributed application, the device comprises: a request receiving unit configured to receive an access request from the target device, the access request comprising a first access path corresponding to a first computing service, the first access path comprising an application identifier of a distributed application to which the first computing service belongs and a second access path for supporting the target device to access the first computing device, the first computing service belonging to the plurality of computing services; a path determination unit, configured to determine a third access path corresponding to the first computing service according to the application identifier, wherein the third access path includes an Internet Protocol address and / or a port number allocated to the first computing service by a computing device running the first computing service; The access processing unit is configured to provide the access request to the first computing service according to a third access path corresponding to the first computing service.
8. The device according to claim 7, further comprising: The path configuration unit is configured to obtain an application identifier of the distributed application to which the computing service belongs, obtain a first access path corresponding to the computing service according to the second access path and the application identifier corresponding to the computing service, and associate the application identifier corresponding to the computing service with a third access path corresponding to the computing service.
9. The apparatus according to claim 7, wherein the second access path comprises: The domain name address publicly disclosed by the first computing device, and / or the Internet Protocol IP address and port number corresponding to the domain name address.
10. The apparatus according to claim 7, wherein the plurality of computing services are run in the first computing device; The third access path corresponding to the computing service includes: a port number assigned by the first computing device to the computing service; Alternatively, the IP address of the computing node to which the computing service belongs and the port number allocated by the computing node to the computing service.
11. The apparatus according to claim 7, wherein the blockchain system is a consortium chain, the plurality of computing services are run on a plurality of computing devices in a cluster to which the first computing device belongs, and the cluster belongs to a single participant of the consortium chain; The third access path corresponding to the computing service includes: The IP address of the computing device running the computing service and the port number allocated by the computing device for the computing service.
12. The device according to any one of claims 7 to 11, further comprising: an information acquisition unit, configured to acquire application information of a first distributed application from the blockchain system, the application information including connection information of a second computing device and an application identifier of the first distributed application, the application information being published to the blockchain system by the second computing device; The service deployment unit is configured to obtain an installation package corresponding to the first distributed application from the second computing device according to the connection information, and deploy and run a computing service belonging to the first distributed application based on the installation package corresponding to the first distributed application.
13. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed in a computing device, the computing device executes the method according to any one of claims 1 to 6.
14. A computing device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Blockchain router and blockchain network
CN112583712A
Sub-application access method and system, block chain platform, gateway and storage medium
CN114401320A
