CN109995585B - Exception handling method, device and storage medium - Google Patents

Exception handling method, device and storage medium Download PDF

Info

Publication number
CN109995585B
CN109995585B CN201910222937.6A CN201910222937A CN109995585B CN 109995585 B CN109995585 B CN 109995585B CN 201910222937 A CN201910222937 A CN 201910222937A CN 109995585 B CN109995585 B CN 109995585B
Authority
CN
China
Prior art keywords
execution
execution failure
end node
transaction
error
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.)
Active
Application number
CN201910222937.6A
Other languages
Chinese (zh)
Other versions
CN109995585A (en
Inventor
魏吉星
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910222937.6A priority Critical patent/CN109995585B/en
Publication of CN109995585A publication Critical patent/CN109995585A/en
Application granted granted Critical
Publication of CN109995585B publication Critical patent/CN109995585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Technology Law (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The invention provides an exception handling method, equipment and a storage medium, wherein a first data access interface is configured in a block chain system, a plurality of error types are packaged in the first data access interface, and the method comprises the following steps: receiving execution failure information of transaction execution failure, wherein the execution failure information comprises an error type of the first transaction execution failure; wherein the execution of the first transaction is dependent on external service data; sending the execution failure information to an actuator framework for the actuator framework to judge that the error type is a network error: if yes, the connection service end node acquires the external service data again. And if not, recording the execution failure information to a block chain. According to the invention, the data access interface is configured in the execution frame of the block chain, and the actuator frame is used for judging different error types to carry out different processing methods, so that the final bifurcation caused by the execution error due to the fact that external access data cannot be obtained is timely realized.

Description

Exception handling method, device and storage medium
Technical Field
The present application relates to the field of computer information technologies, and in particular, to an exception handling method, device, and storage medium.
Background
With the development of the blockchain technology and the wide application of the cross-chain and parallel-chain technologies, in the execution process of the blockchain transaction, the situation of accessing external data may also be data provided by a local service or data of other nodes in a network, under these situations, a situation of network interruption and the like of a certain node connected with a service required by the certain node may occur, which may result in an erroneous execution result being recorded on the blockchain, which is different from the execution results of other nodes, and finally may cause a bifurcation.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies of the prior art, it is desirable to provide an exception handling method, apparatus, and storage medium that avoid generating a fork.
In a first aspect, the present invention provides an exception handling method, where a first data access interface is configured in a blockchain system, and a plurality of error types are encapsulated in the first data access interface, the method including:
receiving execution failure information of transaction execution failure, wherein the execution failure information comprises an error type of the first transaction execution failure; wherein the execution of the first transaction is dependent on external service data;
sending the execution failure information to an actuator framework to enable the actuator framework to judge whether the error type is a network error:
if yes, the connection service end node acquires the external service data again.
Otherwise, recording the execution failure information to the block chain.
Further, connecting the service end node to retrieve the external service data comprises:
transmitting first request information for connecting the service end node in a preset first time;
judging whether the first request information is responded within the first time:
if yes, the first transaction is executed again after the external service data is acquired;
otherwise, the running program is stopped.
Further, the connecting service end node comprises:
and delaying the connection of the current service end node or switching to the service end node in operation through the load balancing server.
Further, a warning message is issued while the running program is suspended.
In a second aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform the exception handling method provided according to embodiments of the present invention.
In a third aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute an exception handling method provided according to embodiments of the present invention.
The invention has the advantages of
The exception handling method, the exception handling device and the storage medium provided by the embodiments of the present invention encapsulate error types that may occur in execution transactions by configuring a data access interface in an execution framework of a block chain, and determine different error types to perform different handling methods by an executor framework, thereby avoiding forking finally caused by execution errors due to a node not acquiring external access data.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of an exception handling method according to an embodiment of the present invention.
Fig. 2 is a flow chart of a preferred embodiment of the method of fig. 1.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of an exception handling method according to an embodiment of the present invention.
As shown in fig. 1, in this embodiment, the present invention provides an exception handling method, where a first data access interface is configured in a blockchain system, and several error types are encapsulated in the first data access interface, the method includes:
s11, receiving execution failure information of the transaction execution failure, wherein the execution failure information comprises an error type of the first transaction execution failure; wherein the execution of the first transaction is dependent on external service data;
s12, sending the execution failure information to the actuator framework for the actuator framework to judge whether the error type is a network error:
if yes, the connection service end node acquires the external service data again.
Otherwise, recording the execution failure information to the block chain.
Specifically, the execution framework of the intelligent contract of the blockchain system is configured with a first data access interface, wherein several types of execution errors are packaged in the interface, such as substantive errors of transaction execution failure caused by insufficient transfer balance, inconsistency between a sender and a sender corresponding to an account and the like, and network type errors of transaction execution failure caused by failure or overtime of acquiring external service data. In step S11, after the first transaction is failed, the executor receives execution failure information of the execution failure, where the information includes an error type of the first transaction failure, and in step S12, after the executor receives the execution failure information, the information is sent to the executor frame, the executor frame makes an analysis and judgment according to the error type in the execution failure information, if the error type is a network error, the server node is connected to obtain external service data again, and if not, the execution failure information is recorded on the block chain to be used for common identification of the block chain links, and the subsequent process is the same as that in the prior art, and is not described herein again.
In the embodiment, the data access interface is configured in the block chain execution framework, and the error type is encapsulated in the interface, so that the executor framework performs different processing on different errors, and the consistency of the execution results of each node is ensured to the greatest extent.
On the basis of the error types, network problems can be further subdivided, such as a parallel chain connection main chain error, a data error of accessing other block chain systems, a data error of accessing a server and the like, and different preset times are configured according to the probability of possible occurrence of each problem, so that the system can operate stably as much as possible.
Fig. 2 is a flowchart of a preferred embodiment of the method shown in fig. 1, and as shown in fig. 2, in this embodiment, connecting the service end node to retrieve the external service data includes:
s121, sending first request information for connecting the service end node in a preset first time;
s122, judging whether the first request information is responded in the first time:
if yes, the first transaction is executed again after the external service data is acquired;
otherwise, the running program is stopped.
Specifically, if the reason that the transaction is failed to be executed is caused by a network problem after the analysis and determination of the executor framework, sending request information for connecting the service end node to the service end node within a certain time (for example, 5 minutes), and if the request information is responded within a set time (for example, 2 minutes), re-executing the first transaction according to the acquired external service data if the request information is responded; and if no response is obtained, stopping executing the running program.
In a preferred embodiment, when the request message re-executes the first transaction according to the external service data, a substantial error may occur to cause a failure in executing the transaction, and at this time, the executor framework may continue to determine according to the method shown in fig. 1, which is not described herein again.
In a preferred embodiment, when the execution of the program is stopped, a warning message is also sent out, so that the user terminal can find and repair the cause of the problem in time, and the working efficiency of the block chain is accelerated.
In a preferred embodiment, the connecting service end node comprises:
and delaying the connection of the current service end node or switching to the service end node in operation through the load balancing server.
Specifically, when the actuator framework judges that the network class is wrong according to the execution failure information, the service end node needs to be connected to obtain the external service data again, at this time, the actuator framework can delay to connect the currently connected service end node within a certain time to provide the network or the service end node with certain repair time, or directly switch the service end node through a load balancer, select a network connection online, and normally operate the service end node to obtain the service data.
The application scene of the method can be applied to the transaction execution of the parallel chain, and the corresponding master chain node requests certain data to realize the transaction execution; the method can also be suitable for scenes that other nodes request data support from the node, and can also be suitable for scenes of different modules, such as a sequencing module, a wallet module, a contract execution module and other modules are respectively arranged on different computer equipment, and when the data of the modules are matched, the computer equipment of the corresponding module is connected, so that the bifurcation condition can be avoided, the required data module can be purposefully selected, and the execution efficiency is greatly improved.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 3, as another aspect, the present application also provides an apparatus 300 including one or more Central Processing Units (CPUs) 301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the apparatus 300 are also stored. The CPU301, ROM302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, according to an embodiment of the present disclosure, the exception handling method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing an exception handling method. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the exception handling methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (6)

1. An exception handling method is applied to a blockchain system, the blockchain system comprises an executor and an executor framework, the executor framework of an intelligent contract of the blockchain system is configured with a first data access interface, and a plurality of error types are packaged in the first data access interface, and the method comprises the following steps:
the executor receives execution failure information of transaction execution failure, wherein the execution failure information comprises an error type of the first transaction execution failure; wherein the execution of the first transaction is dependent on external service data;
sending the execution failure information to an actuator framework for the actuator framework to judge whether the error type is a network type error:
if yes, connecting the service end node to obtain the external service data again;
and if not, recording the execution failure information to a block chain.
2. The method of claim 1, wherein the connecting server-end node re-acquiring the external service data comprises:
transmitting first request information for connecting the service end node in a preset first time;
judging whether the first request information is responded within the first time:
if yes, the first transaction is executed again after the external service data is acquired;
otherwise, the running program is stopped.
3. The method of claim 2, wherein the connecting the service end node comprises:
and delaying the connection of the current service end node or switching to the service end node in operation through the load balancing server.
4. Method according to claim 2, characterized in that the warning message is issued at the same time as the running program is suspended.
5. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-4.
6. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-4.
CN201910222937.6A 2019-03-22 2019-03-22 Exception handling method, device and storage medium Active CN109995585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910222937.6A CN109995585B (en) 2019-03-22 2019-03-22 Exception handling method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910222937.6A CN109995585B (en) 2019-03-22 2019-03-22 Exception handling method, device and storage medium

Publications (2)

Publication Number Publication Date
CN109995585A CN109995585A (en) 2019-07-09
CN109995585B true CN109995585B (en) 2021-12-31

Family

ID=67130891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910222937.6A Active CN109995585B (en) 2019-03-22 2019-03-22 Exception handling method, device and storage medium

Country Status (1)

Country Link
CN (1) CN109995585B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110991573B (en) * 2019-11-04 2023-09-01 京东科技信息技术有限公司 Product management method, system, client node and storage medium
CN111563002B (en) * 2020-05-15 2023-07-25 中国工商银行股份有限公司 Transaction fault processing method and device, electronic equipment and storage medium
CN112486719B (en) * 2020-12-14 2023-07-04 上海万物新生环保科技集团有限公司 Method and equipment for RPC interface call failure processing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1533115A (en) * 2003-02-14 2004-09-29 ���ǵ�����ʽ���� Method and device for supporting error reason of simple network management protocol
JP2011227796A (en) * 2010-04-22 2011-11-10 Fx Prime Corp Transaction type determination device
CN107992415A (en) * 2017-11-28 2018-05-04 中国银联股份有限公司 The fault location and analysis method and associated server of a kind of transaction system
CN109240900A (en) * 2018-08-16 2019-01-18 北京京东尚科信息技术有限公司 Block chain network service platform and its intelligent contract detection method, storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170076286A1 (en) * 2015-09-11 2017-03-16 Bank Of America Corporation Controlling access to data
JP6355168B2 (en) * 2015-11-09 2018-07-11 日本電信電話株式会社 Block chain generation device, block chain generation method, block chain verification device, block chain verification method and program
US10171509B2 (en) * 2016-11-10 2019-01-01 International Business Machines Corporation Filtering and redacting blockchain transactions
JP6888295B2 (en) * 2016-12-26 2021-06-16 富士通株式会社 Programs, information processing equipment, and information processing methods
JP2018136626A (en) * 2017-02-20 2018-08-30 Kddi株式会社 Access control apparatus, access control method and access control program
CN107016611A (en) * 2017-03-29 2017-08-04 杭州秘猿科技有限公司 A kind of transaction manufacture timeout control method based on block chain
CN107800795A (en) * 2017-10-30 2018-03-13 中国联合网络通信集团有限公司 The processing method and processing device of block information
CN108733768B (en) * 2018-04-19 2022-02-22 深圳市迅雷网络技术有限公司 Transaction data consistency processing method, electronic device and storage medium
CN108777703A (en) * 2018-05-15 2018-11-09 维沃移动通信有限公司 A kind of abnormal behaviour processing method and system based on block chain
CN108764906A (en) * 2018-05-30 2018-11-06 深圳市元征科技股份有限公司 A kind of server and its block chain transaction confirmation method, device, storage medium
CN109191135A (en) * 2018-08-27 2019-01-11 北京京东金融科技控股有限公司 Transaction based on block chain retries method, apparatus, equipment and readable storage medium storing program for executing
CN109271446B (en) * 2018-08-30 2020-10-23 杭州复杂美科技有限公司 Parallel chain data synchronization method, equipment and storage medium
CN109300036B (en) * 2018-09-14 2020-08-14 百度在线网络技术(北京)有限公司 Bifurcation regression method and device of block chain network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1533115A (en) * 2003-02-14 2004-09-29 ���ǵ�����ʽ���� Method and device for supporting error reason of simple network management protocol
JP2011227796A (en) * 2010-04-22 2011-11-10 Fx Prime Corp Transaction type determination device
CN107992415A (en) * 2017-11-28 2018-05-04 中国银联股份有限公司 The fault location and analysis method and associated server of a kind of transaction system
CN109240900A (en) * 2018-08-16 2019-01-18 北京京东尚科信息技术有限公司 Block chain network service platform and its intelligent contract detection method, storage medium

Also Published As

Publication number Publication date
CN109995585A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN107908494B (en) Abnormal event processing method and device, electronic equipment and storage medium
CN109995585B (en) Exception handling method, device and storage medium
CN110413676B (en) Database access method and device, electronic equipment and medium
CN109741229B (en) Management system and method applied to rail transit
US11269705B2 (en) Method and apparatus for outputting information
CN110796545A (en) Batch processing method, equipment and storage medium for blockchain transaction
CN114064208A (en) Method and device for detecting application service state, electronic equipment and storage medium
CN111858641A (en) Transaction processing method and device, electronic equipment and readable storage medium
CN111405061B (en) Micro-service shutdown method based on Dubbo frame and server
CN109639755B (en) Associated system server decoupling method, device, medium and electronic equipment
CN112437155B (en) Service data processing method and device and server device
CN109218338B (en) Information processing system, method and device
CN112887355B (en) Service processing method and device for abnormal server
CN113760522A (en) Task processing method and device
CN108632321A (en) Treating method and apparatus based on scheduling of resource under big data platform
CN116319421A (en) Fault detection method and device based on cloud platform, fault detection system and medium
CN115080449A (en) Test method, device, equipment, medium and program product
CN111324668B (en) Database data synchronous processing method, device and storage medium
CN113077241B (en) Approval processing method, device, equipment and storage medium
CN114900531B (en) Data synchronization method, device and system
CN114510495B (en) Database service data consistency processing method and system
CN115756665A (en) TBOX service execution method, device, equipment, vehicle and medium
CN113986686A (en) Distributed transaction anomaly detection method, device and system
WO2017164779A1 (en) Method and module for managing samples relating to performance of a first service hosted by a data center
CN116012158A (en) Service processing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant