Disclosure of Invention
In order to solve the above technical problem, embodiments of the present invention provide a method, a system, a terminal, and a storage medium for integrating service applications based on a block chain.
The invention provides a service application integration method based on a block chain, which comprises the following steps:
when a cooperation request sent by a first business application module is received, sending the cooperation request to a block chain network through a block chain integration middleware connected with the first business application module;
and receiving the cooperation processing result sent by the block chain network through the block chain integration middleware, and sending the cooperation processing result to the first service application module.
Further, the method further comprises:
acquiring a cooperation request in the blockchain network through the blockchain integration middleware, and sending the cooperation request to a second service application module connected with the blockchain integration middleware;
and sending the cooperative processing result of the second service application module to the blockchain network through the blockchain integration middleware.
Further, before the acquiring, by the blockchain integration middleware, the cooperation request in the blockchain network and sending the cooperation request to a second service application module connected to the blockchain integration middleware, the method further includes:
and screening the cooperation request in the block chain network through the block chain integration middleware.
Further, the method further comprises:
storing a cooperation request and a cooperation processing result sent by a business application module in the block chain integration middleware;
and storing the cooperation request and the cooperation processing result acquired from the blockchain network in the blockchain integration middleware.
Further, the method further comprises:
converting a cooperation request and a cooperation processing result sent by a business application module into a block chain network data format through the block chain integration middleware, and sending the block chain network data format to a block chain network;
and converting the cooperation request and the cooperation processing result acquired from the block chain network into a business application module data format through the block chain integration middleware, and sending the business application module data format to a business application module.
The invention also provides a service application integration system based on the block chain, which comprises: the system comprises at least one service application module and a block chain integration middleware respectively connected with each service application module;
the business application module is connected into a blockchain network through the blockchain integration middleware;
and the blockchain integration middleware is used for transmitting data between the service application module and the blockchain network.
Further, the blockchain integration middleware comprises: the system comprises a cooperation request receiving component, a conversion component, a cooperation request sending component, a cooperation task receiving component and a cooperation task executing component;
the cooperation request receiving component is used for receiving the service information sent by the service application module;
the conversion component is used for converting the format of the service information received by the receiving component and converting the format of the cooperative task acquired by the cooperative task receiving component from the block chain network;
the cooperation request sending component is used for sending the service information converted by the conversion component to a block chain network;
the cooperative task receiving component is used for acquiring a cooperative task from the blockchain network;
and the cooperative task execution component is used for sending the cooperative task converted by the conversion component to the target business application module.
Further, the blockchain integration middleware further comprises: a database of the collaborative business is created,
and the collaboration service database is used for recording data information of interaction between the service application module and the block chain network.
Further, the blockchain integration middleware further comprises: a library of collaborative business models is created,
the collaborative business model library comprises data source information and data conversion rules in the business application module, and filtering rules for acquiring collaborative tasks from the block chain network.
The invention also provides a terminal which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for finishing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the service application integration methods based on the block chain when executing the program stored in the memory.
The invention also provides a storage medium, wherein the storage medium is stored with a block chain-based business application integration method program, and the block chain-based business application integration method program realizes any step of the block chain-based business application integration method when being executed by a processor.
Compared with the closest prior art, when a cooperation request sent by a business application module is received, the cooperation request is sent to a block chain network through a block chain integration middleware connected with the business application module; and then, receiving the cooperation processing result sent by the blockchain network through the blockchain integration middleware, and sending the cooperation processing result to the service application module. In the embodiment of the invention, the service application module is connected with the block chain network through the block chain integration middleware, and the bidirectional interaction between the service application module and the block chain network can be realized, so that the data conversion and the service routing function required by the bidirectional interaction are completed.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A mobile terminal implementing various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
The application provides a service application integration method based on a block chain, as shown in fig. 1, the integration problem of a service application system and a block chain network is solved, the integration development work of a service application system end is avoided or reduced through a universal configurable block chain network and a service system integration middleware in the invention, and the technical threshold and the construction cost of a block chain-based cross-organization service cooperation system are reduced. Collaboration requests in the business application system that need to be processed via the blockchain network, and collaboration tasks on the blockchain network that need to be processed through the business application system, are collected, routed, adapted, and distributed by the blockchain integration middleware. The business application system comprises at least one business application module.
In step S101, when a cooperation request sent by a first service application module is received, the cooperation request is sent to a blockchain network through blockchain integration middleware connected to the first service application module.
In the embodiment of the application, when a service application module is detected to have a cooperation request, the cooperation request to be initiated is collected from the service application system through the blockchain integration middleware, and the cooperation request is subjected to data conversion through the blockchain integration middleware, converted into a blockchain operation parameter, and finally routed to the blockchain network.
In step S102, the cooperation processing result sent by the blockchain network is received by the blockchain integration middleware and sent to the first service application module.
In the embodiment of the application, when it is detected that a coordination processing result corresponding to the coordination request exists in the blockchain network, the coordination processing result sent by the blockchain network is received through the blockchain integration middleware, and then the data is converted and sent to the service application module corresponding to the coordination request.
Further, the data interaction between the service application module and the blockchain network is realized through the blockchain integration middleware in the embodiment of the application. That is, the service information in the service application module may be sent to the blockchain network, or the service information in the blockchain network may be sent to the service application module.
The service information may include a cooperation request, a cooperation task corresponding to the cooperation request, and a cooperation processing result.
According to the embodiment of the application, when a cooperation request sent by a business application module is received, the cooperation request is sent to a block chain network through a block chain integration middleware connected with the business application module; and then, receiving the cooperation processing result sent by the blockchain network through the blockchain integration middleware, and sending the cooperation processing result to the service application module. In the embodiment of the invention, the service application module is connected with the blockchain network through the blockchain integration middleware, and the bidirectional interaction between the service application module and the blockchain network can be realized, so that the data conversion and the service routing function required by the bidirectional interaction can be completed.
In one possible embodiment of the present application, the connection relationship and application scenario of the blockchain and business system integration middleware is shown in fig. 2, where ○ a blockchain integration middleware is a blockchain and business system integration middleware, ○ a business application system is a related business application system for cross-organization collaboration business participation parties, and ○ a three-blockchain network is a decentralized blockchain network for recording collaboration ledgers and running collaboration contracts, which are commonly maintained (or adopted) across the organization collaboration business participation parties.
All parties participating in the cross-organization collaboration service comprise a block chain integration middleware which is used as a bridge for bidirectional communication between an internal service application system and a block chain network, and collaboration requests needing to be processed by the block chain network in the service application system and collaboration tasks needing to be processed by the service application system on the block chain network are collected, routed, adapted and distributed by the block chain integration middleware.
As shown in FIG. 2, a first cross-organization collaboration service participant collects ① collaboration requests to be initiated from a service application system through a blockchain integration middleware and routes the collaboration requests to a corresponding blockchain operation (usually, an intelligent contract operation) to convert the collaboration requests into blockchain operation parameters and finally call ② related blockchain operations, a second cross-organization collaboration participant serves as a collaboration request handler to listen to blockchain network events through the blockchain integration middleware to obtain a collaboration request task ③, a service application system related service for processing the task is routed to the service application system related service for processing the task to convert the collaboration task into a data format processed by the service application system and finally distribute the data format to the service application system ④, the block chain integration middleware converts the collaboration processing result into blockchain operation parameters and sends the blockchain operation parameters to a blockchain network ⑥ after the service application system completes task processing and executes subsequent collaboration requests to send collaboration processing results to the blockchain integration middleware ⑤, the first cross-organization collaboration participant converts the collaboration processing results into the data format processed by the blockchain integration middleware ⑧ and sends the data format processed by the blockchain management middleware to the network application system ⑦.
The integration middleware provided by the application can set corresponding integration rules according to the needs of the collaboration service scene, as shown in fig. 2, except for the execution process, the cross-organization collaboration participants act as the collaboration task related parties, collaboration tasks can be collected through the service integration middleware, and task contents are synchronized to the internal service system.
In a specific embodiment of the present application, the method for integrating service applications based on a block chain may further include:
acquiring a cooperation request in the blockchain network through the blockchain integration middleware, and sending the cooperation request to a second service application module connected with the blockchain integration middleware;
and sending the cooperative processing result of the second service application module to the blockchain network through the blockchain integration middleware.
In the embodiment of the application, a cooperation request in a blockchain network can be monitored through a blockchain integration middleware, and when the cooperation request is monitored, the cooperation request is subjected to data conversion and is sent to a business application module connected with the blockchain integration middleware. And the cooperative processing result of the business application module can be converted and then sent to the blockchain network through the blockchain integration middleware.
Further, before the acquiring, by the blockchain integration middleware, the cooperation request in the blockchain network and sending the cooperation request to the second service application module connected to the blockchain integration middleware, the service application integration method based on the blockchain may further include:
and screening the cooperation request in the block chain network through the block chain integration middleware.
That is, the blockchain integration middleware may further screen cooperation requests in the blockchain network, and screen cooperation requests that can be processed by the business application module connected to the blockchain integration middleware from a plurality of cooperation requests.
In one possible embodiment of the present application, the method for integrating service applications based on a block chain may further include:
storing a cooperation request and a cooperation processing result sent by a business application module in the block chain integration middleware;
and storing the cooperation request and the cooperation processing result acquired from the blockchain network in the blockchain integration middleware.
In the embodiment of the present application, the blockchain integration middleware may store various data information in the process of interacting the service application module with the blockchain network.
In one possible embodiment of the present application, the method for integrating service applications based on a block chain may further include:
converting a cooperation request and a cooperation processing result sent by a business application module into a block chain network data format through the block chain integration middleware, and sending the block chain network data format to a block chain network;
and converting the cooperation request and the cooperation processing result acquired from the block chain network into a business application module data format through the block chain integration middleware, and sending the business application module data format to a business application module.
In the embodiment of the application, the express integration middleware can convert the data format between the service application module and the blockchain network, so as to realize data interaction between the service application module and the blockchain network.
Based on the same inventive concept as the above method, in another embodiment of the present application, a service application integration system based on a block chain is further provided, as shown in fig. 3, the service application integration system based on a block chain includes: the system comprises at least one service application module and a block chain integration middleware respectively connected with each service application module;
the service application module is connected to the block chain network through the block chain integration middleware;
and the blockchain integration middleware is used for transmitting data between the service application module and the blockchain network.
In one possible embodiment of the present application, the blockchain integration middleware specifically includes: the system comprises a cooperation request receiving component, a conversion component, a cooperation request sending component, a cooperation task receiving component and a cooperation task executing component.
The collaboration request receiving component is configured to receive business information issued by a business application module.
The conversion component is configured to convert the format of the service information received by the receiving component and convert the format of the collaboration task acquired by the collaboration task receiving component from the blockchain network.
The cooperation request sending component is configured to send the business information converted by the conversion component to the blockchain network.
The collaboration task receiving component is configured to obtain a collaboration task from a blockchain network.
The cooperative task execution component is configured to send the cooperative task converted by the conversion component to the target business application module.
In one possible embodiment of the present application, the blockchain integration middleware may further include: a collaborative business database.
The collaboration business database is configured to record data information of business application modules interacting with the blockchain network.
In one possible embodiment of the present application, the blockchain integration middleware may further include: and (5) a collaborative business model library.
The collaborative business model library comprises data source information and data conversion rules in a business application module, and filtering rules for acquiring collaborative tasks from a block chain network.
The main components and relationships of the blockchain and business system integration middleware provided by the present application, and the relationships with related external systems and components are shown in fig. 3.
The main components include: the system comprises a cooperation request receiving component, a cooperation request processing component, a cooperation data conversion component, a cooperation request sending component, a cooperation task receiving component, a cooperation task processing component, a cooperation task executing component, a cooperation business model base and a cooperation business database.
The collaboration request receiving component is used for collecting service requests, service messages or service data which need to be recorded to a block chain or trigger block chain related events or contracts from a service system and recording the collected collaboration request information to a collaboration service database, supports active data acquisition from data sources such as a message middleware and a database system according to rules configured in a collaboration service model library, and provides a service interface to enable a service application system to actively initiate collaboration requests. And the cooperation request receiving component is used for receiving the service information sent by the service application module. The receiving mode comprises multiple modes, namely a business application module sends a cooperation request through a service interface provided by a cooperation request receiving component; the cooperation request receiving component can also extract the cooperation request from the database or the message middleware of the business application module based on the configuration information in the cooperation business model library.
The cooperation request processing component is responsible for processing and scheduling the cooperation request, realizes routing scheduling of the cooperation request mainly based on rule information configured in a cooperation service model library, calls the cooperation data conversion component and the cooperation request sending component to complete data conversion and distribution scheduling, and records a processing result of the cooperation request to the cooperation service database.
The cooperative data conversion component realizes the conversion of data based on the incoming data grammar mapping rule and is used for realizing the bidirectional data conversion between the business system and the block chain.
The cooperation request sending component sends the cooperation request to the block chain network, specifically, triggering a block chain event or calling a block chain intelligent contract through a block chain client, and the resources such as a signature private key required by the cooperation request sending component are provided through the resources or the resource description information stored in the cooperation service model library.
And the cooperative task receiving component monitors and collects related cooperative tasks from the block chain through the block chain client according to related task filtering rules in the cooperative business model library and records the related cooperative tasks to the cooperative business database.
The cooperative task processing component is responsible for processing and scheduling the cooperative tasks, and mainly realizes routing scheduling of the cooperative tasks based on rule information configured in the cooperative task model library, calls the cooperative data conversion component and the cooperative task execution component to complete task data conversion and task distribution scheduling, and records the processing results of the cooperative tasks to the cooperative service database.
The cooperative task execution component is responsible for distributing cooperative tasks to corresponding internal business application systems, the internal business application systems complete task processing, and common distribution modes such as calling business service interfaces, pushing to message middleware, writing to databases and the like are supported. And the cooperative task execution component is used for sending the cooperative task converted by the conversion component to the target business application module. The sending mode comprises multiple modes, namely the cooperative task execution component sends the cooperative task by calling a service interface of the service application module; or the cooperative task execution component writes the cooperative task into a database or message middleware of the business application module based on the configuration information in the cooperative business model library.
The collaborative business model base is a rule knowledge base for running of the block chain integrated middleware and comprises data source information such as service interfaces, message middleware, business databases and the like in the business application system; acquiring an acquisition rule of a cooperation task from a business application data source; data grammar mapping rules between the internal business system and the block chain; obtaining a filtering rule of a cooperation task from a blockchain network; the coordination requests to blockchain network operations (intelligent contracts) and routing rules of blockchain network events to internal business systems, etc.
The collaboration service database is a service database among the block chain integration middleware and stores the state information of collaboration tasks participating in organization-initiated collaboration requests and processing.
In another embodiment of the present application, a terminal is further provided, as shown in fig. 4, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504;
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
when a cooperation request sent by a business application module is received, sending the cooperation request to a block chain network through a block chain integration middleware connected with the business application module;
and receiving the cooperation processing result sent by the block chain network through the block chain integration middleware, and sending the cooperation processing result to the business application module.
The communication bus 504 mentioned above for the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 504 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 4, but this does not mean that there is only one bus or one type of bus.
The communication interface 502 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory 503 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor 501 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present application, a storage medium is further provided, where the storage medium stores a block chain-based business application integration method program, and the block chain-based business application integration method program, when executed by a processor, implements any of the steps of the block chain-based business application integration method described above.
When the embodiment of the invention is specifically implemented, reference can be made to the above embodiments, and corresponding technical effects are achieved.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and in actual implementation, there may be other divisions, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method described in the embodiments of the present invention can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk), and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention or the method according to some parts of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or applied directly or indirectly to other related technical fields, are included in the scope of the present invention.