DATA PROCESSING METHOD, APPARATUS, ELECTRONIC DEVICE, AND COMPUTER PROGRAM

By employing smart contracts on a blockchain system, the data processing method and device address centralized limitations, reducing costs and ensuring continuous service by enabling distributed processing and secure data management.

JP2025502904AActive Publication Date: 2025-01-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023566964
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-12-22
Filing Date
2023-08-07
Publication Date
2025-01-30
Estimated Expiration
2043-08-07

Smart Images

  • Figure 2025502904000001_ABST
    Figure 2025502904000001_ABST
Patent Text Reader

Abstract

The present application relates to the field of blockchain technology, in particular to a data processing method, an apparatus, an electronic device, a computer storage medium and a computer program product. The method includes receiving a data processing request sent from a target device, obtaining contract identification information, description information of data to be processed, operation type information for the data to be processed and target identification information of the target device contained in the data processing request, searching for a corresponding target smart contract in a stored blockchain based on the contract identification information, and feeding back to the target device a data processing result obtained by processing the data to be processed according to a processing method corresponding to the operation type information in the target smart contract.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202211658556.0, filed with the China Patent Office on December 22, 2022, the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the field of blockchain technology, and in particular to a data processing method, an apparatus, an electronic device, and a computer program. [Background technology]

[0003] In the related technology, when performing data processing, a data processing engine centrally located on the server side typically performs data processing corresponding to a data processing request triggered by a target, where the data processing function provided by the data processing engine is composed of multiple subsystem functions, and the multiple subsystem functions include a load balancing subsystem, various processing function subsystems, and a network balancing subsystem, etc.

[0004] However, because the data processing engines are centrally located, it is not possible to provide data processing services to users or guarantee the data processing needs of users when a failure occurs or when the service is upgraded, and it is difficult to realize service expansion due to geographical limitations of the centralized location.In addition, since the current data processing engines can only store the processing results for a certain period of time after completing data processing, it is unable to meet the processing needs for a wide range of past data.Furthermore, it is difficult to guarantee the overall processing effect of the functions of multiple subsystems, and maintenance costs are also high. Summary of the Invention [Problem to be solved by the invention]

[0005] The embodiments of the present application provide a data processing method, device, electronic device, computer storage medium, and computer program product that can realize various data processing functions using node devices in a blockchain system and smart contracts stored in the blockchain, and can significantly reduce the complexity of maintenance and deployment while ensuring the data processing needs of related subjects. [Means for solving the problem]

[0006] An embodiment of the present application provides a data processing method applied to a node device in a blockchain system, the method comprising: receiving a data processing request sent from a target device, and acquiring contract identification information, description information of data to be processed, operation type information for the data to be processed, and target identification information of the target device included in the data processing request, wherein one contract identification information is used to identify one smart contract, and the one smart contract stores processing logic of at least one data processing function; Searching for a corresponding target smart contract in the stored blockchain according to the contract identification information, and processing the waiting data according to a processing manner corresponding to the operation type information in the target smart contract to obtain a data processing result; and feeding back the data processing result to the target device.

[0007] An embodiment of the present application provides a data processing apparatus, the apparatus comprising: a receiving unit, a processing unit, and a feedback unit; The receiving unit is configured to receive a data processing request sent from a target device, and obtain contract identification information, description information of data to be processed, operation type information for the data to be processed, and target identification information of the target device contained in the data processing request, wherein one contract identification information is used to identify one smart contract, and the one smart contract stores processing logic of at least one data processing function; The processing unit is configured to search for a corresponding target smart contract in the stored blockchain according to the contract identification information, and process the waiting data according to a processing manner corresponding to the operation type information in the target smart contract to obtain a data processing result; The feedback unit is configured to feed back the data processing result to the target device.

[0008] An embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, the processor realizing, when executing the program, any of the data processing methods described above.

[0009] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program realizing any of the data processing methods described above when executed by a processor.

[0010] An embodiment of the present application provides a computer program product including a computer program which, when executed by a processor, realises any of the data processing methods described above. Effect of the Invention

[0011] The present application has the following beneficial effects:

[0012] In the embodiments of the present application, a data processing method, an apparatus, an electronic device, a computer storage medium, and a computer program product are proposed, and when a data processing function is realized based on a data processing request of a target device, various data processing functions can be realized by the node devices in the blockchain system and the smart contracts stored in the blockchain, simplifying the system configuration for performing data processing, and converting the maintenance and deployment of the data processing engine into the deployment and update of the smart contract in the blockchain, thereby greatly reducing the complexity of the maintenance and deployment. In addition, the distributed architecture of the blockchain system can realize the distributed construction of the data processing function, and when data processing is executed, the target smart contract indicated in the data processing request can be called to perform data processing correspondingly for the data waiting to be processed. Therefore, the blockchain can easily deploy various data processing functions in the node devices, thereby greatly reducing the deployment costs and maintenance costs when implementing the data processing function, and the data processing service can be easily expanded, solving the problem that the service expansion is limited by regional factors. Furthermore, due to the nature of the blockchain being stored in each node device within a blockchain system, if one node device within the blockchain system fails, the other node devices can also achieve the same processing function, so that the failure of one node device will not affect the normal operation of the data processing service, thereby ensuring normal responses to data processing requests even when the target device is unaware. [Brief description of the drawings]

[0013] [Figure 1] FIG. 1 is a schematic diagram of the architecture of a prior art data processing engine in an embodiment of the present application; [Diagram 2] FIG. 2 is a schematic diagram of an applicable scene in an embodiment of the present application; [Figure 3A] 2 is a flow chart of data processing in an embodiment of the present application. [Figure 3B]FIG. 2 is a schematic diagram of the architecture of each stored smart contract in an embodiment of the present application. [Figure 3C] FIG. 2 is a schematic diagram of functions supported by a smart contract in an embodiment of the present application. [Figure 3D] FIG. 2 is a comparison diagram of execution sequences of data processing transactions in an embodiment of the present application. [Figure 4A] FIG. 2 is a schematic diagram of an implementation process of trusted computing processing in an embodiment of the present application. [Figure 4B] FIG. 2 is a schematic diagram of another implementation process of trusted computing processing in an embodiment of the present application. [Diagram 5] 1 is a flowchart of invoking a smart contract to execute a transaction in an embodiment of the present application. [Figure 6] 1 is a schematic diagram showing a logical structure of a data processing device according to an embodiment of the present application; [Figure 7] FIG. 1 is a schematic diagram illustrating a hardware configuration of an electronic device according to an embodiment of the present application. [Figure 8] FIG. 1 is a schematic diagram showing the configuration of a computing device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions of the embodiments of the present application with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the technical solutions of the present application, and not all of the embodiments. Based on the embodiments described in the specification of the present application, all other embodiments obtained by those skilled in the art without any creative efforts are included in the protection scope of the present application.

[0015] The terms "first," "second," and the like in the present specification, claims, and above drawings are not intended to limit a particular order or sequence, but are instead intended to distinguish between similar subject matter. It should be understood that data so used can be interchanged where appropriate, such that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.

[0016] To facilitate understanding by those skilled in the art, some of the terms used in the examples of the present application are explained below.

[0017] Blockchain: Refers to distributed ledger technology in the information technology field, and is generally composed of consensus, transaction blocks, state data storage, cryptographic ID security, etc. In addition, since the ledger is stored in a distributed manner and the blocks are consensus-based, it has the characteristics of being tamper-proof, traceable, and commonly maintained.

[0018] Consensus: refers to the mechanism by which all nodes in a blockchain system jointly maintain block development. Common consensus mechanisms include Proof of Work (POW), Proof of Stake (POS), Delegated Proof of Stake (DPOS), Practical Byzantine Fault Tolerance (PBFT), etc.

[0019] Node: or node device, is the smallest unit that participates in the maintenance of the blockchain in a blockchain system, and is the unit for deploying and executing the blockchain node program.

[0020] Data Processing Engine: A tool used to provide data processing functions, typically providing external standard restful interfaces, or remote procedure call interfaces (GRPC: Google Remote Procedure Call), or websocket interface services, or function-level application programming interface (API: Application Programming Interface) calling functions.

[0021] Blockchain is a new application of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a series of data blocks generated by linking them using cryptographic correlation methods, each of which contains the same batch of network transaction information to verify the validity (anti-counterfeiting) of the information and generate the next block. Blockchain may include a blockchain foundation platform, a platform product service layer, and an application service layer.

[0022] The blockchain foundation platform may include processing modules such as user management, basic services, smart contracts, and operation monitoring. Here, the user management module plays the role of identity information management for all blockchain participants, including maintaining the generation of public and private keys (account management), key management, maintaining the correspondence between users' real identities and blockchain addresses (authority management), etc., supervises and audits the transaction status related to a specific real identity after approval, and provides the setting of rules for risk control (risk control audit). The basic service module is deployed in all blockchain node devices and is used to verify the validity of service requests and record them in memory after completing consensus on valid requests. For new service requests, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts the service information through the consensus algorithm (consensus management), and transmits it to the shared ledger (network communication) after integrity is obtained after encryption, and records and stores it. The smart contract module plays the role of contract registration and issuance, contract triggering, and contract execution. Developers define contract logic in a specific programming language, deploy it on the blockchain (contract registration), and according to the logic of the contract conditions, call keys or other events to trigger execution to complete the contract logic, while providing the function of canceling contract upgrades. The operation monitoring module is mainly responsible for the deployment of the product release process, configuration changes, contract settings, cloud adaptation, and the visualization output of the real-time status of product operation, such as warnings, network status monitoring, and node equipment health status monitoring.

[0023] The platform product service layer provides the basic functions and implementation framework of typical applications, and developers can overlay service characteristics based on these basic functions to complete the blockchain implementation of service logic. The application service layer provides application services based on the blockchain solution for service participants to use.

[0024] The design concept of the embodiments of the present invention will be briefly described below.

[0025] In performing data processing, most of the current data processing technologies are centralized service systems based on cloud services, and in some embodiments, data processing is realized by a centralized data processing engine. In the process of providing data processing services, services are usually provided by providing a standard restful interface, and related objects request to perform data processing tasks through the restful interface, and then the server-side data processing engine performs data processing correspondingly, and the server-side data processing system (or data processing engine) usually has a multi-layer architecture.

[0026] As shown in Fig. 1, Fig. 1 is a schematic diagram of the architecture of a data processing engine of the prior art in an embodiment of the present application. As can be seen from Fig. 1, in the prior art, a data processing engine 100 for realizing data processing includes a multi-layer architecture including a Content Delivery Network (CDN) subsystem 200, a load balancing subsystem 300, data sub-processing systems 400-1 to 400-n, a data statistics subsystem 500, a system monitoring subsystem 600, and a data storage subsystem 700.

[0027] The CDN subsystem 200 is used to solve problems such as small network bandwidth and access volume, and can improve the response speed of target devices; the load balancing subsystem 300 is used to evenly distribute and process requests from different target devices to different data processing subsystems; the data processing subsystem is used to process data and obtain processing results; the system monitoring subsystem 600 is used to monitor the operation of the entire data processing system; and the data storage subsystem 700 is used to realize data storage.

[0028] However, in the case of the data processing engine currently performing data processing, the data processing engine is centrally arranged and has a complex configuration, so that large maintenance costs are required for arrangement and maintenance, and if a problem occurs in only a part of the subsystem, it may affect the normal operation of data processing. In addition, although the data processing engine includes a load balancing service, if a failure occurs, it may still affect the access of more target devices, and the failure of the system failure will be greater. Furthermore, due to the influence of the centralized arrangement, on the one hand, the data processing engine is geographically restricted, making it difficult to realize the expansion of the data service range, and on the other hand, the service needs to be stopped when upgrading the function, which affects the normal service data. In addition, since the data processing engine of the conventional technology is generally provided by a cloud vendor, the service function tends to be standardized, and there is a limit to the function expansion, and it often depends on the function provided by the cloud vendor, and it is not possible for the user to customize the unique data processing function.

[0029] In addition, in the case of data processing methods according to the prior art, in order to improve performance, the data processing engine often adopts a one-way authentication method, which is susceptible to request attacks and inevitable losses, so there are data security risks and it is difficult to safely store data. In addition, the operation log of the target device cannot be permanently stored, so related past data cannot be tracked, for example, after data replacement, only the latest data after replacement is saved, and past data before replacement cannot be queried. In addition, the target device can only obtain the processing result from the data processing engine, and cannot check the accuracy of the processing result, so it cannot judge the accuracy of the data processing result.

[0030] In view of the above, embodiments of the present application propose a data processing method, apparatus, electronic device, computer storage medium and computer program product, in which a node device in a blockchain system receives a data processing request sent from a target device, obtains contract identification information, description information of the data to be processed, operation type information for the data to be processed, and target identification information of the target device contained in the data processing request, where one contract identification information is used to identify one smart contract, and one smart contract stores the processing logic of at least one data processing function, then searches for a corresponding target smart contract in the stored blockchain based on the contract identification information, processes the data to be processed according to a processing manner corresponding to the operation type information in the target smart contract to obtain a data processing result, and then feeds back the data processing result to the target device.

[0031] In this way, when a data processing function is realized based on a data processing request of a target device, various data processing functions can be realized by the node devices in the blockchain system and the smart contracts stored in the blockchain, simplifying the system configuration for performing data processing, and converting the maintenance and deployment of the data processing engine into the deployment and update of the smart contract in the blockchain, thereby greatly reducing the complexity of maintenance and deployment. In addition, the distributed architecture of the blockchain system can realize a distributed construction of the data processing function, and when data processing is executed, the target smart contract specified in the data processing request can be called to perform data processing correspondingly for the data waiting to be processed. Therefore, the blockchain can easily deploy various data processing functions in the node devices, thereby greatly reducing the deployment and maintenance costs when implementing the data processing function, and the data processing service can be easily expanded, solving the problem that the service expansion is limited by regional factors. Furthermore, due to the characteristics that the blockchain is stored in each node device in the blockchain system, if one node device in the blockchain system fails, the other node devices can also realize the same processing function, so that the failure of one node device does not affect the normal operation of the data processing service, and therefore, a normal response to the data processing request can be guaranteed in a state where the target device is unaware. In addition, the memory principle of the blockchain system not only allows the data generated in the processing process to be stored in the blockchain, but also makes it possible to query and track past data, making it possible to verify the results of data processing from the perspective of the target device, thereby improving the reliability of the results of data processing while ensuring the safe storage of data.

[0032] The following describes preferred embodiments of the present application with reference to the drawings. It should be understood that the preferred embodiments described in this specification are only used to explain and interpret the present application, and do not limit the present application. The embodiments and features in the embodiments of the present application can be combined with each other without contradiction.

[0033] As shown in Fig. 2, Fig. 2 is a schematic diagram of an application scene in which the embodiment of the present application can be applied. In this schematic diagram of the application scene, a target device 201 and node devices 202 (including node devices 202-1 to 202-m) are shown.

[0034] In the embodiment of the present application, the target device 201 is a terminal device where the target object is located, and may be a computer device having a certain computing capability, such as a personal computer, a mobile phone, a tablet PC, a notebook computer, an e-book reader, a smart home, and an in-vehicle terminal. The target device 201 can send a data processing request to a node device 202 in a blockchain system according to the actual processing needs of the target object, and obtain a data processing result fed back by the node device 202, where the node device accessed by the target device may be selected by the target device by the target object, may be accessed by default based on distance information, or may be accessed according to possible rules for a terminal to access a blockchain node in the related art, and the present application is not limited thereto.

[0035] The node device 202 refers to a node in a blockchain system, and may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), big data and artificial intelligence platforms.

[0036] In the embodiment of the present application, the data processing engine based on the smart contract of the blockchain mainly includes the underlying blockchain system and the smart contract used for data processing. Architecturally, one node device (or node) in the blockchain system mainly includes modules such as a virtual machine, consensus, storage, network, and smart contract for data processing, where a node program for realizing the function of the blockchain system needs to be deployed in the device that becomes a node in the blockchain system, and the program structure of this node program includes four elements: virtual machine, consensus, storage, and network, and is used to build the execution environment of the smart contract, which can receive data processing requests and call the smart contract to complete the processing, and the data generated by the processing can be stored in the blockchain according to the actual processing needs.

[0037] The technical solution proposed in this application can realize data processing for various types of multimedia data in various application scenarios, and the related multimedia data can be video, audio, files, images, etc.

[0038] It should be noted that the processing operations corresponding to the data processing requests initiated by the target device may include, but are not limited to, any one or combination of file format conversion, file content search, file editing, image format conversion, image scaling, image editing, watermark operation, audio format conversion, audio bit rate conversion, audio editing, video format conversion, video compression, video editing, data query, and data statistics, etc.

[0039] According to various data processing needs, the target device 201 can initiate a data processing request based on various data processing needs for multimedia data, where the data processing request includes description information of the data to be processed, contract identification information of the smart contract to be called and executed, operation type information for the data to be processed, and target identification information of the target device.

[0040] Then, after receiving a data processing request, the node device obtains the corresponding target smart contract according to the contract identification information contained in the data processing request, processes the obtained waiting data according to the storage logic bound by the target smart contract, and feeds back the data processing result to the target device 201. Then, if it decides to store the data processing result in the blockchain according to the actual processing needs, in the process of executing the target smart contract, it calls the data storage interface to obtain the data storage logic in the blockchain system, and stores it in the blockchain according to the determined data storage logic.

[0041] In the following, first, with reference to the drawings, a data processing process according to an embodiment of the present application will be described in detail from the viewpoint of one node device in a blockchain system.

[0042] It should be noted that in the embodiment of the present application, the blockchain-based data processing engine is a distributed processing system, and a point-to-point (p2p) communication network is generally adopted between the node devices. When the network is in good condition in the place where the service is required, only one node (or node device) is constructed to provide the data processing service, and the scalability is not limited by geographical location.

[0043] When initiating a data processing request, the target device can transmit the data processing request to at least one node device, so that even if a failure occurs in one node (or node device) in the blockchain system, data processing can be executed by other devices without affecting the normal operation of the entire system, and data processing can be performed without the target device noticing the data processing request transmitted from the target device. In the following explanation, the data processing process will be explained using an example of a processing process that can be executed by one node device.

[0044] As shown in Fig. 3A, Fig. 3A is a flow chart of data processing in an embodiment of the present application. The data processing process in an embodiment of the present application will be described in detail below with reference to Fig. 3A.

[0045] In step 301, the node device receives a data processing request transmitted from a target device, and acquires contract identification information, description information of the data waiting to be processed, operation type information for the data waiting to be processed, and target identification information of the target device, which are included in the data processing request.

[0046] In an embodiment of the present application, a node device must first join the blockchain system to become a node in the blockchain system before receiving a data processing request sent from a target device.

[0047] In some embodiments, according to a node deployment scheme in the blockchain system, a node device can be configured as a node in the blockchain system and store a blockchain, where the blockchain includes stored smart contracts for realizing different data processing functions.

[0048] It should be explained that for node devices in a blockchain system, some devices can be selected according to actual processing needs and node programs can be configured therein, so that the devices configured with the node programs can become node devices in the blockchain system, or can perform data processing according to a blockchain system maintained by another platform, and realize data processing functions through node devices and stored smart contracts in the maintained blockchain system. Here, by configuring the node program, the node device can have modules such as a virtual machine, consensus, storage, network, and smart contracts for data processing.

[0049] For example, ChainMaker technology, which is currently widely used in China, makes it easy to build a highly powerful and high-performance blockchain system, or you can purchase blockchain services directly.

[0050] In this way, by configuring the processing function of a blockchain node, the device can be constructed as a node device in a blockchain system, providing a processing foundation for realizing data processing based on the data processing requirements of subsequent target devices; furthermore, with the gradual maturity of current blockchain technology, the deployment and maintenance of a blockchain system has become very simple; therefore, the data processing system (or data processing engine) constructed by the present application based on a blockchain system can greatly simplify the system configuration and reduce deployment and maintenance costs.

[0051] It should be noted that in the embodiment of the present application, the node device is a node in a blockchain system, a blockchain is stored, and various transaction data is stored in the blockchain, and a smart contract of processing logic for realizing at least one data processing function is stored in the blockchain, where the process of creating and storing the blockchain and the process of deploying the smart contract are mature technologies in the field, and the present application does not limit them.

[0052] For example, when deploying a smart contract, after obtaining the smart contract obtained by programming, the smart contract can be stored in the blockchain according to smart contract deployment methods in different blockchain architectures.

[0053] When performing step 301, the node device can receive a data processing request sent from a target device, where the data processing request is constructed by the target device based on description information of the data to be processed and the determined contract identification information according to a predetermined field format, and the target smart contract corresponding to the contract identification information includes processing logic to be performed on the data to be processed; then parse the data processing request according to the field format to obtain the contract identification information, description information of the data to be processed, operation type information for the data to be processed, and target identification information of the target device, where one contract identification information is used to identify one smart contract, and the processing logic of at least one data processing function is stored in one smart contract.

[0054] In some embodiments, for a data processing request initiated by a target device, the data processing request is triggered on a web page in the target device, on a predefined application (APP) in the target device, or on a designated mini-program page in the target device. The node device and the target device can pre-agree on a field format of the data processing request, so that from the perspective of the target object, the target device where the target object is located can generate a data processing request based on the predefined field format, and from the perspective of the node device, the node device can determine the information content included in the data processing request by analyzing the data processing request based on the predefined field format.

[0055] It should be noted that in the embodiment of the present application, the data processing request may include instruction information for whether to store data in the blockchain, and an identification statement for the instruction information is configured in the smart contract, so that in the subsequent data processing process, the data that is determined to need to be stored in the blockchain based on the instruction information and the smart contract is stored.

[0056] For example, the operation algorithm type and the request structure format of the data processing request defined by the agreement are: / / Operate algo definition Define the operation algorithm enum OpAlgo { / / Represents the definition of an operation algorithm of an enumeration type. / / Document split algo Define the file splitting algorithm DocSplit=0; / / Define that the number 0 represents the file splitting algorithm / / Picture Compression algo Define the image compression algorithm PicCompression=1; / / Define that the number 1 represents the image compression algorithm. / / Music Compression algo defines the audio compression algorithm MusicCompression=2; / / Define the number 2 to represent the audio compression algorithm. / / Video Rate Compression algo Define the video compression rate algorithm VideoRateCompression=3; / / Define the number 3 to represent the video compression rate algorithm …} message Operate{ / / Represents the defined request structure / / id of data / / Represents the identification information of the data, and represents the corresponding keyword information in the blockchain of the data to be processed. Based on the keyword information, the value stored in the blockchain, i.e., the data to be processed, can be obtained. DataId string=0; / / Indicates that the position where the number is 0 in the data processing request indicates the identification information of the data waiting to be processed. / / Op is the op algo for the data. It represents the operation algorithm to be adopted to process the data type shown in number 0. Op OpAlgo=1; / / Represents the operation algorithm to be adopted to process the pending data … / / Furthermore, according to actual processing needs, the number position corresponding to the contract identification information of the smart contract in the data processing request, the number position corresponding to the target identification information, the number position where the instruction information for whether to store the data is located, etc. can be defined.}” As stated above.

[0057] In this way, by defining the enumeration type operation algorithm, the data processing function that the node device can realize is extensible, and by increasing the definition and configuration of the operation algorithm, a smart contract for data processing is realized, and the data processing function can be easily expanded, in other words, it is equivalent to expanding the processing function in the smart contract. In addition, the defined field format makes it possible to effectively analyze the contents of the data processing request, and to effectively process data with a standardized request structure.

[0058] It should be noted that in the embodiments of the present application, multiple smart contracts can be defined respectively according to the data types that need to be processed and the processing operations that need to be realized, or multiple smart contracts can be unified into one smart contract, and the present application is not limited thereto.

[0059] For each smart contract, the smart contract includes a three-layer logical structure including a function interface layer, an algorithm layer, and a memory layer, where the function interface layer is used to define the data processing functions that can be realized and the parameters on which the data processing depends, the algorithm layer is used to define the algorithm content for realizing the data processing functions, and the memory layer is used to define the storage format of the data processing results. In other words, the function interface layer is used to represent the functions supported by the smart contract and the parameters that should be passed to realize the functions, the algorithm layer includes the data processing algorithms involved in the realization of data processing, and the function layer calls them according to the actual processing needs, and the memory layer is used to store the data finally generated by the algorithm layer, and in some embodiments, the encapsulated data storage interface can be called in the memory layer to adopt the blockchain storage method in the blockchain system to realize data storage.

[0060] For example, as shown in Figure 3B, Figure 3B is a schematic diagram of the architecture of each smart contract stored in an embodiment of the present application. As can be seen from the content shown in Figure 3B, for various multimedia data such as files, images, audio, and videos, smart contracts can be respectively constructed to process the corresponding data, where various smart contracts include the same hierarchical structure.

[0061] In another example, as shown in Figure 3C, Figure 3C is a schematic diagram of functions supported by smart contracts in an embodiment of the present application. As shown in Figure 3C, the feasible functions of smart contracts are defined by the function interface layer of smart contracts, and typical functions include operations such as querying corresponding data content according to data ID, various data operations, billing statistics operations, etc., where the data operations can be further classified into multiple operations according to different data types, for example, the format conversion operation includes format conversion for files, images, audio, and videos.

[0062] It should be noted that, according to actual processing needs, the smart contract may be created by the developer and then placed on the blockchain, or may be created by the target object on the target device and then placed on the blockchain, and the present application is not limited thereto. In addition, the smart contract has a general-purpose three-layer structure, which is convenient for the relevant developer or target object to program hierarchically, thereby obtaining the smart contract that realizes the data.

[0063] For example, in a possible implementation form, when creating a smart contract that realizes one data processing function A, developer 1 can create the realization code for the function interface layer, developer 2 can create the realization code for the algorithm layer, and developer 3 can create the realization code for the memory layer. Furthermore, by integrating the contents created by developers 1 to 3, a smart contract that realizes data processing function A can be obtained.

[0064] In this way, it is equivalent to breaking down the entire code corresponding to the smart contract into blocks, which allows multiple people to participate in the programming process of the smart contract, allowing the creation of smart contracts with clear internal logic and facilitating the maintenance of smart contracts, thereby reducing not only the difficulty of programming smart contracts but also the difficulty of expanding data processing functions.

[0065] In step 302, the node device searches for a corresponding target smart contract in the stored blockchain based on the contract identification information, and processes the waiting data according to the processing method bound by the target smart contract to obtain a data processing result.

[0066] In an embodiment of the present application, after the node device obtains the target identification information, contract identification information, operation type information for the data to be processed, and description information of the data to be processed contained in the data processing request, if the node device determines based on the target identification information that the target device has passed identity authentication, it searches for the corresponding target smart contract in the stored blockchain based on the contract identification information; then, if the node device determines based on the target smart contract, the target identification information, and the operation type information that the target device has the authority to request an operation corresponding to the operation type information, it obtains the data to be processed; and then determines a function interface corresponding to the operation type information in the target smart contract, and invokes the algorithm content corresponding to the function interface to process the data to be processed.

[0067] In some embodiments, before data processing, it is necessary to first perform identity authentication for the target device, and in the verification process, the node device can call the identity authentication processing logic in the blockchain through a predetermined identity authentication interface to realize signature verification for the target device. Here, the identity authentication logic of the blockchain executed in different blockchain system architectures may be different, and the present application follows the processing logic for signature verification in the blockchain system in the related art to realize identity authentication before processing.

[0068] In this way, since the mechanism of the blockchain is generally two-way authentication, all requests of the target device are generally recorded on the chain as transactions, and all transactions are signed by the target device, and the node device decides to provide services to the target device only after the target device passes signature verification according to the authentication logic in the blockchain system. This makes it more difficult to attack the node device, and even if an attack occurs, it can be determined whether the traffic is normal service traffic or attack traffic by performing signature verification, thereby reducing unnecessary service costs and reducing the impact of attacks on the data processing engine built on the blockchain.

[0069] Then, when the node device determines that the target device has passed identity authentication, it searches for the corresponding target smart contract in the stored blockchain based on the contract identification information. Here, since the storage format of content in the blockchain is usually in the form of keyword-key value (key-value), obtaining the contract identification information is equivalent to obtaining a keyword that can search for a smart contract, and the target smart contract can be queried and determined by searching the content of the key value with the contract identification information as a keyword.

[0070] Furthermore, if the node device determines, based on the target smart contract, the target identification information, and the operation type information, that the target device has the authority to initiate the operation corresponding to the operation type information, it acquires the waiting-to-be-processed data.

[0071] In some embodiments, after completing identity authentication at the blockchain system level, before performing processing based on the determined target smart contract, the node device verifies whether the target device has the authority to request the operation indicated by the operation type information through the authority authentication logic within the target smart contract, and obtains the waiting for processing data if it determines that the target device has the authority to request the provision of the corresponding operation.

[0072] It should be noted that all target devices that can request services from the node device are target devices that have been registered in advance in the blockchain system, so the node device can configure the authority to request operations from the target devices. Based on this, the smart contract can define the correspondence between the target and the operation authority that the target can request according to the actual processing needs.

[0073] For example, a smart contract may maintain a set of objects registered in a blockchain system, where the objects in the set may request services from a node device, and each object in the set may have a corresponding set of operation permissions to represent the processing operations that the object may request to be provided.

[0074] In another example, if it is determined that the target 1 has purchased a data compression service, the target 1 has the authority to request an audio data compression operation. Based on this, when the target 1 initiates an audio data compression request, the node device can call a target smart contract that realizes a data compression function to realize audio data compression based on the acquired audio data.

[0075] In this way, after the node device completes signature verification, it is equivalent to realizing authority verification for the target device within the target smart contract, and is equivalent to realizing service request authentication for the target device, thereby avoiding providing unauthorized services to the target device.

[0076] It should be noted that when a node device acquires data to be processed, there are two acquisition methods according to different possible implementation scenarios:

[0077] In method 1, data waiting to be processed that is included in the data processing request is obtained.

[0078] In an embodiment of the present application, when the descriptive information included in the data processing request is used to describe the contents of the data waiting to be processed, the node device determines the data contents determined based on the descriptive information as the acquired data waiting to be processed.

[0079] In some possible implementation scenarios, when the storage space of the pending data requested to be processed by the target device is not large and the pending data is not pre-stored in the blockchain, the data processing request received by the node device can directly include the pending data. At this time, the description information of the received pending data is used to describe the contents of the pending data, so that the pending data included in the data processing request can be directly obtained.

[0080] In method 2, pending data is queried and obtained based on descriptive information in the data processing request.

[0081] In an embodiment of the present application, when the descriptive information included in the data processing request is used to instruct the determination of the data content stored in the blockchain, the data content obtained by searching the blockchain based on the descriptive information is determined as the obtained data waiting to be processed, or when the descriptive information is used to describe the storage address of the data waiting to be processed, the data obtained based on the storage address is determined as the data waiting to be processed.

[0082] In some embodiments, in some possible implementation scenarios, when the data to be processed that is requested to be processed is data that is pre-stored in the blockchain, the descriptive information acquired by the node device can represent a keyword (key) corresponding to the data to be processed in the blockchain, thereby enabling the data to be processed (i.e., the value corresponding to the key) to be acquired based on the keyword.

[0083] In some possible implementation scenarios, when the storage space occupied by the pending data requested for processing by the target device is large, the pending data is not stored in the blockchain in advance, and the target device instructs to store the pending data in the blockchain, the node device first calls the target smart contract that realizes the data storage function based on the data processing request for storing the pending data in the blockchain, and realizes storage of the pending data in the blockchain based on the processing logic that realizes the data storage function in the target smart contract, and feeds back to the target device the key value information corresponding to the pending data when it is stored in the blockchain. Furthermore, in response to the data processing request for the pending data, the node device determines the description information (i.e., the key value) included in the data processing request, and then the node device determines the pending data by searching for the value corresponding to the description information, where the value value may refer to the address information where the pending data is stored, in which case the node device needs to acquire the pending data based on the acquired address information.

[0084] In some other possible implementation scenarios, when the storage space occupied by the waiting data requested for processing by the target device is large, the target device instructs that the waiting data will not be stored in the blockchain, and the waiting data has not been stored in the blockchain in advance, the descriptive information included in the data processing request received by the node device refers to address information where the waiting data is stored, and in this case, the node device needs to obtain the waiting data based on the address information.

[0085] It should be noted that in the embodiment of the present application, when determining the size of the occupied storage space, the determination can be made based on the relationship between the space occupied by the data waiting to be processed and a set value, and if it is determined that the space occupied is greater than the set value, it can be determined that the occupied storage space is large, and if it is less than the set value, it can be determined that the occupied storage space is not large. The contents stored in the blockchain are in the form of key-value, so that the corresponding key value can be searched and determined using the description information as a key, and the data waiting to be processed can be obtained based on the searched key value.

[0086] In addition, when storing data waiting for processing that occupies a large storage space in the blockchain, if a large storage space is required to store the data waiting for processing, the node device can instruct the target device to store the contents of the data waiting for processing in a device such as a designated cloud according to actual processing needs, and the data processing request sent by the target device can include a URL (uniform resource locator) representing the storage location of the data waiting for processing. Furthermore, when processing the data storage request, the node device adopts a processing logic corresponding to the data storage function interface in the designated data storage smart contract to call a mature data blockchain storage method in the related technology and stores the constructed key-value and the defined dictionary content in the blockchain. Here, the data identification information (denoted as data ID) generated by the data waiting for processing is the key, the URL corresponding to the data waiting for processing is the value corresponding to the key, and the dictionary content defines the data structure of the blockchain storage and is used to indicate what data structure is stored when stored in the blockchain, that is, it defines the correspondence between the key and the value.

[0087] It should be noted that in the embodiment of the present application, the keyword in the dictionary content can be a data Id (i.e., information that can uniquely identify data), and the value in the dictionary content can be a byte array obtained after data serialization according to a specific structure. In the dictionary content, specific structures corresponding to all types of data can be defined, and these structures can be unifiedly defined using a data serialization protocol (protobuf: Google Protocol Buffers), and the stored data type can be adjusted according to actual processing needs.

