CN110209381A - SDK fast integration method, apparatus, equipment and storage medium based on block chain - Google Patents
SDK fast integration method, apparatus, equipment and storage medium based on block chain Download PDFInfo
- Publication number
- CN110209381A CN110209381A CN201910475206.2A CN201910475206A CN110209381A CN 110209381 A CN110209381 A CN 110209381A CN 201910475206 A CN201910475206 A CN 201910475206A CN 110209381 A CN110209381 A CN 110209381A
- Authority
- CN
- China
- Prior art keywords
- sdk
- block chain
- theme
- consumer
- fast integration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Abstract
The SDK fast integration method based on block chain that the invention discloses a kind of, is related to financial technology field, this method comprises: obtaining the configuration file of preset format when operation system receives enabled instruction;Based on configuration file, ether mill web3j example is created, wherein the web3j example provides block chain api interface;Determine the corresponding theme configuration item of configuration file;If theme configuration item is consumer's theme configuration item, consumer's example is initialized by SDK, and subscribe to consumer's subject events on alliance's chain node;If theme configuration item is producer's theme configuration item, producer's example is initialized by SDK, so that operation system calls api interface to issue producer's subject events.The invention also discloses a kind of SDK fast integration device, equipment and storage medium based on block chain.The present invention is initialized consumers and producers' initialization process in SDK, is effectively realized the fast integration of SDK, simplify cost of access by the configuration file of preset format.
Description
Technical field
The present invention relates to block chain (Block chain) technical field more particularly to financial industry based on block chain
SDK fast integration method, apparatus, equipment and storage medium.
Background technique
With the development of computer technology, more and more technologies are (such as distribution, block chain Block chain, big number
According to, artificial intelligence etc.) it applies in financial field, traditional financial industry gradually changes to financial technology (Fintech), increasingly
More technologies is applied to financial industry.In the prior art, the web3j sdk kit based on java connection block chain integrates phase
It closes about event (contract of maintenance topic and event event), enclosed inside message cochain and the operation such as pulls, externally provide
Publication and subscribing interface allow application system display to call, and carry out the transmission of topic message and message is monitored.
However, in the prior art, application project must be introduced into application Context.xml file, pass through
Spring component loads this document initialization web3j environment, and the integrated level of Software Development Kit SDK is low, causes to issue and order
The cost of access for readding event is high.
Summary of the invention
It is a primary object of the present invention to propose a kind of SDK fast integration method, apparatus based on block chain, equipment and deposit
Storage media, it is intended to solve the problem that integrated level in the prior art is low, causes the cost of access for issuing and subscribing to event high.
To achieve the above object, the present invention provides a kind of SDK fast integration method based on block chain, described to be based on block
The SDK fast integration method of chain includes the following steps:
When operation system receives enabled instruction, the configuration file of preset format is obtained;
Based on the configuration file, ether mill web3j example is created, wherein the web3j example provides block chain API
Interface;
Determine the corresponding theme configuration item of the configuration file;
If the theme configuration item is consumer's theme configuration item, pass through Software Development Kit SDK initialization consumption
Person's example, and subscribe to consumer's subject events on alliance's chain node;
If the theme configuration item is producer's theme configuration item, producer's example is initialized by the SDK, for
The operation system calls the api interface to issue producer's subject events.
Preferably, when operation system receives the enabled instruction of Software Development Kit SDK, matching for preset format is obtained
Before the step of setting file, the SDK fast integration method based on block chain further include:
It is based on business scenario and the SDK configuration information by service application, obtains configuration file.
Preferably, described the step of being based on the configuration file, creating ether mill web3j example, includes:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, with building
The web3j example.
Preferably, the step of consumer's subject events subscribed on alliance's chain node further include:
Consumer's subject events are monitored to obtain message data based on alliance's chain node;
The message data is parsed to obtain message informing;
The message informing is distributed to the corresponding business function of consumer's theme configuration item by message distributor
In, so that the business function handles the message informing.
Preferably, consumer's subject events include the first custom events and the second custom events;The base
Being monitored the step of obtaining message data to consumer's subject events in alliance's chain node includes:
First custom events are monitored based on alliance's chain node to obtain the first data, and to described
Two custom events carry out caching process.
Preferably, the api interface is the interface that gives out information;If the theme configuration item is the configuration of producer's theme
, then producer's example is initialized by the SDK, so that the operation system calls the api interface to issue producer master
The step of topic event includes:
If the theme configuration item is producer's theme configuration item, the configuration file is parsed by the SDK, is obtained
Theme contract;
The corresponding interface that gives out information of the theme contract is called, sends producer's subject events to alliance's chain
Node.
In addition, to achieve the above object, the present invention also provides a kind of SDK fast integration device based on block chain is described
SDK fast integration device based on block chain includes:
Module is obtained, for obtaining the configuration file of preset format when operation system receives enabled instruction;
Module is constructed, for being based on the configuration file, creates ether mill web3j example, wherein the web3j example
Block chain api interface is provided;
Determining module, for determining the corresponding theme configuration item of the configuration file;
Subscribing module passes through Software Development Kit if being consumer's theme configuration item for the theme configuration item
SDK initializes consumer's example, and subscribes to consumer's subject events on alliance's chain node;
Release module passes through the initial metaplasia of the SDK if being producer's theme configuration item for the theme configuration item
Production person's example, so that the operation system calls the api interface to issue producer's subject events.
Preferably, the SDK fast integration device based on block chain further include:
Configuration module obtains configuration file for being based on business scenario and the SDK configuration information by service application.
Preferably, the building module is also used to:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, with building
The web3j example.
Preferably, the subscribing module is also used to:
Consumer's subject events are monitored to obtain message data based on alliance's chain node;
The message data is parsed to obtain message informing;
The message informing is distributed to the corresponding business function of consumer's theme configuration item by message distributor
In, so that the business function handles the message informing.
Preferably, the quantity of consumer's subject events is multiple, respectively the first custom events, the second consumer
Event;The subscribing module is also used to:
First custom events are monitored based on alliance's chain node to obtain the first data, and to described
Two custom events carry out caching process.
In addition, to achieve the above object, the SDK fast integration equipment based on block chain that the present invention also provides a kind of is described
SDK fast integration equipment based on block chain includes: memory, processor and is stored on the memory and can be at the place
The SDK fast integration program based on block chain run on reason device, the SDK fast integration program based on block chain are described
The step of SDK fast integration method based on block chain as described above is realized when processor executes.
In addition, to achieve the above object, the present invention also provides a kind of readable storage medium storing program for executing, being deposited on the readable storage medium storing program for executing
The SDK fast integration program based on block chain is contained, when the SDK fast integration program based on block chain is executed by processor
The step of realizing SDK fast integration method based on block chain as described above.
SDK fast integration method proposed by the present invention based on block chain is effectively gone by the configuration file of preset format
Except the file of the application.xml of the prior art relies on, so that Software Development Kit SDK is more general, and scalability is strong;
Also, based on the web3j example of configuration file building, support a plurality of alliance's chain;Furthermore after theme configuration item has been determined, lead to
Production role, the consumption role's configuration for crossing the same theme, realize news release and/or subscribe to message.With need in the prior art
Operation system initialization consumer's example is wanted to compare with the mode of producer's example, by initialization consumers and producers in SDK
Middle initialization process effectively realizes the fast integration of SDK, simplifies cost of access.
Detailed description of the invention
Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is that the present invention is based on the flow diagrams of the SDK fast integration method first embodiment of block chain;
Fig. 3 is the present invention is based on the publication of the block chain node of the SDK fast integration method first embodiment of block chain, subscribes to
The schematic diagram of event;
Fig. 4 is the process of the building web3j example the present invention is based on the SDK fast integration method first embodiment of block chain
Schematic diagram.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The embodiment of the present invention can be PC machine or server apparatus based on the SDK fast integration equipment of block chain.
As shown in Figure 1, being somebody's turn to do the SDK fast integration equipment based on block chain may include: processor 1001, such as CPU, net
Network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing these
Connection communication between component.User interface 1003 may include display screen (Display), input unit such as keyboard
(Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 is optional
May include standard wireline interface and wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory,
It is also possible to stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally may be used also
To be independently of the storage device of aforementioned processor 1001.
It will be understood by those skilled in the art that device structure shown in Fig. 1 does not constitute the restriction to equipment, can wrap
It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe module, Subscriber Interface Module SIM and the SDK fast integration program based on block chain.
In equipment shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background server
Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor
1001 can be used for calling the SDK fast integration program based on block chain stored in memory 1005, and execute following be based on
Operation in each embodiment of SDK fast integration method of block chain.
Based on above-mentioned hardware configuration, propose that the present invention is based on the SDK fast integration embodiments of the method for block chain.
Referring to Fig. 2, Fig. 2 be the present invention is based on the flow diagram of the SDK fast integration method first embodiment of block chain,
The described method includes:
Step S10 obtains the configuration file of preset format when operation system receives enabled instruction;
In the present embodiment, SDK (Software Development Kit, Software Development Kit) is typically all some soft
Part engineer is developing instrument when specific software package, software frame, hardware platform, operating system etc. establish application software
Set.When operation system receives the enabled instruction of Software Development Kit SDK, the configuration file of preset format is obtained,
In, enabled instruction triggers when can be starting operation system, can be to the configuration text of acquisition during operation system starting
Part is read out.
The configuration file of preset format may include: SDK functional switch, block chain node ip:port, theme topic conjunction
About address, block chain certificate file path, mechanism id consume theme topic, produce one or more information such as theme topic,
The configuration of orgid prefix-free is added by key between multiple operational agencies.Such as:
Aaaa.weevent.consumer.topic=*****
Bbbb.weevent.consumer.topic=*****
Aaa and bbb is respectively operational agency's title (such as banking institution, financial institution, insurance institution), being capable of flexible area
Separate service mechanism.As shown in figure 3, Fig. 3 is the publication of block chain node, the schematic diagram for subscribing to event.WeEvent provides a set of
Publish/Subscribe function set based on block chain.Event (event) is a message in business, can be word
Symbol type, such as Json or XML.It is also possible to binary type, such as agreement buffer structure.The thing that the WeEvent of this case is supported
Part, content maximum length are 10KB.The identical a kind of event of Topic (theme) structure, definition belongs to same in logic
Topic.When event handling and maintenance, it is mutually isolated between Topic.Event Broker is block chain node middleware,
Publish Event (publication event), Producer, toward one event of publication on some Topic, are issued by publish interface
Successful event will be permanently stored on financial block chain FISCO-BCOS.Event is never lost, and can not be distorted, and supports subsequent examine
Core.In Subscribe Event (subscribing to event), consumer Consumer subscribes to the event monitored on some Topic, when busy
Part will receive message informing when occurring, and can obtain the Topic since creation by special flag bit OFFSET_FIRST
All events.Unsubscribe Event (unsubscribes event), cancels a subscription movement, subsequent no longer to will receive thing
Part notice.
In the prior art, application project must be introduced into application Context.xml file, pass through spring component
It loading this document and initializes web3j environment, most of java applications are substantially now is built based on spring-boot frame,
It is the property file of properties with suffix, the configuration of application.xml can fix specific content instance, also,
The mode of application.xml cannot achieve a plurality of alliance's chain.
This programme service application configures relevant information according to the business scenario of oneself, specifically includes: configuration Correlation block chain
Nodal information, access certificate, topic title, the corresponding business interface function of statement topic.When activating business system,
It only needs to increase configuration item and be configured, is i.e. flexibly configurable content instance, so that SDK has good versatility and expansible
Property.
Step S20 is based on the configuration file, creates ether mill web3j example, wherein the web3j example provides area
Block chain api interface;
In the step, it is based on the configuration file, is communicated by Software Development Kit SDK building with alliance chain node
Ether mill web3j example, also, the corresponding web3j example of an operational agency, also, pass through Software Development Kit SDK
Based on web3j example described in alliance's chain node initializing, wherein the web3j example provides block chain api interface.Moreover, dimension
Hold the mode communicated between SDK and alliance's chain node are as follows: service application is linked with block chain node creation length, can play a heartbeat
Thread, link fails can Auto-reconnects.
As shown in figure 4, Fig. 4 is the flow diagram for constructing web3j example, during the system startup process, configuration text is obtained
The web3j environment of part, each operational agency's connection block chain link point of dynamic generation is specifically based on configuration file, creates ether
Mill web3j example, obtains web3j environment;Initialization consumer's example consumer is configured according to theme topic, and is initialized
Producer's example producer;Also, by web3j environment, alliance's chain of each mechanism is established respectively to obtain web3j reality
Example, such as the communication between alliance's chain of mechanism A, the communication between alliance's chain of mechanism B, with mechanism C's are established respectively
Communication between alliance's chain, to obtain web3j example.
Web3j example provides block chain api calling interface, and producer's example, consumer's example are all to rely on web3j reality
Example api calling interface by producer's example, consumer's example is integrated with a series of logical operations, realizes a kind of subscription, hair
Cloth mode.
Based on configuration file, the ether mill web3j example communicated by SDK building with alliance chain node be can be realized more
Alliance's chain, such as with alliance's chain of mechanism A, alliance's chain with mechanism B, alliance's chain with mechanism C effectively evades the prior art
The mode of application.xml can not support the problem of multi-joint alliance's chain.
Step S30 determines the corresponding theme configuration item of the configuration file;
In the step, the theme configuration item of configuration file is determined, specifically: the configuration file is parsed by the SDK.
Theme configuration item is determined according to the configuration item set in advance in configuration file.
It should be noted that SDK parses the configuration file, the subject name of the not just theme configuration item of acquisition is gone back
The port id including alliance's chain, ip and communication certificate etc..
Such as: configuration file has configuration item:
{ orgid } .weevent.consumer.topic={ topicname }
{ orgid } .weevent.producer.topic={ topicname }.
So, it is learnt by above-mentioned configuration item, theme configuration item { orgid } .weevent.consumer.topic is
Consumer configuration item, it is determined that be configured with consumer's theme configuration item, and corresponding consumer's example in configuration file, can carry out
Subscription event;Theme configuration item { orgid } .weevent.producer.topic is producer configuration item, it is determined that configuration
It is configured with producer's theme configuration item, and corresponding producer's example in file, publication event can be carried out.
By parsing to configuration file, the corresponding value of specific business configuration item is got, so that it is determined that being consumption
Person's theme configuration item or producer's theme configuration item.
Step S40, if the theme configuration item is consumer's theme configuration item, by the beginning of Software Development Kit SDK
Beginningization consumer's example, and subscribe to consumer's subject events on alliance's chain node.
In the step, it is equivalent to by Software Development Kit SDK initialization consumer's example and passes through Software Development Tools
SDK alliance chain node initializing consumer's example is wrapped, consumer's subject events on alliance's chain node are subscribed to specifically: is based on institute
It states alliance's chain node consumer's subject events are monitored to obtain message data;The message data parse
To message informing;The message informing is distributed to the corresponding business letter of consumer's theme configuration item by message distributor
In number, so that the business function handles the message informing.As soon as having after defining a subject events topic
One timed task pulls the high data parsing of block, is distributed to the process of the business function processing of theme topic statement.
Specifically: the block of SDK timing acquisition current block chain block a height of blockHeight, SDK pulling data is high
LastBlock, the high currentBlockNum=lastBlocNum+1 of block for currently needing to pull, when currentBlockNum <
=blockHeight, SDK obtain the data of currentBlockNum block on chain, data content are parsed, according to data content
Affiliated theme is distributed notice.
Since consumer's example is initialized by SDK, operation system is needed to initialize consumer with the prior art
The mode of example is compared, and effectively realizes the fast integration of SDK.
Step S50 initializes the producer by the SDK if the theme configuration item is producer's theme configuration item
Example, so that the operation system calls the api interface to issue producer's subject events.
In the step, producer's example is initialized by the SDK and is equivalent to through the SDK alliance chain node initializing
Producer's example issues producer's subject events specifically: the interface that gives out information of SDK calling theme topic Contracts Definitions
Publish WeEvent sends message cochain, is that operation system actively calls publication.
Since producer's example is also to initialize by SDK, operation system initialization is needed to produce with the prior art
The mode of person's example is compared, and effectively realizes the fast integration of SDK.
SDK fast integration method proposed by the present invention based on block chain is effectively gone by the configuration file of preset format
Except the file of the application.xml of the prior art relies on, so that Software Development Kit SDK is more general, and scalability is strong;
Also, based on the web3j example of configuration file building, support a plurality of alliance's chain;Furthermore after theme configuration item has been determined, lead to
Production role, the consumption role's configuration for crossing the same theme, realize news release and/or subscribe to message.With need in the prior art
Operation system initialization consumer's example is wanted to compare with the mode of producer's example, by initialization consumers and producers in SDK
Middle initialization process effectively realizes the fast integration of SDK, simplifies cost of access.
Further, before step S10, the SDK fast integration method based on block chain can also include:
It is based on business scenario and the SDK configuration information by service application, obtains configuration file.
In the present embodiment, operation system fills corresponding Configuration Values according to the configuration item that SDK is defined, and SDK is directly read
Local file is taken to obtain.
In the prior art, application Context.xml file is the configurations text loaded by spring component
Part, the inside statement are configured with various context instances.This mode allows operation system pressure to rely on spring external member, is in addition
A kind of configuration of fixed structure example, it is subsequent bad to carry out upgrading extension.
In this case, operation system carries out scene information configuration, business scenario such as consumer and Sheng according to business scenario and SDK
Production person fills corresponding Configuration Values according to the configuration item that SDK is defined, obtains the configuration file of preset format, preset format
Configuration file may include: SDK functional switch, block chain node ip:port, theme topic contract address, block chain certificate text
Part path, mechanism id consume theme topic, produce the information such as theme topic, pass through key between multiple operational agencies and add
The configuration of orgid prefix-free, especially, the configuration file stored by the format of Key=value, SDK can be each with dynamic generation
Kind context instance, for application system, it is only necessary to be configured by the configuration item of offer, oneself control deinitialization inside SDK
Context instance, and the configuration file of Key=value is various programs using more commonly general configuration mode.
The configuration file stored by the format of Key=value, when activating business system, it is only necessary to increase configuration item
It is configured, i.e. flexibly configurable content instance, so that SDK has good versatility and scalability.
Further, step S20 may include:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, with building
The web3j example.
In the present embodiment, when SDK parses configuration file, the ID of alliance's chain node is obtained, also, establish SDK
With the communication link between corresponding alliance's chain, and then realize web3j example building.Wherein, the mode of communication is maintained are as follows: industry
Business application is linked with block chain node creation length, can play a heartbeat thread, and link fails can Auto-reconnect.
Such as: configuration file has configuration item:
{ orgid } .weevent.consumer.topic={ topicname }
{ orgid } .weevent.producer.topic={ topicname }.
So, it after parsing, obtains theme configuration item { orgid } .weevent.consumer.topic and matches for consumer
Item is set, determines configured with consumer's theme configuration item in configuration file, and correspond to consumer's example, subscription event can be carried out;It is main
Topic configuration item { orgid } .weevent.producer.topic is producer configuration item, is determined in configuration file configured with life
Production person's theme configuration item, and corresponding producer's example, can carry out publication event.
When the ID of alliance's chain node has multiple, it can be achieved that the communication of a plurality of alliance's chain and SDK, it is real to obtain multiple web3j
Example, also, the corresponding operational agency of a web3j example, effectively support multichain scene.
Judge by being parsed to configuration file, and to theme configuration item therein, to obtain specific
Business configuration item, configuration item, carries out message communication for the specific business.
Further, based on the present invention is based on the first embodiment of the SDK fast integration method of block chain, the proposition present invention
The second embodiment of SDK fast integration method based on block chain;Step S50 may include: based on alliance's chain node pair
Consumer's subject events are monitored to obtain message data;
The message data is parsed to obtain message informing;
The message informing is distributed to the corresponding business function of consumer's theme configuration item by message distributor
In, so that the business function handles the message informing.
In the present embodiment, consumer's subject events on alliance's chain node are subscribed to specifically: be based on alliance's chain link
Point is monitored to obtain message data to consumer's subject events;It is logical to be parsed to obtain message to the message data
Know;The message informing is distributed in the corresponding business function of consumer's theme configuration item by message distributor, with
The message informing is handled for the business function.As soon as having a timing after defining a subject events topic
Task pulls the high data parsing of block, is distributed to the process of the business function processing of theme topic statement.
Specifically: the block of SDK timing acquisition current block chain block a height of blockHeight, SDK pulling data is high
LastBlock, the high currentBlockNum=lastBlocNum+1 of block for currently needing to pull, when currentBlockNum <
=blockHeight, SDK obtain the data of currentBlockNum block on chain, data content are parsed, according to data content
Affiliated theme is distributed notice.
In the prior art, a subsystem subscribes to the same theme topic message under more application examples, when there is theme
When information, each example can pull the message, cause operation system to reprocess message, operation system is needed to settle a dispute by the parties concerned themselves
Duplicate removal processing.
In the present invention, the business interface of corresponding topic statement only need to be paid close attention to and realize to service application, and other realizations such as disappear
Duplicate removal is ceased, the generalized flowsheets such as message flag position storage are uniformly processed by message distributor.
Subscribe to theme topic message unify in inbound message distributor, message distributor can by redis middleware into
Row message duplicate removal, i.e. default redis mode are realized that connector need to only inject the redis component of oneself in distributor, are also supported
Customized implementation, can offer interface basis class (interface IEventHelp) it is inner state, thus guarantee only
There is a mechanism example that can execute the topic message, distributor is according to the affiliated operational agency id of message, topic title, then
Message is assigned to the business function of corresponding topic statement, and last distributor is asynchronous again to record the message consumed.
Further, the quantity of consumer's subject events is multiple, respectively the first custom events, the second consumption
Person's event;Step S40 can also include:
First custom events are monitored based on alliance's chain node to obtain the first data, and to described
Two custom events carry out caching process.
It in the present embodiment, such as include the first custom events, second when the quantity of consumer's subject events is multiple
Custom events ... can first monitor the first custom events when monitoring consumer's subject events, and
And the second custom events and the event in addition to the first custom events are subjected to caching process, and there is message when interior, it can be same
Step the second custom events of processing.
For example, there is tri- scenes of topicA, topicB, topicC, execution sequence is: topicA first requests to pull this on chain
Block data caches other topicB, topicC message.TopicB, topicC wait topicA handled, directly from
Memory obtains message and returns.
The processing mode of the prior art are as follows: under the multiple consumer topic scenes of service application configuration, each area
Block, each topic can request the chain last time to pull the block data, then parsing data return to one's own topic and disappear
Breath, leads to inefficiency.
This case by being cached to the second custom events, avoid each theme pull message can request it is a certain on chain
The problem of a block total data, is realized to reach efficiency optimization and takes Message Processing for the drop-down of multiple subject scenes.
Further, the api interface is the interface that gives out information;Step S50 includes:
The configuration file is parsed by the SDK, obtains theme contract;
The corresponding interface that gives out information of the theme contract is called, sends producer's subject events to alliance's chain
Node.
In the present embodiment, producer's subject events are issued specifically: SDK calls the publication of theme topic Contracts Definitions to disappear
Interface publishWeEvent is ceased, message cochain is sent, is that operation system actively calls publication, is issued successfully in subject events
When, which is permanently stored on FISCO-BCOS block chain, and the subject events are never lost, and can not distort, and prop up
Hold post audit.
Since producer's example is also to initialize by SDK, operation system initialization is needed to produce with the prior art
The mode of person's example is compared, and effectively realizes the fast integration of SDK, also, in the event of publication, due to the fast integration of SDK, letter
Interface method of calling is changed.
The present invention also provides a kind of SDK fast integration device based on block chain.SDK of the present invention based on block chain
Fast integration device includes:
Module is obtained, for obtaining the configuration file of preset format when operation system receives enabled instruction;
Module is constructed, for being based on the configuration file, creates ether mill web3j example, wherein the web3j example
Block chain api interface is provided;
Determining module, for determining the corresponding theme configuration item of the configuration file;
Subscribing module passes through Software Development Kit if being consumer's theme configuration item for the theme configuration item
SDK initializes consumer's example, and subscribes to consumer's subject events on alliance's chain node;
Release module passes through the initial metaplasia of the SDK if being producer's theme configuration item for the theme configuration item
Production person's example, so that the operation system calls the api interface to issue producer's subject events.
Further, the SDK fast integration device based on block chain further include:
Configuration module obtains configuration file for being based on business scenario and the SDK configuration information by service application.
Further, the building module is also used to:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, with building
The web3j example.
Further, the subscribing module is also used to:
Consumer's subject events are monitored to obtain message data based on alliance's chain node;
The message data is parsed to obtain message informing;
The message informing is distributed to the corresponding business function of consumer's theme configuration item by message distributor
In, so that the business function handles the message informing.
Further, the quantity of consumer's subject events is multiple, respectively the first custom events, the second consumption
Person's event;The subscribing module is also used to:
First custom events are monitored based on alliance's chain node to obtain the first data, and to described
Two custom events carry out caching process.
The present invention also provides a kind of computer readable storage mediums.
The SDK fast integration program based on block chain is stored on computer readable storage medium of the present invention, it is described to be based on
It realizes when the SDK fast integration program of block chain is executed by processor as described above based on the fast integration side SDK of block chain
The step of method.
Wherein, the SDK fast integration program based on block chain that runs on the processor, which is performed, to be realized
Method can refer to each embodiment of SDK fast integration method the present invention is based on block chain, and details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), use including some instructions so that a stylobate quickly collects in the SDK of block chain
Forming apparatus (can be mobile phone, computer, server, air conditioner or the network equipment etc.) executes each embodiment institute of the present invention
The method stated.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (13)
1. a kind of SDK fast integration method based on block chain, which is characterized in that the SDK fast integration based on block chain
Method includes the following steps:
When operation system receives enabled instruction, the configuration file of preset format is obtained;
Based on the configuration file, ether mill web3j example is created, wherein the web3j example provides block chain api interface;
Determine the corresponding theme configuration item of the configuration file;
If the theme configuration item is consumer's theme configuration item, it is real that consumer is initialized by Software Development Kit SDK
Example, and subscribe to consumer's subject events on alliance's chain node;
If the theme configuration item is producer's theme configuration item, producer's example is initialized by the SDK, for described
Operation system calls the api interface to issue producer's subject events.
2. the SDK fast integration method based on block chain as described in claim 1, which is characterized in that received in operation system
To Software Development Kit SDK enabled instruction when, it is described to be based on block before the step of obtaining the configuration file of preset format
The SDK fast integration method of chain further include:
It is based on business scenario and the SDK configuration information by service application, obtains configuration file.
3. the SDK fast integration method based on block chain as described in claim 1, which is characterized in that described to be matched based on described
The step of setting file, creating ether mill web3j example include:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, described in building
Web3j example.
4. the SDK fast integration method based on block chain as described in claim 1, which is characterized in that subscription alliance chain
The step of consumer's subject events on node further include:
Consumer's subject events are monitored to obtain message data based on alliance's chain node;
The message data is parsed to obtain message informing;
The message informing is distributed in the corresponding business function of consumer's theme configuration item by message distributor, with
The message informing is handled for the business function.
5. the SDK fast integration method based on block chain as claimed in claim 4, which is characterized in that consumer's theme
Event includes the first custom events and the second custom events;It is described to be based on alliance's chain node to the consumer master
Topic event is monitored the step of obtaining message data and includes:
First custom events are monitored based on alliance's chain node to obtain the first data, and are disappeared to described second
The person's of expense event carries out caching process.
6. the SDK fast integration method based on block chain as described in any one of claims 1 to 5, which is characterized in that described
Api interface is the interface that gives out information;If the theme configuration item is producer's theme configuration item, by the beginning of the SDK
Beginningization producer's example, the step of calling api interface publication producer's subject events for the operation system include:
If the theme configuration item is producer's theme configuration item, the configuration file is parsed by the SDK, obtains theme
Contract;
The corresponding interface that gives out information of the theme contract is called, sends producer's subject events to alliance's chain link
Point.
7. a kind of SDK fast integration device based on block chain, which is characterized in that the SDK fast integration based on block chain
Device includes:
Module is obtained, for obtaining the configuration file of preset format when operation system receives enabled instruction;
Module is constructed, for being based on the configuration file, creates ether mill web3j example, wherein the web3j example provides
Block chain api interface;
Determining module, for determining the corresponding theme configuration item of the configuration file;
Subscribing module, if being consumer's theme configuration item for the theme configuration item, by the beginning of Software Development Kit SDK
Beginningization consumer's example, and subscribe to consumer's subject events on alliance's chain node;
Release module initializes the producer by the SDK if being producer's theme configuration item for the theme configuration item
Example, so that the operation system calls the api interface to issue producer's subject events.
8. the SDK fast integration device based on block chain as claimed in claim 6, which is characterized in that described to be based on block chain
SDK fast integration device further include:
Configuration module obtains configuration file for being based on business scenario and the SDK configuration information by service application.
9. the SDK fast integration device based on block chain as claimed in claim 6, which is characterized in that the building module is also
For:
The configuration file is parsed by the SDK, obtains the ID of alliance's chain node;
Based on the ID of alliance's chain node, the communication link between the SDK and corresponding alliance's chain is constructed, described in building
Web3j example.
10. the SDK fast integration device based on block chain as claimed in any one of claims 7-9, which is characterized in that described
Subscribing module is also used to:
Consumer's subject events are monitored to obtain message data based on alliance's chain node;
The message data is parsed to obtain message informing;
The message informing is distributed in the corresponding business function of consumer's theme configuration item by message distributor, with
The message informing is handled for the business function.
11. the SDK fast integration device based on block chain as claimed in claim 10, which is characterized in that the consumer master
The quantity of topic event is multiple, respectively the first custom events, the second custom events;The subscribing module is also used to:
First custom events are monitored based on alliance's chain node to obtain the first data, and are disappeared to described second
The person's of expense event carries out caching process.
12. a kind of SDK fast integration equipment based on block chain, which is characterized in that the SDK fast integration based on block chain
Equipment include: memory, processor and be stored on the memory and can run on the processor based on block chain
SDK fast integration program, realize when the SDK fast integration program based on block chain is executed by the processor such as right
It is required that the step of SDK fast integration method described in any one of 1 to 6 based on block chain.
13. a kind of storage medium, which is characterized in that be stored with the SDK fast integration journey based on block chain on the storage medium
Sequence is realized when the SDK fast integration program based on block chain is executed by processor such as any one of claims 1 to 6 institute
The step of SDK fast integration method based on block chain stated.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910475206.2A CN110209381A (en) | 2019-05-31 | 2019-05-31 | SDK fast integration method, apparatus, equipment and storage medium based on block chain |
PCT/CN2020/079997 WO2020238344A1 (en) | 2019-05-31 | 2020-03-18 | Rapid sdk integration method and apparatus based on block chain, device and device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910475206.2A CN110209381A (en) | 2019-05-31 | 2019-05-31 | SDK fast integration method, apparatus, equipment and storage medium based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110209381A true CN110209381A (en) | 2019-09-06 |
Family
ID=67790364
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910475206.2A Pending CN110209381A (en) | 2019-05-31 | 2019-05-31 | SDK fast integration method, apparatus, equipment and storage medium based on block chain |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110209381A (en) |
WO (1) | WO2020238344A1 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110162559A (en) * | 2019-04-13 | 2019-08-23 | 山东公链信息科技有限公司 | A kind of block chain processing method called based on general JSON synchronization and asynchronous data api interface |
CN111010450A (en) * | 2019-12-25 | 2020-04-14 | 安徽兆尹信息科技股份有限公司 | Client-side chain data downloading method for FISCO BCOS platform |
CN111309551A (en) * | 2020-02-10 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Method and device for determining correct integration of event monitoring SDK |
CN111861381A (en) * | 2020-06-28 | 2020-10-30 | 深圳市中农易讯信息技术有限公司 | Multi-fund channel access method and system |
WO2020238344A1 (en) * | 2019-05-31 | 2020-12-03 | 深圳前海微众银行股份有限公司 | Rapid sdk integration method and apparatus based on block chain, device and device and storage medium |
CN112671878A (en) * | 2020-12-17 | 2021-04-16 | 杭州趣链科技有限公司 | Block chain information subscription method, device, server and storage medium |
CN113301132A (en) * | 2021-05-12 | 2021-08-24 | 苏州域乎区块链科技有限公司 | Transaction subscription system and method based on alliance chain |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170346639A1 (en) * | 2016-05-24 | 2017-11-30 | Business Information Exchange System Corp. | Public Key Infrastructure based on the Public Certificates Ledger |
US10552601B2 (en) * | 2017-01-18 | 2020-02-04 | Red Hat, Inc. | Deferred subscription activation using blockchain |
US20200294039A1 (en) * | 2017-04-25 | 2020-09-17 | The Bank Of Nova Scotia | Retail blockchain method and apparatus |
CN107767229A (en) * | 2017-10-14 | 2018-03-06 | 董富坤 | A kind of transparent business model |
CN108566375A (en) * | 2018-03-12 | 2018-09-21 | 深圳壹账通智能科技有限公司 | The method, terminal and storage medium of message communicating between multiterminal based on block chain |
CN109067810A (en) * | 2018-10-22 | 2018-12-21 | 中链科技有限公司 | A kind of distributed message guard method and protective device based on block chain |
CN109408753A (en) * | 2018-10-28 | 2019-03-01 | 北京工业大学 | A kind of farm data display platform based on block chain traceability system |
CN110209381A (en) * | 2019-05-31 | 2019-09-06 | 深圳前海微众银行股份有限公司 | SDK fast integration method, apparatus, equipment and storage medium based on block chain |
-
2019
- 2019-05-31 CN CN201910475206.2A patent/CN110209381A/en active Pending
-
2020
- 2020-03-18 WO PCT/CN2020/079997 patent/WO2020238344A1/en active Application Filing
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110162559A (en) * | 2019-04-13 | 2019-08-23 | 山东公链信息科技有限公司 | A kind of block chain processing method called based on general JSON synchronization and asynchronous data api interface |
CN110162559B (en) * | 2019-04-13 | 2020-07-10 | 山东公链信息科技有限公司 | Block chain processing method based on universal JSON synchronous and asynchronous data API (application program interface) interface call |
WO2020238344A1 (en) * | 2019-05-31 | 2020-12-03 | 深圳前海微众银行股份有限公司 | Rapid sdk integration method and apparatus based on block chain, device and device and storage medium |
CN111010450A (en) * | 2019-12-25 | 2020-04-14 | 安徽兆尹信息科技股份有限公司 | Client-side chain data downloading method for FISCO BCOS platform |
CN111010450B (en) * | 2019-12-25 | 2022-01-28 | 安徽兆尹信息科技股份有限公司 | Client-side chain data downloading method for FISCO BCOS platform |
CN111309551A (en) * | 2020-02-10 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Method and device for determining correct integration of event monitoring SDK |
CN111309551B (en) * | 2020-02-10 | 2023-08-08 | 北京达佳互联信息技术有限公司 | Method and device for determining event monitoring SDK integration correctness |
CN111861381A (en) * | 2020-06-28 | 2020-10-30 | 深圳市中农易讯信息技术有限公司 | Multi-fund channel access method and system |
CN111861381B (en) * | 2020-06-28 | 2024-04-09 | 深圳市中农易讯信息技术有限公司 | Access method and system of multi-fund channel |
CN112671878A (en) * | 2020-12-17 | 2021-04-16 | 杭州趣链科技有限公司 | Block chain information subscription method, device, server and storage medium |
CN113301132A (en) * | 2021-05-12 | 2021-08-24 | 苏州域乎区块链科技有限公司 | Transaction subscription system and method based on alliance chain |
Also Published As
Publication number | Publication date |
---|---|
WO2020238344A1 (en) | 2020-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110209381A (en) | SDK fast integration method, apparatus, equipment and storage medium based on block chain | |
CN111625452B (en) | Flow playback method and system | |
US20080037452A1 (en) | Method Supplying Content to a Device | |
JP5046161B2 (en) | Application partitioning for network edge computing | |
CN104115142B (en) | For the file specific to equipment of bookmark synchronization | |
CN106713469B (en) | Dynamic loading method, device and system for distributed container | |
CN108337127B (en) | Application performance monitoring method, system, terminal and computer readable storage medium | |
US20140181252A1 (en) | Request and response decoupling via pluggable transports in a service oriented pipeline architecture for a request response message exchange | |
CN102362261A (en) | Input content to application via web browser | |
CN111064626B (en) | Configuration updating method, device, server and readable storage medium | |
US9906626B2 (en) | Resource demand-based network page generation | |
WO2023185166A1 (en) | Service call method and apparatus, device and storage medium | |
CN110300067A (en) | Queue regulation method, device, equipment and computer readable storage medium | |
US11544119B2 (en) | Business rules processing framework for implementing new desired functionality in a telecommunication application | |
CN111831461A (en) | Method and device for processing business process | |
CN111159040A (en) | Test data generation method, device, equipment and storage medium | |
CN112052001B (en) | UI dynamic display design architecture, method, equipment and storage medium of APP client | |
CN103646015B (en) | Transmission, the method and system for receiving and transmitting XML message | |
CN113254235A (en) | Message transmission method and device under multi-test environment | |
CN115811481A (en) | Interactive service testing method and device, computer equipment and storage medium | |
CN111158931A (en) | Dynamic data balancing method and device for Kafka partition and storage medium | |
CN110264035A (en) | Configuration method, device, terminal and the storage medium of workflow | |
CN113268272B (en) | Application delivery method, device and system based on private cloud | |
CN113542217A (en) | Service subscription system | |
CN114461424A (en) | Inter-unit service discovery method, device and system under unitized deployment architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |