CN108566291B - Event processing method, server and system - Google Patents

Event processing method, server and system Download PDF

Info

Publication number
CN108566291B
CN108566291B CN201810150232.3A CN201810150232A CN108566291B CN 108566291 B CN108566291 B CN 108566291B CN 201810150232 A CN201810150232 A CN 201810150232A CN 108566291 B CN108566291 B CN 108566291B
Authority
CN
China
Prior art keywords
event
identifier
cache database
shared cache
upstream node
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
CN201810150232.3A
Other languages
Chinese (zh)
Other versions
CN108566291A (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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201810150232.3A priority Critical patent/CN108566291B/en
Publication of CN108566291A publication Critical patent/CN108566291A/en
Application granted granted Critical
Publication of CN108566291B publication Critical patent/CN108566291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure

Abstract

The embodiment of the invention provides an event processing method, a server and a system, wherein the method comprises the following steps: receiving event information sent by a downstream system, wherein the event information comprises an event identifier; if the event identifier is not found in a preset shared cache database, acquiring corresponding event state information based on the event identifier; and writing the event identification and the corresponding event state information into the shared cache database. The embodiment of the invention can ensure that the event state information does not exist in any upstream node but is uniformly stored in the shared cache, thereby realizing the separation of the event state information and the upstream node and ensuring that the embodiment of the invention can be applied to the state information of all scenes.

Description

Event processing method, server and system
Technical Field
The present invention relates to the field of telephone data processing, and in particular, to a method, a server, and a system for processing an event.
Background
In order to improve the reliability of the overall application and improve the concurrency performance of the system, in the state service, the prior art generally adopts the state node communication viscosity or the active/standby service mode to perform the state transition, but the two modes respectively have the following disadvantages:
for the mode of state node communication viscosity, the state node distribution generally performs a hash remainder algorithm according to a certain specific attribute value to uniquely hit a certain service node, and the denominator of the hash remainder algorithm is the number of application nodes, so that when the application nodes are newly increased or reduced, the hash remainder algorithm is influenced, and the capacity of the nodes cannot be expanded. On the other hand, because the data of the node is kept in the memory of the server and the data is maintained by the node, when the application node fails, the memory data disappears immediately and cannot be recovered.
The communication node only maintains the state on the main service in a main/standby service mode, and when the main node fails, the backup node is immediately started.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed in order to provide a method, server and system for event processing that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses an event processing method, where the method includes:
receiving event information sent by a downstream system, wherein the event information comprises an event identifier;
if the event identifier is not found in a preset shared cache database, acquiring corresponding event state information based on the event identifier;
and writing the event identification and the corresponding event state information into the shared cache database.
Preferably, the event identifier includes a service object identifier and an event sequence number, and before the event identifier is not found in the preset shared cache database, and corresponding event state information is obtained based on the event identifier, the method further includes:
searching the service object identification and the event sequence number in a shared cache database;
if the service object identifier and the event sequence number are both found, judging that the event identifier is found successfully;
and if the service object identifier is found but the event sequence number is not found, or the service object identifier and the event sequence number are not found, judging that the event identifier is found to be failed.
Preferably, the writing the event identifier and the corresponding event state information into the shared cache database includes:
if the service object identification and the event sequence number are not found, the service object identification is used as a main key, and the event sequence number and the event state information are used as values corresponding to the main key and are written into the shared cache database;
and if the service object identification is found but the event sequence number is not found, covering the original record under the service object identification with the event sequence number and the event state information.
Preferably, the method further comprises:
and if the event identifier is found in a preset shared cache database, or after the event identifier and the corresponding event state information are written into the shared cache database, returning processing completion information to the downstream system.
Preferably, before the step of receiving the event information sent by the downstream system, the method further comprises:
and sending a subscription message to the downstream system.
The embodiment of the invention also discloses an event processing method, which comprises the following steps:
sending event information to a first upstream node, wherein the event information comprises an event identifier;
if the processing completion message sent by the first upstream node is not received within a preset time period, sending the event information to a second upstream node; the processing completion message is a message generated after the event identifier and the corresponding event state information are written into a shared cache database when the event identifier is not found in a preset shared cache database by the first upstream node, or the message generated when the event identifier is found in the preset shared cache database by the first upstream node;
preferably, the method further comprises:
receiving a subscription message of the newly added node;
and distributing the messages to the newly added nodes based on the subscription messages.
The embodiment of the invention also discloses a server for processing the event, which comprises:
the system comprises an event information receiving module, a processing module and a processing module, wherein the event information receiving module is used for receiving event information sent by a downstream system, and the event information comprises an event identifier;
the event state information acquisition module is used for acquiring corresponding event state information based on the event identifier if the event identifier is not found in a preset shared cache database;
and the information writing module is used for writing the event identification and the corresponding event state information into the shared cache database.
The embodiment of the invention also discloses an event processing system, which comprises:
an event information sending module, configured to send event information to a first upstream node, where the event information includes an event identifier;
the retransmission module is used for sending the event information to a second upstream node if the processing completion message sent by the first upstream node is not received within a preset time period; the processing completion message is a message generated after the event identifier and the corresponding event state information are written into a shared cache database when the event identifier is not found in a preset shared cache database by the first upstream node, or the message generated when the event identifier is found in the preset shared cache database by the first upstream node;
the embodiment of the invention also discloses electronic equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the steps of the method are realized when the processor executes the program.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps of the method when being executed by a processor.
The embodiment of the invention has the following advantages:
in the embodiment of the present invention, after receiving event information sent by a downstream system, an upstream node may search an event identifier in the event information in a preset shared cache database, and if the search fails, obtain corresponding event state information based on the event identifier, and write the event identifier and the corresponding event state information into the shared cache database, where the event state information does not exist in any upstream node but is uniformly stored in a shared cache, so that the separation of the event state information from the upstream node is realized, and the embodiment of the present invention can be applied to state information of all scenarios.
In addition, in the embodiment of the present invention, the downstream system may determine whether the upstream node fails according to whether a processing completion message sent by the upstream node is received within a predetermined time period, and when it is determined that the upstream node fails, the same event information of the same service object may be sent to other upstream nodes for processing, so as to reduce the influence of the failed node on the state change, so that when a single application node fails, no influence is exerted on the service, and the availability of the service is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flowchart illustrating the steps of a first embodiment of a method for event processing according to the present invention;
FIG. 2 is a first diagram illustrating state transitions in a first embodiment of a method for event processing according to the present invention;
FIG. 3 is a diagram illustrating a state transition in a first embodiment of a method for event processing according to the present invention;
FIG. 4 is a flowchart illustrating the steps of a second embodiment of a method for event processing according to the present invention;
FIG. 5 is a block diagram of a server embodiment of event processing according to the present invention;
FIG. 6 is a block diagram of an embodiment of a system for event processing according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all 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.
In an embodiment of the present invention, a data interaction between a downstream system and an upstream node is involved, where the downstream system may include a voice system and a message distribution application, the voice system may be a telephone access device, and is configured to generate an original event related to a telephone and distribute event information of the event to the upstream node via the message distribution application, and the upstream node may be a node performing event processing, for example, the upstream node may include an upstream application performing event state processing. The embodiment of the invention can combine all the upstream nodes into a cluster, all the nodes in the cluster can update the state information acquired based on the event into the shared cache database, when a certain node fails, the other nodes in the cluster are switched to, and simultaneously, the other nodes can update the state information of the same service object in the shared cache, thereby ensuring that the state information is not transferred to the original state.
As an example, the shared cache database may include a Redis cache database, where Redis is an open source, written in ANSI C language, network-enabled, memory-based or persistent journaled, Key-Value database, and provides API (Application programming interface) in multiple languages. Redis is a key-value storage system which supports more stored value types, including string, list, set and zset. These data types all support push/pop, add/remove, and intersect union and difference, and richer operations, and these operations are all atomic. On this basis, Redis supports various different ways of ordering. In order to ensure efficiency, data of Redis is cached in a memory, and the Redis periodically writes updated data into a disk or writes modification operation into an additional recording file, and realizes master-slave synchronization on the basis. The following embodiments are described with reference to a Redis cache database as an example.
The embodiment of the invention adopts the Redis cluster to cache data, stores the current atomic state of each service node into the Redis cache cluster, ensures that the previous atomic state information can be synchronously acquired when other nodes are used, and ensures the safety and stability of the atomic state data with high reliability.
In the embodiment of the invention, when an upstream node is newly added, the subscription message can be sent to the downstream system, and the message middleware MQ (message distribution application) of the downstream system effectively distributes the message according to the subscription link state of the subscriber, so that the upstream application node is quickly accessed to the cluster, the processing capacity is provided, and the capacity expansion capacity of the system is improved.
The following examples of the present invention are more specifically described:
referring to fig. 1, a flowchart illustrating a step of a first method embodiment of event processing according to the present invention is shown, where the embodiment of the present invention is explained from an upstream node side, and specifically includes the following steps:
step 101, receiving event information sent by a downstream system, wherein the event information comprises an event identifier;
in a specific implementation, the downstream system may detect a telephony event, generate event information when it is monitored that the event is triggered, and distribute the event information to the upstream node.
As an example, an event may include, but is not limited to, EventDailing, eventteady, EventNotReady (busy, minor, post-event, etc., differentiated according to different reason codes), eventerestablish, EventRelease, etc.
In practice, the downstream system may call QueryAgentStatusEx (phone.workno) to query the seat state, and then may call the query method in some events to obtain the real-time seat state. The agent state is logically processed, and corresponding event information can be generated.
As an example, the event information may include an event identifier, and further, the event identifier may include a service object identifier and an event sequence number.
The service object can comprise a telephone seat, and the service object identifier is an identity unique identifier of the seat and can comprise information such as a seat employee number, a seat extension number and the like; the event sequence number may be used to identify the unique sequence number of the event that the data last triggered.
102, if the event identifier is not found in a preset Redis cache database, acquiring corresponding event state information based on the event identifier;
the upstream node is driven by an event, and after receiving the event information, the upstream node may first search for an event identifier corresponding to the event information in a Redis cache database to determine whether the event information has been processed. If the search is successful, the event information is processed, and if the search is failed, the event information is not processed.
In a preferred embodiment of the present invention, step 102 may comprise the following sub-steps:
searching the service object identification and the event sequence number in a Redis cache database; if the service object identifier and the event sequence number are both found, judging that the event identifier is found successfully; and if the service object identifier is found but the event sequence number is not found, or the service object identifier and the event sequence number are not found, judging that the event identifier is found to be failed.
Specifically, because there may be a plurality of events that can be triggered by the same service object, an event sequence number is set to perform event identification, when a service object identification is searched in the Redis cache database, the service object identification may be searched first, and when the service object identification cannot be found, it indicates that a record of the service object is not stored in the Redis cache database, that is, the event identification search fails.
When the service object identifier is found, it indicates that the record of the service object is stored in the Redis cache database, and at this time, the event sequence number may be searched from the record of the service object to determine whether the event is a historical event, if the event sequence number is found, the event identifier is successfully found, that is, the event is a historical event, and if the event sequence number is not found, the event identifier is failed to find, that is, the event is a non-historical event.
If the event identification lookup fails, i.e., for a non-historical event, the upstream node may perform event processing based on the event information. In a specific implementation, the upstream node may perform logic processing on the event information to analyze the event state information corresponding to the event identifier.
As one example, event state information may include agent states and corresponding attribute information. In the embodiment of the present invention, standardized and expanded extraction is adopted for service expansion, and then the agent status may include a standard atomic status and an expandable atomic status, for example, the standard atomic status may include sign-in, sign-out, idle, busy, work, post-arrangement, and the like, and the expandable atomic status may include microshuts and the like.
Attribute information corresponding to the agent state may also be referred to as state atom information, which may include but is not limited to: the system comprises a seat number, state starting time, a seat login unique identifier, a reason, an equipment number, an equipment type, a role, service attribute information, a user unique identifier and the like.
And 103, writing the event identifier and the corresponding event state information into the Redis cache database.
In a specific implementation, if the event information is not processed, after the event state information corresponding to the event information is acquired, the event state information may be recorded in a Redis cache database.
In a preferred embodiment of the present invention, step 103 may comprise the following sub-steps:
in the substep S11, if neither the service object identifier nor the event sequence number is found, writing the service object identifier as a primary key, and the event sequence number and the event state information as values corresponding to the primary key into the Redis cache database;
in a specific implementation, if a service object identifier is not found in the Redis cache database, and an event corresponding to the event information is a first event, that is, an original event, of the service object, when data caching is performed, the service object identifier may be used as a main key, for example, an agent work number is used as a key, and an event sequence number and event state information corresponding to the service object identifier are used as values corresponding to the key, and are written into the Redis cache database.
And a substep S12, if the service object identifier is found but the event sequence number is not found, covering the original record under the service object identifier with the event sequence number and the event state information.
On the other hand, if the service object identifier exists in the Redis cache database but the event sequence number does not exist, it indicates that the event corresponding to the event information is not an original event, and at this time, the event sequence number and the event state information may be written into a record of the same service object.
In a specific implementation, in order to save a storage space, only event state information corresponding to a latest event is stored in the Redis cache database, and a historical event is not retained, so that an event sequence number and event state information corresponding to currently received event information are written into the cache and then an original record under the service object identifier is covered.
In a preferred embodiment of the present invention, the embodiment of the present invention may further include the following steps:
and if the event identifier is found in a preset Redis cache database, or after the event identifier and the corresponding event state information are written into the Redis cache database, returning processing completion information to the downstream system.
Specifically, in an embodiment, if the upstream node finds the currently received service object identifier and the corresponding event sequence number in the Redis cache database, it indicates that the state update operation of the current event is completed, and at this time, the upstream node may directly send a piece of processing completion information to the message route to notify the downstream system that the current state update is completed.
In another embodiment, if the upstream node does not find the currently received service object identifier and/or the corresponding event sequence number, after the processing of step 103, the upstream node may send a processing completion message to the downstream system to notify the downstream system that the current state update is completed.
For example, the scene of the agent state change in response to the event information may be as shown in fig. 2 and 3.
In the embodiment of the present invention, after receiving event information sent by a downstream system, an upstream node may search an event identifier in the event information in a preset Redis cache database, and if the search fails, obtain corresponding event state information based on the event identifier, and write the event identifier and the corresponding event state information into the Redis cache database, where the event state information does not exist in any upstream node but is uniformly stored in the Redis cache, so that separation of the event state information from the upstream node is achieved, and the embodiment of the present invention can be applied to state information of all scenarios.
Referring to fig. 4, a flowchart of a second step of the method embodiment of event processing according to the present invention is shown, and the embodiment of the present invention is described from a downstream system side.
Based on a message distribution mechanism of a downstream system and a round-robin strategy for events, the embodiment of the invention specifically comprises the following steps:
step 401, sending event information to a first upstream node, where the event information includes an event identifier;
in a specific implementation, when the downstream system monitors that an event is triggered, event information of the event may be generated and sent to the first upstream node through the message distribution application.
As an example, the event information may include an event identifier, and further, the event identifier may include a service object identifier and an event sequence number.
The service object can comprise a telephone seat, and the service object identification can comprise information such as a seat number, a seat extension number and the like; the event sequence number may be used to identify the unique sequence number of the event that the data last triggered.
Step 402, if the processing completion message sent by the first upstream node is not received within a preset time period, sending the event information to a second upstream node.
After sending the event information to the first upstream node, the downstream system may wait for a preset time period, and determine whether a processing completion message sent by the first upstream node is received within the preset time period.
Specifically, the processing completion message may be a message generated after the first upstream node determines that the event information processing is completed.
In a preferred embodiment of the present invention, the processing completion message may be a message generated after the first upstream node does not find the event identifier in a preset Redis cache database, acquires the corresponding event status information based on the event identifier, and writes the event identifier and the corresponding event status information in the Redis cache database.
In another preferred embodiment of the present invention, the processing completion message may be a message generated when the first upstream node finds the event identifier in a preset Redis cache database.
If the message distribution application of the downstream system does not receive the processing completion message returned by the first upstream node within the preset time period, the downstream system may determine that the first upstream node is faulty, and in order to ensure that the agent state transitions to be noninductive, the message distribution application may distribute the event information to the second upstream node after the preset time period.
In a specific implementation, the message distribution application does not receive the processing completion message returned by the first upstream node within a preset time period, and the two cases can be:
the first case is: the first upstream node fails before or during event processing, in this case, the update of the agent state of the event is not completed, and the record corresponding to the event identifier does not exist in the Redis cache database. When the second upstream node performs event processing, it needs to obtain corresponding event state information based on the event identifier, and writes the event identifier and the corresponding event state information into the Redis cache database to complete the update of the agent state, and after the update is completed, the second upstream node may send a processing completion message to the message distribution application.
The second case is: and the first upstream node fails after the event is processed and before a processing completion message is sent, under the condition, the updating of the seat state of the event is already processed, and a record corresponding to the event identifier exists in the Redis cache database. The second upstream node need not perform event processing but only send a processing complete message to the message distribution application.
When the message distribution application receives a processing completion message returned by the second upstream node and can learn that the processing of the event information is completed, the message distribution application continues to wait for the processing of the next event. Otherwise, when the message distribution application does not receive the processing completion message returned by the second upstream node, the procedure of steps 401 to 403 is continued.
In the embodiment of the invention, the message distribution application can judge whether the upstream node fails according to the judgment that whether the processing completion message sent by the upstream node is received or not within the preset time period, and when the upstream node is judged to fail, the same event information of the same service object can be sent to other upstream nodes for processing, so that the influence of the failed node on state change is reduced, the service is not influenced when a single application node fails, and the service availability is ensured.
For simplicity of explanation, the method embodiments are described as a series of acts or combinations, but those skilled in the art will appreciate that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the embodiments of the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a server for event processing according to an embodiment of the present invention is shown, and specifically includes the following modules:
an event information receiving module 501, configured to receive event information sent by a downstream system, where the event information includes an event identifier;
an event status information obtaining module 502, configured to, if the event identifier is not found in a preset shared cache database, obtain corresponding event status information based on the event identifier;
an information writing module 503, configured to write the event identifier and the corresponding event state information into the shared cache database.
In a preferred embodiment of the present invention, the event identifier includes a service object identifier and an event sequence number, and the server further includes:
the searching submodule is used for searching the service object identification and the event sequence number in a shared cache database;
the first judging module is used for judging that the event identifier is successfully searched if the service object identifier and the event serial number are both searched;
and the second judging module is used for judging that the event identifier is failed to search if the service object identifier is searched but the event serial number is not searched, or the service object identifier and the event serial number are not searched.
In a preferred embodiment of the present invention, the information writing module 503 includes:
a first writing sub-module, configured to, if neither the service object identifier nor the event sequence number is found, write the service object identifier as a primary key, and the event sequence number and the event state information as values corresponding to the primary key into the shared cache database;
and the second writing sub-module is used for covering the original record under the service object identification with the event serial number and the event state information if the service object identification is found but the event serial number is not found.
In a preferred embodiment of the present invention, the server further includes:
and a processing completion information returning module, configured to return processing completion information to the downstream system if the event identifier is found in a preset shared cache database, or after the event identifier and the corresponding event state information are written in the shared cache database.
In a preferred embodiment of the present invention, the server further includes:
and the subscription message sending module is used for sending the subscription message to the downstream system.
Referring to fig. 6, a block diagram of a system embodiment of event processing according to the present invention is shown, and specifically includes the following modules:
an event information sending module 601, configured to send event information to a first upstream node, where the event information includes an event identifier;
a retransmission module 602, configured to send the event information to a second upstream node if a processing completion message sent by the first upstream node is not received within a preset time period; the processing completion message is a message generated after the event identifier and the corresponding event state information are written into a shared cache database when the event identifier is not found in a preset shared cache database by the first upstream node, or a message generated when the event identifier is found in a preset shared cache database by the first upstream node.
In a preferred embodiment of the embodiments of the present invention, the system further includes:
the subscription message receiving module is used for receiving the subscription message of the newly added node;
and the distribution module is used for distributing the message to the newly added node based on the subscription message.
Embodiments of the present invention further provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method in fig. 1 and/or fig. 4 are implemented.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method of any one of fig. 1 and/or fig. 4.
The above-described embodiments are merely illustrative, and 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 modules can be selected according to actual needs to achieve the purpose of the scheme of the application.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method, the server and the system for processing the event provided by the invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (11)

1. A method for event processing, applied to an upstream node, the method comprising:
a first upstream node receives event information sent by a downstream system, wherein the event information comprises an event identifier;
if the first upstream node does not find the event identifier in a preset shared cache database, the first upstream node acquires corresponding event state information based on the event identifier;
the first upstream node writes the event identifier and the corresponding event state information into the shared cache database;
if the first upstream node fails, the second upstream node receives the event information sent by the downstream system;
under the condition that the updating of the event state information in the shared cache database is not completed, the second upstream node acquires corresponding event state information based on the event identifier, and writes the event identifier and the corresponding event state information into the shared cache database;
the shared cache database can be used for a plurality of upstream nodes to update the event state information acquired based on the event into the shared cache database.
2. The method according to claim 1, wherein the event identifier includes a service object identifier and an event sequence number, and before the event identifier is not found in the preset shared cache database, and corresponding event status information is obtained based on the event identifier, the method further includes:
searching the service object identification and the event sequence number in a shared cache database;
if the service object identifier and the event sequence number are both found, judging that the event identifier is found successfully;
and if the service object identifier is found but the event sequence number is not found, or the service object identifier and the event sequence number are not found, judging that the event identifier is found to be failed.
3. The method of claim 2, wherein writing the event identifier and corresponding event state information to the shared cache database comprises:
if the service object identification and the event sequence number are not found, the service object identification is used as a main key, and the event sequence number and the event state information are used as values corresponding to the main key and are written into the shared cache database;
and if the service object identification is found but the event sequence number is not found, covering the original record under the service object identification with the event sequence number and the event state information.
4. The method of claim 1, further comprising:
and if the event identifier is found in a preset shared cache database, or after the event identifier and the corresponding event state information are written into the shared cache database, returning processing completion information to the downstream system.
5. The method according to any of claims 1-4, further comprising, prior to the step of receiving event information sent by a downstream system:
and sending a subscription message to the downstream system.
6. A method of event processing, the method comprising:
sending event information to a first upstream node, wherein the event information comprises an event identifier;
if the processing completion message sent by the first upstream node is not received within a preset time period, sending the event information to a second upstream node, so that the second upstream node obtains corresponding event state information based on the event identifier under the condition that the update of the event state information in a shared cache database is not completed, and writing the event identifier and the corresponding event state information into the shared cache database;
the processing completion message is a message generated after the event identifier and the corresponding event state information are written into a shared cache database when the event identifier is not found in a preset shared cache database by the first upstream node, or the message generated when the event identifier is found in the preset shared cache database by the first upstream node;
the shared cache database can be used for a plurality of upstream nodes to update the event state information acquired based on the event into the shared cache database.
7. The method of claim 6, further comprising:
receiving a subscription message of the newly added node;
and distributing the messages to the newly added nodes based on the subscription messages.
8. A server for event processing, the server comprising:
a first event information receiving module, configured to enable a first upstream node to receive event information sent by a downstream system, where the event information includes an event identifier;
a first event status information obtaining module, configured to, if the first upstream node does not find the event identifier in a preset shared cache database, enable the first upstream node to obtain corresponding event status information based on the event identifier;
an information writing module, configured to enable the first upstream node to write the event identifier and the corresponding event state information into the shared cache database;
a second event information receiving module, configured to, if the first upstream node fails, enable a second upstream node to receive the event information sent by the downstream system;
a second event status information obtaining module, configured to, when update of event status information in the shared cache database is not completed, enable the second upstream node to obtain corresponding event status information based on the event identifier, and write the event identifier and the corresponding event status information into the shared cache database;
the shared cache database can be used for a plurality of upstream nodes to update the event state information acquired based on the event into the shared cache database.
9. A system for event processing, the system comprising:
an event information sending module, configured to send event information to a first upstream node, where the event information includes an event identifier;
a retransmission module, configured to send the event information to a second upstream node if a processing completion message sent by the first upstream node is not received within a preset time period, so that the second upstream node obtains corresponding event state information based on the event identifier when update of the event state information in a shared cache database is not completed, and writes the event identifier and the corresponding event state information in the shared cache database;
the processing completion message is a message generated after the event identifier and the corresponding event state information are written into a shared cache database when the event identifier is not found in a preset shared cache database by the first upstream node, or the message generated when the event identifier is found in the preset shared cache database by the first upstream node;
the shared cache database can be used for a plurality of upstream nodes to update the event state information acquired based on the event into the shared cache database.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1 to 5 and/or 6 to 7 are implemented when the program is executed by the processor.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5 and/or 6 to 7.
CN201810150232.3A 2018-02-13 2018-02-13 Event processing method, server and system Active CN108566291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810150232.3A CN108566291B (en) 2018-02-13 2018-02-13 Event processing method, server and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810150232.3A CN108566291B (en) 2018-02-13 2018-02-13 Event processing method, server and system

Publications (2)

Publication Number Publication Date
CN108566291A CN108566291A (en) 2018-09-21
CN108566291B true CN108566291B (en) 2020-04-28

Family

ID=63532254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810150232.3A Active CN108566291B (en) 2018-02-13 2018-02-13 Event processing method, server and system

Country Status (1)

Country Link
CN (1) CN108566291B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669791A (en) * 2018-12-22 2019-04-23 网宿科技股份有限公司 Exchange method, server and computer readable storage medium
CN110232032B (en) * 2019-07-22 2022-02-11 东软医疗系统股份有限公司 Data acquisition system and method
CN112288990A (en) * 2019-07-24 2021-01-29 上海东方富联科技有限公司 Method, system, medium and device for generating internet of things event based on internet of things data
CN110795632B (en) * 2019-10-30 2022-10-04 北京达佳互联信息技术有限公司 State query method and device and electronic equipment
CN111338818A (en) * 2020-02-24 2020-06-26 北京声智科技有限公司 Event processing method and related equipment
CN112785729A (en) * 2020-12-30 2021-05-11 深圳市顺易通信息科技有限公司 Parking fee reduction and exemption processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103518377A (en) * 2011-01-06 2014-01-15 汤姆逊许可公司 Method and apparatus for updating a database in a receiving device
CN107404524A (en) * 2017-07-24 2017-11-28 郑州云海信息技术有限公司 A kind of method and device of distributed type assemblies node visit

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309165B (en) * 2007-05-14 2012-04-04 华为技术有限公司 Control method, apparatus and equipment for information reporting
CN102779121A (en) * 2011-05-09 2012-11-14 腾讯科技(深圳)有限公司 Event content information acquiring method and system
CN104133724B (en) * 2014-04-03 2015-08-19 腾讯科技(深圳)有限公司 Concurrent tasks dispatching method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103518377A (en) * 2011-01-06 2014-01-15 汤姆逊许可公司 Method and apparatus for updating a database in a receiving device
CN107404524A (en) * 2017-07-24 2017-11-28 郑州云海信息技术有限公司 A kind of method and device of distributed type assemblies node visit

Also Published As

Publication number Publication date
CN108566291A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
CN108566291B (en) Event processing method, server and system
JP6749926B2 (en) Method, device and system for synchronizing data
CN106059825A (en) Distributed system and configuration method
CN107357688B (en) Distributed system and fault recovery method and device thereof
CN107948318B (en) Method and system for synchronizing cache among multiple nodes
CN110543512B (en) Information synchronization method, device and system
CN113051110A (en) Cluster switching method, device and equipment
US20180121531A1 (en) Data Updating Method, Device, and Related System
CN110650164A (en) File uploading method and device, terminal and computer storage medium
EP2416526B1 (en) Task switching method, server node and cluster system
CN110784498B (en) Personalized data disaster tolerance method and device
CN110196749B (en) Virtual machine recovery method and device, storage medium and electronic device
CN112000850A (en) Method, device, system and equipment for data processing
US9043274B1 (en) Updating local database and central database
WO2023071999A1 (en) User matching method and apparatus, and device and storage medium
CN108881452B (en) Data synchronization method, device and storage medium
CN110928945B (en) Data processing method and device for database and data processing system
CN113472566A (en) Status monitoring method of union block chain and master node status monitoring system
CN113010263A (en) Method, system, equipment and storage medium for creating virtual machine in cloud platform
CN114629783B (en) State monitoring method, system, equipment and computer readable storage medium
CN113704254B (en) Method and device for processing database business, electronic equipment and storage medium
CN114595069B (en) Service offline method and device, electronic equipment and storage medium
CN113792891B (en) Machine learning feature production system and method
CN110879774B (en) Network element performance data alarming method and device
CN113064950B (en) Data synchronization method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant