A task processing method, device, equipment and storage medium based on blockchain
By forming supercomputing nodes in the blockchain, the problem of low task processing efficiency caused by insufficient computing power of operating components is solved, and the effect of improving the computing performance and task processing efficiency of blockchain nodes is achieved.
Patent Information
- Application Number
- CN202211021012.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Insufficient computing power of operating components in blockchain leads to low task processing efficiency, affecting the normal operation of blockchain.
By starting the established registry, connect the preset service components to the registry to form a supercomputer node. Responding to the task request of the blockchain node, obtain task data information, and determine the target component from the supercomputer node, and send the data information to the target component for processing.
It improves the computing performance of blockchain nodes, improves task processing efficiency, and ensures the normal operation of blockchain.
Smart Images

Figure CN115396439B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically to a task processing method, device, equipment and storage medium based on blockchain. Background Art
[0002] As a new generation of disruptive technology, blockchain technology plays a huge role in scenarios such as multi-party collaboration and penetrating supervision. Due to the complex and changeable business scenarios of blockchain, the operating components in the blockchain need to have ultra-high processing performance to meet the processing of various complex tasks of blockchain nodes.
[0003] However, when an operating component handles various complex tasks of a blockchain node, its own insufficient computing power often results in low task processing efficiency, affecting the normal operation of the blockchain. Summary of the invention
[0004] In view of this, the present application provides a task processing method, apparatus, device and storage medium based on blockchain, which is used to solve the problem that when an operating component in the blockchain processes various complex tasks of the blockchain node, the task processing efficiency is often very low due to its own insufficient computing power, thereby affecting the normal operation of the blockchain.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a task processing method based on blockchain includes:
[0007] Starting the established registration center and connecting each preset service component to the registration center to form a supercomputing node;
[0008] In response to a request instruction initiated by a blockchain node to operate a target task, obtain data information of the target task;
[0009] Determine at least one target component from each service component in the supercomputing node according to the data information;
[0010] The data information is sent to each of the target components respectively, so that each of the target components can process the target task.
[0011] Preferably, the starting of the established registration center and connecting each preset service component with the registration center to form a supercomputing node includes:
[0012] Starting the registration center and obtaining target parameters of the registration center;
[0013] Sending the target parameter to each of the service components so that each of the service components generates a registration request corresponding thereto;
[0014] Generate a key pair corresponding to each of the service components according to the target parameters;
[0015] Combining the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain connection information corresponding to each of the service components;
[0016] The connection information corresponding to each of the service components is sent to the registration center to realize the connection between each of the service components and the registration center to form a supercomputing node.
[0017] Preferably, determining at least one target component from each service component in the supercomputing node according to the data information includes:
[0018] Obtain the field type of the data information;
[0019] The service component corresponding to the field type in the supercomputing node is used as the target component.
[0020] Preferably, before sending the data information to each of the target components so that each of the target components processes the target task, the method further includes:
[0021] Acquire the data type of the data information;
[0022] According to the data type, the data information is compressed and encoded according to a preset compression mapping table to obtain encoded first information;
[0023] The sending the data information to each of the target components includes: sending the encoded first information to each of the target components.
[0024] Preferably, the process of each of the target components processing the target task includes:
[0025] Based on the data information of the target task, determining the processing order of each target component corresponding to the data information;
[0026] The target task is processed according to the processing mode corresponding to each of the target components and the data information and in accordance with the processing order.
[0027] In a second aspect, a task processing device based on blockchain includes:
[0028] A connection module, used to start the established registration center and connect each preset service component with the registration center to form a supercomputing node;
[0029] A data information acquisition module, used to respond to a request instruction initiated by a blockchain node to operate a target task, and acquire data information of the target task;
[0030] A target component determination module, configured to determine at least one target component from each service component in the supercomputing node according to the data information;
[0031] The sending module is used to send the data information to each of the target components respectively, so that each of the target components can process the target task.
[0032] Preferably, the connection module comprises:
[0033] A startup module, used to start the registration center and obtain target parameters of the registration center;
[0034] A registration request generating module, used for sending the target parameter to each of the service components, so that each of the service components generates a corresponding registration request;
[0035] A key pair generation module, used to generate a key pair corresponding to each of the service components according to the target parameters;
[0036] A combining module, used to combine the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain the connection information corresponding to each of the service components;
[0037] The supercomputing node forming module is used to send the connection information corresponding to each of the service components to the registration center to realize the connection between each of the service components and the registration center to form a supercomputing node.
[0038] Preferably, the target component determination module includes:
[0039] The first target component determines a submodule, which is used to obtain the field type of the data information;
[0040] The second target component determination submodule takes the service component corresponding to the field type in the supercomputing node as the target component.
[0041] In a third aspect, a task processing device based on blockchain includes a memory and a processor;
[0042] The memory is used to store programs;
[0043] The processor is used to execute the program to implement the various steps of the blockchain-based task processing method as described in the first aspect.
[0044] In a fourth aspect, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the various steps of the blockchain-based task processing method as described in the first aspect are implemented.
[0045] It can be seen from the above technical scheme that the present application starts the established registration center and connects the preset service components with the registration center to form a supercomputing node, and then responds to the request instruction initiated by the blockchain node to operate the target task, obtains the data information of the target task, and determines at least one target component from each service component in the supercomputing node according to the data information, and finally sends the data information to each target component respectively, so that each target component can process the target task. This scheme forms a supercomputing node with high computing power by connecting each service component to the established registration center. When the blockchain node initiates a request instruction to operate the target task, it responds to the request instruction and obtains the data information of the target task, determines at least one target component from each service component according to the data information, and then sends the data information to each target component respectively, so as to meet the needs of each target component to process the target task, thereby improving the efficiency of task processing and ensuring the normal operation of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0047] Figure 1 An optional flowchart of a task processing method based on blockchain provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of an application form of a blockchain provided in an embodiment of the present application;
[0049] Figure 3 A structural block diagram of a task processing method based on blockchain provided in an embodiment of the present application;
[0050] Figure 4 A structural diagram of the relationship between a service component and a registration center provided in an embodiment of the present application;
[0051] Figure 5 A BChainBinary compression encoding flow chart provided for an embodiment of the present application;
[0052] Figure 6A flowchart of a target task processing in a blockchain provided in an embodiment of the present application;
[0053] Figure 7 A processing flow chart of a service component provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the structure of a task processing device based on blockchain provided in an embodiment of the present application;
[0055] Fig. 9 A schematic diagram of the structure of a blockchain-based task processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] As a new generation of disruptive technology, blockchain technology plays a huge role in scenarios such as multi-party collaboration and penetrating supervision. Due to the complex and changeable business scenarios of blockchain, the operating components in the blockchain need to have ultra-high processing performance to meet the processing of various complex tasks of blockchain nodes.
[0058] In terms of computing power competition, home computers cannot compare with enterprise-level servers and dedicated cloud service hosts. First, due to their low computing power, home computers can only act as data backupers rather than data producers. Second, when faced with high-concurrency scenarios, home computers cannot exert sufficient performance to cope with the huge data processing needs of the blockchain, which makes the efficiency of blockchain task processing very low, affecting the normal operation of the blockchain.
[0059] Based on the above defects, an embodiment of the present invention provides a task processing method based on blockchain, which can be applied to various computer terminals or smart terminals, and its execution subject can be a processor or server of the computer terminal or smart terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0060] S1: Start the established registration center and connect the preset service components to the registration center to form a supercomputing node.
[0061] It is understandable that common blockchain application forms such as Figure 2As shown in the figure: a P2P network is formed by connecting multiple nodes (Node) of the blockchain, and the node processes all blockchain logic, including: data caching, data storage, data synchronization, verification of ledgers, execution of ledgers, world state changes, packaging blocks, execution of smart contracts, encryption and decryption operations, etc. In this application, the processing power of the node is split to form a blockchain network (BlockChain Network) and a layer 2 network (Layer 2Network). In the blockchain network, the node only retains the basic external interface capability, which can be regarded as the only external gateway of the layer 2 network.
[0062] In this application, service components include but are not limited to: a registration center (also known as a discovery registration center, Discovery & Registration), which can provide service discovery functions for other service components in the supercomputing node and assist the service components inside the supercomputing node to connect; a data pool (Data Pool), which is used to cache the on-chain data to be processed in the blockchain network, and its essence is a component that provides cache services; an encryptor (Cryptography), which is used to provide data encryption and decryption services, including encryption and decryption of blockchain network data and encryption and decryption of data transmission between service components inside the second-layer network in the supercomputing node; an executor (Actuator), which is responsible for executing the blockchain ledger and generating corresponding blocks; a storage engine (Storage), which is used to provide data storage services for supercomputing nodes; a smart contract virtual machine (Contract VM), which is used to execute smart contract codes in the blockchain. It is understandable that these service components can be deployed on different service hosts respectively.
[0063] Therefore, in this step, a registration center is pre-established to provide service discovery functions for other service components in the supercomputing node, and then the preset service components are connected to the registration center to form a supercomputing node with high computing power.
[0064] S2: Responding to the request instruction initiated by the blockchain node to operate the target task, obtaining the data information of the target task.
[0065] When other nodes or third-party applications of the blockchain initiate a request instruction to operate a target task or target transaction, the data information of the target task is obtained in response to the request instruction. The data information of the target task can be used to characterize the type of the target task, the specific processing method, etc., which is not limited in this embodiment.
[0066] S3: Determine at least one target component from each service component in the supercomputing node according to the data information.
[0067] After acquiring the data information of the target task, it is possible to determine which service components are needed to process the target task based on the data information, and use these service components as target components corresponding to the target task.
[0068] S4: Send the data information to each target component respectively, so that each target component can process the target task.
[0069] After determining the target components corresponding to the target task in the above step S3, the data information of the target task is sent to each target component respectively, so that each target component can jointly process the target task. The structural diagram of the task processing method based on blockchain provided in this application can be as follows: Figure 3 shown.
[0070] It can be seen from the above technical scheme that the present application starts the established registration center and connects the preset service components with the registration center to form a supercomputing node, and then responds to the request instruction initiated by the blockchain node to operate the target task, obtains the data information of the target task, and determines at least one target component from each service component in the supercomputing node according to the data information, and finally sends the data information to each target component respectively, so that each target component can process the target task. This scheme splits the various functions of the node, connects each service component with the established registration center in a horizontal performance expansion manner, forms a supercomputing node with high computing power, and improves the computing performance of a single node in the blockchain. When the blockchain node initiates a request instruction to operate the target task, it responds to the request instruction and obtains the data information of the target task, determines at least one target component from each service component according to the data information, and then sends the data information to each target component respectively, so as to meet the needs of each target component to process the target task, thereby improving the efficiency of task processing and ensuring the normal operation of the blockchain.
[0071] In the method provided in the embodiment of the present invention, the process of starting the established registration center and connecting each preset service component with the registration center to form a supercomputing node may include the following steps:
[0072] S11: Start the registration center and obtain target parameters of the registration center.
[0073] S12: Send the target parameters to each of the service components, so that each of the service components generates a corresponding registration request.
[0074] S13: Generate a key pair corresponding to each of the service components according to the target parameters.
[0075] S14: combining the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain connection information corresponding to each of the service components.
[0076] S15: Send the connection information corresponding to each of the service components to the registration center to achieve the connection between each of the service components and the registration center to form a supercomputing node.
[0077] In the above scheme, after starting the registration center, it is necessary to define the current target parameter of the registration center, which can be a tag parameter, to identify the registration center for access by each service component. It is understandable that the access order of each service component can be in no particular order, but they will all receive the target parameter defined by the registration center, and generate a registration request corresponding to themselves according to the target parameter, thereby requesting access to the registration center. In addition, a key pair corresponding to each service component can also be generated using an asymmetric encryption algorithm based on the target parameter. For a service component, the key pair of the service component is combined with the registration request, which can be to combine the target parameter with the public key in the key pair, and then mark the registration request of the service component. The marked registration request can be regarded as the connection information corresponding to the service component, and then the connection information is sent to the registration center to realize the connection between the service component and the registration center. At the same time, each service component realizes the connection with the registration center, thereby forming a supercomputing node. In addition, each service component will maintain a heartbeat connection with the registration center and periodically refresh its own service content.
[0078] After the registration center receives the connection information sent by each service component, it will store the internal information of each service component (its own service content) in the local database to form a service list for use by other service components.
[0079] Here is an example to illustrate this process:
[0080] Please refer to Figure 4 ,like Figure 4 As shown, the service component takes the storage engine (Storage) as an example. The target parameter tag of the registration center is BChain, discovery.url = 192.168.0.200:9527. After Storage sends its connection information to the registration center (Discovery&&Registration), the two are connected successfully, and the registration center will form a service list and return it to Storage.
[0081] The above embodiment describes the process of how to start the established registration center in this application and connect the preset service components with the registration center to form a supercomputing node. The following describes in detail how to determine at least one target component from the various service components in the supercomputing node based on the data information.
[0082] S31: Acquire the field type of the data information.
[0083] S32: Taking the service component corresponding to the field type in the supercomputing node as the target component.
[0084] Specifically, the entrance of the supercomputing node can be used as the instruction recipient of the blockchain node requesting to process the target task. After the entrance of the supercomputing node receives the request instruction, it can first determine the field type (action) of the data information of the target task. If the field type does not belong to any of the preset fields, the entrance of the supercomputing node will reject the request instruction; if the field type belongs to one of the preset fields, the service component corresponding to the field type in the supercomputing node will be used as the target component of the target task.
[0085] Optionally, field types include but are not limited to: block message (block), ledger creation (create), ledger query (query), ledger existence verification (has), contract deployment (deploy), contract call (call), etc. The correspondence between field types and service components is shown in Table 1 below:
[0086] Table 1
[0087]
[0088] In one embodiment provided by the present application, before determining at least one target component from each service component in the supercomputing node according to the data information, the method may further include encoding the data information of the target task. It is understandable that the encoding process is applicable to the data transmission process between each service component in the supercomputing node, and the encoding step may include:
[0089] The data type of the data information is obtained, and then, according to the data type, the data information is compressed and encoded according to a preset compression mapping table to obtain the encoded first information. Wherein, sending the data information to each of the target components includes: sending the encoded first information to each of the target components.
[0090] Specifically, because each service component in the supercomputing node can be deployed on different service hosts, each service component can communicate with each other through RPC communication. During the data transmission process, TCP / IP protocol can be used to transmit binary data. The encoding method of binary data can be compression encoding, called BChainBinary. Its core idea is to compress the plaintext data before encoding. The compression encoding process of BChainBinary can be as follows: Figure 5 As shown, it includes: first defining a compression mapping table, then initializing a preset compression converter, inputting data information at the same time, using the initialized compression converter to compress and convert the data information according to the compression mapping table to obtain UTF-8 encoded data. Compared with the traditional encoding process, the BChainBinary encoding process provided in this application adds steps such as "defining a compression mapping table", "initializing a compression converter", and "information compression conversion".
[0091] Specifically, the compression mapping table provided in this application mainly shows the conversion rules between the data type of the data information and the first information after BChainBinary encoding, as shown in Table 2 below:
[0092] Table 2
[0093]
[0094]
[0095] The process of initializing the compression converter may include: defining the converter f according to the compression mapping table T (x) = y, where x is data information and y is first information. It can be understood that for any input data information x, it can be obtained by f T The (x)=y converter obtains the compressed y, which is a mapping conversion process.
[0096] An example is as follows:
[0097] The data information of the target task in this application is a positive integer 16, which occupies 2 bytes. The data type of the data information is positive int. It can be seen from the compression mapping table that the data information of the positive int type can be represented as a positive integer from 0 to 127. Finally, the data information is compressed and encoded through the compression converter, and the first information obtained is 0×10, which occupies 1 byte.
[0098] JSON encoding is commonly used in this field. Table 3 below compares the memory space occupied by JSON encoding and BChainBinary encoding:
[0099] Table 3
[0100]
[0101] As can be seen from Table 3 above, the encoding method used by JSON encoding is that one character occupies one byte, while BChainBinary encoding uses special character mapping to concisely represent various special characters. This compressed encoding method can reduce the amount of network information transmission, thereby improving network transmission efficiency.
[0102] In addition, data is transmitted directly between service components through the TCP / IP protocol. Based on the BChainBinary encoding of data information, the sender of the target task or target transaction can obtain the public key in the generated key pair, and then encrypt the data information according to the public key (the service list of the registration center contains this item) and send it to the receiver. When the receiver decrypts, it can decrypt and process it according to the private key in the key pair.
[0103] The above embodiment describes the process of determining at least one target component from each service component in the supercomputing node based on the data information in the present application. The following describes in detail the process of each target component processing the target task.
[0104] Based on the data information of the target task (the field type of the data information can be determined), the processing order of each target component corresponding to the data information is determined, and then the target task is processed according to the processing method corresponding to each target component and the data information (field type) and in the processing order. The final processing result will be returned to the entrance of the supercomputing node, so that the supercomputing node can feed back the processing result to the blockchain node that initiates the request instruction to operate the target task. Table 4 is the processing procedure of each target component corresponding to different data information, as shown in Table 4:
[0105] Table 4
[0106]
[0107] Some of the scenarios in the table are shown in the figure below. Figure 6 and Figure 7 shown. Figure 6 It shows the processing flow of a target task or a target transaction in the blockchain. Figure 7 Demonstrates the processing flow of smart contract components.
[0108] and Figure 1 Corresponding to the method described above, the embodiment of the present invention also provides a task processing device based on blockchain, for Figure 1 In the specific implementation of the method, the task processing device based on blockchain provided by the embodiment of the present invention can be combined with a computer terminal or various mobile devices. Figure 8 , introduces the task processing device based on blockchain, such as Figure 8 As shown, the device may include:
[0109] The connection module 10 is used to start the established registration center and connect each preset service component with the registration center to form a supercomputing node.
[0110] The data information acquisition module 20 is used to obtain the data information of the target task in response to a request instruction initiated by the blockchain node to operate the target task.
[0111] The target component determination module 30 is used to determine at least one target component from each service component in the supercomputing node according to the data information.
[0112] The sending module 40 is used to send the data information to each of the target components respectively, so that each of the target components can process the target task.
[0113] In one example, the connection module 10 may include:
[0114] The startup module is used to start the registration center and obtain the target parameters of the registration center.
[0115] The registration request generating module is used to send the target parameters to each of the service components so that each of the service components generates a corresponding registration request.
[0116] The key pair generation module is used to generate a key pair corresponding to each of the service components according to the target parameters.
[0117] The combining module is used to combine the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain the connection information corresponding to each of the service components.
[0118] The supercomputing node forming module is used to send the connection information corresponding to each of the service components to the registration center to realize the connection between each of the service components and the registration center to form a supercomputing node.
[0119] In one example, the target component determination module 30 may include:
[0120] The first target component determines a submodule, which is used to obtain the field type of the data information.
[0121] The second target component determination submodule takes the service component corresponding to the field type in the supercomputing node as the target component.
[0122] In one example, the apparatus may further include:
[0123] The data type acquisition module is used to acquire the data type of the data information.
[0124] A compression coding module is used to compress and encode the data information according to the data type and a preset compression mapping table to obtain the encoded first information, wherein sending the data information to each of the target components includes: sending the encoded first information to each of the target components.
[0125] In one example, the sending module 40 may include:
[0126] The processing sequence determination module is used to determine the processing sequence of each target component corresponding to the data information based on the data information of the target task.
[0127] A processing module is used to process the target task according to the processing methods corresponding to the target components and the data information and in the processing order.
[0128] Furthermore, the embodiment of the present application provides a task processing device based on blockchain. Fig. 9 The hardware structure diagram of the task processing device based on blockchain is shown. Fig. 9 The hardware structure of the blockchain-based task processing device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0129] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0130] The processor 01 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0131] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0132] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following blockchain-based task processing method, including:
[0133] Starting the established registration center and connecting each preset service component to the registration center to form a supercomputing node;
[0134] In response to a request instruction initiated by a blockchain node to operate a target task, obtain data information of the target task;
[0135] Determine at least one target component from each service component in the supercomputing node according to the data information;
[0136] The data information is sent to each of the target components respectively, so that each of the target components can process the target task. Optionally, the detailed functions and extended functions of the program can refer to the description of the task processing method based on blockchain in the method embodiment.
[0137] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is running, controls the device where the storage medium is located to execute the following blockchain-based task processing method, including:
[0138] Starting the established registration center and connecting each preset service component to the registration center to form a supercomputing node;
[0139] In response to a request instruction initiated by a blockchain node to operate a target task, obtain data information of the target task;
[0140] Determine at least one target component from each service component in the supercomputing node according to the data information;
[0141] The data information is sent to each of the target components respectively, so that each of the target components can process the target task.
[0142] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0143] Optionally, the detailed functions and extended functions of the program may refer to the description of the task processing method based on blockchain in the method embodiment.
[0144] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0145] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0146] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0147] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task processing method based on blockchain, characterized in that: include: Start the established registration center and connect each preset service component with the registration center to form a supercomputing node; wherein the service component includes a data pool, an encryptor, an executor, a storage engine and a smart contract virtual machine; In response to a request instruction initiated by a blockchain node to operate a target task, obtain data information of the target task; Determine at least one target component from each service component in the supercomputing node according to the data information; Sending the data information to each of the target components respectively, so that each of the target components can process the target task; Before sending the data information to each of the target components for each of the target components to process the target task, the method further includes: obtaining the data type of the data information; compressing and encoding the data information according to the data type according to a preset compression mapping table to obtain the encoded first information; and defining a compression mapping table, defining a compression converter f according to the compression mapping table. T (x)=y, initialize the compression converter, use the initialized compression converter to compress and convert the data information according to the compression mapping table to obtain the encoded first information, wherein various special characters are represented by special character mapping, x is the data information, y is the first information, and T represents compression conversion; sending the data information to each of the target components includes: sending the encoded first information to each of the target components.
2. The method according to claim 1, characterized in that The starting of the established registration center and connecting each preset service component with the registration center to form a supercomputing node includes: Starting the registration center and obtaining target parameters of the registration center; Sending the target parameter to each of the service components so that each of the service components generates a registration request corresponding thereto; Generate a key pair corresponding to each of the service components according to the target parameters; Combining the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain connection information corresponding to each of the service components; The connection information corresponding to each of the service components is sent to the registration center to realize the connection between each of the service components and the registration center to form a supercomputing node.
3. The method according to claim 1, characterized in that: The step of determining at least one target component from each service component in the supercomputing node according to the data information includes: Obtain the field type of the data information; The service component corresponding to the field type in the supercomputing node is used as the target component.
4. The method according to claim 1, characterized in that The process of each of the target components processing the target task includes: Based on the data information of the target task, determining the processing order of each target component corresponding to the data information; The target task is processed according to the processing mode corresponding to each of the target components and the data information and in accordance with the processing order.
5. A task processing device based on blockchain, characterized in that: include: A connection module, used to start the established registration center and connect each preset service component with the registration center to form a supercomputing node; wherein the service component includes a data pool, an encryptor, an executor, a storage engine and a smart contract virtual machine; A data information acquisition module, used to respond to a request instruction initiated by a blockchain node to operate a target task, and acquire data information of the target task; A target component determination module, configured to determine at least one target component from each service component in the supercomputing node according to the data information; A sending module, used for sending the data information to each of the target components respectively, so that each of the target components can process the target task; A data type acquisition module is used to acquire the data type of the data information; a compression encoding module is used to compress and encode the data information according to the data type and a preset compression mapping table to obtain the encoded first information; including: defining a compression mapping table, defining a compression converter f according to the compression mapping table T (x)=y, initialize the compression converter, use the initialized compression converter to compress and convert the data information according to the compression mapping table to obtain the encoded first information, wherein various special characters are represented by special character mapping, x is the data information, y is the first information, and T represents compression conversion; sending the data information to each of the target components includes: sending the encoded first information to each of the target components.
6. The device according to claim 5, characterized in that The connection module comprises: A startup module, used to start the registration center and obtain target parameters of the registration center; A registration request generating module, used for sending the target parameter to each of the service components, so that each of the service components generates a corresponding registration request; A key pair generation module, used to generate a key pair corresponding to each of the service components according to the target parameters; A combining module, used to combine the key pair corresponding to each of the service components with the registration request corresponding to the service component to obtain the connection information corresponding to each of the service components; The supercomputing node forming module is used to send the connection information corresponding to each of the service components to the registration center to realize the connection between each of the service components and the registration center to form a supercomputing node.
7. The device according to claim 5, characterized in that The target component determination module includes: The first target component determines a submodule, which is used to obtain the field type of the data information; The second target component determination submodule takes the service component corresponding to the field type in the supercomputing node as the target component.
8. A task processing device based on blockchain, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the blockchain-based task processing method as described in any one of claims 1 to 4.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the blockchain-based task processing method as claimed in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Service updating method and device
CN114780243A