[0088] For example, a typical data structure format is: / / datatype definition Represents the definition of a data type enum DataType{ / / Defines the data type of an enumeration. / / Document type of data Data representing the file type Document=0; / / The character 0 represents the data that indicates the file type. / / Picture type of data Picture=1; / / Character 1 represents the data that indicates the image type. / / Music type of data Music=2; / / Character 2 represents the data that indicates the audio type / / Video type of data Video=3; / / Character 3 represents the data that indicates the video type …} message Data { / / Represents the data structure in the stored value / / DataType for data field Represents the data area reserved for the data type. DataType data_type=0 / / Represents the data type information stored at position number 0 in the data structure / / The field “data” is used to hold the binary data to process or store bytes data=1; / / Indicates that the data content is stored at location number 1 in the data structure. As stated above.

[0089] In another example, suppose one audio data needs to be stored in the blockchain, as can be seen from the dictionary content, the structure format for storing the audio data in the blockchain is audio data ID-{2;audio data content in binary format}, where the character 2 represents the audio type.

[0090] In this way, by defining a data type that has extensibility for data storage and specifying a smart contract that realizes data processing for data waiting to be processed, when the specified smart contract is called to perform a data processing operation, corresponding processing algorithms can be called according to different data types to easily perform data processing, thereby improving data processing efficiency.

[0091] Furthermore, by combining this with the methods for acquiring data waiting to be processed shown as methods 1 and 2 above, data waiting to be processed can be acquired effectively in a variety of situations.

[0092] In some embodiments, the processing device determines a function interface corresponding to the operation type information in the target smart contract, and invokes the algorithm content corresponding to the function interface to process the waiting data and obtain a data processing result.

[0093] In the embodiment of the present application, considering that one smart contract may include at least one function interface to represent at least one processing function that can be realized based on the smart contract, operation type information is included in the data processing request to determine the function interface to be called. Here, the function interface layer of the smart contract defines the function that can be realized by calling the smart contract, and the function interface in the function interface layer can call an algorithm in the algorithm layer of the smart contract. Then, the node device processes the waiting data by calling the algorithm content corresponding to the function interface to obtain a data processing result.

[0094] In this way, after determining the target smart contract and operation type based on the data processing request, if the target smart contract determines that the authentication of the target device has been passed, data processing services are provided. Thus, the distributed architecture of the blockchain system can provide data processing functions to each node device, and can effectively respond to the data processing request of the target device and ensure the stable progress of data processing.

[0095] In step 303, the node device feeds back the data processing result to the target device.

[0096] In some embodiments, for the acquired data processing result, when executing the target smart contract, the node device determines whether the data processing result needs to be stored according to the instruction information included in the data processing request, which instructs whether to store the data processing result. Based on this, the process in which the node device feeds back the data processing result includes the following two types of operations:

[0097] In an embodiment of the present application, the data processing request of the target device includes instruction information instructing whether to store progress data and data processing results, and it can be predetermined that a statement identifying the above field is configured in the smart contract, so that different processing contents can be executed based on different values ​​of the above field.

[0098] In Type 1, the data processing results are fed back directly to the target device.

[0099] In an embodiment of the present application, if the node device determines not to store the data processing result based on the data processing request, it directly feeds back the acquired data processing result to the target device.

[0100] In some embodiments, when a node device executes a target smart contract, if the node device determines that it does not need to store the data processing result, the node device may directly feed back the data processing result obtained by the processing to the target device.

[0101] In type 2, the data processing result is fed back to the target device, data identification information is generated for the data processing result, and the data identification information and the corresponding data processing result are stored in the blockchain.

[0102] In an embodiment of the present application, when a node device decides to store a data processing result based on a data processing request, it generates corresponding data identification information for the acquired data processing result, feeds back the data processing result to the target device, and stores the data identification information and the corresponding data processing result in each node device in the blockchain system according to the principles of blockchain consensus.

[0103] In some embodiments, when the node device executes the target smart contract and determines that the data processing result needs to be stored, it will feed back the data processing result obtained by processing to the target device, and generate corresponding data identification information for the data processing result, and then, when executing the target smart contract, it will call the data storage interface to request the adoption of a block chain storage method in the block chain system, and store the data identification information and the corresponding data processing result in each node device in the block chain system according to the principles of block chain consensus. Here, the data block chain storage method is a mature technology in the field, and this application will not describe it.

[0104] It should also be explained that, with regard to the storage principle of the blockchain system, all data processing operations generated are usually stored in the form of transactions, so that all past operation data can be traced, and the storage of this part of the past operation data is not affected by the configuration of the target device, and the target device can be configured to store or not store data generated in the processing (such as progress data and processing result data), and the storage of past operation data can be realized by invoking the storage logic in the blockchain system, and the present application is not limited thereto.

[0105] For example, assuming that User 1 requests video editing and instructs not to store the editing result, according to the storage principle of the blockchain system, the past operation information of User 1's video editing operation will be stored, but the final editing result will not be stored.

[0106] In this way, the data contents instructed and stored by the target device can be stored according to the storage needs of the configuration of the target device, thereby enabling differential processing according to the storage needs of different targets.

[0107] It should be noted that in the embodiment of the present application, the adjustment and upgrade of the data processing function can be realized by upgrading and configuring the smart contract. In other words, when upgrading the function of the data processing engine of the block chain system, only the corresponding smart contract needs to be upgraded, and the smart contract corresponding to the upgraded function and the service of the smart contract corresponding to other functions are not affected in the smart contract upgrade process. In the smart contract upgrade, the smart contract upgrade transaction and other transactions that call this contract have a dependency relationship, so that the block chain system automatically sorts and executes each related transaction (or data processing request) in order, thereby achieving the effect that all transactions can be executed accurately.

[0108] In some embodiments, the node device receives a function adjustment processing request for a target data processing function, obtains a smart contract to be stored that includes the adjusted processing logic included in the function adjustment processing request, sorts each of the received data processing requests based on the dependency between the target data processing function and other data processing requests, and processes each data processing request based on the sorting result.

[0109] In addition, a smart contract may have dependencies on different transactions that invoke it (processing the same data) or may not have dependencies on each other (processing completely different data), and in either case, whether or not this smart contract is upgraded does not affect the execution relationship between the transactions.

[0110] Assuming that there is no dependency between all transactions that invoke the same smart contract, as shown in Figure 3D, Figure 3D is a comparison diagram of the execution order of data processing transactions in an embodiment of the present application. As shown in Figure 3D, when there is no contract upgrade, each data processing transaction (data processing request) is executed in parallel, but when there is a contract upgrade, the contract upgrade transaction and the data processing transaction are executed in series, and the data processing transactions are executed in parallel.

[0111] In this way, the execution order of different data processing requests can be determined, which corresponds to respectively instructing the execution order of the data inquiry and operation process, the data processing process in a trusted computing scenario, and the processing process in which a contract upgrade transaction and a data processing transaction are parallel. Based on the automatic sorting function in the blockchain system, various transactions can be executed in an orderly manner, so that data processing is not interrupted when the processing function is upgraded.

[0112] The data processing solution proposed in the embodiment of the present application can also be applied to a trusted computing scenario, and in the case of a node device, a trusted computing environment is configured in the node device for performing trusted computing, where the configuration of a trusted computing environment is a common technique in the art, and the present application does not limit the same.

[0113] For data processing tasks that require trusted computing, there can be two processing schemes based on blockchain according to different security levels: the first processing scheme is that both the deployment and invocation of smart contracts directly access the trusted computing service to perform trusted computing, and then the calculated data and data ID are stored on the chain; the second processing scheme is that the deployment and invocation of smart contracts are performed through the blockchain, but the contract is finally executed through the trusted computing environment.

[0114] It should be noted that a data encryption and decryption method is agreed upon between the node device and the target device of the target object, so that the node device can decrypt encrypted data sent from the target device.

[0115] In the first processing scheme, the node device receives a trusted processing request triggered by the target device for encrypted data, obtains the encrypted data, the encrypted smart contract, the trusted operation type information for the encrypted data, and the target identification information of the target device contained in the trusted processing request, and then, in the constructed trusted computing environment, decrypts it based on the encrypted smart contract to obtain the corresponding trusted smart contract; if it determines that the target device has the authority to request an operation corresponding to the trusted computing type information, decrypts it based on the encrypted data to obtain the target data, and adopts the trusted computing logic bound in the trusted smart contract to process the target data to obtain a trusted computing result, and then stores the trusted computing result in the blockchain, and feeds back the keyword information corresponding to the trusted computing result to the target device.

[0116] In some embodiments, in a first processing scheme, after the node device obtains the encrypted data, the encrypted smart contract, the target identification information of the target device, and the trusted computing type information for the encrypted data contained in the trusted processing request, in the trusted computing environment, it performs the following operations: decrypting the encrypted smart contract, and if it is determined that the target device has the authority to request an operation corresponding to the trusted computing type based on the decrypted trusted smart contract, the target identification information of the target device, and the trusted computing type information, decrypting the encrypted data to obtain the target data; and adopting the trusted computing logic in the trusted smart contract that matches the trusted computing type information to call an algorithm to realize the processing of the target data and obtain a trusted computing result.

[0117] In some embodiments, in the process of storing in the blockchain, after the node device executes the trusted smart contract in the trusted computing environment to obtain a trusted computing result, the node device can subsequently call the data storage interface through the trusted smart contract, thereby adopting the data storage method in the blockchain system to store data in the blockchain.

[0118] For example, as shown in Fig. 4A, Fig. 4A is a schematic diagram of the implementation process of trusted computing processing in an embodiment of the present application. The following describes the process of performing trusted computing based on private data when obtaining the ground of related object with reference to Fig. 4A.

[0119] In step 41, the target device sends a private data computing request to the node device, which includes encrypted private data, encrypted private contract, target device identification information, and trusted computing type information.

[0120] In step 42, the node device transmits the contents contained in the private data computing request to the trusted computing environment.

[0121] In step 43, the node device, in the trusted computing environment, decrypts the encrypted private contract to obtain the private contract.

[0122] In step 44, the node device determines, in the trusted computing environment, based on the correspondence between the target information and the trusted computing type in the private contract, that the target device has the authority to initiate an operation corresponding to the trusted computing type information.

[0123] In step 45, the node device, in the trusted computing environment, decrypts the encrypted data to obtain the target data, and invokes the contract engine to execute the private contract.

[0124] In step 46, the node device generates a unique data ID for the trusted computing result in the trusted computing environment and stores the data ID and the corresponding trusted computing result in the blockchain.

[0125] In some embodiments, by invoking a data storage interface encapsulated in a storage layer in a private contract, processing logic for performing data storage in a blockchain system can be obtained and storage can be realized in the blockchain.

[0126] In step 47, the node device feeds back the data ID to the target device in the trusted computing environment.

[0127] In this way, by obtaining the encrypted smart contract and data to be processed, as well as the indicated trusted computing type according to the needs of trusted computing, it is possible to realize effective processing in the trusted computing environment and ensure the safety of data processing.

[0128] In the second processing scheme, the smart contract to be executed in the trusted computing environment is encrypted and stored in the blockchain, and the data content to be processed is also pre-encrypted and stored in the blockchain system. In this case, data processing can be performed according to the normal data processing process shown in Figure 3A.

[0129] In this case, when the node device is configured to perform trusted computing and the data processing request is used to perform trusted processing on encrypted data, the contract identification information in the data processing request is used to identify the encrypted and stored trusted smart contract in the blockchain, the description information is used to describe the encrypted and stored target data, and the operation type information represents the requested trusted computing type information; and further, when performing trusted computing, the node device decrypts the encrypted and stored trusted smart contract in the constructed trusted computing environment to obtain the trusted smart contract, and if it determines that the target device has the authority to request the operation corresponding to the trusted computing type information, decrypts the encrypted and stored target data to obtain the target data, and processes the target data according to the trusted computing logic bound in the trusted smart contract.

[0130] For example, as shown in Fig. 4B, Fig. 4B is a schematic diagram of another implementation process of trusted computing processing in an embodiment of the present application. The following describes the process of performing trusted computing based on private data when obtaining the ground of related object with reference to Fig. 4B.

[0131] In step 4b-1, the target device sends a private data computing request to the node device, including the contract identification information of the encrypted private contract, description information of the encrypted data, the target identification information of the target device, and trusted computing type information.

[0132] In step 4b-2, the node device receives the content included in the private data computing request, and obtains the encrypted private contract and encrypted data based on the contract identification information and description information.

[0133] In step 4b-3, the node device, in the trusted computing environment, decrypts the encrypted private contract to obtain the private contract.

[0134] In step 4b-4, the node device determines, in the trusted computing environment, based on the correspondence between the target information and the trusted computing type in the private contract, that the target device has the authority to request an operation corresponding to the trusted computing type information.

[0135] In step 4b-5, the node device, in the trusted computing environment, decrypts the encrypted data to obtain the target data, and invokes the contract engine to execute the private contract.

[0136] In step 4b-6, the node device generates a unique data ID for the trusted computing result in the trusted computing environment, and stores the data ID and the corresponding trusted computing result in the blockchain.

[0137] In some embodiments, by invoking a data storage interface encapsulated in a storage layer in a private contract, processing logic for performing data storage in a blockchain system can be obtained and storage can be realized in the blockchain.

[0138] In step 4b-7, the node device feeds back the data ID to the target device in the trusted computing environment.

[0139] In this way, by integrating the steps of realizing trusted computing into normal data processing processes, trusted computing can be realized based on smart contracts and target data encrypted and stored in the blockchain.

[0140] Next, examples will be given to describe the process of invoking smart contracts to perform query and operation processing in various data processing processes.

[0141] As shown in Figure 5, Figure 5 is a flowchart of invoking a smart contract to execute a transaction in an embodiment of the present application. The following describes the process of invoking a query and operation with reference to Figure 5.

[0142] In step 501, the target device formulates a data processing request.

[0143] In step 502, the node device receives a data processing request, and acquires the contract identification information, description information of the data to be processed, operation type information, and target identification information contained in the data processing request.

[0144] In step 503, the node device performs signature verification on the target device and determines that the identity of the target device has been successfully authenticated.

[0145] In step 504, the node device searches for the target smart contract to execute in the blockchain based on the contract identification information.

[0146] In step 505 , the node device determines whether the target device has the authority to request the operation corresponding to the operation type information, and if so, executes step 507 , and if not, executes step 506 .

[0147] In step 506, the node device feeds back an indication of the processing failure to the target device.

[0148] In step 507, the node device searches the blockchain for pending data based on the description information.

[0149] In step 508, the node device determines the name of the function to be called in the target smart contract based on the operation type information, and calls the function.

[0150] In step 509, the node device performs data processing by calling a corresponding algorithm based on the determined functional function, and obtains a data processing result.

[0151] In step 510 , the node device determines whether the target device has instructed to store the data processing result, and if so, executes step 512 , otherwise executes step 511 .

[0152] In step 511, the node device transmits the data processing result to the target device.

[0153] In step 512, the node device generates a data ID for the data processing result, takes the data ID as keyword information, and stores the data ID and the corresponding data processing result in the blockchain after block packing, verification, and submission are completed by consensus.

[0154] In step 513, the node device feeds back the data processing result and the data ID to the target device.

[0155] In view of the above, the data processing solution proposed by the present application proposes an overall architecture of a data processing engine based on a smart contract of a blockchain, and each smart contract has a versatile contract hierarchical structure, which is easy for developers to program hierarchically, and the data processing function is realized by executing the smart contract. In addition, by providing an extensible data type definition for the data type to be stored, the smart contract that realizes the data processing function can call the corresponding processing algorithm according to different data types to perform data processing. In addition, the smart contract that realizes the data processing function has an extensible definition of its function layer interface, and can program and realize the addition of new functions according to actual processing needs. In addition, by providing an extensible data operation type definition, the target device can define the request structure of the data processing request, so that the data with a specified data ID can be processed using a specified algorithm, and the transaction sorting function in the blockchain system can provide a processing order for the data query and operation process, the data processing process in the trusted computing scene, and the state in which the contract upgrade transaction and the data processing transaction are in parallel.

[0156] In addition, the upgrade of the data processing function does not affect the service, and the actual data processing of the data processing engine based on the blockchain is realized by using a smart contract, and the contract upgrade is performed as an operation at the same level as the request for the blockchain storage of data, data processing, etc., so that the service can be performed without being noticed without affecting the operation of the service. In addition, the relevant object can realize a data processing algorithm with a customized configuration based on the blockchain by creating a smart contract that realizes the data processing function, and the function extension is not limited. Furthermore, due to the characteristic that past data is traceable in the blockchain system, all operations related to the data processing of the data processing engine based on the blockchain are stored in the form of transactions, so that all past data can be traced, and the relevant object can query the operation log from the node device and realize data statistics and billing by itself. In addition, since the data storage security of the blockchain system is high, there is no data security risk, and in special scenarios where data is sensitive, a method of encrypting data and contracts and storing them in the blockchain, or a method of directly executing the smart contract and target data in trusted computing can be selected to protect data security.

[0157] Based on the same technical concept, as shown in FIG. 6, FIG. 6 is a schematic diagram showing a logical structure of a data processing device in an embodiment of the present application. The data processing device 600 includes a receiving unit 601, a processing unit 602, and a feedback unit 603; The receiving unit 601 is configured to receive a data processing request sent from the target equipment, and obtain contract identification information, description information of the data to be processed, operation type information for the data to be processed, and target identification information of the target equipment contained in the data processing request, where one contract identification information is used to identify one smart contract, and one smart contract stores the processing logic of at least one data processing function; the processing unit 602 is configured to search for a corresponding target smart contract in the stored blockchain based on the contract identification information, and process the data to be processed according to a processing method corresponding to the operation type information in the target smart contract to obtain a data processing result; and the feedback unit 603 is configured to feedback the data processing result to the target equipment.

[0158] In some embodiments, each smart contract includes a three-layer logical structure including a function interface layer, an algorithm layer, and a memory layer, in which the function interface layer is used to define the realizable data processing functions and the parameters on which the data processing depends, the algorithm layer is used to define the content of the algorithm that realizes the data processing functions, and the memory layer is used to define the storage format of the data processing results.

[0159] In some embodiments, when the node device is configured to perform trusted computing and the data processing request is used to request that a trusted operation be performed on encrypted data, the contract identification information is used to identify an encrypted and stored trusted smart contract in the blockchain, the description information is used to describe the encrypted and stored target data, and the operation type information represents the requested trusted computing type information; When searching for a corresponding target smart contract in the stored blockchain based on the contract identification information, and processing the waiting data according to a processing manner corresponding to the operation type information in the target smart contract, the processing unit 602 is configured to: decrypt the encrypted and stored trusted smart contract in the constructed trusted computing environment to obtain the trusted smart contract; if it determines that the target device has the authority to request an operation corresponding to the trusted computing type information, decrypt the encrypted and stored target data to obtain the target data, and process the target data according to the trusted computing logic bound in the trusted smart contract.

[0160] In some embodiments, when the node device is configured to perform data processing in a trusted computing mode, the data processing device further includes a computing unit 604, which is configured to receive a trusted processing request triggered by the target device for encrypted data, obtain the encrypted data, the encrypted smart contract, the trusted computing type information for the encrypted data, and the target identification information of the target device included in the trusted processing request, decrypt according to the encrypted smart contract in the constructed trusted computing environment to obtain a corresponding target smart contract, and if it is determined that the target device has the authority to request an operation corresponding to the trusted computing type information, decrypt according to the encrypted data to obtain the target data, and employ the trusted computing logic bound in the target smart contract to process the target data to obtain a trusted computing result, store the trusted computing result in the blockchain, and feed back keyword information corresponding to the trusted computing result to the target device.

[0161] In some embodiments, before receiving a data processing request sent from the target device, the receiving unit 601 is configured to configure the node device as a node in the blockchain system according to a node deployment scheme in the blockchain system, and store smart contracts for realizing different data processing functions.

[0162] In some embodiments, when receiving a data processing request sent from a target device and obtaining contract identification information, descriptive information of the data to be processed, and target identification information of the target device contained in the data processing request, the receiving unit 601 is configured to perform the steps of: receiving the data processing request sent from the target device, where the data processing request is constructed based on the descriptive information of the data to be processed and the determined contract identification information according to a predetermined field format, and a target smart contract corresponding to the contract identification information includes processing logic to be executed on the data to be processed; and parsing the data processing request according to the field format to obtain the contract identification information, the descriptive information of the data to be processed, and the target identification information of the target device.

[0163] In some embodiments, when searching for a corresponding target smart contract in the stored blockchain based on the contract identification information, and processing the waiting data according to a processing manner corresponding to the operation type information in the target smart contract, the processing unit 602 is configured to: search for a corresponding target smart contract in the stored blockchain based on the contract identification information, if it determines that the target device has passed identity authentication based on the target identification information, and obtain the waiting data, determine a function interface corresponding to the operation type information in the target smart contract, and invoke the algorithm content corresponding to the function interface to process the waiting data.

[0164] In some embodiments, when feeding back the data processing result to the target device, the processing unit 602 is configured to: generate corresponding data identification information for the acquired data processing result, feed back the data processing result to the target device, and store the data identification information and the corresponding data processing result in each node device in the blockchain system according to the principles of blockchain consensus, if it is determined based on the data processing request that the data processing result is to be stored; and directly feed back the acquired data processing result to the target device if it is determined not to store the data processing result based on the data processing request.

[0165] In some embodiments, when retrieving the data to be processed, the processing unit 602 is configured to perform one of the following operations: if the descriptive information is used to indicate a determination of data content stored in the blockchain, determining the data content retrieved from the blockchain based on the descriptive information as the retrieved data to be processed; if the descriptive information is used to describe the content of the data to be processed, determining the data content determined based on the descriptive information as the retrieved data to be processed; if the descriptive information is used to describe a storage address of the data to be processed, determining the retrieved data based on the storage address as the data to be processed.

[0166] In some embodiments, the data processing device further comprises a sorting unit 605, the sorting unit 605 being configured to perform the steps of receiving a function adjustment processing request for a target data processing function, and obtaining a to-be-stored smart contract included in the function adjustment processing request, where the to-be-stored smart contract includes the adjusted processing logic, and sorting each received data processing request based on a dependency relationship between the target data processing function and other data processing requests, and processing each data processing request based on the sorting result.

[0167] Having described the data processing method and apparatus of the exemplary embodiment of the present application, an electronic device according to another exemplary embodiment of the present application will now be described.

[0168] Those skilled in the art will appreciate that various aspects of the present application may be embodied as a system, method, or program product. Thus, various aspects of the present application may be embodied in an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.), or an embodiment combining both hardware and software, which may be collectively referred to herein as a "circuit," "module," or "system."

[0169] Based on the same technical concept as the above-mentioned embodiment, the embodiment of the present application further provides an electronic device, as shown in Fig. 7, which is a schematic diagram showing a hardware configuration of an electronic device to which the embodiment of the present application is applied, and the electronic device 700 includes at least a processor 701 and a memory 702. Here, the memory 702 stores a program code, which, when executed by the processor 701, causes the processor 701 to execute any of the above-mentioned data processing steps.

[0170] In some possible embodiments, a computing device according to the present application may include at least one processor and at least one memory, where the memory stores program code that, when executed by the processor 701, causes the processor to perform the data processing steps according to various embodiments of the present application described herein. For example, the processor may perform the steps shown in FIG. 3A.

[0171] Hereinafter, a computing device 800 according to this embodiment of the present application will be described with reference to Fig. 8. As shown in Fig. 8, the computing device 800 is represented in the form of a general-purpose computing device. The components of the computing device 800 may include, but are not limited to, at least one processing unit 801 as described above, at least one storage unit 802 as described above, and a bus 803 connecting different system components (including the storage unit 802 and the processing unit 801).

[0172] Bus 803 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local area bus using any of a number of bus structures.

[0173] The storage unit 802 may include a readable medium in the form of volatile memory, such as a random access memory (RAM) 8021 and / or a cache memory 8022 , and may also include a read only memory (ROM) 803 .

[0174] The storage unit 802 may further include programs / utilities 8025 having a set (at least one) of program modules 8024, including, but not limited to, an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include implementation of a network environment.

[0175] The computing device 800 may also communicate with one or more external devices 804 (e.g., keyboard, pointing device, etc.), one or more devices that enable interaction of objects with the computing device 800, and / or any device (e.g., router, modem, etc.) that enables the computing device 800 to communicate with one or more other computing devices. Such communication may occur via an input / output (I / O) interface 805. The computing device 800 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 806. As shown, the network adapter 806 communicates with other modules of the computing device 800 via a bus 803. It should be understood that, although not shown, other hardware and / or software modules may be used in combination with the computing device 800, including, but not limited to, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0176] Based on the same technical concept as the above examples, each aspect of data processing provided by the present application may be realized in the form of a program product including program code, and when the program product is executed in an electronic device, the program code causes the electronic device to perform the steps of data processing according to various embodiments of the present application described in this specification, for example, the electronic device can perform the steps shown in FIG. 3A.

[0177] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. Readable storage media (a non-exhaustive list) include those electrically connected with one or more leads, portable disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0178] Although the preferred embodiments of the present application have been described, those skilled in the art can make further changes and modifications to these embodiments after understanding the basic creative concept. Therefore, it is intended that the appended claims be interpreted to include the preferred embodiments and all changes and modifications that are within the scope of the present application.

[0179] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Therefore, if these modifications and variations of the present application fall within the scope of the claims of the present application and the scope of the equivalent technology, the present application also intends to include these modifications and variations.

Claims

1. A data processing method executed by a node device in a blockchain system, comprising: receiving a data processing request sent from a target device, and acquiring contract identification information, description information of data to be processed, operation type information for the data to be processed, and target identification information of the target device included in the data processing request, wherein one contract identification information is used to identify one smart contract, and the one smart contract stores processing logic of at least one data processing function; Searching for a corresponding target smart contract in the stored blockchain according to the contract identification information, and processing the waiting data according to a processing manner corresponding to the operation type information in the target smart contract to obtain a data processing result; and feeding back the data processing result to the target device.

2. Each smart contract includes a three-layer logical structure including a function interface layer, an algorithm layer, and a memory layer, the function interface layer being used to define the data processing functions that can be realized and the parameters on which the data processing depends, the algorithm layer being used to define the content of the algorithm that realizes the data processing functions, and the memory layer being used to define the storage format of the data processing results.

2. The data processing method according to claim 1.

3. When the node device is configured to perform trusted computing and the data processing request is used to request performing a trusted processing on encrypted data, the contract identification information is used to identify an encrypted and stored trusted smart contract in a blockchain, the description information is used to describe the encrypted and stored target data, and the operation type information represents requested trusted computing type information; The step of searching for a corresponding target smart contract in the stored blockchain based on the contract identification information, and processing the pending data according to a processing manner corresponding to the operation type information in the target smart contract, Decrypting the encrypted and stored trusted smart contract in the constructed trusted computing environment to obtain the trusted smart contract; When the target device determines that it has the authority to request an operation corresponding to the trusted computing type information, decrypting the encrypted and stored target data to obtain the target data; and processing the target data according to trusted computing logic bound in the trusted smart contract.

2. The data processing method according to claim 1.

4. When the node device is configured to perform data processing in a trusted computing mode, the data processing method includes: receiving a trusted processing request triggered by a target device for encrypted data, and obtaining the encrypted data, the encrypted smart contract, trusted computing type information for the encrypted data, and target identification information of the target device included in the trusted processing request; In the constructed trusted computing environment, decrypting the encrypted smart contract to obtain a corresponding target smart contract; When the target device determines that it has the authority to request an operation corresponding to the trusted computing type information, decrypting according to the encrypted data to obtain target data; Employing a trusted computing logic bound in the target smart contract to process the target data to obtain a trusted computing result; storing the trusted computing result in a blockchain, and feeding back keyword information corresponding to the trusted computing result to the target device; 2. The data processing method according to claim 1.

5. Before receiving a data processing request transmitted from the target device, the data processing method includes: The method includes configuring the node device as a node in the blockchain system according to a node arrangement method in the blockchain system, and storing a smart contract for realizing different data processing functions in the node device.

2. The data processing method according to claim 1.

6. The step of receiving a data processing request transmitted from the target device and acquiring contract identification information, description information of data waiting to be processed, and target identification information of the target device, which are included in the data processing request, includes: receiving a data processing request sent from a target device, the data processing request being constructed by the target device based on description information of data to be processed and a determined contract identification information according to a predetermined field format, a target smart contract corresponding to the contract identification information including a processing logic that needs to be performed on the data to be processed; Parsing the data processing request according to the field format to obtain the contract identification information, description information of the data to be processed, and target identification information of the target device.

2. The data processing method according to claim 1.

7. The step of searching for a corresponding target smart contract in the stored blockchain based on the contract identification information, and processing the pending data according to a processing manner corresponding to the operation type information in the target smart contract, When determining that the target device has passed identity authentication based on the target identification information, searching for a corresponding target smart contract in the stored blockchain based on the contract identification information; When determining that the target device has the authority to initiate an operation corresponding to the operation type information based on the target smart contract, the target identification information, and the operation type information, acquiring the waiting data; Determining a function interface corresponding to the operation type information in the target smart contract, and calling an algorithm content corresponding to the function interface to process the pending data; 2. The data processing method according to claim 1.

8. The step of feeding back the data processing result to the target device includes: If it is determined to store the data processing result based on the data processing request, generating corresponding data identification information for the acquired data processing result, feeding back the data processing result to the target device, and storing the data identification information and the corresponding data processing result in each node device in the blockchain system according to the blockchain consensus principle; and when it is determined not to store the data processing result based on the data processing request, directly feeding back the acquired data processing result to the target device. The data processing method according to claim 7.

9. The step of acquiring data to be processed includes: determining, when the descriptive information is used to indicate a determination of a data content stored in the blockchain, the data content retrieved from the blockchain based on the descriptive information as the retrieved data to be processed; determining, if said description information is used to describe the content of the to-be-processed data, the data content determined based on said description information as the acquired to-be-processed data; when the description information is used to describe a storage address of data to be processed, determining data obtained based on the storage address as data to be processed; The data processing method according to claim 7.

10. The data processing method includes: A step of receiving a function adjustment processing request for a target data processing function and acquiring a smart contract to be stored included in the function adjustment processing request, the smart contract to be stored including a processing logic after adjustment; and sorting each of the received data processing requests based on a dependency relationship between the target data processing function and other data processing requests, and processing each of the data processing requests based on a sorting result.

2. The data processing method according to claim 1.

11. A data processing apparatus comprising: a receiving unit, a processing unit, and a feedback unit; The receiving unit is configured to receive a data processing request sent from a target device, and obtain contract identification information, description information of data to be processed, operation type information for the data to be processed, and target identification information of the target device contained in the data processing request, wherein the contract identification information is used to identify a smart contract, and the smart contract stores processing logic of at least one data processing function; The processing unit is configured to search for a corresponding target smart contract in the stored blockchain according to the contract identification information, and process the waiting data according to a processing manner corresponding to the operation type information in the target smart contract to obtain a data processing result; The data processing device, wherein the feedback unit is configured to feed back the data processing result to the target device.

12. Each smart contract includes a three-layer logical structure including a function interface layer, an algorithm layer, and a memory layer, the function interface layer being used to define the data processing functions that can be realized and the parameters on which the data processing depends, the algorithm layer being used to define the content of the algorithm that realizes the data processing functions, and the memory layer being used to define the storage format of the data processing results. A data processing apparatus according to claim 11.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, the processor realizing the data processing method according to any one of claims 1 to 10 when executing the computer program.

14. A computer program which, when executed by a processor, causes the processor to carry out a data processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Intelligent contract execution method, device and system, storage medium and electronic equipment

    CN112632573A

  • Method and apparatus for maintaining private data using a consortium blockchain

    JP2022547853A

  • Blockchain-based data processing method, and blockchain node apparatus

    WO2022247385A1