CN106933932B - Data processing method and device and application server - Google Patents

Data processing method and device and application server Download PDF

Info

Publication number
CN106933932B
CN106933932B CN201511033240.2A CN201511033240A CN106933932B CN 106933932 B CN106933932 B CN 106933932B CN 201511033240 A CN201511033240 A CN 201511033240A CN 106933932 B CN106933932 B CN 106933932B
Authority
CN
China
Prior art keywords
event
domain
user identifier
service
events
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
CN201511033240.2A
Other languages
Chinese (zh)
Other versions
CN106933932A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201511033240.2A priority Critical patent/CN106933932B/en
Publication of CN106933932A publication Critical patent/CN106933932A/en
Application granted granted Critical
Publication of CN106933932B publication Critical patent/CN106933932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/01Customer relationship services
    • G06Q30/015Providing customer assistance, e.g. assisting a customer within a business location or via helpdesk
    • G06Q30/016After-sales

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a data processing method, a data processing device and an application server, and relates to the technical field of communication. The method comprises the following steps: receiving a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type; if the operation type is a first operation, marking the first domain event as a rollback event based on the electronic certificate identifier and the first corresponding relation; inquiring an event database based on the user identification, and acquiring other field events except the first field event in the field events corresponding to the user identification; the other field events are re-processed in sequence according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identification; and updating the service state information corresponding to the user identification in the state database according to the processed service state information corresponding to the user identification.

Description

Data processing method and device and application server
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data processing method and apparatus, and an application server.
Background
In the communication operation process, due to the needs of a client, misoperation of an operator and the like, the situation that a completed service order often needs service rollback occurs, for example, the client orders a short message call service, the corresponding service order is processed and completed, the operator prompts that the client can use the short message call service, the client finds that the short message call service is not actually opened, and the operator helps the client to order the color ring package monthly combo due to operation error, so the operator needs to inquire the transacted service order, perform corresponding service rollback and reorder the correct short message call service for the client.
At present, in order to complete the rollback of a business order, a log table of corresponding entity state changes is usually designed, and the entity may be an order, an order product, or the like, that is, a Customer Relationship Management (CRM) system records which order causes the entity state to change, and what the value of the entity state before and after the change is, respectively, so as to "restore" the entity state stored in the CRM system to the state before the corresponding business order is completed and fulfilled, so as to complete the rollback of the business order.
However, for the entity state change, a corresponding entity state change log table needs to be maintained, and the entity state change log is subjected to corresponding logic processing, so that extra burden is added to developers, and problems such as service rollback and the like which do not meet conditions also occur.
Disclosure of Invention
Embodiments of the present invention provide a data processing method, an apparatus, and an application server, which are used to improve the data processing speed and simplify the data processing process.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a data processing method is provided, which is applied in an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the method includes:
receiving a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, and the electronic certificate is used for indicating that a preset state is met between a user and a service;
if the operation type is a first operation, a first domain event is marked as a rollback event based on the electronic certificate identifier and a first corresponding relation, the first domain event is a domain event corresponding to the electronic certificate identifier, and the first corresponding relation comprises the electronic certificate identifier and the domain event corresponding to the electronic certificate identifier;
inquiring an event database based on the user identification, and acquiring other field events except the first field event in the field events corresponding to the user identification; the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the other domain events are re-processed in sequence according to the sequence of the occurrence time of the domain events to obtain the processed service state information corresponding to the user identification;
and updating the service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the sequentially reprocessing the other domain events according to the sequence of occurrence times of the domain events to obtain processed service state information corresponding to the user identifier includes:
the other domain events are sequentially sent to a first event bus according to the sequence of the occurrence time of the domain events;
and sequentially acquiring the other field events from the first event bus, and processing in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the sequentially reprocessing the other domain events according to the sequence of occurrence times of the domain events to obtain the processed service state information corresponding to the user identifier further includes:
and if a preset incidence relation exists between a second domain event and the first domain event in the other domain events, sending error information, wherein the error information is used for indicating that the first operation has an error.
With reference to any one possible implementation manner of the first aspect to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the querying the event database based on the user identifier to obtain other domain events except the first domain event in the domain events corresponding to the user identifier includes:
acquiring a domain event corresponding to the user identifier within a preset time before the current time from the event database;
if the domain event corresponding to the user identifier in the preset time length before the current time comprises the first domain event, deleting the first domain event and then acquiring other domain events except the first domain event;
and if the domain event corresponding to the user identifier does not contain the first domain event within the preset time before the current time, sending error information, wherein the error information is used for indicating that the first operation has an error.
In a second aspect, a data processing method is provided, which is applied in an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the method includes:
receiving a data processing request, wherein the data processing request comprises a user identifier, a service identifier and an operation type;
if the operation type is a second operation, generating an electronic certificate based on the data processing request, wherein the electronic certificate is used for indicating that a preset state is met between a user and a service;
generating a first domain event corresponding to the identification of the electronic certificate based on the identification of the electronic certificate;
updating an event database according to the first domain event, wherein the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
processing the first domain event to obtain a service state corresponding to the first domain event;
and updating the service state information corresponding to the user identifier in a state database according to the service state corresponding to the first domain event, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the processing the first domain event to obtain a service state corresponding to the first domain event includes:
according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises an electronic certificate identifier, field events corresponding to the electronic certificate identifier, and preset states corresponding to the field events respectively;
and if it is determined that a second domain event corresponding to the second preset state does not exist in the event database, triggering generation of the second domain event after the first domain event is processed.
And if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the method further includes:
updating an event database according to the second domain event;
processing the second domain event to obtain a service state corresponding to the second domain event;
and updating the service state information corresponding to the user identification in a state database according to the service state corresponding to the second field event.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, before the updating the event database according to the first domain event, the method further includes:
sending the first domain event to a second event bus;
correspondingly, processing the first domain event to obtain a service state corresponding to the first domain event includes:
and acquiring the first event bus from the second event bus, and processing the first domain event to acquire a service state corresponding to the first domain event.
In a third aspect, a data processing apparatus is provided, which is applied in an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the apparatus includes:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data processing request, the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, and the electronic certificate is used for indicating that a preset state is met between a user and a service;
a marking unit, configured to mark, if the operation type is a first operation, a first domain event as a fallback event based on the electronic credential identifier and a first corresponding relationship, where the first domain event is a domain event corresponding to the electronic credential identifier, and the first corresponding relationship includes the electronic credential identifier and a domain event corresponding to the electronic credential identifier;
an obtaining unit, configured to query an event database based on the user identifier, and obtain other domain events except the first domain event from domain events corresponding to the user identifier; the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the processing unit is used for sequentially reprocessing the other field events according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identifier;
and the updating unit is used for updating the service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the processing unit is specifically configured to:
the other domain events are sequentially sent to a first event bus according to the sequence of the occurrence time of the domain events;
and sequentially acquiring the other field events from the first event bus, and processing in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the processing unit is further specifically configured to:
and if a preset incidence relation exists between a second domain event and the first domain event in the other domain events, sending error information, wherein the error information is used for indicating that the first operation has an error.
With reference to any one possible implementation manner of the third aspect to the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the obtaining unit is specifically configured to:
acquiring a domain event corresponding to the user identifier within a preset time before the current time from the event database;
if the domain event corresponding to the user identifier in the preset time length before the current time comprises the first domain event, deleting the first domain event and then acquiring other domain events except the first domain event;
and if the domain event corresponding to the user identifier does not contain the first domain event within the preset time before the current time, sending error information, wherein the error information is used for indicating that the first operation has an error.
In a fourth aspect, a data processing apparatus is provided, which is applied in an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the apparatus includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data processing request, and the data processing request comprises a user identifier, a service identifier and an operation type;
the first generating unit is used for generating an electronic certificate based on the data processing request if the operation type is a second operation, wherein the electronic certificate is used for indicating that a preset state is met between a user and a service;
the second generation unit is used for generating a first domain event corresponding to the identification of the electronic certificate based on the identification of the electronic certificate;
the first updating unit is used for updating an event database according to the first domain event, wherein the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the first processing unit is used for processing the first domain event to obtain a service state corresponding to the first domain event;
and the second updating unit is used for updating the service state information corresponding to the user identifier in a state database according to the service state corresponding to the first domain event, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the first processing unit is further specifically configured to:
according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises an electronic certificate identifier, field events corresponding to the electronic certificate identifier, and preset states corresponding to the field events respectively;
and if it is determined that a second domain event corresponding to the second preset state does not exist in the event database, triggering generation of the second domain event after the first domain event is processed.
And if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the apparatus further includes:
the third updating unit is used for updating the event database according to the second field event;
the second processing unit is used for processing the second domain event to obtain a service state corresponding to the second domain event;
and the fourth updating unit is used for updating the service state information corresponding to the user identifier in the state database according to the service state corresponding to the second field event.
With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the apparatus further includes:
the sending unit is used for sending the first domain event to a second event bus;
correspondingly, the first processing unit is further specifically configured to:
and acquiring the first event bus from the second event bus, and processing the first domain event to acquire a service state corresponding to the first domain event.
In a fifth aspect, an application server is provided, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the application server includes the data processing apparatus described in any possible implementation manner of the third possible implementation manners of the third aspect to the third aspect, and the data processing apparatus described in any possible implementation manner of the third possible implementation manners of the fourth aspect to the fourth aspect.
The data processing method, the device and the application server provided by the embodiment of the invention receive a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, if the operation type is a first operation, a first field event is marked as a backspace event based on the electronic certificate identifier and a first corresponding relation, then an event database is inquired based on the user identifier to obtain other field events except the first field event in the field events corresponding to the user identifier, the other field events are re-processed in sequence according to the occurrence time sequence of the field events to obtain processed service state information corresponding to the user identifier, and the service state information corresponding to the user identifier in the state database is updated according to the processed service state information corresponding to the user identifier, therefore, based on the existing service logic, the domain events except the rollback event are replayed in the forward direction, and further, a change log table of state information does not need to be developed additionally, so that the burden of developers is reduced, and meanwhile, the condition of service rollback is guaranteed.
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 or the prior art will be briefly described 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 creative efforts.
Fig. 1 is a system architecture diagram of a communication system according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a first data processing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a second data processing method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a third data processing method according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a fourth data processing method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a fifth data processing method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a first data processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a second data processing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a third data processing apparatus according to an embodiment of the present invention.
Detailed Description
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.
A system architecture of a communication system to which an embodiment of the present invention is applied is shown in fig. 1, and the communication system includes: client 101, application server 102, storage server 103.
The client 101 may be a mobile phone, a notebook computer, a computer, etc., and the client 101 may communicate with the application server 102 in various manners such as a manner of specifying browsing or a manner of specifying an application program, and the communicated data may be transmitted in a wired or wireless manner.
The application server 102 comprises a memory 1021, a processor 1022, a system bus 1023, a power component 1024, an input/output interface 1025, a communication component 1026 and the like; the memory 1021 may be used for storing data, software programs, and modules, and mainly includes a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, and the like, and the storage data area may store data created by use of the application server 102, and the like; the processor 1022 executes various functions of the application server 102 and processes data by running or executing software programs and/or modules stored in the memory 1021 and calling data stored in the memory 1021, for example, the processor 1022 processes events in sequence according to an event sequence arranged on an event bus when processing the events, wherein the event bus is used for placing the events to be processed in the application server 102; system bus 1023 includes an address bus, a data bus, and a control bus for transmitting data and instructions; the power component 1024 is used to provide power to the various components of the application server 102; input/output interface 1025 provides an interface between processor 1022 and peripheral interface modules; the communications component 1026 is operable to facilitate wired or wireless communication between the application server 102 and other devices.
The storage server 103 and the application server 102 may be connected through a network or a data line, and the storage server 103 is mainly used for storing a domain event generated when the application server 102 executes or runs, where the domain event may be stored permanently or may be stored for a specified time. In addition, the storage server 103 may be a separate server for storage, or may be a part of the memory 1021 of the application server 102, that is, a domain event generated when the application server 102 executes or runs is stored in the memory 1021.
Fig. 2 is a data processing method provided in an embodiment of the present invention, which is applied to an application server that at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and referring to fig. 2, the method includes the following steps.
Step 201: and receiving a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, and the electronic certificate is used for indicating that a preset state is met between a user and a service.
For example, when the electronic voucher is an order generated by a user ordering a service, the electronic voucher identifier may be an order identifier of the order, and the order identifier may be an order number used for indicating that the user orders the service.
In addition, the operation type comprises a first operation and a second operation, when the data processing request comprises a user identifier and an electronic certificate identifier, the operation type is the first operation, and when the data processing request comprises the user identifier and a service identifier, the operation type is the second operation. For example, when a user needs to handle or cancel a certain service, the first operation type may refer to canceling the handled service, and the second operation type may refer to handling the required service.
Step 202: if the operation type is a first operation, a first domain event is marked as a rollback event based on the electronic certificate identifier and a first corresponding relation, the first domain event is a domain event corresponding to the electronic certificate identifier, and the first corresponding relation comprises the electronic certificate identifier and the domain event corresponding to the electronic certificate identifier.
The first corresponding relation refers to the corresponding relation between the electronic certificate identifier and the domain event, the domain event corresponding to the electronic certificate identifier can be determined through the electronic certificate identifier, and the first corresponding relation can be stored separately or in an event database.
For example, if the user desires to cancel a previously handled short message call service, and the electronic certificate identifier is an order identifier during handling of the short message call service, the application server obtains a first domain event corresponding to the order identifier during handling of the short message call service, that is, an ordered short message call service, from the first corresponding relationship based on the order identifier during handling of the short message call service, so as to mark the ordered short message call service of the first domain event as a fallback event.
It should be noted that the first corresponding relationship, that is, the electronic certificate identifier and the domain event corresponding to the electronic certificate identifier, is stored when the electronic certificate is generated and the domain event is generated based on the electronic certificate identifier, and the specific methods for generating the electronic certificate and generating the domain event based on the electronic certificate identifier may refer to a data processing method whose operation type is the second operation, which is not described herein again in the embodiments of the present invention.
Step 203: inquiring an event database based on the user identification, and acquiring other field events except the first field event in the field events corresponding to the user identification; the event database comprises a user identification, a domain event corresponding to the user identification and occurrence time corresponding to the domain event.
The event database may include, in addition to the user identifier, the domain event corresponding to the user identifier, and the occurrence time corresponding to the domain event, the electronic certificate identifier, the data of the event, or the event state, and the corresponding relationship between the user identifier and the domain event, and the like, and in addition, the occurrence time corresponding to the domain event may be accurate to seconds, milliseconds, or microseconds, and the like, which is not limited in the embodiment of the present invention.
In addition, the event database may be stored in the application server, or may be separately stored in the storage server, and the data information in the event database may be permanently stored, or may be stored within a preset time duration, when the data information is permanently stored, the first operation may be performed on any domain event in the event database based on the user identifier and the electronic certificate identifier, and when the data information is stored within the preset time duration, the first operation may be performed on any domain event within the preset time duration based on the user identifier and the electronic certificate information, which is not limited in the embodiment of the present invention.
For example, the user identifier is 1234567, the electronic voucher identifier is an order identifier and is ID1, the first domain event is event 1, the application server queries the event database shown in table 1 below based on the user identifier 1234567, and obtains other domain events except for the event 1 from the domain events corresponding to the user identifier 1234567 as event 2 and event 3.
TABLE 1
Figure BDA0000898800900000111
It should be noted that, in the embodiment of the present invention, only the event database shown in table 1 is taken as an example for description, and the correspondence relationship between the user identifier, the order identifier, the domain event, the occurrence time of the domain event, and the event state shown in table 1 is not limited to the embodiment of the present invention.
Optionally, when the data information in the event database is stored within a preset time length, the application server obtains a domain event corresponding to the user identifier within the preset time length before the current time from the event database; if the domain event corresponding to the user identifier in the preset duration before the current time comprises a first domain event, deleting the first domain event and then acquiring other domain events except the first domain event; and if the domain event corresponding to the user identifier in the preset time before the current time does not contain the first domain event, sending error information, wherein the error information is used for indicating that the first operation has errors.
That is, only the domain events within the preset duration before the current time are stored in the event database, the domain events exceeding the preset duration before the current time are deleted, and if the first domain event belongs to the domain events within the preset duration before the current time, the first domain event is stored in the event database, so that after the first domain event in the domain events corresponding to the user identifier is deleted, other domain events except the first domain event are acquired; if the first domain event does not belong to the domain event within the preset time length before the current time, the first domain event is not stored in the event database, so that the application server can send error information to the user terminal, wherein the error information is used for indicating that the first operation is wrong, namely, the application server sends information that the first domain event cannot be backed back to the user terminal.
It should be noted that the preset duration may be set in advance, and the preset durations corresponding to different field events may be the same or different, which is not limited in the embodiment of the present invention.
For example, in the communication operation process, when the subscription short message call service is specified to exceed three months, the unsubscribe cannot be performed, if the first field event is the subscription short message call service, the preset duration is three months, the event database contains the first field event subscription short message call service in three months, the user can apply for rollback, if the subscription short message call service exceeds three months, the first field event subscription short message call service is deleted, and if the user applies for rollback, the application server sends information that the unsubscribe to the user terminal.
Step 204: and re-processing other field events in sequence according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identification.
Because each domain event has an event listener, the corresponding domain event is processed by the event listener, so that when other domain events are reprocessed in sequence according to the sequence of the occurrence time of the domain events, the other domain events can be sent to the first event bus in sequence according to the sequence of the occurrence time of the domain events, the corresponding event listener acquires the other domain events from the first event bus in sequence and processes the other domain events in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
The processing in the synchronous interception mode means that the sending and receiving processing of the domain events are performed in the same thread, thread switching is not performed, and it is ensured that each domain event is processed and then the next domain event is processed.
It should be noted that, when the system is initialized, the application server has corresponding event listeners for different domain events, and the purpose of the event listeners is to invoke different domain services for the different domain events, capture a domain event to be processed when the system is running, and invoke a corresponding domain service of the corresponding domain event, so as to process the corresponding domain event.
Step 205: and updating the service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
Because the state database comprises the user identifier and the service state information corresponding to the user identifier, the service state information corresponding to the user identifier is changed after the first operation is performed, and in order to restore the service state information corresponding to the user identifier in the state database to the state when the first field event does not occur, the service state information corresponding to the user identifier in the state database can be updated according to the processed service state information corresponding to the user identifier, that is, the service state information corresponding to the user identifier in the state database can be replaced by the processed service state information corresponding to the user identifier.
It should be noted that the status database is used to store the service status information of the user, and the status database includes a user identifier and service status information corresponding to the user identifier, and the service status information may include a service identifier, an electronic certificate identifier, creation time of the information, and the like, which is not limited in this embodiment of the present invention.
Optionally, referring to fig. 3, after step 203, the method further includes:
step 206: and if the second domain event and the first domain event in the other domain events have the preset incidence relation, sending error information, wherein the error information is used for indicating that the first operation has errors.
The preset incidence relation means that the first domain event and the second domain event are mutually correlated, and when the second domain event exists, the first domain event also needs to exist. For example, in the communication operation process, it is specified that package B includes a short message call service, if the second domain event is subscription package B, the first domain event is subscription short message call service, and since subscription package B is associated with subscription short message call service, when the second domain event subscription package B exists, the first domain event subscription short message call service must also exist.
Specifically, in other domain events, if there is a preset association relationship between the second domain event and the first domain event, it is determined that the first domain event cannot be backed, and therefore, the application server may send error information to the user terminal, where the error information is used to indicate that the first operation is in error, that is, the application server sends information that the first domain event cannot be backed to the user terminal.
The data processing method provided by the embodiment of the invention comprises the steps of receiving a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, if the operation type is a first operation, marking a first field event as a backspacing event based on the electronic certificate identifier and a first corresponding relation, then inquiring an event database based on the user identifier to obtain other field events except the first field event in the field events corresponding to the user identifier, sequentially reprocessing the other field events according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identifier, updating the service state information corresponding to the user identifier in the state database according to the processed service state information corresponding to the user identifier, and updating the service state information corresponding to the user identifier in the state database based on the existing service logic, the domain events except the rollback event are replayed in the forward direction, so that a change log table of state information does not need to be developed additionally, the burden of developers is reduced, and meanwhile, the condition of service rollback is guaranteed.
Fig. 4 is a data processing method provided in an embodiment of the present invention, which is applied to an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the method includes the following steps:
step 301: and receiving a data processing request, wherein the data processing request comprises a user identifier, a service identifier and an operation type.
The operation type comprises a first operation and a second operation, when the data processing request comprises a user identifier and an electronic certificate identifier, the operation type is the first operation, and when the data processing request comprises the user identifier and a service identifier, the operation type is the second operation. For example, when a user needs to handle or cancel a certain service, the first operation type may refer to canceling the handled service, and the second operation type may refer to handling the required service.
Step 302: and if the operation type is the second operation, generating an electronic certificate based on the data processing request, wherein the electronic certificate is used for indicating that the preset state is met between the user and the service.
The step of generating the electronic certificate based on the data processing request means that the electronic certificate is generated based on the user identifier and the service identifier included in the data processing request. For example, in the communication operation process, the data processing request may be a request for a user to order a service, the application server may generate an order based on a user identifier and a service identifier that the user desires to order, where the order is used to indicate that the user orders the service, and the electronic certificate is a generated order at this time, and the electronic certificate identifier may be an order identifier of the order, and the order identifier may be an order number.
Step 303: based on the identification of the electronic voucher, a first domain event corresponding to the identification of the electronic voucher is generated.
The application server may further store the electronic certificate identifier and a first domain event corresponding to the electronic certificate identifier in a first corresponding relationship, where the first corresponding relationship may be separately stored or may be stored in event data.
For example, in the communication operation process, the user desires to order the short message call service, and the electronic certificate is an order, the application server may generate a first domain event corresponding to the order identifier based on the order identifier, that is, order the short message call service, and then may store the order identifier and the first domain event corresponding to the order identifier in the first corresponding relationship.
Step 304: updating an event database according to the first domain event, wherein the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the event database may include, in addition to the user identifier, the domain event corresponding to the user identifier, and the occurrence time corresponding to the domain event, the electronic certificate identifier, the data of the event, or the event state, and the corresponding relationship between the user identifier and the domain event, and the like, and in addition, the occurrence time corresponding to the domain event may be accurate to seconds, milliseconds, or microseconds, and the like, which is not limited in the embodiment of the present invention.
In addition, the event database may be stored in the application server, or may be separately stored in the storage server, and the data information in the event database may be permanently stored, or may be stored within a preset time length, when the data information is stored within the preset time length, only the domain event within the preset time length before the current time is stored in the event database, and the domain event exceeding the preset time length before the current time is deleted.
It should be noted that the preset duration may be set in advance, and the preset durations corresponding to different field events may be the same or different, which is not limited in the embodiment of the present invention.
Step 305: processing the first domain event to obtain a service state corresponding to the first domain event;
specifically, before processing the first domain event, the first domain event may be sent to the second event bus, and since each domain event has one event listener, the corresponding event listener acquires the first domain event from the second event bus, and processes the first domain event to obtain the service state corresponding to the first domain event.
It should be noted that, when the system is initialized, the application server has corresponding event listeners for different domain events, and the purpose of the event listeners is to invoke different domain services for the different domain events, capture a domain event to be processed when the system is running, and invoke a corresponding domain service of the corresponding domain event, so as to process the corresponding domain event.
Step 306: and updating the service state information corresponding to the user identifier in a state database according to the service state corresponding to the first field event, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
After the service state corresponding to the first domain event is obtained, the service state information corresponding to the user identifier in the state database may be updated according to the service state corresponding to the first domain event, that is, the service state corresponding to the first domain event in the state database may be added to the service state information corresponding to the user identifier.
It should be noted that the status database is used to store the service status information of the user, and the status database includes a user identifier and service status information corresponding to the user identifier, and the service status information may include a service identifier, an electronic certificate identifier, creation time of the information, and the like, which is not limited in this embodiment of the present invention.
Optionally, referring to fig. 5, after step 305, the method further includes:
step 307: according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises electronic certificate identification, domain events corresponding to the electronic certificate identification, and preset states corresponding to the domain events respectively.
For example, when the service that the user desires to order is package B, the electronic certificate identifier may be an order identifier, and since package B includes a short message call service, the two domain events corresponding to the order identifier are included, that is, the first domain event orders package B for the user, and the second domain event orders short message call service for the user.
In addition, the preset states respectively corresponding to each domain event included in the second corresponding relationship means that the second corresponding relationship includes state information corresponding to each domain event, for example, the preset state of the first domain event is a first preset state, and the first preset state is state information of the first domain event.
Specifically, the first domain event corresponds to a first preset state, the second domain event corresponds to a second preset state, and the first preset state and the second preset state are associated with each other, the application server determines whether the second corresponding relationship includes a second preset state associated with the first preset state based on the electronic certificate identifier and a preset second corresponding relationship, and if the second preset state is determined to exist, determines the second domain event corresponding to the second preset state according to the preset second corresponding relationship.
Step 308: and if the event database is determined not to have a second domain event corresponding to the second preset state, processing the first domain event and triggering to generate the second domain event.
When the second domain event is determined, whether the second domain event corresponding to the second preset state exists in the event database needs to be inquired, and if the second domain event corresponding to the second preset state does not exist in the event database, the second domain event needs to be generated by triggering after the first domain event is processed because the first preset state and the second preset state are correlated and the second preset state is a necessary condition of the first preset state.
For example, in the communication operation process, the package B includes a short message call service, the first domain event is that the user subscribes to the package B, the second domain event is that the user subscribes to the short message call service, and if it is determined that the second domain event does not exist in the event database, that is, the user unsubscribes to the short message call service, the package B needs to be subscribed to the user, and the second domain event for subscribing to the short message call service is triggered and generated.
Step 309: and if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
When whether a second domain event corresponding to a second preset state exists in the event database is queried, if the event database is determined to have the second domain event corresponding to the second preset state, namely the second domain event already exists, the second domain event is not required to be generated in a triggering mode, and the first domain event is directly processed.
Optionally, referring to fig. 6, after step 308, the method further includes:
step 310: and updating the event database according to the second field event, and processing the second field event to obtain a service state corresponding to the second field event.
Specifically, before the second domain event is processed, the first domain event may be sent to the second event bus, and before the second domain event is acquired by the corresponding event listener, the second domain event is updated to the event database, and then, the corresponding event listener acquires the second domain event from the second event bus, and processes the second domain event to obtain the service state corresponding to the second domain event.
Step 311: and updating the service state information corresponding to the user identifier in the state database according to the service state corresponding to the second field event.
After the service state corresponding to the second domain event is obtained, the service state information corresponding to the user identifier in the state database may be updated according to the service state corresponding to the second domain event, that is, the service state corresponding to the second domain event in the state database may be added to the service state information corresponding to the user identifier.
The data processing method provided by the embodiment of the invention comprises the steps of receiving a data processing request, wherein the data processing request comprises a user identifier, a service identifier and an operation type, generating an electronic certificate based on the data processing request if the operation type is a second operation, generating a first domain event corresponding to the identifier of the electronic certificate based on the identifier of the electronic certificate, updating an event database according to the first domain event, processing the first domain event to obtain a service state corresponding to the first domain event, updating service state information corresponding to the user identifier in the state database according to the service state corresponding to the first domain event, and triggering generation of a second domain event after processing the first domain event when the event database does not have the second domain event corresponding to a second preset state, so that data processing of related services can be rapidly and effectively carried out, meanwhile, service processing is guaranteed to meet certain conditions.
Fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention, which is applied to an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, referring to fig. 7, where the apparatus includes:
a receiving unit 401, configured to receive a data processing request, where the data processing request includes a user identifier, an electronic certificate identifier, and an operation type, and the electronic certificate is used to indicate that a preset state is satisfied between a user and a service;
a marking unit 402, configured to mark, if the operation type is a first operation, a first domain event as a fallback event based on the electronic credential identifier and a first corresponding relationship, where the first domain event is a domain event corresponding to the electronic credential identifier, and the first corresponding relationship includes the electronic credential identifier and a domain event corresponding to the electronic credential identifier;
an obtaining unit 403, configured to query an event database based on the user identifier, and obtain other domain events except the first domain event from the domain events corresponding to the user identifier; the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
a processing unit 404, configured to reprocess the other domain events in sequence according to the occurrence time sequence of the domain events, so as to obtain processed service state information corresponding to the user identifier;
an updating unit 405, configured to update service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, where the state database includes the user identifier and the service state information corresponding to the user identifier.
Optionally, the processing unit 404 is specifically configured to:
the other domain events are sequentially sent to a first event bus according to the sequence of the occurrence time of the domain events;
and sequentially acquiring the other field events from the first event bus, and processing in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
Optionally, the processing unit 404 is further specifically configured to:
and if a preset incidence relation exists between a second domain event and the first domain event in the other domain events, sending error information, wherein the error information is used for indicating that the first operation has an error.
Optionally, the obtaining unit 403 is specifically configured to:
acquiring a domain event corresponding to the user identifier within a preset time before the current time from the event database;
if the domain event corresponding to the user identifier in the preset time length before the current time comprises the first domain event, deleting the first domain event and then acquiring other domain events except the first domain event;
and if the domain event corresponding to the user identifier does not contain the first domain event within the preset time before the current time, sending error information, wherein the error information is used for indicating that the first operation has an error.
The data processing device provided by the embodiment of the invention receives a data processing request, the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, if the operation type is a first operation, a first field event is marked as a backspacing event based on the electronic certificate identifier and a first corresponding relation, then an event database is inquired based on the user identifier, other field events except the first field event in the field events corresponding to the user identifier are obtained, the other field events are re-processed in sequence according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identifier, and the service state information corresponding to the user identifier in the state database is updated according to the processed service state information corresponding to the user identifier, so that based on the existing service logic, the domain events except the rollback event are replayed in the forward direction, so that a change log table of state information does not need to be developed additionally, the burden of developers is reduced, and meanwhile, the condition of service rollback is guaranteed.
Fig. 8 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention, which is applied to an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, referring to fig. 8, where the apparatus includes:
a receiving unit 501, configured to receive a data processing request, where the data processing request includes a user identifier, a service identifier, and an operation type;
a first generating unit 502, configured to generate an electronic certificate based on the data processing request if the operation type is a second operation, where the electronic certificate is used to indicate that a preset state is satisfied between a user and a service;
a second generating unit 503, configured to generate, based on the identifier of the electronic certificate, a first domain event corresponding to the identifier of the electronic certificate;
a first updating unit 504, configured to update an event database according to the first domain event, where the event database includes a user identifier, a domain event corresponding to the user identifier, and an occurrence time corresponding to the domain event;
a first processing unit 505, configured to process the first domain event, and obtain a service state corresponding to the first domain event;
a second updating unit 506, configured to update service state information corresponding to the user identifier in a state database according to a service state corresponding to the first domain event, where the state database includes the user identifier and the service state information corresponding to the user identifier.
Optionally, the first processing unit 505 is further specifically configured to:
according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises an electronic certificate identifier, field events corresponding to the electronic certificate identifier, and preset states corresponding to the field events respectively;
and if it is determined that a second domain event corresponding to the second preset state does not exist in the event database, triggering generation of the second domain event after the first domain event is processed.
And if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
Optionally, referring to fig. 9, the apparatus further includes:
a third updating unit 507, configured to update an event database according to the second domain event;
a second processing unit 508, configured to process the second domain event, and obtain a service state corresponding to the second domain event;
a fourth updating unit 509, configured to update the service state information corresponding to the user identifier in the state database according to the service state corresponding to the second domain event.
Optionally, the apparatus further comprises:
the sending unit is used for sending the first domain event to a second event bus;
correspondingly, the first processing unit 505 is further specifically configured to:
and acquiring the first event bus from the second event bus, and processing the first domain event to acquire a service state corresponding to the first domain event.
The data processing method provided by the embodiment of the invention comprises the steps of receiving a data processing request, wherein the data processing request comprises a user identifier, a service identifier and an operation type, generating an electronic certificate based on the data processing request if the operation type is a second operation, generating a first domain event corresponding to the identifier of the electronic certificate based on the identifier of the electronic certificate, updating an event database according to the first domain event, processing the first domain event to obtain a service state corresponding to the first domain event, updating service state information corresponding to the user identifier in the state database according to the service state corresponding to the first domain event, and triggering generation of a second domain event after processing the first domain event when the event database does not have the second domain event corresponding to a second preset state, so that data processing of related services can be rapidly and effectively carried out, meanwhile, service processing is guaranteed to meet certain conditions.
An embodiment of the present invention provides an application server, where the application server at least includes a first event bus and a second event bus, where the first event bus is used to transmit a domain event of a first operation on a service, and the second event bus is used to transmit a domain event of a second operation on the service, and the application server includes a data processing apparatus shown in fig. 7 or a data processing apparatus shown in any one of fig. 8 and 9.
The application server provided by the embodiment of the invention receives a data processing request, the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, if the operation type is a first operation, a first field event is marked as a backspacing event based on the electronic certificate identifier and a first corresponding relation, then an event database is inquired based on the user identifier, other field events except the first field event in the field events corresponding to the user identifier are obtained, the other field events are re-processed in sequence according to the occurrence time sequence of the field events to obtain the processed service state information corresponding to the user identifier, and the service state information corresponding to the user identifier in the state database is updated according to the processed service state information corresponding to the user identifier, so that based on the existing service logic, the domain events except the rollback event are replayed in the forward direction, so that a change log table of state information does not need to be developed additionally, the burden of developers is reduced, and meanwhile, the condition of service rollback is guaranteed.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (17)

1. A data processing method is applied to an application server, the application server at least comprises a first event bus and a second event bus, wherein the first event bus is used for transmitting a domain event of a first operation on a service, and the second event bus is used for transmitting a domain event of a second operation on the service, and the method comprises the following steps:
receiving a data processing request, wherein the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, and the electronic certificate is used for indicating that a preset state is met between a user and a service;
if the operation type is a first operation, a first domain event is marked as a rollback event based on the electronic certificate identifier and a first corresponding relation, the first domain event is a domain event corresponding to the electronic certificate identifier, and the first corresponding relation comprises the electronic certificate identifier and the domain event corresponding to the electronic certificate identifier;
inquiring an event database based on the user identification, and acquiring other field events except the first field event in the field events corresponding to the user identification; the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the other domain events are re-processed in sequence according to the sequence of the occurrence time of the domain events to obtain the processed service state information corresponding to the user identification;
and updating the service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
2. The method according to claim 1, wherein the reprocessing the other domain events in sequence according to the occurrence time sequence of the domain events to obtain the processed service state information corresponding to the user identifier comprises:
the other domain events are sequentially sent to a first event bus according to the sequence of the occurrence time of the domain events;
and sequentially acquiring the other field events from the first event bus, and processing in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
3. The method according to claim 2, wherein the reprocessing of the other domain events is performed in sequence according to the sequence of occurrence times of the domain events to obtain the processed service state information corresponding to the user identifier, further comprising:
and if a preset association relationship exists between a second domain event and the first domain event in the other domain events, sending error information, wherein the error information is used for indicating that the first operation is wrong, and the second domain event is a domain event which has a preset association relationship with the first domain event in the other domain events.
4. The method according to any one of claims 1 to 3, wherein the querying the event database based on the user identifier to obtain other domain events except the first domain event from the domain events corresponding to the user identifier comprises:
acquiring a domain event corresponding to the user identifier within a preset time before the current time from the event database;
if the domain event corresponding to the user identifier in the preset time length before the current time comprises the first domain event, deleting the first domain event and then acquiring other domain events except the first domain event;
and if the domain event corresponding to the user identifier does not contain the first domain event within the preset time before the current time, sending error information, wherein the error information is used for indicating that the first operation has an error.
5. A data processing method is applied to an application server, the application server at least comprises a first event bus and a second event bus, wherein the first event bus is used for transmitting a domain event of a first operation on a service, and the second event bus is used for transmitting a domain event of a second operation on the service, and the method comprises the following steps:
receiving a data processing request, wherein the data processing request comprises a user identifier, a service identifier and an operation type;
if the operation type is a second operation, generating an electronic certificate based on the data processing request, wherein the electronic certificate is used for indicating that a preset state is met between a user and a service;
generating a first domain event corresponding to the identification of the electronic certificate based on the identification of the electronic certificate;
updating an event database according to the first domain event, wherein the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
processing the first domain event to obtain a service state corresponding to the first domain event;
and updating the service state information corresponding to the user identifier in a state database according to the service state corresponding to the first domain event, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
6. The method according to claim 5, wherein the processing the first domain event to obtain the service state corresponding to the first domain event comprises:
according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises an electronic certificate identifier, field events corresponding to the electronic certificate identifier, and preset states corresponding to the field events respectively; the second domain event is a domain event which has a preset incidence relation with the first domain event in other domain events, and the other domain events are domain events except the first domain event in the domain events corresponding to the user identifier;
if it is determined that a second domain event corresponding to the second preset state does not exist in the event database, triggering generation of the second domain event after the first domain event is processed;
and if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
7. The method of claim 6, further comprising:
updating an event database according to the second domain event;
processing the second domain event to obtain a service state corresponding to the second domain event;
and updating the service state information corresponding to the user identification in a state database according to the service state corresponding to the second field event.
8. The method of claim 5 or 6, prior to updating the event database based on the first domain event, further comprising:
sending the first domain event to a second event bus;
correspondingly, processing the first domain event to obtain a service state corresponding to the first domain event includes:
and acquiring the first event bus from the second event bus, and processing the first domain event to acquire a service state corresponding to the first domain event.
9. A data processing apparatus, applied in an application server, the application server at least including a first event bus and a second event bus, wherein the first event bus is used for transmitting a domain event of a first operation on a service, and the second event bus is used for transmitting a domain event of a second operation on the service, the apparatus comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data processing request, the data processing request comprises a user identifier, an electronic certificate identifier and an operation type, and the electronic certificate is used for indicating that a preset state is met between a user and a service;
a marking unit, configured to mark, if the operation type is a first operation, a first domain event as a fallback event based on the electronic credential identifier and a first corresponding relationship, where the first domain event is a domain event corresponding to the electronic credential identifier, and the first corresponding relationship includes the electronic credential identifier and a domain event corresponding to the electronic credential identifier;
an obtaining unit, configured to query an event database based on the user identifier, and obtain other domain events except the first domain event from domain events corresponding to the user identifier; the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the processing unit is used for sequentially reprocessing the other field events according to the sequence of the occurrence time of the field events to obtain the processed service state information corresponding to the user identifier;
and the updating unit is used for updating the service state information corresponding to the user identifier in a state database according to the processed service state information corresponding to the user identifier, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
10. The apparatus according to claim 9, wherein the processing unit is specifically configured to:
the other domain events are sequentially sent to a first event bus according to the sequence of the occurrence time of the domain events;
and sequentially acquiring the other field events from the first event bus, and processing in a synchronous interception mode to obtain the processed service state information corresponding to the user identification.
11. The apparatus according to claim 10, wherein the processing unit is further specifically configured to:
and if a preset association relationship exists between a second domain event and the first domain event in the other domain events, sending error information, wherein the error information is used for indicating that the first operation is wrong, and the second domain event is a domain event which has a preset association relationship with the first domain event in the other domain events.
12. The apparatus according to any one of claims 9 to 11, wherein the obtaining unit is specifically configured to:
acquiring a domain event corresponding to the user identifier within a preset time before the current time from the event database;
if the domain event corresponding to the user identifier in the preset time length before the current time comprises the first domain event, deleting the first domain event and then acquiring other domain events except the first domain event;
and if the domain event corresponding to the user identifier does not contain the first domain event within the preset time before the current time, sending error information, wherein the error information is used for indicating that the first operation has an error.
13. A data processing apparatus, applied in an application server, the application server at least including a first event bus and a second event bus, wherein the first event bus is used for transmitting a domain event of a first operation on a service, and the second event bus is used for transmitting a domain event of a second operation on the service, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data processing request, and the data processing request comprises a user identifier, a service identifier and an operation type;
the first generating unit is used for generating an electronic certificate based on the data processing request if the operation type is a second operation, wherein the electronic certificate is used for indicating that a preset state is met between a user and a service;
the second generation unit is used for generating a first domain event corresponding to the identification of the electronic certificate based on the identification of the electronic certificate;
the first updating unit is used for updating an event database according to the first domain event, wherein the event database comprises a user identifier, a domain event corresponding to the user identifier and occurrence time corresponding to the domain event;
the first processing unit is used for processing the first domain event to obtain a service state corresponding to the first domain event;
and the second updating unit is used for updating the service state information corresponding to the user identifier in a state database according to the service state corresponding to the first domain event, wherein the state database comprises the user identifier and the service state information corresponding to the user identifier.
14. The apparatus according to claim 13, wherein the first processing unit is further specifically configured to:
according to a preset second corresponding relation, if the preset state is determined to comprise a first preset state and a second preset state which are mutually associated, and the second preset state is a necessary condition of the first preset state, determining a second domain event corresponding to the second preset state according to the preset second corresponding relation; the second corresponding relation comprises an electronic certificate identifier, field events corresponding to the electronic certificate identifier, and preset states corresponding to the field events respectively; the second domain event is a domain event which has a preset incidence relation with the first domain event in other domain events, and the other domain events are domain events except the first domain event in the domain events corresponding to the user identifier;
if it is determined that a second domain event corresponding to the second preset state does not exist in the event database, triggering generation of the second domain event after the first domain event is processed;
and if the event database is determined to have a second domain event corresponding to the second preset state, processing the first domain event.
15. The apparatus of claim 14, further comprising:
the third updating unit is used for updating the event database according to the second field event;
the second processing unit is used for processing the second domain event to obtain a service state corresponding to the second domain event;
and the fourth updating unit is used for updating the service state information corresponding to the user identifier in the state database according to the service state corresponding to the second field event.
16. The apparatus of claim 13 or 14, further comprising:
the sending unit is used for sending the first domain event to a second event bus;
correspondingly, the first processing unit is further specifically configured to:
and acquiring the first event bus from the second event bus, and processing the first domain event to acquire a service state corresponding to the first domain event.
17. An application server, characterized in that the application server comprises at least a first event bus for transmitting domain events for a first operation of a service and a second event bus for transmitting domain events for a second operation of the service, the application server comprising a data processing arrangement according to any of claims 9-12 or a data processing arrangement according to any of claims 13-16.
CN201511033240.2A 2015-12-31 2015-12-31 Data processing method and device and application server Active CN106933932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511033240.2A CN106933932B (en) 2015-12-31 2015-12-31 Data processing method and device and application server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511033240.2A CN106933932B (en) 2015-12-31 2015-12-31 Data processing method and device and application server

Publications (2)

Publication Number Publication Date
CN106933932A CN106933932A (en) 2017-07-07
CN106933932B true CN106933932B (en) 2020-11-06

Family

ID=59444692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511033240.2A Active CN106933932B (en) 2015-12-31 2015-12-31 Data processing method and device and application server

Country Status (1)

Country Link
CN (1) CN106933932B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110196895B (en) * 2019-04-19 2022-05-17 平安科技(深圳)有限公司 User data information self-service query method and device, computer equipment and storage medium
CN111652781A (en) * 2020-06-01 2020-09-11 阿里巴巴集团控股有限公司 Service processing method, device, equipment and storage medium based on community codes
CN112435004A (en) * 2020-11-20 2021-03-02 金蝶软件(中国)有限公司 Method and device for realizing service flow processing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039259A (en) * 2006-03-17 2007-09-19 华为技术有限公司 Method for controlling service of communication equipment and system thereof
CN103747072A (en) * 2013-12-30 2014-04-23 乐视网信息技术(北京)股份有限公司 Data reading and writing method and application server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8571791B2 (en) * 2009-07-29 2013-10-29 Searete Llc Remote processing of selected vehicle operating parameters
US8621072B2 (en) * 2011-12-06 2013-12-31 Microsoft Corporation Providing notification of document repository events to external systems
WO2015085507A1 (en) * 2013-12-11 2015-06-18 华为技术有限公司 Data storage method, data processing method and device, and mobile terminal
CN104636437B (en) * 2014-12-31 2018-06-05 华为技术有限公司 A kind of processing method and processing device of event notification method, monitor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039259A (en) * 2006-03-17 2007-09-19 华为技术有限公司 Method for controlling service of communication equipment and system thereof
CN103747072A (en) * 2013-12-30 2014-04-23 乐视网信息技术(北京)股份有限公司 Data reading and writing method and application server

Also Published As

Publication number Publication date
CN106933932A (en) 2017-07-07

Similar Documents

Publication Publication Date Title
CN109684054B (en) Information processing method and device, electronic equipment and memory
US10387856B2 (en) Online payment method, system, and apparatus
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
JP6742650B2 (en) Application calling method and device using mobile browser
CN111176858A (en) Data request processing method and device
CN111274052A (en) Data distribution method, server, and computer-readable storage medium
WO2020248375A1 (en) Method and system for synchronizing data between databases, computer device and storage medium
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN108733720B (en) On-line checking method and checking system for SQL (structured query language) query of multiple database types
CN111277639A (en) Method and device for maintaining data consistency
CN106407021A (en) Queue-based business request processing method
CN106933932B (en) Data processing method and device and application server
CN111090532B (en) Application service calling method, device, electronic equipment and computer storage medium
CN108230089A (en) A kind of online order processing method, system and device
CN111198892A (en) Information processing method, information processing device, electronic equipment and storage medium
CN111355765B (en) Network request processing and sending method and device
WO2022062661A1 (en) Operation notification method and apparatus, and storage medium and electronic apparatus
CN109583980A (en) Method, system, electronic equipment and the storage medium of order processing
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN115658745A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN110768855B (en) Method and device for testing linkmzation performance
CN107704557B (en) Processing method and device for operating mutually exclusive data, computer equipment and storage medium
CN111061576A (en) Method and system for creating entity object
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111506644A (en) Application data processing method and device and electronic equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200214

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant after: HUAWEI TECHNOLOGIES Co.,Ltd.

Address before: 210012 HUAWEI Nanjing base, 101 software Avenue, Yuhuatai District, Jiangsu, Nanjing

Applicant before: Huawei Technologies Co.,Ltd.

GR01 Patent grant
GR01 Patent grant