Data transmission method, blockchain node device and medium

By introducing a business logic layer into the blockchain node device to process data requests, the problem of storing different programs on multiple interfaces is solved, reducing the amount of code and improving development efficiency.

CN111339141BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010119722.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-25
Publication Date
2024-10-15
Estimated Expiration
2040-02-25

AI Technical Summary

Technical Problem

In blockchain node equipment, multiple interfaces store different programs, resulting in a large amount of code and low development efficiency. How to reduce the amount of code and improve development efficiency has become a research hotspot.

Method used

By introducing a business logic layer into the blockchain node device, it receives data requests sent by the interface, determines business rules, processes and accesses the resource pool, reduces the amount of code in the interface, and improves development efficiency.

Benefits of technology

Data requests are processed through the business logic layer, which reduces the amount of code stored in the interface and improves the convenience of data access and development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111339141B_ABST
    Figure CN111339141B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method for data transmission, a blockchain node device, and a medium. The data transmission method may include: receiving a data request sent by any one of at least one interface through a business logic layer; determining the business rules corresponding to the data request through the business logic layer; processing the data request based on the business rules through the business logic layer to obtain a processing result; and accessing a resource pool based on the processing result through the business logic layer. By adopting the embodiment of the present application, data conversion is performed through an interface, and a series of processing is performed on the data request through the business logic layer, which can reduce the amount of code of the interface and improve development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, a blockchain node device, and a medium. Background Art

[0002] In blockchain technology, the resource pool can be directly accessed through the interface of the blockchain node device. Among them, the interface contains a complete set of programs, and different programs implement different functions. For example, the function of one interface is to query the blocks in the blockchain, so the interface contains the program for querying the blocks, and the function of another interface is to query the consensus cycle of the blockchain, so the interface contains the program for querying the consensus cycle. Each interface contains a set of programs, resulting in a large amount of code and low development efficiency. Therefore, how to process data according to the interface of the blockchain node device, reduce the amount of code, and improve development efficiency has become a hot topic in current research. Summary of the invention

[0003] The embodiments of the present application provide a data transmission method, a blockchain node device, and a medium, which can reduce the amount of code and improve development efficiency.

[0004] In a first aspect, an embodiment of the present application provides a method for data transmission, the method comprising: receiving a data request sent by any one of at least one interface through a business logic layer; determining a business rule corresponding to the data request through the business logic layer; processing the data request based on the business rule through the business logic layer to obtain a processing result; and accessing a resource pool based on the processing result through the business logic layer.

[0005] In a second aspect, an embodiment of the present application provides a blockchain node device, which includes a business logic layer, a resource pool, at least one interface, a memory, and a processor. The memory is used to store a computer program. The processor is used to call the computer program to execute the data transmission method described in the first aspect.

[0006] In a third aspect, an embodiment of the present application provides a blockchain node device, which is configured with a business logic layer, a resource pool, and at least one interface. The device has the function of implementing the data transmission described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0007] In one implementation, the blockchain node device includes a receiving module, a determining module, a processing module, and an access module. The receiving module is used to receive a data request sent by any one of the at least one interfaces through the business logic layer. The determining module is used to determine the business rules corresponding to the data request through the business logic layer. The processing module is used to process the data request based on the business rules through the business logic layer to obtain a processing result. The access module is used to access the resource pool based on the processing result through the business logic layer.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, which, when executed by a processor, are used to enable the processor to perform the function of data transmission as described in the first aspect.

[0009] Through the embodiment of the present application, the interface of the blockchain node device sends the data request to the business logic layer, and the business logic layer processes the data request according to the business rules, which can reduce the amount of interface code. The business logic layer accesses the resource pool according to the processing results, making the data access process more convenient and improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application will be described below.

[0011] Figure 1 It is a schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application;

[0012] Figure 2 It is a structural schematic diagram of a blockchain node device provided in an embodiment of the present application;

[0013] Figure 3 It is a flowchart of a data transmission method provided by an embodiment of the present application;

[0014] Figure 4 This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;

[0015] Figure 5 is a flowchart of another data transmission method provided by an embodiment of the present application;

[0016] Figure 6 It is a structural schematic diagram of a blockchain node device provided in an embodiment of the present application;

[0017] Figure 7 It is a structural schematic diagram of another blockchain node device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.

[0019] With the rapid development of Internet technology, in order to achieve fairness in transactions, various industries and fields have gradually formed a transaction system supervised by a third-party management agency or hardware facilities. However, there may be problems with the credibility of the third-party management agency. For example, when the third-party management agency favors one party in the transaction, it will lead to an unfair transaction process. Therefore, Blockchain (BC) technology has become a hot topic of research due to its advantages of decentralization, distributed ledger storage, and high fairness.

[0020] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0021] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational detection. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status detection, node equipment health status detection, etc.

[0022] The blockchain network includes at least one blockchain node device, which can be any form of computer device connected to the blockchain network, such as a server, a user terminal, etc. Each blockchain node device can receive input information when performing normal work, and maintain the shared data of the blockchain network based on the received input information. In order to ensure the information exchange between blockchain node devices, there can be an information connection between each blockchain node device in the blockchain network, and information can be transmitted between blockchain node devices through the above information connection. For example, when any blockchain node device in the blockchain network receives input information, other blockchain node devices in the blockchain network obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all blockchain node devices in the blockchain network are consistent.

[0023] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of a data transmission system provided by an embodiment of the present application. Among them, the blockchain network is composed of multiple blockchain node devices that can communicate with each other, such as a blockchain network composed of blockchain node devices 101, blockchain node devices 102, blockchain node devices 103 and blockchain node devices 104. Each blockchain node device stores an identical blockchain, and each blockchain consists of multiple blocks. Each block includes a hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block, and each block is connected to form a blockchain through a hash value. The block also includes information such as the timestamp when the block is generated. The blocks in the blockchain are connected together in the order of the block generation time. For example, blockchain 105 is composed of blocks 1, block 2, block 3, block 4, block 5 and block 6, etc., which are connected to each other in the order of the time when the blocks are generated. For example, the time of generating block 2 is after the time of generating block 1, so block 2 includes the hash value of block 1, and block 2 is connected after block 1.

[0024] Currently, users obtain data stored in the blockchain network by directly accessing the resource pool through interfaces. Therefore, different interfaces store different programs for performing different functions. For example, the function of interface A is to access the target block in the blockchain, so interface A stores the block height of the target block. For another example, the function of interface B is to transmit the target data, so interface B stores the relevant programs for transmitting the target data. Among them, interface A and interface B are different interfaces.

[0025] In order to increase the utilization rate of interfaces and improve development efficiency, the present application provides a method for data transmission, which can be applied to blockchain node devices. Wherein, the blockchain node device is configured with a business logic layer, a resource pool and at least one interface, and the data transmission method may include: receiving a data request sent by any one of the at least one interfaces through the business logic layer; determining the business rules corresponding to the data request through the business logic layer; processing the data request based on the business rules through the business logic layer to obtain a processing result; and accessing the resource pool based on the processing result through the business logic layer.

[0026] See also Figure 2 , Figure 2 It is a structural diagram of a blockchain node device provided by an embodiment of the present application. Among them, the blockchain node device is configured with a business logic layer, a resource pool and at least one interface. The interface is used for data type conversion. For example, the interface can convert the acquired integer type data into floating point type data. The resource pool is used to store the data written into the blockchain. For example, the time of the transaction, the content of the transaction, and the information of the two parties to the transaction, etc. The business logic layer is used to process data requests and access the resource pool, wherein the business logic layer is integrated with the function of executing the data transmission method provided by the present application. Specifically, the interface can send a data request to the business logic layer, and after the business logic layer executes the data processing provided by the present application, it obtains the processing result, and the business logic layer accesses the resource pool based on the processing result.

[0027] It can be seen that the embodiment of the present application adds a business logic layer in the blockchain node device, and integrates the relevant programs of the data transmission method provided by the present application in the business logic layer. Accordingly, the interface is used to convert the data type of the data. Compared with each interface storing programs that perform different data processing functions, the amount of code in the interface can be reduced and the development efficiency can be improved.

[0028] based on Figure 2 The schematic diagram of the blockchain node device is shown in Figure 1. Figure 3 , Figure 3 This is a flow chart of a data transmission method provided in an embodiment of the present application. The data transmission method may include but is not limited to the following steps:

[0029] Step S301: receiving a data request sent by any one of at least one interface through the business logic layer.

[0030] Among them, the data request is used to request specific data from the resource pool, or to request functions such as processing of the transmitted data. Due to the different purposes of data requests, the information carried by the data requests is different. For example, the data request is used to query the target block in the target blockchain based on the block height, then the information carried by the data request is the block height of the target block.

[0031] Specifically, the blockchain node device is configured with at least one interface, wherein any interface can execute the action of sending a data request to the business logic layer. Accordingly, after the business logic layer receives the data request, the business logic layer can process the data request and return the data requested by the data request to the interface corresponding to the data request, thereby completing the data transmission process.

[0032] There are multiple ways for the interface to obtain data requests. Optionally, the interface can receive an acquisition request sent by the user side, and the interface generates a data request according to the acquisition request. For example, the acquisition request is to determine the information of the target block in the target blockchain according to the height of the target block. Optionally, the interface can generate a data request when detecting a user operation. For example, the interface can detect a user's click operation on the display screen and generate a corresponding data request according to the click operation.

[0033] In one implementation, the interface can perform data conversion processing on the acquired acquisition request and generate a data request based on the acquisition request. For example, the acquisition request acquired by the interface includes information A and the data format of information A. It can be understood that the data format of information A received by the interface is not always a data format that meets the requirements of channel transmission or business logic layer. Therefore, after the interface receives the data format of information A, it can convert the data type of the data format of information A to facilitate subsequent processing of information A. For example, the data format of information A received by the interface is low byte. If the data processed by the business logic layer is high byte, the interface can convert the data format of information A to the data format of the high byte corresponding to information A to facilitate subsequent processing by the business logic layer.

[0034] It can be seen that the interface's function of converting data formats reduces the amount of code stored in the interface compared to the interface's function of performing data processing.

[0035] Step S302: Determine the business rules corresponding to the data request through the business logic layer.

[0036] Business rules are created, updated and debugged by business personnel. Business rules can be understood as business processes or the processing logic of data items. For example, the business rule defines the generation method of indicators as follows: indicator A is obtained by adding indicator B and indicator C.

[0037] Specifically, in addition to the data format of the data, the data request may also include the logical requirements of the data request. For example, the logical requirement is to query the information of the target block in the target blockchain, etc. Therefore, the business logic layer can determine the business rule corresponding to the data request based on the data request, which is to query the information of the target block in the target blockchain.

[0038] Step S303: The business logic layer processes the data request based on business rules to obtain a processing result.

[0039] In one implementation, the data request may indicate the information of the target block to be queried, and the data request includes the height of the target block. The height of the block is the number of blocks on the blockchain. Therefore, the process of processing the data request based on the business rules by the business logic layer and obtaining the processing result can be understood as: determining the identity of the target block based on the height of the target block by the business logic layer, and the above processing result is the identity of the target block.

[0040] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a blockchain provided by this application. Figure 4 As shown, the blockchain consists of 466 blocks, wherein the genesis block 401 includes a block header and a block body, wherein the block header stores input information characteristic values, version numbers, timestamps, and difficulty values, etc., and the block body stores input information. The next block of the genesis block 401 takes the genesis block 401 as the parent block, and the next block also includes a block header and a block body, wherein the block header stores the input information characteristic values ​​of the current block, the block header characteristic values ​​of the parent block, version numbers, timestamps, and difficulty values, and so on, so that the block data stored in each block in the blockchain are associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block. Among them, the height of the genesis block 401 is 0, and the block height of the next block of the genesis block is 1, and so on, each block has a corresponding block height. Therefore, the corresponding block and block identifier can be queried according to the block height.

