CN110362406B - Event processing method and device - Google Patents

Event processing method and device Download PDF

Info

Publication number
CN110362406B
CN110362406B CN201910642568.6A CN201910642568A CN110362406B CN 110362406 B CN110362406 B CN 110362406B CN 201910642568 A CN201910642568 A CN 201910642568A CN 110362406 B CN110362406 B CN 110362406B
Authority
CN
China
Prior art keywords
operation information
information
server
event
record
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
CN201910642568.6A
Other languages
Chinese (zh)
Other versions
CN110362406A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910642568.6A priority Critical patent/CN110362406B/en
Publication of CN110362406A publication Critical patent/CN110362406A/en
Application granted granted Critical
Publication of CN110362406B publication Critical patent/CN110362406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention discloses an event processing method and device. Wherein, the method comprises the following steps: the first server judges whether first event information obtained by an event of the first record object during execution of the first event is tampered event information or not; if the first server judges that the first event information is tampered event information, a query request is sent to at least one second server, second event information obtained when the first record object executes the first event is stored on each second server, and the second event information is used for repairing the first event information; the first server merges second event information obtained by each second server responding to the query request to obtain merged event information; and the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first record object. The invention solves the technical problem of low event processing efficiency of the related technology.

Description

Event processing method and device
The application is a divisional application proposed by a Chinese patent application with application number 201710052185.4 and invention name "event processing method and device" submitted by the Chinese patent office on 20/01/2017.
Technical Field
The invention relates to the field of event processing, in particular to an event processing method and device.
Background
In the event processing, when there is a problem in event information obtained by executing an event on a recording target or when there is a problem in information on the recording target, it is necessary to repair the problem.
It is difficult to repair the event information and the information of the recorded object, and a data mirroring repair method or a log repair method based on execution of all events is generally used. The data mirror image repairing method and the log repairing method based on all events are used for repairing information in a full amount, that is, when some event information obtained by the recorded object executing event has a problem or the information of the recorded object has a problem, the event information obtained by the recorded object executing event and the information of the recorded object need to be repaired, wherein the event information and the information of the recorded object obtained by the recorded object executing event in the past are included, and the repairing is not only performed on the information with the problem.
In the event processing, when the information has a problem, the event information of the recording object and the information of the recording object need to be repaired in a full amount, so that the process of the event processing is time-consuming, and the efficiency of the event processing is low.
In view of the above-mentioned problem of low efficiency of event processing, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides an event processing method and device, which at least solve the technical problem of low event processing efficiency in the related art.
According to an aspect of an embodiment of the present invention, there is provided an event processing method. The event processing method comprises the following steps: the first server judges whether first event information obtained when the first record object executes the first event is tampered event information or not; if the first server judges that the first event information is tampered event information, sending an inquiry request to at least one second server, wherein the second event information obtained when the first record object executes the first event is stored on each second server, the inquiry request is used for requesting each second server to inquire the second event information, and the second event information is used for repairing the first event information; the first server merges second event information obtained by each second server responding to the query request to obtain merged event information; and the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first record object.
According to another aspect of the embodiment of the invention, an event processing device is also provided. The event processing apparatus includes: a judging unit, configured to enable the first server to judge whether first event information obtained when the first recording object executes the first event is tampered event information; a sending unit, configured to send, by a first server, an inquiry request to at least one second server if it is determined that first event information is tampered event information, where each second server stores second event information obtained when a first record object executes a first event, the inquiry request is used to request each second server to inquire the second event information, and the second event information is used to repair the first event information; the first processing unit is used for enabling the first server to carry out merging processing on the second event information obtained by each second server responding to the query request to obtain merged event information; and the second processing unit is used for repairing the first event information by the first server according to the merged event information to obtain third event information of the first record object.
In the embodiment of the invention, a first server is adopted to send an inquiry request to at least one second server under the condition that the first event information is judged to be tampered event information, second event information obtained when a first record object executes a first event is stored on each second server, the inquiry request is used for requesting each second server to inquire the second event information, and the second event information is used for repairing the first event information; the first server merges second event information obtained by each second server responding to the query request to obtain merged event information; the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first recording object, and the purpose of processing the events is achieved, so that the technical effect of improving the event processing efficiency is achieved, and the technical problem of low event processing efficiency in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a hardware environment for an event processing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of an event method according to an embodiment of the invention;
fig. 3 is a flowchart of a method for determining, by a first server, whether first operation information of a first record object is tampered operation information according to an embodiment of the present invention;
FIG. 4 is a flow diagram of a method for a first server to send a first query request to at least one second server, according to an embodiment of the invention;
fig. 5 is a flowchart of a method for merging, by a first server, second operation information obtained by each second server in response to a first query request according to an embodiment of the present invention;
FIG. 6 is a flow diagram of another event processing method according to an embodiment of the invention;
fig. 7 is a flowchart of a method for merging operation information lists obtained by each second server in response to a second query request by a first server according to an embodiment of the present invention;
fig. 8 is a flowchart of a method for repairing the first operation information according to the merge operation information list by the first server according to the embodiment of the present invention;
fig. 9 is a flowchart of a method in which a server performs a repair process on first recorded information according to third operation information according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of repairing tampered operation information according to an embodiment of the invention;
FIG. 11 is a schematic diagram of repairing information of a tampered recording object according to an embodiment of the present invention;
fig. 12 is a schematic diagram of repairing both tampered operation information and information of a recording object according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of an event processing device according to an embodiment of the present invention; and
fig. 14 is a block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an embodiment of the present invention, an embodiment of an event processing method is provided.
Alternatively, in the present embodiment, the event processing method described above may be applied to a hardware environment formed by the server 102 and the terminal 104 as shown in fig. 1. FIG. 1 is a schematic diagram of a hardware environment for an event processing method according to an embodiment of the present invention. As shown in fig. 1, a server 102 is connected to a terminal 104 via a network including, but not limited to: the terminal 104 is not limited to a PC, a mobile phone, a tablet computer, etc. in a wide area network, a metropolitan area network, or a local area network. The event processing method according to the embodiment of the present invention may be executed by the server 102, the terminal 104, or both the server 102 and the terminal 104. The event processing method of the embodiment of the present invention executed by the terminal 104 may also be executed by a client installed thereon.
FIG. 2 is a flow diagram of an event method according to an embodiment of the invention. As shown in fig. 2, the method may include the steps of:
in step S202, the first server determines whether the first event information obtained when the first recording object executes the first event is tampered event information.
In the technical solution provided by step S202 of the present invention, the first server determines whether the first event information obtained when the first recording object executes the first event is tampered event information.
The first recording object may be used to scientifically classify the specific contents of the event, and may be used to record the name, purpose, structure, etc. of the event. The first event may be an information exchange event, and the first event information generated by the first record object when the first event is executed may be event information obtained by the first record object when the information exchange event is performed, including operation information of the first event and information of the first record object. The first server determines whether the first event information is tampered event information, that is, the first server determines whether the first event information is wrong event information or event information that fails to be verified.
The data structure of the event information of the first record object may be a block chain, and the hash chain structure is used for storage. The blockchain is a brand new distributed infrastructure and computing paradigm that data is verified and stored using blockchain data structures, data is generated and updated using a distributed node consensus algorithm, data transmission and access security is guaranteed using cryptography, and data is programmed and operated using intelligent contracts composed of automated script codes. Information non-tamper-ability, an essential characteristic of blockchain technology, means that data is non-tamper-able in blockchain networks, guaranteed by decentralized ledgers, but data of a single ledger is at risk of being tampered, especially in federation chains.
Step S204, the first server sends a query request to at least one second server.
In the technical solution provided in step S204 of the present invention, if the first server determines that the first event information is tampered event information, the first server sends an inquiry request to at least one second server, where each second server stores second event information obtained when the first record object executes the first event, the inquiry request is used to request each second server to inquire the second event information, and the second event information is used to repair the first event information.
The recording objects stored in the first server and the second server are the same, and the event information obtained by executing the event by each recording object is stored.
After the first server determines whether first event information obtained by the first recording object executing the first event is tampered event information, if the first server determines that the first event information is tampered event information, that is, if the first server determines that the first server is a node with tampered information, the first event information needs to be recovered. The first server sends an inquiry request to at least one second server, the inquiry request can be sent to the at least one second server through a server program which is deployed in advance on the first server, and the at least one second server comprises a normal server of which the information is not tampered. Each second server stores second event information obtained by the first record object in executing the first event, and the second event information may include operation information of the first record object and information of the first record object. When the number of the second servers is one, the second event information is the non-tampered event information, and when the number of the second servers is multiple, the second event information stored in each second server may be the non-tampered event information or the tampered event information, and the tampered event information may be the same as or different from the first event information.
Preferably, the number of the second servers is plural, and since only a small part of the event information stored in the servers is tampered under normal conditions, the number of the second event information which is not tampered in the event information stored in the plurality of second servers is larger than the number of the tampered second event information.
The query request sent by the first server to each second server is used for requesting each second server to query the second event information, and each second server responds to the query request after receiving the query request to obtain the second event information.
Step S206, the first server performs merging processing on the second event information obtained by each second server responding to the query request, so as to obtain merged event information.
In the technical solution provided in step S206 of the present invention, the first server performs merging processing on the second event information obtained by each second server responding to the query request, so as to obtain merged event information.
After the first server sends the query request to at least one second server, the first server receives the second event information sent by each second server, and the second event information sent by each second server is merged. Optionally, the first server receives a plurality of pieces of the second event information corresponding to at least one second server, where the plurality of pieces of the second event information include event information that the tampered first recording object executes the first event, and event information that the untampered first recording object executes the first event, and when the plurality of pieces of the second event information are merged, the merging may be performed according to a majority rule, and the second event information with the largest result is determined as the merged event information.
For example, the second server includes a server a, a server B, a server C, and a server D, where second event information obtained when the first record object stored in the server a executes the first event is a, second event information obtained when the first record object stored in the server B executes the first event is B, second event information obtained when the first record object stored in the server C executes the first event is a, and second event information obtained when the first record object stored in the server D executes the first event is C. When the first server merges the second event information obtained by each second server responding to the query request, merging the results of the second event information a to obtain 2 results, merging the results of the second event information b to obtain 1 result, merging the results of the second event information c to obtain 1 result, and determining the result of the second event information a as the merged event information.
In step S208, the first server performs a repairing process on the first event information according to the merged event information, so as to obtain third event information of the first recording object.
In the technical solution provided by step S208 of the present invention, the first server performs a repairing process on the first event information according to the merged event information, so as to obtain third event information of the first recording object.
After the first server merges the second event information obtained by each second server responding to the query request to obtain merged event information, the first server repairs the first event information according to the merged event information, the first event information on the first server can be replaced by the merged event information to obtain third event information of the first recording object, and the third event information is correct event information obtained when the first recording object executes the first event, so that the tampered first event information of the first recording object is repaired. Because the full replacement of all event information of the first recording object on the first server is not needed during the repair, the recovery based on the data mirror image is not needed, or the recovery of all logs is not executed, the time for repairing the event information is reduced, and the event processing efficiency is improved.
Optionally, the first record object is an account, and scientifically classifies the specific content of the accounting element, including name, purpose and structure, and the event is a transaction event. The method comprises the steps that a server judges whether transaction information and/or account information of an account is tampered information when the account conducts transaction, a first server sends an inquiry request to at least one second server under the condition that the transaction information and/or the account information of the account is judged to be tampered information when the account conducts transaction, and transaction information and/or account information obtained when the account conducts transaction are stored in each second server; the first server merges the transaction information and/or the account information obtained by each second server responding to the query request to obtain merged transaction information; and the first server carries out repair processing on the transaction information and/or the account information of the account during transaction according to the combined transaction information to obtain correct transaction information and/or account information of the first record object.
Through the above steps S202 to S208, when the first server determines that the first event information is tampered event information, the first server sends an inquiry request to at least one second server, and each second server stores second event information obtained by the first record object executing the first event; the first server merges second event information obtained by each second server responding to the query request to obtain merged event information; the first server carries out restoration processing on the first event information according to the merged event information to obtain third event information of the first recording object, the purpose of processing the events is achieved, individual damaged event information can be quickly recovered, the technical effect of improving the event processing efficiency is achieved, and the technical problem of low event processing efficiency in the related technology is solved.
As an optional implementation manner, the first event information includes first operation information that the first recording object operates the first event when executing the first event, and in step S202, the determining, by the first server, whether the first event information obtained when the first recording object executes the first event is tampered event information includes: the first server judges whether first operation information obtained when the first record object executes the first event is tampered operation information or not; step S204, if the first server determines that the first event information is tampered event information, sending an inquiry request to at least one second server includes: if the first server judges that the first operation information is tampered operation information, a first query request is sent to at least one second server; step S206, the first server performs merging processing on the second event information obtained by each second server in response to the query request, and obtaining merged event information includes: the first server merges second operation information obtained by each second server responding to the first query request to obtain merged operation information; step S208, the first server performs a repairing process on the first event information according to the merged event information, and obtaining third event information of the first record object includes: and the first server carries out repair processing on the first operation information according to the merging operation information to obtain third operation information of the first record object.
Optionally, the first operation information is first transaction information of a first account obtained by executing a transaction event, and the transaction information is operation information of the first account. The server judges whether first operation information obtained when the first record object executes the transaction event is tampered operation information or not; and if the first server judges that the first operation information is tampered operation information, the first server sends a first query request to at least one second server, and each second server stores second operation information obtained by the first account executing the first event. When the number of the second servers is one, the second operation information is the operation information that has not been tampered with, and when the number of the second servers is multiple, the second operation information stored in each second server may be the operation information that has not been tampered with, or may be the operation information that has been tampered with, and the tampered operation information may be the same as or different from the first operation information.
Optionally, when the event is a transaction event, the first operation information is transaction information, and the transaction information may include a transaction serial number, a transaction height, an account transferring address, a transfer quota, an account balance transferring field, an additional field, account backup information, a previous transaction hash, a current transaction hash, signature information, and the like.
After the first server sends the query request to at least one second server, the first server receives the second operation information sent by each second server, and the second operation information sent by each second server is merged. Optionally, the first server receives a plurality of pieces of the second operation information corresponding to at least one second server, where the plurality of pieces of the second operation information include operation information of a tampered first account executing a first transaction event and operation information of a non-tampered first account executing the first transaction event, when merging the plurality of pieces of the second operation information, merging may be performed according to a majority rule, the second operation information with the largest result is determined as merging operation information, and the first server performs repair processing on the first operation information according to the merging operation information to obtain third operation information of the first record object, where the third event information includes third operation information.
As an optional implementation manner, the determining, by the first server, whether the first operation information obtained by the first record object executing the first event is tampered operation information includes: the first server acquires first operation information before the first record object executes the second event; when the first operation information is verified to meet the preset rule, the first server determines that the first operation information is the operation information which is not tampered; and when the first server verifies that the first operation information does not accord with the preset rule, determining that the first operation information is tampered operation information.
Fig. 3 is a flowchart of a method for determining, by a first server, whether first operation information of a first record object is tampered operation information according to an embodiment of the present invention. As shown in fig. 3, the method comprises the steps of:
in step S301, the first server obtains the first operation information before the first recording object executes the second event.
In the technical solution provided in step S301 of the present invention, the first server obtains the first operation information before the first recording object executes a second event, where the second event is an event adjacent to the first event after the first event is executed.
When a new event is executed, the event information of the previous event needs to be verified, and the new event can be executed only when the verification of the previous event information is passed. For example, the event information of the block chain is in a hash chain structure, so that when a new event occurs, the previous event information is verified. The second event is an event adjacent to the first event after the first event is executed, that is, the second event is an event executed after the first event is executed, the second event is a new event of the first event, and the first event is an event executed last at present. The first server obtains first operation information obtained by executing the first event before the first record object executes the second event, wherein the first operation information is the last operation information obtained by currently operating the event.
Step S302, the first server verifies the first operation information.
In the technical solution provided by step S302 of the present invention, the first server verifies the first operation information.
After the first server obtains the first operation information, the first server verifies the first operation information, determines whether the first operation information is tampered, and can verify the first operation information by using a hash field. When the first server verifies the first operation information, step S303 is performed, and when the first server does not verify the first operation information, step S304 is performed.
Step S303, when it is verified that the first operation information meets the preset rule, the first server determines that the first operation information is the operation information that has not been tampered with.
In the technical solution provided in step S303 of the present invention, when it is verified that the first operation information meets the preset rule, the first server determines that the first operation information is the operation information that has not been tampered with, wherein the second event is executed after determining that the first operation information is the operation information that has not been tampered with.
After the first server verifies the first operation information, when it is verified that the first operation information conforms to the preset rule, that is, when it is verified that the first operation information conforms to the rule of the correct operation information, it is determined that the first operation information passes verification, and the first operation information is operation information which is not tampered.
In step S304, when it is verified that the first operation information does not meet the preset rule, the first server determines that the first operation information is tampered operation information.
In the technical solution provided by step S304 of the present invention, when it is verified that the first operation information does not meet the preset rule, the first server determines that the first operation information is tampered operation information.
After the first server verifies the first operation information, when it is verified that the first operation information does not conform to the preset rule, that is, when it is verified that the first operation information does not conform to the rule of the correct operation information, it is determined that the first operation information is not verified, and the first operation information is tampered operation information.
According to the embodiment, the first operation information is obtained by the first server before the first recording object executes the second event, when the first operation information is verified to be in accordance with the preset rule, the first operation information is determined to be the operation information which is not tampered, when the first operation information is verified to be not in accordance with the preset rule, the first operation information is determined to be the tampered operation information, so that the purpose that the first server judges whether the first operation information obtained when the first recording object executes the first event is the tampered operation information or not is achieved, when the first operation information is the tampered operation information, the first operation information is repaired, individual damaged operation information can be quickly recovered, and the event execution efficiency is improved.
As an optional implementation manner, the first server and the second server respectively further store operation information obtained by executing the event by the plurality of second record objects, and the sending, by the first server, the first query request to the at least one second server includes: the first server inquires a plurality of execution sequence numbers of a first record object and a plurality of second record objects on the first server; determining the maximum execution sequence number and the sequence number which corresponds to the correct operation information as a target execution sequence number; the first server sends a first query request to at least one second server according to the target execution sequence number.
Fig. 4 is a flowchart of a method for a first server to send a first query request to at least one second server according to an embodiment of the present invention. As shown in fig. 4, the method comprises the steps of:
in step S401, the first server queries a plurality of execution sequence numbers of the first record object and the plurality of second record objects on the first server.
In the technical solution provided by step S401 of the present invention, the first server queries a plurality of execution sequence numbers of the first record object and the plurality of second record objects on the first server, where the plurality of execution sequence numbers are used to indicate an execution sequence of the first record object and the plurality of second record objects to execute the events, and the execution sequence numbers are changed in an increasing manner according to time.
The first server and the second server store event information of a second recording object except the first recording object in addition to the event information of the first recording object. The execution sequence of the events executed by the first record object and the second record objects can be represented by a plurality of execution sequence numbers, each event corresponds to one execution sequence number, and the execution sequence numbers are changed in an increasing mode according to time, that is, the execution sequence numbers corresponding to the events closer to the current time are larger. Alternatively, when the event is a transaction event, the plurality of execution sequence numbers may be transaction-high, i.e., strictly increasing transaction sequence numbers.
In step S402, the first server determines the largest execution sequence number as the target execution sequence number.
In the technical solution provided by step S402 of the present invention, when the first server queries the execution sequence number with the largest value among the plurality of execution sequence numbers, and when the fourth operation information corresponding to the execution sequence number with the largest value is the previous operation information adjacent to the first operation information and not tampered, the first server determines the largest execution sequence number as the target execution sequence number.
The first server queries a plurality of execution sequence numbers of the first record object and a plurality of second record object execution events on the first server to obtain an execution sequence number with a largest value among the plurality of execution sequence numbers, and preferably, the fourth operation information corresponding to the execution sequence number with the largest value is the operation information which is not tampered and is the last operation information adjacent to the first operation information. For example, the operation information generated by the execution event is a operation information a, a operation information B, and a operation information C, where the operation information C is a tampered first operation information, the operation information B is a previous operation information adjacent to the operation information C, the operation information a is a previous operation information adjacent to the operation information B, the execution sequence number corresponding to the operation information a is 1, the execution sequence number corresponding to the operation information B is 2, the execution sequence number corresponding to the operation information C is 3, and the execution sequence number corresponding to the operation information B is a target execution sequence number.
The first record object and the second record object on the first server and the second server have the same execution sequence number of the execution event of the plurality of second record objects.
In step S403, the first server sends a first query request to at least one second server according to the target execution sequence number.
In the technical solution provided by step S403 of the present invention, the first server sends a first query request to at least one second server according to the target execution sequence number, where the first query request is used to request each second server to query the second operation information according to the fourth operation information.
And after determining the maximum execution sequence number as a target execution sequence number, the first server sends a first query request to at least one second server according to the target execution sequence number. And each second server responds to the first query request and queries the second operation information according to the fourth operation information, because the fourth operation information is adjacent to the first operation information on the first server and is not tampered with. For example, the operation information generated by executing the event on the second server is the a operation information, the B operation information, and the C ' operation information, the B operation information is the fourth operation information, the C ' operation information is the second operation information, which may be correct operation information, and the second server responds to the first query request to query the C ' operation information according to the B operation information.
The embodiment queries a plurality of execution sequence numbers of a first record object and a plurality of second record objects on the first server for execution events through the first server; determining the maximum execution sequence number as a target execution sequence number; the first server sends the first query request to the at least one second server according to the target execution sequence number, the purpose that the first server sends the first query request to the at least one second server is achieved, the first server further conducts merging processing on second operation information obtained by each second server responding to the first query request to obtain merging operation information, restoration processing is conducted on the first operation information according to the merging operation information to obtain third operation information of the first recording object, and efficiency of event processing is improved.
As an optional implementation manner, the merging, by the first server, the second operation information obtained by each second server in response to the first query request, where obtaining the merged operation information includes: the first server acquires a plurality of pieces of second operation information; the first server acquires first sub-operation information from the plurality of pieces of second operation information, wherein the number of the same first sub-operation information is more than that of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information; the first server determines the first sub-operation information as merging operation information.
Fig. 5 is a flowchart of a method for merging, by a first server, second operation information obtained by each second server in response to a first query request according to an embodiment of the present invention. As shown in fig. 5, the method comprises the steps of:
in step S501, the first server obtains a plurality of pieces of second operation information.
In the technical solution provided by step S501 of the present invention, the first server obtains a plurality of pieces of second operation information, where the plurality of pieces of second operation information respectively correspond to at least one second server, and the plurality of pieces of second operation information include different pieces of sub-operation information.
After the first server sends the first query request to the at least one second server, each first server responds to the first query request, and the first server receives second operation information corresponding to the at least one second server to obtain a plurality of pieces of operation information. The plurality of pieces of second operation information include different pieces of sub-operation information, for example, the plurality of pieces of second operation information include 2 pieces of a operation information, 1 piece of a 'operation information, and 1 piece of a ″ operation information, where the 2 pieces of a operation information are operation information that has not been tampered, and the 1 piece of a' operation information and the 1 piece of a ″ operation information are different pieces of operation information that have been tampered, and are all from different second servers.
In step S502, the first server obtains the first sub-operation information from the plurality of pieces of second operation information.
In the technical solution provided by step S502 of the present invention, the first server obtains first sub-operation information from the plurality of pieces of second operation information, where the number of the same first sub-operation information is greater than the number of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information.
The first server acquires first sub-operation information from the plurality of pieces of second operation information after acquiring the plurality of pieces of second operation information, and the number of the same first sub-operation information is more than the number of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information. For example, the plurality of pieces of second operation information include first sub-operation information that is 2 pieces of a operation information, and second sub-operation information that is 1 piece of a 'operation information and 1 piece of a "operation information, where the 2 pieces of a operation information are operation information with completely the same contents that has not been tampered with, and the 1 piece of a' operation information and the 1 piece of a" operation information are second sub-operation information with different contents that has been tampered with, and both of the pieces of a 'operation information and the 1 piece of a "operation information come from different second servers, and the number of the a operation information is greater than the number of the a' operation information and the number of the a" operation information.
In step S503, the first server determines the first sub-operation information as merging operation information.
In the technical solution provided by step S503 of the present invention, the first server determines the first sub-operation information as the merge operation information.
After the first server acquires the first sub-operation information from the plurality of pieces of second operation information, the first sub-operation information is determined as merging operation information, that is, the merging operation information is determined by the majority of the same first sub-operation information, and the first server merges the plurality of pieces of received second operation information according to the majority rule to obtain merging operation information for repairing the tampered first operation information.
The embodiment acquires a plurality of pieces of second operation information through the first server; the first server acquires first sub-operation information from the plurality of pieces of second operation information, wherein the number of the same first sub-operation information is more than that of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information; the first server determines the first sub-operation information as the merging operation information, so that the purpose that the first server merges the second operation information obtained by each second server responding to the first query request to obtain the merging operation information is achieved, the first operation information is repaired according to the merging operation information, and the efficiency of event processing is improved.
As an optional implementation manner, the performing, by the first server, the repair processing on the first operation information according to the merge operation information, and obtaining the third operation information of the first record object includes: and the first server replaces the first operation information with the merging operation information to obtain third operation information.
And when the first server carries out repair processing on the first operation information according to the merging operation information to obtain third operation information of the first record object, replacing the first operation information with the merging operation information to achieve the purpose of repairing the first operation information. Optionally, after the first server performs merging processing on the second operation information obtained by each second server in response to the first query request to obtain merged operation information, when it is verified that the first operation information does not meet the preset rule, the first server replaces the first operation information with the merged operation information, that is, the tampered first operation information is repaired to be correct third operation information, so that a new event can be executed.
As an optional implementation manner, the first event information further includes record information of the first record object when the first record object executes the first event, and the determining, by the first server, whether the first event information obtained when the first record object executes the first event is tampered event information includes: when the first operation information is the operation information which is not tampered, the first server judges whether the first record information obtained when the first record object executes the first event is the tampered record information.
The first event information includes, in addition to the first operation information, record information of the first record object, for example, when the event is a transaction event and the first operation information is the first transaction information, the first event information also includes account information. When the first operation information is the operation information which is not tampered, the first server judges whether the first record information obtained when the first record object executes the first event is the tampered record information.
Optionally, when the event is a transaction event, the first record information is account information, including balance information, additional fields, last transaction height, last transaction hash, account hash, signature information, and the like.
As an optional implementation manner, after the first server determines that first record information obtained by the first record object executing the first event is tampered record information, the first server performs repair processing on the remaining event resource and the additional information in the first operation information to obtain second record information.
Fig. 6 is a flowchart of another event processing method according to an embodiment of the present invention. As shown in fig. 6, the method further includes:
in step S601, the first server obtains the remaining event resource and the additional information in the first operation information.
In the technical solution provided by step S601 of the present invention, if the first server determines that the first record information obtained by the first record object executing the first event is tampered record information, the first server obtains the remaining event resource and the additional information in the first operation information.
The first recorded information cannot execute the event when tampered, and needs to be repaired. The last operation information of the first record object may be found in the first server according to the address information of the first record object. Optionally, since the first server and the at least one second server both store event information of the record object when executing the event, the query may be performed from the at least one second server according to the address information of the first record object, and the last piece of operation information of the first record object is determined by the majority rule.
Because the event information of the block chain adopts a Hash chain structure, new event operation can be executed only when the previous event information passes verification, new operation information is generated, the first operation information is the last operation information which is not tampered, and the first server acquires the remaining event resources and the additional information in the first operation information. The remaining event resource is a remaining event resource recorded by the first record object by the current time, and includes an event resource remaining after the total event resource is transferred to another record object, and the additional information may be additional information arbitrarily invoked when the event is executed, which is not limited herein.
Step S602, the first server performs a repair process on the first record information according to the remaining event resource and the additional information, to obtain second record information.
In the technical solution provided by step S602 in the present invention, the first server performs a repair process on the first record information according to the remaining event resource and the additional information to obtain second record information, where the second record information is correct record information of a second record object.
Optionally, when the event is a transaction event, the first record object is account information, and the transaction event cannot be initiated when the account information is tampered, and the account information needs to be repaired. Firstly, the last piece of transaction information related to the account address in the first server is inquired according to the account address in the account information. And repairing the account information according to the balance information and the additional information of the last transaction information.
In the embodiment, after the first server judges whether first recording information obtained by a first recording object executing a first event is tampered recording information, if the first server judges that the first recording information obtained by the first recording object executing the first event is tampered recording information, the first server acquires the remaining event resources and additional information in the first operation information; the first server repairs the first recorded information according to the remaining event resources and the additional information to obtain second recorded information, individual damaged account information can be quickly recovered, the information repairing speed is increased, and the event processing efficiency is further improved.
As an optional implementation manner, the first event information includes first operation information that the first recording object performs an operation when executing the first event, and record information of the first recording object, and the step S202, the determining, by the first server, whether the first event information obtained when the first recording object executes the first event is tampered event information includes: the first server judges whether first operation information obtained when the first recording object executes the first event is tampered operation information or not, and judges whether first recording information obtained when the first recording object executes the first event is tampered recording information or not.
Optionally, the first operation information is first transaction information of a first account obtained by executing a transaction event, and the first record information is account information of executing the transaction event. The transaction information is operation information of the first account. The server judges whether the first operation information obtained when the first record object executes the transaction event is tampered operation information or not, and judges whether the first record information obtained when the first record object executes the transaction event is tampered record information or not.
Step S204, if the first server determines that the first event information is tampered event information, sending an inquiry request to at least one second server includes: and if the first server judges that the first operation information is the tampered operation information and judges that the first record information is the tampered record information, sending a second query request to at least one second server according to the identification information in the first record information.
The first server determines whether first operation information obtained by a first recording object executing a first event is tampered operation information, and determines whether first recording information obtained by the first recording object executing the first event is tampered recording information, and if so, determines that the first operation information is tampered recording information, that is, the first operation information and the first recording information are both tampered, and obtains identification information in the first recording object, where the identification information can be used to uniquely identify the first recording object, for example, address information of the first recording object, and the first server sends a second query request to at least one second server according to the identification information in the first recording information.
Step S206, the first server performs merging processing on the second event information obtained by each second server in response to the query request, and obtaining merged event information includes: and the first server performs merging processing on the operation information lists obtained by each second server responding to the second query request to obtain merged operation information lists.
After the first server sends a second query request to at least one second server according to the identification information in the first record information, each second server responds to the second query request, finds all operation information related to the identification information according to the identification information to obtain an operation information list, and the first server receives the operation information list sent by each second server and merges the operation information lists to obtain a merged operation information list.
Optionally, when the event is a transaction event, and both the account information and the last transaction information are tampered, both need to be recovered at the same time. Firstly, all transaction information related to the account address is inquired from the account address to the rest nodes, and a transaction information list is obtained. Secondly, the transaction information lists returned by the nodes are merged according to the majority of the consistency principle.
Step S208, the first server performs a repairing process on the first event information according to the merged event information, and obtaining third event information of the first record object includes: and the first server performs repair processing on the first operation information according to the merging operation information list to obtain third operation information of the first recording object, and performs repair processing on the first recording information according to the third operation information to obtain second recording information of the first recording object.
And after the first server merges the operation information lists obtained by each second server responding to the second query request to obtain the merged operation information list, the first server repairs the first operation information according to the merged operation information list to obtain third operation information of the first record object, and repairs the first record information according to the third operation information to obtain second record information of the first record object.
Optionally, when the event is a transaction event, traversing the merged transaction information list, querying a hash field in the transaction information of the tampered node by using the hash field of each transaction information in the merged transaction information list, if the queried function is used to repair the tampered transaction information, obtaining correct transaction information, and repairing the tampered account information according to balance information and additional information in the correct transaction information, so that the purpose of repairing the event information is achieved, and the efficiency of event processing is improved.
As an optional implementation manner, the merging, by the first server, the operation information list obtained by each second server in response to the second query request, where obtaining the merged operation information list includes: the method comprises the steps that a first server obtains a plurality of operation information lists; the first server acquires a first sub-operation information list from the plurality of operation information lists; the first server determines the first sub-operation information list as a merge operation information list.
Fig. 7 is a flowchart of a method for merging operation information lists obtained by each second server in response to a second query request by a first server according to an embodiment of the present invention. As shown in fig. 7, the method comprises the steps of:
in step S701, the first server acquires a plurality of operation information lists.
In the technical solution provided by step S701 of the present invention, the first server obtains a plurality of operation information lists, where the plurality of operation information lists correspond to at least one second server, and the plurality of operation information lists include different sub-operation information lists.
After the first servers send the second query requests to the at least one second server, each first server responds to the second query requests, and the first servers receive the operation information lists corresponding to the at least one second server to obtain a plurality of operation information lists. For example, the sub-operation information lists included in the second operation information lists are 2 a operation information lists, 1 a 'operation information list and 1 a "operation information list, where the 2 a operation information lists are the operation information lists that have not been tampered with, and the 1 a' operation information lists and the 1 a" operation information lists are different operation information lists that have been tampered with, and all of the operation information lists are from different second servers.
In step S702, the first server obtains a first sub-operation information list from the plurality of operation information lists.
In the technical solution provided by step S702 in the present invention, the first server obtains a first sub-operation information list from a plurality of operation information lists, where the number of the same first sub-operation information list is greater than the number of different second sub-operation information lists in the plurality of operation information lists except for the first sub-operation information list.
The first server acquires a first sub-operation information list from the plurality of operation information lists after acquiring the plurality of operation information lists, wherein the number of the same first sub-operation information lists is more than that of different second sub-operation information lists except the first sub-operation information lists in the plurality of operation information lists. For example, the first sub-operation information list included in the plurality of second operation information lists is 2 a operation information lists, and the second sub-operation information lists are 1 a ' operation information list and 1 a "operation information list, where the 2 a operation information lists are operation information lists with completely the same contents that have not been tampered, and the 1 a ' operation information list and the 1 a" operation information list are second sub-operation information lists with different contents that have been tampered, and both of them are from different second servers, and the number of the a operation information lists is greater than the number of the a ' operation information lists and the number of the a "operation information lists.
In step S703, the first server determines the first sub-operation information list as a merge operation information list.
In the technical solution provided in step S703 of the present invention, the first server determines the first sub-operation information list as the merge operation information list.
The first server obtains a first sub-operation information list from the multiple operation information lists, and then determines the first sub-operation information list as a merge operation information list, that is, the merge operation information list is determined by multiple identical operation information lists, the first server merges the received multiple operation information lists according to a majority consistency principle to obtain a merge operation information list for repairing the tampered first operation information, the merge operation information list includes operation information corresponding to the identical identification information, and then repairs the first operation information according to the merge operation information list to obtain correct operation information.
The embodiment acquires a plurality of operation information lists through a first server; the first server acquires a first sub-operation information list from the plurality of operation information lists; the first server determines the first sub-operation information list as a merging operation information list, so that the first server performs merging processing on the operation information list obtained by each second server responding to the first query request according to a majority rule, and repairs the first operation information according to the obtained merging operation information list to obtain correct operation information.
As an optional implementation manner, the repairing, by the first server, the first operation information according to the merge operation information list to obtain the third operation information includes: the first server traverses the merging operation information list; acquiring each piece of operation information in the merging operation information list; the first server inquires a preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information; and under the condition that the first server inquires the preset field in the last piece of operation information before the first operation information according to the preset field in each piece of operation information, replacing the first operation information with the merged event information list.
Fig. 8 is a flowchart of a method for repairing the first operation information according to the merge operation information list by the first server according to an embodiment of the present invention. As shown in fig. 8, the method comprises the steps of:
in step S801, the first server traverses the merge operation information list.
In the technical solution of step S801 of the present invention, the first server traverses the merge operation information list.
The data structure of the event information in the merging operation information list is a block chain, and a Hash chain structure is adopted. And the first server reversely traverses the merging operation information list after determining the first sub-operation information list as the merging operation information list.
In step S802, the first server obtains each piece of operation information in the merge operation information list.
In the technical solution provided by step S802 of the present invention, the first server obtains each piece of operation information in the merge operation information list.
In step S803, the first server queries a preset field in the previous piece of operation information before the first piece of operation information according to the preset field in each piece of operation information.
In the technical solution provided by step S803 of the present invention, the first server queries the preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information.
In the process of reversely traversing the merged transaction information list, the first server acquires each piece of operation information, and queries a preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information, optionally, the preset field is a hash field, and the hash field in each piece of operation information is used for querying the hash field of the previous piece of operation information in the tampered operation information on the first server.
In step S804, the first server replaces the first operation information with the merged event information list.
In the technical solution provided by step S804 of the present invention, the first server replaces the first operation information with the merged event information list when querying the preset field in the previous operation information before the first operation information according to the preset field in each operation information.
After the first server queries the preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information, the first operation information is replaced by the merged event information list, that is, the merged event information list is used for covering the tampered event information, so that the first operation information is repaired.
As an optional implementation manner, after querying a preset field in a previous piece of operation information of the first operation information according to the preset field in each piece of operation information, in a case that the preset field in the previous piece of operation information of the first operation information is not queried according to the preset field in each piece of operation information, it is determined that the repair of the first event information fails.
After the preset field in the last piece of operation information of the first operation information is inquired according to the preset field in each piece of operation information, when the preset field in the last piece of operation information of the first operation information is not inquired in the header of the merged event information list, it is determined that the first event is failed to be repaired.
As an optional implementation manner, the performing, by the server, a repair process on the first record information according to the third operation information, and obtaining the second record information of the first record object includes: the first server judges whether the third operation information is correctly connected in series on the event chain; and if the first server judges that the third operation information is correctly connected in series on the event chain, repairing the first record information according to the remaining event resources and the additional information in the third operation information to obtain second record information.
Fig. 9 is a flowchart of a method for performing repair processing on first recorded information by a server according to third operation information according to an embodiment of the present invention. As shown in fig. 9, the method includes the steps of:
in step S901, the first server determines whether the third operation information is correctly connected in series to the event chain.
In the technical solution provided by step S901 of the present invention, the first server determines whether the third operation information is correctly connected in series to the event chain, where the event information on the event chain is stored in a chain structure.
And after the server performs repairing processing on the first operation information according to the merging operation information list to obtain third operation information of the first record object, the server judges whether the third operation information is correctly connected in series on the event chain when performing repairing processing on the first record information according to the third operation information. Optionally, it is determined whether the transaction information of the tampered node obtained by the last query is linked according to the address information of the previous operation information included in each piece of operation information, that is, when querying the event chain, querying is performed according to a sequence from back to front. If the first server determines that the third operation information is correctly connected in series to the event chain, step S902 is executed, and if the first server determines that the third operation information is not correctly connected in series to the event chain, it is determined that the first record information is failed to be repaired.
Step S902, the first server performs a repair process on the first record information according to the remaining event resource and the additional information in the third operation information, so as to obtain second record information.
In the technical solution provided by step S902 of the present invention, if the first server determines that the third operation information is correctly connected in series to the event chain, the first record information is repaired according to the remaining event resources and the additional information in the third operation information, so as to obtain the second record information.
After the first server determines whether the third operation information is correctly connected in series to the event chain, if the first server determines that the third operation information is correctly connected in series to the event chain, the remaining event resource and the additional information in the third operation information are obtained, where the remaining event resource is the remaining event resource recorded in the first recording object by the current time, and the additional information may be additional information that is randomly called when the event is executed, which is not limited herein. And repairing the first record information according to the residual event resources and the accessory information to obtain second record information.
The embodiment judges whether the third operation information is correctly connected in series on the event chain through the first server; if the first server judges that the third operation information is correctly connected in series on the event chain, the first record information is repaired according to the remaining event resources and the additional information in the third operation information to obtain the second record information, so that the aim that the server repairs the first record information according to the third operation information to obtain the second record information of the first record object is fulfilled, the tampered first record object is repaired, and the efficiency of event processing is improved.
As an alternative implementation, after determining whether the third operation information is correctly concatenated on the event chain, if it is determined that the third operation information is not correctly concatenated on the event chain, it is determined that the first record information is failed to be repaired.
Example 2
The technical solution of the present invention will be described below with reference to preferred embodiments. Specifically, the event is taken as a transaction event, the record object is taken as an account, and the record information is taken as account information for explanation.
In this embodiment, the data structure of the event includes two basic data structures: account information, transaction information.
TABLE 1 Account information
Figure BDA0002132387880000261
The account information of this embodiment includes: account address, balance information, additional fields, last transaction height, last transaction hash, account hash, and signature. The account address can be a public key address which is a unique identifier of the user account; the balance information is the resource information of the account ending the current record; the attachment field may be any service information called, and is not limited herein; the last transaction height is used for representing the maximum transaction sequence number in the strictly increasing transaction sequence numbers, and the last transaction hash is used for uniquely identifying the field of the last transaction; an account hash field to uniquely identify account information; the signature is used to represent information of the user.
The account information is only the preferred account information of the embodiment of the present invention, and the account information does not represent that the account information of the embodiment of the present invention is only the above information, and is not limited herein.
TABLE 2 transaction information
Figure BDA0002132387880000271
The transaction information of this embodiment includes: transaction number, transaction height, transfer-out account address, transfer-in account address, transfer-out amount, transfer-out account balance, transfer-in account balance, additional field, account backup information, last transaction hash and current transaction hash. The transaction sequence number is a sequence number when an event sent to the server by the client is executed; the transaction height is used for representing strictly increasing transaction sequence numbers; the roll-out account is the address of the record object of the roll-out event resource on the server, and the roll-in account address is the address of the record object of the roll-in event resource on the server; the transfer-out amount is the transfer-out event resource; the transfer account balance is the remaining event resource currently recorded by the record object of the transfer event resource; the transferred account balance is the remaining event resource currently recorded by the target object of the transferred event resource; the account backup information is the backup of the transaction information; the last transaction hash is used for uniquely representing the last transaction information; the transaction hash is used to uniquely identify the transaction hash.
The following describes a method for repairing event information.
Fig. 10 is a schematic diagram of repairing tampered operation information according to an embodiment of the present invention. As shown in fig. 10, the operation information may be transaction information. When the last transaction information is tampered, the transaction information of the block chain adopts a hash chain structure, so that the previous transaction information is verified when a new transaction is executed. If the previous transaction information is not verified, the next transaction information cannot be generated, and thus the previous transaction information must be repaired when an error in the previous transaction information is detected. When the transaction information is repaired, firstly, the value with the maximum transaction height in all accounts of the node is inquired, and the transaction information corresponding to the value with the maximum transaction height, such as the node A transaction information, the node B transaction information, the node C transaction information and the node D transaction information, is inquired from the rest nodes according to the inquired maximum transaction height value, wherein the node A transaction information, the node B transaction information and the node C transaction information are correct and untrusted transaction information, and the node D transaction information is tampered transaction information.
After inquiring the transaction information corresponding to the value with the maximum transaction height from the rest of the nodes, merging the inquired transaction information of the node A, the node B, the node C and the node D, and merging the inquired transaction information according to the majority of the consistency principles, namely, the final merged information is determined by the majority of the same results, for example, the transaction information of the node A, the transaction information of the node B and the transaction information of the node C are correct and untampered transaction information, and the correct and untampered transaction information is determined to be the reddest merged transaction information only if the transaction information of the node D is tampered. The purpose of repairing the last transaction information is achieved by replacing the tampered last transaction information with the merged transaction information, and the efficiency of event processing is improved.
Fig. 11 is a schematic diagram of repairing information of a tampered recording object according to an embodiment of the present invention. As shown in fig. 11, the information of the recording object may be account information. When the account information is tampered, a transaction cannot be initiated, and the account information needs to be repaired. Firstly, an account address of account information is obtained, and the last piece of transaction information related to the account address in the node is inquired according to the account address. And recovering the account information according to the balance information and the additional information of the last transaction information, thereby realizing the aim of repairing the account information when the account information is falsified and improving the efficiency of event processing.
Fig. 12 is a schematic diagram of repairing both tampered operation information and information of a recording object according to an embodiment of the present invention. As shown in fig. 12, the operation information may be transaction information, and the information of the recording object may be account information. When the account information and the last transaction information are tampered, the account information and the last transaction information need to be repaired. First, an account address corresponding to tampered transaction information is acquired, all transaction information related to the account address is queried from the account address to the remaining node, and a transaction information list is obtained, wherein in a tampered transaction information portion in fig. 12, from top to bottom, a first box and a fifth box are used for representing correct transaction information, second boxes to fourth boxes are used for representing tampered transaction information, in a combined information list portion, from top to bottom, the first box and the fifth box are used for representing correct transaction information, and the second boxes to the fourth boxes are used for representing transaction information for covering the tampered transaction information. And secondly, merging the transaction information lists returned by the nodes according to a majority of consistency principles to obtain a merged transaction information list. And finally, matching the transaction information chain of the tampered node according to the merged transaction information list.
Matching the transaction information chain of the tampered node according to the merged transaction information list comprises the following steps:
the first step, traversing the merged transaction information list reversely, using the hash field of each transaction information in the merged transaction information list to inquire the previous transaction hash field in the transaction information of the tampered node, if the inquiry is successful, executing the second step, if the header of the merged transaction information list is reached and the previous transaction hash field is not inquired, executing the fifth step, and if the header of the merged transaction information list is not reached, continuing traversing the merged transaction information list reversely.
And secondly, under the condition that the last transaction hash field in the transaction information of the tampered node is inquired by using the hash field of each piece of transaction information in the combined transaction information list, the tampered transaction information is covered by using the combined transaction information. Optionally, the information of the merged transaction information list is replaced by the tampered transaction information along the direction indicated by the dotted arrow shown in fig. 12, so as to obtain the correct matched transaction information, and the third step is executed.
And thirdly, judging whether the finally matched correct transaction information is correctly connected in series on the transaction chain, and covering the information represented by the 4 th block from top to bottom in the merged transaction information list to the information represented by the 4 th block from top to bottom in the tampered transaction information as the finally matched correct transaction information as shown in the figure 12. If the correct transaction information matched at last is correctly connected in series on the transaction chain, executing the fourth step; if the last matched correct transaction information is not correctly concatenated on the transaction chain, the fifth step is executed.
Fourthly, repairing the tampered account information according to the balance information and the additional information of the finally matched correct transaction information.
And fifthly, repairing failure.
The embodiment can be applied to the data quick repair function of the block chain database. The transaction information chain of the tampered node is matched according to the merged transaction information list, so that individual damaged transaction information and account information can be quickly recovered, and the efficiency of event processing is improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. 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, or a network device) to execute the method according to the embodiments of the present invention.
Example 3
According to the embodiment of the invention, the event processing device for implementing the event processing method is also provided. Fig. 13 is a schematic diagram of an event processing apparatus according to an embodiment of the present invention. As shown in fig. 13, the apparatus may include: a judging unit 10, a transmitting unit 20, a first processing unit 30 and a second processing unit 40.
The determining unit 10 is configured to cause the first server to determine whether first event information obtained when the first recording object executes the first event is tampered event information.
A sending unit 20, configured to, if the first server determines that the first event information is tampered event information, send an inquiry request to at least one second server, where each second server stores second event information obtained when the first record object executes the first event, the inquiry request is used to request each second server to inquire the second event information, and the second event information is used to repair the first event information.
The first processing unit 30 is configured to enable the first server to perform merging processing on the second event information obtained by each second server in response to the query request, so as to obtain merged event information.
And the second processing unit 40 is configured to perform a repairing process on the first event information by the first server according to the merged event information, so as to obtain third event information of the first recording object.
Optionally, the determining unit 10 includes a first determining module, configured to enable the first server to determine whether first operation information obtained when the first recording object executes the first event is tampered operation information; the sending unit 20 includes a first sending module, configured to enable the first server to send a first query request to at least one second server if the first server determines that the first operation information is tampered operation information, where each second server stores second operation information of the first record object in operating the first event, and the first query request is used to request each second server to query the second operation information; the first processing unit 30 includes a first processing module, configured to enable the first server to perform merging processing on second operation information obtained by each second server in response to the first query request, so as to obtain merging operation information, where the merging event information includes merging operation information, and the second operation information is used to repair the first operation information; the second processing unit 40 includes a second processing module, configured to enable the first server to perform repair processing on the first operation information according to the merge operation information, so as to obtain third operation information of the first record object, where the third event information includes the third operation information.
Optionally, the first determining module includes: the device comprises a first obtaining submodule, a verification submodule, a first determining submodule and a second determining submodule. The first obtaining submodule is used for enabling the first server to obtain first operation information before the first record object executes a second event, wherein the second event is an event adjacent to the first event after the first event is executed; the verification sub-module is used for enabling the first server to verify the first operation information; the first determining submodule is used for determining that the first operation information is the operation information which is not tampered when the first server verifies that the first operation information meets the preset rule, wherein the second event is executed after the first operation information is determined to be the operation information which is not tampered; and the second determining submodule is used for determining the first operation information as the tampered operation information when the first operation information is verified to be not in accordance with the preset rule by the first server.
Optionally, the first server and the second server respectively further store operation information obtained by executing an event on a plurality of second record objects, and the first sending module includes: the device comprises a query submodule, a third determination submodule and a sending submodule. The query submodule is used for enabling the first server to query a plurality of execution sequence numbers of a plurality of second record object execution events on the first record object and the first server, wherein the plurality of execution sequence numbers are used for indicating the execution sequence of the first record object and the plurality of second record objects execution events, and the execution sequence numbers are changed in an increasing mode according to time; a third determining sub-module, configured to, when the first server queries an execution sequence number with a largest value among the multiple execution sequence numbers, and fourth operation information corresponding to the execution sequence number with the largest value is previous operation information that is adjacent to the first operation information and is not tampered on the first server, determine, by the first server, the largest execution sequence number as a target execution sequence number; and the sending submodule is used for enabling the first server to send a first query request to at least one second server according to the target execution sequence number, wherein the first query request is used for requesting each second server to query second operation information according to fourth operation information.
Optionally, the first processing module comprises: a second obtaining submodule, a third obtaining submodule and a fourth determining submodule. The second obtaining submodule is used for enabling the first server to obtain a plurality of pieces of second operation information, wherein the plurality of pieces of second operation information correspond to at least one second server respectively, and the plurality of pieces of second operation information comprise different pieces of sub-operation information; a third obtaining sub-module, configured to enable the first server to obtain first sub-operation information from the multiple pieces of second operation information, where the number of the same first sub-operation information is greater than the number of different second sub-operation information, except for the first sub-operation information, in the multiple pieces of second operation information; and the fourth determining submodule is used for enabling the first server to determine the first sub-operation information as the merging operation information.
Optionally, the second processing module includes a replacement sub-module, configured to replace the first operation information with the merge operation information by the first server, so as to obtain third operation information.
Optionally, the first event information further includes record information of the first record object when the first event is executed, and the determining unit 10 includes: and the second judging module is used for enabling the first server to judge whether the first record information obtained by the first record object executing the first event is the tampered record information or not under the condition that the first operation information is the untampered operation information.
Optionally, the event processing apparatus further includes: an acquisition unit and a processing unit. After the first server judges whether first recording information obtained by a first recording object executing a first event is tampered recording information or not, if the first server judges that the first recording information obtained by the first recording object executing the first event is tampered recording information, the first server acquires the remaining event resources and additional information in the first operation information; and the first server carries out repair processing on the first record information according to the residual event resources and the additional information to obtain second record information.
Optionally, the first event information includes first operation information that the first recording object operates when executing the first event and recording information of the first recording object, and the determining unit 10 includes a third determining module, configured to enable the first server to determine whether the first operation information obtained when the first recording object executes the first event is tampered operation information, and determine whether the first recording information obtained when the first recording object executes the first event is tampered recording information; the sending unit 20 includes a second sending module, configured to send a second query request to at least one second server according to identification information in the first record information if the first server determines that the first operation information is tampered operation information and determines that the first record information is tampered record information, where each second server stores second operation information in which a first record object operates on a first event when the first event is executed, the second query request is used to request each second server to query second operation information corresponding to the identification information, and the second operation information corresponding to the identification information is used to repair the first operation information; the first processing unit 30 includes a third processing module, configured to enable the first server to perform merging processing on an operation information list obtained by each second server in response to the second query request, so as to obtain a merged operation information list, where the operation information list includes multiple pieces of operation information corresponding to the identification information on the second server, and the merged event information includes the merged operation information list; the second processing unit 40 includes a fourth processing module, configured to enable the first server to perform repair processing on the first operation information according to the merge operation information list to obtain third operation information of the first record object, and perform repair processing on the first record information according to the third operation information to obtain second record information of the first record object, where the third event information includes the third operation information and the second record information.
Optionally, the third processing module comprises: a fourth acquisition submodule, a fifth acquisition submodule, and a fifth determination submodule. The fourth obtaining submodule is used for the first server to obtain a plurality of operation information lists, wherein the plurality of operation information lists correspond to the at least one second server, and the plurality of operation information lists comprise different sub-operation information lists; a fifth obtaining sub-module, configured to enable the first server to obtain a first sub-operation information list from the multiple operation information lists, where the number of the same first sub-operation information list is greater than the number of different second sub-operation information lists in the multiple operation information lists except for the first sub-operation information list; and the fifth determining submodule is used for enabling the first server to determine the first sub-operation information list as a merging operation information list.
Optionally, the fourth processing module includes: the traversing submodule, the sixth obtaining submodule, the inquiring submodule and the replacing submodule. The traversing submodule is used for enabling the first server to traverse the merging operation information list; a sixth obtaining submodule, configured to enable the first server to obtain each piece of operation information in the merge operation information list; the first server queries a preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information; and the replacing sub-module is used for replacing the first operation information with the merged event information list under the condition that the first server inquires the preset field in the previous operation information before the first operation information according to the preset field in each piece of operation information.
Optionally, the event processing apparatus further includes a determining unit, configured to, after querying a preset field in a previous piece of operation information of the first operation information according to the preset field in each piece of operation information, the first server determines that the first event information is failed to be repaired when the preset field in the previous piece of operation information of the first operation information is not queried according to the preset field in each piece of operation information.
The second processing unit 40 includes: the fourth judging module is used for enabling the first server to judge whether the third operation information is correctly connected in series on the event chain, wherein the event information on the event chain is stored in a chain structure; and the fifth processing module is used for enabling the first server to carry out repair processing on the first recorded information according to the remaining event resources and the additional information in the third operation information to obtain second recorded information if the first server judges that the third operation information is correctly connected in series on the event chain.
Optionally, the event processing apparatus further includes: and the determining module is used for determining that the first record information is failed to be repaired if the first server judges that the third operation information is not correctly connected in series on the event chain after the first server judges whether the third operation information is correctly connected in series on the event chain.
It should be noted that the determining unit 10 in this embodiment may be configured to execute step S202 in embodiment 1 of this application, the sending unit 20 in this embodiment may be configured to execute step S204 in embodiment 1 of this application, the first processing unit 30 in this embodiment may be configured to execute step S206 in embodiment 1 of this application, and the second processing unit 40 in this embodiment may be configured to execute step S208 in embodiment 1 of this application.
In this embodiment, the determining unit 10 causes the first server to determine whether first event information obtained by executing a first event of a first record object is tampered event information, the sending unit 20 causes the first server to send an inquiry request to at least one second server if it is determined that the first event information is tampered event information, wherein each second server stores second event information obtained by executing the first event of the first record object, the inquiry request is used to request each second server to inquire second event information, the second event information is used to repair the first event information, the first processing unit 30 causes the first server to merge the second event information obtained by each second server in response to the inquiry request to obtain merged event information, the second processing unit 40 causes the first server to perform repair processing on the first event information according to the merged event information, and obtaining the third event information of the first recording object, so as to achieve the purpose of processing the event, thereby achieving the technical effect of improving the event processing efficiency, and further solving the technical problem of low event processing efficiency in the related technology.
It should be noted here that the above units and modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the above embodiment 1. It should be noted that the modules described above as a part of the apparatus may be run in a hardware environment as shown in fig. 1, and may be implemented by software, where the hardware environment includes a network environment.
Example 4
According to the embodiment of the invention, the invention also provides a server or a terminal for implementing the event processing method.
Fig. 14 is a block diagram of a terminal according to an embodiment of the present invention. As shown in fig. 14, the terminal may include: one or more processors 141 (only one of which is shown), a memory 143, and a transmission apparatus 145 (such as the transmission apparatus in the above-described embodiments), as shown in fig. 14, the terminal may further include an input/output device 147.
The memory 143 may be used to store software programs and modules, such as program instructions/modules corresponding to the event method and apparatus in the embodiment of the present invention, and the processor 141 executes various functional applications and data processing by running the software programs and modules stored in the memory 143, so as to implement the event processing method. Memory 143 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 143 may further include memory located remotely from processor 141, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 145 is used for receiving or transmitting data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 145 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 145 is a Radio Frequency (RF) module for communicating with the internet by wireless.
Wherein, in particular, the memory 143 is used for storing application programs.
Processor 141 may invoke an application stored in memory 143 via transport 145 to perform the following steps:
the first server judges whether first event information obtained when the first record object executes the first event is tampered event information or not;
if the first server judges that the first event information is tampered event information, sending an inquiry request to at least one second server, wherein the second event information obtained when the first record object executes the first event is stored on each second server, the inquiry request is used for requesting each second server to inquire the second event information, and the second event information is used for repairing the first event information;
the first server merges second event information obtained by each second server responding to the query request to obtain merged event information;
and the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first record object.
Processor 141 is also configured to perform the following steps: the first event information comprises first operation information for operating the first event when the first record object executes the first event, and the first server judges whether the first operation information obtained by the first record object executing the first event is tampered operation information or not; if the first server judges that the first operation information is tampered operation information, a first query request is sent to at least one second server, wherein second operation information of a first record object in operating a first event is stored on each second server, and the first query request is used for requesting each second server to query the second operation information; the first server merges second operation information obtained by each second server responding to the first query request to obtain merged operation information, wherein the merged event information comprises the merged operation information, and the second operation information is used for repairing the first operation information; and the first server carries out repair processing on the first operation information according to the merging operation information to obtain third operation information of the first record object, wherein the third event information comprises the third operation information.
Processor 141 is also configured to perform the following steps: the first server acquires first operation information before a first record object executes a second event, wherein the second event is an event adjacent to the first event after the first event is executed; the first server verifies the first operation information; when the first operation information is verified to meet the preset rule, the first operation information is determined to be the operation information which is not tampered, wherein the second event is executed after the first operation information is determined to be the operation information which is not tampered; and when the first server verifies that the first operation information does not accord with the preset rule, determining that the first operation information is tampered operation information.
Processor 141 is also configured to perform the following steps: the first server inquires a plurality of execution sequence numbers of the second record object execution events on the first record object and the first server, wherein the execution sequence numbers are used for indicating the execution sequence of the first record object and the second record object execution events, and the execution sequence numbers are changed in an increasing mode according to time; when the first server inquires the execution sequence number with the largest value in the execution sequence numbers and the fourth operation information corresponding to the execution sequence number with the largest value is the previous operation information which is adjacent to the first operation information and is not tampered, the first server determines the largest execution sequence number as a target execution sequence number; and the first server sends a first query request to at least one second server according to the target execution sequence number, wherein the first query request is used for requesting each second server to query second operation information according to the fourth operation information.
Processor 141 is also configured to perform the following steps: the first server acquires a plurality of pieces of second operation information, wherein the plurality of pieces of second operation information respectively correspond to at least one second server, and the plurality of pieces of second operation information comprise different pieces of sub-operation information; the first server acquires first sub-operation information from the plurality of pieces of second operation information, wherein the number of the same first sub-operation information is more than the number of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information; the first server determines the first sub-operation information as merging operation information.
Processor 141 is also configured to perform the following steps: and the first server replaces the first operation information with the merging operation information to obtain third operation information.
Processor 141 is also configured to perform the following steps: the first event information further includes record information of the first record object when the first record object executes the first event, and the first server determines whether the first record information obtained when the first record object executes the first event is tampered record information or not when the first operation information is the operation information which is not tampered.
Processor 141 is also configured to perform the following steps: after the first server judges whether first recording information obtained by the first recording object executing the first event is tampered recording information or not, if the first server judges that the first recording information obtained by the first recording object executing the first event is tampered recording information, acquiring remaining event resources and additional information in the first operation information; and the first server carries out repairing processing on the first recording information according to the residual event resources and the additional information to obtain second recording information.
Processor 141 is also configured to perform the following steps: the first event information comprises first operation information operated by the first recording object when the first event is executed and recording information of the first recording object, and the first server judges whether the first operation information obtained when the first recording object executes the first event is tampered operation information and judges whether the first recording information obtained when the first recording object executes the first event is tampered recording information; if the first server judges that the first operation information is tampered operation information and judges that the first record information is tampered record information, a second query request is sent to at least one second server according to identification information in the first record information, wherein each second server stores second operation information of a first record object for operating a first event when the first event is executed, the second query request is used for requesting each second server to query second operation information corresponding to the identification information, and the second operation information corresponding to the identification information is used for repairing the first operation information; the first server performs merging processing on an operation information list obtained by each second server responding to the second query request to obtain a merging operation information list, wherein the operation information list comprises a plurality of pieces of operation information corresponding to the identification information on the second server, and the merging event information comprises the merging operation information list; and the first server performs repair processing on the first operation information according to the merging operation information list to obtain third operation information of the first recording object, and performs repair processing on the first recording information according to the third operation information to obtain second recording information of the first recording object, wherein the third event information comprises the third operation information and the second recording information.
Processor 141 is also configured to perform the following steps: the method comprises the steps that a first server acquires a plurality of operation information lists, wherein the operation information lists correspond to at least one second server, and the operation information lists comprise different sub-operation information lists; the method comprises the steps that a first server acquires a first sub-operation information list from a plurality of operation information lists, wherein the number of the same first sub-operation information lists is more than that of different second sub-operation information lists except for the first sub-operation information lists in the plurality of operation information lists; the first server determines the first sub-operation information list as a merge operation information list.
Processor 141 is also configured to perform the following steps: the first server traverses the merging operation information list; the first server acquires each piece of operation information in the merging operation information list; the first server inquires a preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information; and under the condition that the first server inquires the preset field in the last piece of operation information before the first operation information according to the preset field in each piece of operation information, replacing the first operation information with the merged event information list.
Processor 141 is also configured to perform the following steps: after the first server queries the preset field in the last piece of operation information of the first operation information according to the preset field in each piece of operation information, the first server determines that the first event information is failed to be repaired under the condition that the preset field in the last piece of operation information of the first operation information is not queried according to the preset field in each piece of operation information.
Processor 141 is also configured to perform the following steps: the first server judges whether the third operation information is correctly connected in series on the event chain, wherein the event information on the event chain is stored in a chain structure; and if the first server judges that the third operation information is correctly connected in series on the event chain, repairing the first record information according to the remaining event resources and the additional information in the third operation information to obtain second record information.
Processor 141 is also configured to perform the following steps: after the first server judges whether the third operation information is correctly connected in series on the event chain, if the first server judges that the third operation information is not correctly connected in series on the event chain, the first server determines that the first record information is failed to be repaired.
The embodiment of the invention provides an event processing scheme. Sending an inquiry request to at least one second server by adopting the first server under the condition that the first event information is judged to be tampered event information, wherein the second event information obtained when the first record object executes the first event is stored on each second server, the inquiry request is used for requesting each second server to inquire the second event information, and the second event information is used for repairing the first event information; the first server merges second event information obtained by each second server responding to the query request to obtain merged event information; the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first recording object, and the purpose of processing the events is achieved, so that the technical effect of improving the event processing efficiency is achieved, and the technical problem of low event processing efficiency in the related technology is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 14 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 14 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 14, or have a different configuration than shown in FIG. 14.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 5
The embodiment of the invention also provides a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing the event processing method.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
the first server judges whether first event information obtained when the first record object executes the first event is tampered event information or not;
if the first server judges that the first event information is tampered event information, sending an inquiry request to at least one second server, wherein the second event information obtained when the first record object executes the first event is stored on each second server, the inquiry request is used for requesting each second server to inquire the second event information, and the second event information is used for repairing the first event information;
the first server merges second event information obtained by each second server responding to the query request to obtain merged event information;
and the first server carries out repairing processing on the first event information according to the merged event information to obtain third event information of the first record object.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first event information comprises first operation information for operating the first event when the first record object executes the first event, and the first server judges whether the first operation information obtained by the first record object executing the first event is tampered operation information or not; if the first server judges that the first operation information is tampered operation information, a first query request is sent to at least one second server, wherein second operation information of a first record object in operating a first event is stored on each second server, and the first query request is used for requesting each second server to query the second operation information; the first server merges second operation information obtained by each second server responding to the first query request to obtain merged operation information, wherein the merged event information comprises the merged operation information, and the second operation information is used for repairing the first operation information; and the first server carries out repair processing on the first operation information according to the merging operation information to obtain third operation information of the first record object, wherein the third event information comprises the third operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first server acquires first operation information before a first record object executes a second event, wherein the second event is an event adjacent to the first event after the first event is executed; the first server verifies the first operation information; when the first operation information is verified to meet the preset rule, the first operation information is determined to be the operation information which is not tampered, wherein the second event is executed after the first operation information is determined to be the operation information which is not tampered; and when the first server verifies that the first operation information does not accord with the preset rule, determining that the first operation information is tampered operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first server inquires a plurality of execution sequence numbers of the second record object execution events on the first record object and the first server, wherein the execution sequence numbers are used for indicating the execution sequence of the first record object and the second record object execution events, and the execution sequence numbers are changed in an increasing mode according to time; when the first server inquires the execution sequence number with the largest value in the execution sequence numbers and the fourth operation information corresponding to the execution sequence number with the largest value is the previous operation information which is adjacent to the first operation information and is not tampered, the first server determines the largest execution sequence number as a target execution sequence number; and the first server sends a first query request to at least one second server according to the target execution sequence number, wherein the first query request is used for requesting each second server to query second operation information according to the fourth operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first server acquires a plurality of pieces of second operation information, wherein the plurality of pieces of second operation information respectively correspond to at least one second server, and the plurality of pieces of second operation information comprise different pieces of sub-operation information; the first server acquires first sub-operation information from the plurality of pieces of second operation information, wherein the number of the same first sub-operation information is more than the number of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information; the first server determines the first sub-operation information as merging operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: and the first server replaces the first operation information with the merging operation information to obtain third operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first event information further includes record information of the first record object when the first record object executes the first event, and the first server determines whether the first record information obtained when the first record object executes the first event is tampered record information or not when the first operation information is the operation information which is not tampered.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first server judges whether first recording information obtained by the first recording object executing the first event is tampered recording information or not, if the first server judges that the first recording information obtained by the first recording object executing the first event is tampered recording information, acquiring remaining event resources and additional information in the first operation information; and the first server carries out repairing processing on the first recording information according to the residual event resources and the additional information to obtain second recording information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first event information comprises first operation information operated by the first recording object when the first event is executed and recording information of the first recording object, and the first server judges whether the first operation information obtained when the first recording object executes the first event is tampered operation information and judges whether the first recording information obtained when the first recording object executes the first event is tampered recording information; if the first server judges that the first operation information is tampered operation information and judges that the first record information is tampered record information, a second query request is sent to at least one second server according to identification information in the first record information, wherein each second server stores second operation information of a first record object for operating a first event when the first event is executed, the second query request is used for requesting each second server to query second operation information corresponding to the identification information, and the second operation information corresponding to the identification information is used for repairing the first operation information; the first server performs merging processing on an operation information list obtained by each second server responding to the second query request to obtain a merging operation information list, wherein the operation information list comprises a plurality of pieces of operation information corresponding to the identification information on the second server, and the merging event information comprises the merging operation information list; and the first server performs repair processing on the first operation information according to the merging operation information list to obtain third operation information of the first recording object, and performs repair processing on the first recording information according to the third operation information to obtain second recording information of the first recording object, wherein the third event information comprises the third operation information and the second recording information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the method comprises the steps that a first server acquires a plurality of operation information lists, wherein the operation information lists correspond to at least one second server, and the operation information lists comprise different sub-operation information lists; the method comprises the steps that a first server acquires a first sub-operation information list from a plurality of operation information lists, wherein the number of the same first sub-operation information lists is more than that of different second sub-operation information lists except for the first sub-operation information lists in the plurality of operation information lists; the first server determines the first sub-operation information list as a merge operation information list.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first server traverses the merging operation information list; the first server acquires each piece of operation information in the merging operation information list; the first server inquires a preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information; and under the condition that the first server inquires the preset field in the last piece of operation information before the first operation information according to the preset field in each piece of operation information, replacing the first operation information with the merged event information list.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first server queries the preset field in the last piece of operation information of the first operation information according to the preset field in each piece of operation information, the first server determines that the first event information is failed to be repaired under the condition that the preset field in the last piece of operation information of the first operation information is not queried according to the preset field in each piece of operation information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first server judges whether the third operation information is correctly connected in series on the event chain, wherein the event information on the event chain is stored in a chain structure; and if the first server judges that the third operation information is correctly connected in series on the event chain, repairing the first record information according to the remaining event resources and the additional information in the third operation information to obtain second record information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first server judges whether the third operation information is correctly connected in series on the event chain, if the first server judges that the third operation information is not correctly connected in series on the event chain, the first server determines that the first record information is failed to be repaired.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be 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, units or modules, and may be in an electrical 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, may be located in one place, or may 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. An event processing method, comprising:
the method comprises the steps that a first server judges whether first operation information obtained when a first recording object executes a first event is tampered operation information or not, and judges whether first recording information obtained when the first recording object executes the first event is tampered recording information or not;
if the first server judges that the first operation information is tampered operation information and judges that the first record information is tampered record information, a second query request is sent to at least one second server according to identification information in the first record information, wherein each second server stores second operation information of the first record object operating on the first event when executing the first event, the second query request is used for requesting each second server to query the second operation information corresponding to the identification information, and the second operation information corresponding to the identification information is used for repairing the first operation information;
the first server merges operation information lists obtained by each second server responding to the second query request to obtain merged operation information lists, wherein the merged operation information lists comprise a plurality of pieces of operation information corresponding to the identification information on the second servers;
and the first server performs repair processing on the first operation information according to the merging operation information list to obtain third operation information of the first recording object, and performs repair processing on the first recording information according to the third operation information to obtain second recording information of the first recording object.
2. The method of claim 1, wherein the merging, by the first server, the operation information lists obtained by each of the second servers in response to the second query request, and obtaining the merged operation information list comprises:
the first server acquires a plurality of operation information lists, wherein the operation information lists correspond to at least one second server and comprise different sub-operation information lists;
the first server acquires a first sub-operation information list from the plurality of operation information lists, wherein the number of the same first sub-operation information lists is more than the number of different second sub-operation information lists except the first sub-operation information lists in the plurality of operation information lists;
and the first server determines the first sub-operation information list as the merge operation information list, wherein a data structure of event information in the merge operation information list is a block chain.
3. The method of claim 2, wherein the first server performs a repair process on the first operation information according to the merge operation information list, and obtaining the third operation information comprises:
the first server traverses the merging operation information list;
the first server acquires each piece of operation information in the merging operation information list;
the first server inquires the preset field in the previous piece of operation information before the first operation information according to the preset field in each piece of operation information;
and the first server replaces the first operation information with a merged event information list under the condition that the preset field in the last operation information before the first operation information is inquired according to the preset field in each piece of operation information.
4. The method according to claim 3, wherein after the first server queries the preset field in the last piece of operation information of the first operation information according to the preset field in each piece of operation information, the method further comprises:
and the first server determines that the first event information is failed to be repaired under the condition that the preset field in the last piece of operation information before the first operation information is not inquired according to the preset field in each piece of operation information.
5. The method according to claim 3, wherein the first server performs the repair processing on the first record information according to the third operation information, and obtaining the second record information of the first record object includes:
the first server judges whether the third operation information is correctly connected in series on an event chain, wherein the event information on the event chain is stored in a chain structure;
and if the first server judges that the third operation information is correctly connected in series on the event chain, repairing the first record information according to the remaining event resources and the additional information in the third operation information to obtain the second record information.
6. The method of claim 5, wherein after the first server determines whether the third operation information is correctly concatenated on the event chain, the method further comprises:
and if the first server judges that the third operation information is not correctly connected in series on the event chain, determining that the first record information is failed to be repaired.
7. The method according to claim 1, wherein the determining, by the first server, whether the first operation information obtained when the first record object executes the first event is tampered operation information includes:
the first server acquires the first operation information before the first record object executes a second event, wherein the second event is an event adjacent to the first event after the first event is executed;
the first server verifies the first operation information;
when the first server verifies that the first operation information meets a preset rule, determining that the first operation information is operation information which is not tampered, wherein the second event is executed after the first operation information is determined to be the operation information which is not tampered;
and when the first server verifies that the first operation information does not accord with the preset rule, determining that the first operation information is tampered operation information.
8. The method according to claim 1, wherein after the first server determines whether the first operation information obtained by the first record object executing the first event is tampered operation information, and determines whether the first record information obtained by the first record object executing the first event is tampered record information, the method further comprises:
if the first server judges that the first operation information is the operation information which is not tampered and the first record information is the tampered record information, acquiring the remaining event resources and the additional information in the first operation information;
and the first server carries out repair processing on the first record information according to the residual event resources and the additional information to obtain second record information.
9. The method according to claim 1, wherein after the first server determines whether the first operation information obtained by the first record object executing the first event is tampered operation information, the method further comprises:
if the first server judges that the first operation information is tampered operation information and the first record information is record information which is not tampered, sending a first query request to at least one second server, wherein the first query request is used for requesting each second server to query the second operation information, and a data structure of event information of a first record object is a block chain;
the first server merges the second operation information obtained by each second server responding to the first query request to obtain merged operation information, wherein the second operation information is used for repairing the first operation information;
and the first server carries out repairing processing on the first operation information according to the merging operation information to obtain the third operation information.
10. The method according to claim 9, wherein the first server and the second server respectively store operation information obtained by executing an event on a plurality of second record objects, and if the first server determines that the first operation information is tampered operation information and the first record information is non-tampered record information, sending the first query request to at least one of the second servers includes:
the first server queries a plurality of execution sequence numbers of a plurality of second record object execution events on the first server and the first record object, wherein the execution sequence numbers are used for indicating the execution sequence of the first record object and the second record object execution events, and the execution sequence numbers are changed in an increasing mode according to time;
when the first server inquires the execution sequence number with the largest value in the execution sequence numbers, and when fourth operation information corresponding to the execution sequence number with the largest value is previous operation information which is adjacent to the first operation information and is not tampered on the first server, the first server determines the largest execution sequence number as a target execution sequence number;
the first server sends the first query request to the at least one second server according to the target execution sequence number, wherein the first query request is used for requesting each second server to query the second operation information according to the fourth operation information.
11. The method of claim 9, wherein the merging, by the first server, the second operation information obtained by each of the second servers in response to the first query request, and obtaining the merged operation information comprises:
the first server acquires a plurality of pieces of second operation information, wherein the plurality of pieces of second operation information respectively correspond to at least one second server, and the plurality of pieces of second operation information comprise different pieces of sub-operation information;
the first server acquires first sub-operation information from the plurality of pieces of second operation information, wherein the number of the same first sub-operation information is more than the number of different second sub-operation information except the first sub-operation information in the plurality of pieces of second operation information;
the first server determines the first sub-operation information as the merge operation information.
12. The method of claim 9, wherein the first server performs a repair process on the first operation information according to the merge operation information, and obtaining third operation information of the first record object comprises:
and the first server replaces the first operation information with the merging operation information to obtain the third operation information.
13. An event processing apparatus, comprising:
a third determining module, configured to enable the first server to determine whether first operation information obtained when the first recording object executes the first event is tampered operation information, and determine whether first recording information obtained when the first recording object executes the first event is tampered recording information;
a second sending module, configured to, if the first server determines that the first operation information is tampered operation information and determines that the first record information is tampered record information, send a second query request to at least one second server according to identification information in the first record information, where each second server stores second operation information that the first record object operates on the first event when executing the first event, the second query request is used to request each second server to query the second operation information corresponding to the identification information, and the second operation information corresponding to the identification information is used to repair the first operation information;
a third processing module, configured to enable the first server to perform merging processing on an operation information list obtained by each second server in response to the second query request, so as to obtain a merged operation information list, where the operation information list includes multiple pieces of operation information corresponding to the identification information on the second server;
and the fourth processing module is configured to enable the first server to perform repair processing on the first operation information according to the merge operation information list to obtain third operation information of the first record object, and perform repair processing on the first record information according to the third operation information to obtain second record information of the first record object.
14. The apparatus of claim 13, wherein the third processing module comprises:
a fourth obtaining sub-module, configured to enable the first server to obtain multiple operation information lists, where the multiple operation information lists correspond to at least one of the second servers, and the multiple operation information lists include different sub-operation information lists;
a fifth obtaining sub-module, configured to enable the first server to obtain a first sub-operation information list from the multiple operation information lists, where the number of the same first sub-operation information lists is greater than the number of different second sub-operation information lists in the multiple operation information lists except for the first sub-operation information list;
a fifth determining sub-module, configured to enable the first server to determine the first sub-operation information list as the merge operation information list.
15. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 12 when executed.
CN201910642568.6A 2017-01-20 2017-01-20 Event processing method and device Active CN110362406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910642568.6A CN110362406B (en) 2017-01-20 2017-01-20 Event processing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710052185.4A CN108021443B (en) 2017-01-20 2017-01-20 Event processing method and device
CN201910642568.6A CN110362406B (en) 2017-01-20 2017-01-20 Event processing method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201710052185.4A Division CN108021443B (en) 2017-01-20 2017-01-20 Event processing method and device

Publications (2)

Publication Number Publication Date
CN110362406A CN110362406A (en) 2019-10-22
CN110362406B true CN110362406B (en) 2020-12-25

Family

ID=62079171

Family Applications (3)

Application Number Title Priority Date Filing Date
CN201910642568.6A Active CN110362406B (en) 2017-01-20 2017-01-20 Event processing method and device
CN201710052185.4A Active CN108021443B (en) 2017-01-20 2017-01-20 Event processing method and device
CN201910642566.7A Active CN110347514B (en) 2017-01-20 2017-01-20 Event processing method and device

Family Applications After (2)

Application Number Title Priority Date Filing Date
CN201710052185.4A Active CN108021443B (en) 2017-01-20 2017-01-20 Event processing method and device
CN201910642566.7A Active CN110347514B (en) 2017-01-20 2017-01-20 Event processing method and device

Country Status (1)

Country Link
CN (3) CN110362406B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263088B (en) * 2019-05-20 2021-04-02 创新先进技术有限公司 Conditional receipt storage method and node combining code labeling and event type

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188273B2 (en) * 2003-11-24 2007-03-06 Tsx Inc. System and method for failover
WO2005099239A1 (en) * 2004-04-07 2005-10-20 Orange Personal Communications Services Limited Event processing system
WO2008061919A2 (en) * 2006-11-22 2008-05-29 Agfa Healthcare Inc. Method and system for remote collaboration
CN101299758B (en) * 2008-05-21 2011-05-11 网御神州科技(北京)有限公司 Well-regulated group system for cosmically processing event as well as processing method
CN101815118A (en) * 2009-02-20 2010-08-25 腾讯科技(深圳)有限公司 System and method for realizing real-time processing on user input in mobile phone software
US8261126B2 (en) * 2009-04-03 2012-09-04 Microsoft Corporation Bare metal machine recovery from the cloud
US8179246B2 (en) * 2009-06-08 2012-05-15 Tex-Ray Industrial Co., Ltd. Indication clothing
US20110040722A1 (en) * 2009-08-17 2011-02-17 International Business Machines Corporation Predicate selection in event filtering
CN101753461B (en) * 2010-01-14 2012-07-25 中国建设银行股份有限公司 Method for realizing load balance, load balanced server and group system
US8635187B2 (en) * 2011-01-07 2014-01-21 Symantec Corporation Method and system of performing incremental SQL server database backups
CN102195987B (en) * 2011-05-31 2014-04-30 成都七巧软件有限责任公司 Distributed credibility authentication method and system thereof based on software product library
CN102571424A (en) * 2011-12-29 2012-07-11 华为技术服务有限公司 Processing method, device and system for engineering event
CN102769615B (en) * 2012-07-02 2014-11-26 北京大学 Task scheduling method and system based on MapReduce mechanism
CN103218554B (en) * 2013-03-18 2015-10-28 卡巴斯基实验室封闭式股份公司 For the system and method based on user behavior Adaptive Control user action
CN103279385A (en) * 2013-06-01 2013-09-04 北京华胜天成科技股份有限公司 Method and system for scheduling cluster tasks in cloud computing environment
CN105760252A (en) * 2014-12-19 2016-07-13 中兴通讯股份有限公司 Method and device for achieving transaction log image backup
WO2016160850A1 (en) * 2015-03-30 2016-10-06 Iperial, Inc. System and method for authenticating digital content
CN105389207A (en) * 2015-11-06 2016-03-09 成都视达科信息技术有限公司 Adaptive data request processing method and apparatus, task scheduler and adaptive data request processing system
CN105656698B (en) * 2016-03-24 2019-03-19 鞠洪尧 A kind of network application system intelligent monitoring structure and method
CN106095618A (en) * 2016-06-06 2016-11-09 北京中油瑞飞信息技术有限责任公司 The method and system of data manipulation
CN106254236A (en) * 2016-08-05 2016-12-21 成都广达新网科技股份有限公司 A kind of multiserver slave method of work based on TCP event

Also Published As

Publication number Publication date
CN110347514A (en) 2019-10-18
CN110362406A (en) 2019-10-22
CN110347514B (en) 2021-03-16
CN108021443B (en) 2020-04-07
CN108021443A (en) 2018-05-11

Similar Documents

Publication Publication Date Title
JP7199775B2 (en) Data processing method, data processing device, node device, and computer program based on smart contract
CN101313495B (en) Method, system and apparatus for data synchronization
CN107396360B (en) Block verification method and device
CN112615871B (en) Method and device for transmitting authenticatable message across chains
CN106326219B (en) Method, device and system for checking business system data
CN110730225A (en) Data processing method of Internet of things based on block chain, Internet of things and storage medium
CN109255056B (en) Data reference processing method, device, equipment and storage medium of block chain
CN110690974B (en) Block chain based data verification method, device, equipment and readable storage medium
CN110458709B (en) Resource transfer information transmission method and device, storage medium and electronic device
CN112422341B (en) Fault detection method of block chain network and related equipment
CN110599346A (en) Block chain information acquisition method and related equipment
CN111831548A (en) Method and device for drawing dependency relationship topological graph
CN110289999B (en) Data processing method, system and device
CN111698315B (en) Data processing method and device for block and computer equipment
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
CN110599174A (en) Block chain information processing method and related equipment
CN111984735A (en) Data archiving method and device, electronic equipment and storage medium
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
CN111353136A (en) Method and device for processing operation request
CN110362406B (en) Event processing method and device
CN114328029A (en) Backup method and device of application resources, electronic equipment and storage medium
CN105160244A (en) File processing method and system
CN110825609B (en) Service testing method, device and system
CN108924089A (en) A kind of client device recognition methods, device and client device
KR102485970B1 (en) Blockchain system tolerating byzantine faults and operating method for blockchain node in system

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