[0041] In another implementation, the data request may indicate information for querying the target transaction data, and the data request includes a hash of the target transaction data. Therefore, the process of processing the data request based on the business rules by the business logic layer and obtaining the processing result can be understood as: determining the address information of the target transaction data based on the hash by the business logic layer, and the above processing result is the address information of the target transaction data. Specifically, when the blockchain node device processes the target transaction data, a hash is generated, and the hash is associated with the target transaction data. Therefore, the address information of the target transaction data can be determined based on the hash, and further information such as the time when the target transaction data occurred, the transaction status, etc. can be obtained.

[0042] For example, the first blockchain node device and the second blockchain node device belong to the same blockchain network. The first blockchain node device obtains the address information of the target transaction data according to the hash of the target transaction data, and the address information points to the second blockchain node device. Then the first blockchain node device can obtain the information of the target transaction data from the second blockchain node device.

[0043] Step S304: Access the resource pool based on the processing result through the business logic layer.

[0044] The resource pool is used to perform operations such as data storage and query. The resource pool stores at least one data resource. When there is a data request, the resource pool can allocate the corresponding data resource according to the data request and give the data resource a busy flag to indicate that the data resource is occupied. When the data resource is used up, the resource pool clears the busy flag of the data resource to indicate that the data resource can be used in the next request.

[0045] In one implementation, the data request indicates querying the information of the target block, and the data request includes the height of the target block, and the processing result is the identifier of the target block. Accordingly, the method of accessing the resource pool based on the processing result through the business logic layer may include: accessing the target block indicated by the identifier of the target block in the resource pool through the business logic layer to obtain the information of the target block.

[0046] In another implementation, the data request indicates querying information of the target transaction data, and the data request includes a hash of the target transaction data, and the processing result is the address information of the target transaction data. Accordingly, the method of accessing the resource pool based on the processing result through the business logic layer may include: accessing the resource pool based on the address information of the target transaction data through the business logic layer to obtain the information of the target transaction data.

[0047] It can be seen that the interface in the data transmission method provided in the embodiment of the present application is used to perform data conversion, and the business logic layer is responsible for processing data requests. Compared with storing a complete set of data processing programs in the interface, the amount of interface code is greatly reduced and development efficiency is improved.

[0048] See also Figure 5 , Figure 5 : is a flow chart of another data transmission method provided by an embodiment of the present application, the method includes but is not limited to the following steps:

[0049] Step S501: receiving a data request sent by an interface through the business logic layer.

[0050] Step S502: verify the data request through the business logic layer.

[0051] It is understandable that the data request sent by the interface to the business logic layer may include various data formats, while the data format of the data request processed by the business logic layer is certain. In other words, the business logic layer will only execute the subsequent related steps if the data format included in the data request meets the requirements of the business logic layer. Therefore, the business logic layer will verify the data request and execute the subsequent steps if the verification is successful. For example, the business logic layer only processes data requests in format A. If the format of the data request sent by the interface is B, the business logic layer cannot process data requests in format B.

[0052] In one implementation, the business logic layer can verify the data request by comparing the data type of the data request with the data type corresponding to the interface stored in the business logic layer; if the data type of the data request is the same as the data type corresponding to the interface stored in the business logic layer, the business logic layer determines that the data request verification is successful. For example, if the data type of the data request sent by the interface is an integer, and the data type corresponding to the interface stored in the business logic layer is a string, then it can be determined that the data type of the data request sent by the interface is different from the data type corresponding to the interface stored in the business logic layer, and the business logic layer determines that the data request verification has failed.

[0053] In another implementation, the business logic layer may verify the data request by: determining through the business logic layer whether the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device; if the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device, then determining through the business logic layer that the data request is verified successfully. For example, if the business domain corresponding to the blockchain node device is the education domain, and if the business domain of the data requested by the data request is the financial domain, then the business logic layer may determine that the data request verification has failed.

[0054] Step S503: Determine the business rules corresponding to the data request through the business logic layer.

[0055] Step S504: The business logic layer processes the data request based on business rules to obtain a processing result.

[0056] Step S505: Access the resource pool based on the processing result through the business logic layer.

[0057] It should be noted that the implementation process of step 501 is similar to that of step S301 , and the implementation process of steps S503 to S505 is similar to that of steps S202 to S204 , which will not be elaborated in detail in the embodiments of the present application.

[0058] It can be seen that through the embodiment of the present application, the business logic layer verifies the data request before determining the business rules based on the data request, and performs subsequent operations if the verification is successful, which can ensure that the data request processed by the blockchain node device is a data request allowed by the blockchain node device, thereby improving data transmission efficiency. The business logic layer integrates data processing programs, which reduces the amount of code and improves development efficiency compared to programs with different functions stored separately in each interface.

[0059] See also Figure 6 , Figure 6 : is a schematic diagram of a blockchain node device provided in an embodiment of the present application, wherein the blockchain node device 60 is used to execute Figure 3 , Figure 5 In the steps performed by the blockchain node device in the corresponding method embodiment, the blockchain node device 60 may include a receiving module 601, a determining module 602, a processing module 603 and an access module 604. Each module in the blockchain node device 60 is specifically used for:

[0060] A receiving module 601 is used to receive a data request sent by any interface of at least one interface through a business logic layer;

[0061] A determination module 602 is used to determine the business rules corresponding to the data request through the business logic layer;

[0062] The processing module 603 is used to process the data request based on the business rules through the business logic layer to obtain a processing result;

[0063] The access module 604 is used to access the resource pool based on the processing result through the business logic layer.

[0064] In one implementation, before the determination module 602 determines the business rule corresponding to the data request through the business logic layer, it is also used to:

[0065] Verify data requests through the business logic layer;

[0066] If the verification is successful, the step of determining the business rules corresponding to the data request through the business logic layer is triggered.

[0067] In one implementation, the determination module 602 verifies the data request through the business logic layer, specifically for:

[0068] The business logic layer compares the data type of the data request with the data type corresponding to the interface stored in the business logic layer;

[0069] If the data type of the data request is the same as the data type corresponding to the interface stored in the business logic layer, the business logic layer determines that the data request is successfully verified.

[0070] In one implementation, the determination module 602 verifies the data request through the business logic layer, specifically for:

[0071] Determine through the business logic layer whether the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device;

[0072] If the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device, the business logic layer determines that the data request is successfully verified.

[0073] In one implementation, the data request is used to indicate information of a query target block, and the data request includes a height of the target block;

[0074] The processing module 603 processes the data request based on the business rules through the business logic layer to obtain a processing result, which is specifically used for:

[0075] Determine the identity of the target block based on the height of the target block through the business logic layer;

[0076] The access module 604 accesses the resource pool based on the processing result through the business logic layer, and is specifically used for:

[0077] The target block indicated by the identifier of the target block in the resource pool is accessed through the business logic layer to obtain information of the target block.

[0078] In one implementation, the data request is used to indicate information for querying target transaction data, and the data request includes a hash of the target transaction data;

[0079] The processing module 603 processes the data request based on the business rules through the business logic layer to obtain a processing result, which is specifically used for:

[0080] Determine the address information of the target transaction data based on hash through the business logic layer;

[0081] The access module 604 accesses the resource pool based on the processing result through the business logic layer, and is specifically used for:

[0082] The business logic layer accesses the resource pool based on the address information of the target transaction data to obtain the information of the target transaction data.

[0083] It should be noted that Figure 6 The contents not mentioned in the corresponding embodiments and the specific implementation methods of the execution steps of each module can be found in Figure 3 , Figure 5 The illustrated embodiments and the aforementioned contents will not be described in detail here.

[0084] See also Figure 7 , Figure 770 is a schematic diagram of the structure of another blockchain node device provided in an embodiment of the present application. The blockchain node device 70 includes a processor 701, a business logic layer 702, a resource pool 703, an interface 704 and a memory 705, wherein the processor 701, the business logic layer 702, the resource pool 703, the interface 704 and the memory 705 are connected via one or more communication buses.

[0085] Processor 701 is configured to support blockchain node devices to execute Figure 3 , Figure 5 The corresponding functions of the blockchain node device in the method. The processor 701 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof.

[0086] The memory 705 is used to store program codes, etc. The memory 705 may include a volatile memory (volatile memory), for example, a random access memory (Random Access Memory, RAM); the memory 705 may also include a non-volatile memory (non-volatile memory), for example, a read-only memory (Read Only Memory, ROM), a flash memory (flash memory), a hard disk (Hard Disk Drive, HDD) or a solid state drive (Solid State Drive, SSD); the memory 705 may also include a combination of the above-mentioned types of memory.

[0087] The interface can convert the obtained small type data into large type data.

[0088] The resource pool is used to store data written to the blockchain.

[0089] The business logic layer is used to process data requests and access resource pools.

[0090] In an embodiment of the present application, the blockchain node device 70 includes multiple interfaces, wherein the interface for sending data and the interface for receiving data may not be the same interface.

[0091] The processor 701 may call the program code stored in the memory 705 to perform the following operations:

[0092] Receiving a data request sent by any interface 704 of at least one interface through the business logic layer 702;

[0093] Determine the business rules corresponding to the data request through the business logic layer 702;

[0094] The business logic layer 702 processes the data request based on business rules to obtain a processing result;

[0095] The resource pool is accessed based on the processing result through the business logic layer 702.

[0096] In one implementation, before the processor 701 determines the business rule corresponding to the data request through the business logic layer 702, it is further configured to:

[0097] Verify the data request through the business logic layer 702;

[0098] If the verification is successful, the step of determining the business rules corresponding to the data request through the business logic layer 702 is triggered.

[0099] In one implementation, the processor 701 verifies the data request through the business logic layer 702, specifically for:

[0100] Compare the data type of the data request with the data type corresponding to the interface stored in the business logic layer 702 through the business logic layer 702;

[0101] If the data type of the data request is the same as the data type corresponding to the interface 703 stored in the business logic layer 702 , the business logic layer 702 determines that the verification of the data request is successful.

[0102] In one implementation, the processor 701 verifies the data request through the business logic layer, specifically for:

[0103] Determine, through the business logic layer 702, whether the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device;

[0104] If the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device, the business logic layer 702 determines that the data request is successfully verified.

[0105] In one implementation, the data request is used to indicate information of a query target block, and the data request includes a height of the target block;

[0106] The processor 701 processes the data request based on the business rules through the business logic layer 702 to obtain a processing result, which is specifically used for:

[0107] Determine the identifier of the target block based on the height of the target block through the business logic layer 702;

[0108] The processor 701 accesses the resource pool 703 based on the processing result through the business logic layer 702, specifically for:

[0109] The target block indicated by the identifier of the target block in the resource pool 703 is accessed through the business logic layer 702 to obtain information of the target block.

[0110] In one implementation, the data request is used to indicate information for querying target transaction data, and the data request includes a hash of the target transaction data;

[0111] The processor 701 processes the data request based on the business rules through the business logic layer 702 to obtain a processing result, which is specifically used for:

[0112] Determine the address information of the target transaction data based on the hash through the business logic layer 702;

[0113] The processor 701 accesses the resource pool 703 based on the processing result through the business logic layer 702, specifically for:

[0114] The business logic layer 701 accesses the resource pool 703 based on the address information of the target transaction data to obtain the information of the target transaction data.

[0115] Furthermore, the processor 701 can also cooperate with the business logic layer 702, the resource pool 703, the interface 704 and the memory 705 to execute Figure 3 , Figure 5 For the operations corresponding to the blockchain node device in the method embodiment shown, please refer to the description in the method embodiment and will not be described in detail here.

[0116] The present application also provides a computer-readable storage medium that can be used to store Figure 3 , Figure 5 The computer program used by the blockchain node device in the illustrated embodiment includes a computer program for executing the program designed for the blockchain node device in the above-mentioned embodiment.

[0117] The computer-readable storage medium includes but is not limited to a flash memory, a hard disk, and a solid-state drive.

[0118] The present application also provides a computer program product. When the computer program product is executed by a computer device, the above Figure 3 , Figure 5 In the embodiment, a data transmission method is designed for a blockchain node device.

[0119] In an embodiment of the present application, a chip is also provided, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, and the computer program is used to implement the method in the above method embodiment.

[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0121] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted by the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0122] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for data transmission, characterized in that: Applied to a blockchain node device, the blockchain node device is configured with a business logic layer, a resource pool, and at least one interface, the method comprising: A data request sent by any one of the at least one interface is received through the business logic layer; any one of the interfaces can perform data conversion processing on the data in the acquisition request sent by the user side, and generate the data request according to the data after the data conversion processing; the data format of the data after the data conversion processing meets the format requirements of the business logic layer; the data request includes the logical requirements of the data request; Determining, through the business logic layer, a business rule corresponding to the data request based on the logical requirements of the data request; the business rule is used to calculate the processing result required to implement the logical requirements; Processing the data request based on the business rules through the business logic layer to obtain a processing result; The resource pool is accessed through the business logic layer based on the processing result.

2. The method according to claim 1, characterized in that: Before determining the business rule corresponding to the data request through the business logic layer, the method further includes: Verifying the data request through the business logic layer; If the verification is successful, the step of determining the business rules corresponding to the data request through the business logic layer is triggered.

3. The method according to claim 2, characterized in that The verifying the data request through the business logic layer includes: Comparing the data type of the data request with the data type corresponding to the interface stored in the business logic layer through the business logic layer; If the data type of the data request is the same as the data type corresponding to the interface stored in the business logic layer, the business logic layer determines that the verification of the data request is successful.

4. The method according to claim 2, characterized in that: The verifying the data request through the business logic layer includes: Determine, by the business logic layer, whether the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device; If the business domain of the data requested by the data request is the business domain corresponding to the blockchain node device, the business logic layer determines that the data request is successfully verified.

5. The method according to claim 1, characterized in that: The data request is used to indicate information of a target block to be queried, and the data request includes the height of the target block; The processing of the data request based on the business rule by the business logic layer to obtain a processing result includes: Determining, by the business logic layer, an identifier of the target block based on the height of the target block; The accessing the resource pool based on the processing result through the business logic layer includes: The target block indicated by the identifier of the target block in the resource pool is accessed through the business logic layer to obtain information about the target block.

6. The method according to claim 1, characterized in that The data request is used to indicate information for querying target transaction data, and the data request includes a hash of the target transaction data; The processing of the data request based on the business rule by the business logic layer to obtain a processing result includes: Determine the address information of the target transaction data based on the hash through the business logic layer; The accessing the resource pool based on the processing result through the business logic layer includes: The resource pool is accessed through the business logic layer based on the address information of the target transaction data to obtain information of the target transaction data.

7. A blockchain node device, characterized in that: The blockchain node device includes a business logic layer, a resource pool, at least one interface, a memory, and a processor; The memory is used to store computer programs; The processor is configured to call the computer program to execute the method according to any one of claims 1 to 6.

8. A blockchain node device, characterized in that: The blockchain node device is configured with a business logic layer, a resource pool and at least one interface, and the device includes: A receiving module, used for receiving, through the business logic layer, a data request sent by any one of the at least one interface; any one of the interfaces can perform data conversion processing on the data in the acquisition request sent by the user side, and generate the data request according to the data after the data conversion processing; the data format of the data after the data conversion processing meets the format requirements of the business logic layer; the data request includes the logical requirements of the data request; A determination module, configured to determine, through the business logic layer, a business rule corresponding to the data request based on the logical requirements of the data request; the business rule is used to calculate a processing result required to implement the logical requirements; A processing module, used to process the data request based on the business rules through the business logic layer to obtain a processing result; An access module is used to access the resource pool based on the processing result through the business logic layer.

9. The blockchain node device according to claim 8, characterized in that: Before the determination module determines the business rule corresponding to the data request through the business logic layer, it is also used to: Verifying the data request through the business logic layer; If the verification is successful, the step of determining the business rules corresponding to the data request through the business logic layer is triggered.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is used to cause the processor to perform the method according to any one of claims 1 to 6.

11. A computer program product, characterized in that When the computer program product is executed by a blockchain node device, the method according to any one of claims 1 to 6 is executed.