CN113821519B - Data processing method and domain drive design architecture - Google Patents
Data processing method and domain drive design architecture Download PDFInfo
- Publication number
- CN113821519B CN113821519B CN202011349021.6A CN202011349021A CN113821519B CN 113821519 B CN113821519 B CN 113821519B CN 202011349021 A CN202011349021 A CN 202011349021A CN 113821519 B CN113821519 B CN 113821519B
- Authority
- CN
- China
- Prior art keywords
- data
- modified
- identifier
- aggregation
- event
- 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
Links
- 238000013461 design Methods 0.000 title claims abstract description 51
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 230000002776 aggregation Effects 0.000 claims abstract description 91
- 238000004220 aggregation Methods 0.000 claims abstract description 91
- 230000004048 modification Effects 0.000 claims abstract description 86
- 238000012986 modification Methods 0.000 claims abstract description 86
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000012545 processing Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 9
- 230000007246 mechanism Effects 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 9
- 230000008859 change Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 239000000835 fiber Substances 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a data processing method and a domain drive design architecture, and relates to the technical field of computers. One embodiment of the method comprises the following steps: the domain layer of the domain drive design architecture monitors whether a data modification request is received or not in real time, and intercepts the data modification request when the data modification request is monitored; the domain layer analyzes the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified; the application layer of the domain drive design architecture determines data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifies the data to be modified according to the target data. The embodiment can only update the modified data in the aggregation without updating the whole aggregation, thereby reducing the occupation of computing resources, reducing the CPU overhead and ensuring that the running performance of the domain drive design architecture is not affected.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and a domain driving design architecture.
Background
With the increasing complexity of software systems, domain driven design architectures have evolved. In the field-driven design architecture field, a developer designs data with strong association into an aggregation, and then writes, reads or modifies the aggregation as a complete unit.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
Because the aggregation is completed as a complete unit, when partial data in the aggregation is modified each time, the whole aggregation is required to be updated in a full amount, so that excessive computing resources are occupied, CPU overhead is increased, other services can be influenced when more data in the aggregation is generated, and the operation performance of the domain drive design architecture is influenced.
Disclosure of Invention
In view of this, the embodiment of the invention provides a data processing method and a domain driving design architecture, which can only update the modified data when modifying part of the data in the aggregation, and does not need to update the whole aggregation in a full amount, thereby reducing the occupation of computing resources, reducing the CPU overhead and ensuring that the running performance of the domain driving design architecture is not affected.
To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a data processing method.
The data processing method of the embodiment of the invention is applied to a field driving design framework and comprises the following steps:
The domain layer of the domain drive design architecture monitors whether a data modification request is received or not in real time, and intercepts the data modification request when the data modification request is monitored;
The domain layer analyzes the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified;
the application layer of the domain drive design architecture determines data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifies the data to be modified according to the target data.
Alternatively, the process may be carried out in a single-stage,
When the domain layer analyzes to obtain a plurality of first identifiers respectively corresponding to the to-be-modified aggregation, the method further comprises the following steps:
The domain layer correspondingly writes a plurality of first identifiers corresponding to the to-be-modified aggregation, a second identifier of to-be-modified data in each to-be-modified aggregation and target data corresponding to the to-be-modified data in each to-be-modified aggregation into a cache queue, so that the application layer sequentially acquires the first identifiers, the second identifiers and the target data corresponding to each to-be-modified aggregation from the cache queue.
Alternatively, the process may be carried out in a single-stage,
The domain layer comprises: an event generator, an event manager and an event listener,
The event generator records a first identifier and a second identifier of data to be modified in the aggregation to be modified corresponding to the first identifier, and generates a data modification event;
The event generator sends a data modification event to the event manager, so that the event manager notifies the event monitor according to the data modification event, and the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager.
Alternatively, the process may be carried out in a single-stage,
And the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager and a preset read-write period.
Alternatively, the process may be carried out in a single-stage,
The event monitor correspondingly writes the first identifier, the second identifier and the target data into a cache queue according to the notification of the event manager and a preset read-write period, and the event monitor comprises:
The event monitor reads data modification events from the event manager according to the notification of the event manager to obtain a first identifier and a second identifier;
the event monitor acquires target data by using a java reflection mechanism according to the first identifier and the second identifier, and correspondingly writes the first identifier, the second identifier and the target data into a cache queue.
Alternatively, the process may be carried out in a single-stage,
When the same second identifier corresponds to a plurality of target data, the method further comprises:
and modifying the data to be modified according to the target data closest to the current time in the target data.
Alternatively, the process may be carried out in a single-stage,
The domain layer intercepts the data modification request by String Aop.
To achieve the above object, according to still another aspect of the embodiments of the present invention, a domain driving design architecture is provided.
The field driving design framework of the embodiment of the invention comprises a field layer and an application layer; wherein:
The domain layer is used for: monitoring whether a data modification request is received or not in real time, and intercepting the data modification request when the data modification request is monitored; analyzing the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified;
the application layer is used for: and determining the data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifying the data to be modified according to the target data.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a data processing electronic device.
An electronic device for modifying data according to an embodiment of the present invention includes: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize a data processing method of the embodiment of the invention.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements a data processing method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: when the domain layer of the domain driving design framework monitors the data modification request, the data modification request is intercepted and analyzed to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified and target data corresponding to the data to be modified, and then the application layer of the domain driving design framework determines the data to be modified in the aggregation to be modified according to the first identifier and the second identifier and modifies the data to be modified according to the target data. When partial data in the aggregation is modified, the modified data is only updated, and the whole aggregation is not required to be updated in a full amount, so that the occupation of computing resources is reduced, CPU (Central processing Unit) overhead is reduced, and the running performance of the domain drive design architecture is not influenced.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a cache queue structure according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a domain layer according to an embodiment of the invention;
FIG. 4 is a schematic diagram of main steps of a method for an event listener to write a first identifier, a second identifier, and target data to a cache queue according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main steps of a method for modifying data to be modified by an application layer according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the major modules of a domain drive design architecture, according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 8 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features in the embodiments may be combined with each other without collision.
The domain drive design architecture includes an interface layer, an application layer, a domain layer, and an infrastructure layer, wherein: the interface layer provides an interface for a user or a caller to access; the application layer is used for completing specific tasks; the domain layer is the core of the domain drive design architecture and comprises most of objects and business logic; the infrastructure layer provides general technical services such as data storage for the other three layers, and the database is located in the infrastructure layer.
At present, the common practice of the domain driving design architecture is as follows: designing data with stronger association into an aggregation, wherein the aggregation is equivalent to a set of a plurality of data tables; the architecture then aggregates as units of processing, performing write, read, or modify operations. However, when modifying part of the data in the aggregation, the data in the whole aggregation needs to be updated in full, so that excessive computing resources are occupied, CPU overhead is increased, other services can be influenced when the data in the aggregation is more, and system performance is influenced. In view of this, the present invention provides a data processing method applied to a domain driving design architecture.
Fig. 1 is a schematic diagram of main steps of a data processing method according to an embodiment of the present invention.
As shown in fig. 1, a data processing method of the embodiment of the present invention is applied to a domain driving design architecture, and mainly includes the following steps:
step S101: the domain layer of the domain drive design architecture monitors whether a data modification request is received or not in real time, and intercepts the data modification request when the data modification request is monitored.
In the embodiment of the invention, when the domain layer monitors the data modification request, the data modification request can be intercepted on the aggregation root object in String Aop mode, the data modification request can be intercepted in a Filter mode, and the data modification request can be intercepted by other dynamic agent technologies and interceptor technologies, so that the scheme is not particularly limited. In a preferred embodiment of the present invention, the domain layer intercepts the data modification request in String Aop manner, wherein String Aop manner is cut-plane-oriented interception, so as to obtain the entity object information of specific modification such as packet name, class name, method name, and parameter in the data modification request.
Step S102: the domain layer analyzes the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified.
In the embodiment of the invention, the data modification request may include a json file, and after the domain layer intercepts the data modification request, the json file may be parsed to obtain a first identifier of the aggregate to be modified, a second identifier of the data to be modified in the aggregate to be modified, and target data corresponding to the data to be modified.
In the embodiment of the invention, the modified entity class name, the entity parameter object and the unique identifier field name can be marked in the data modification request in the form of annotation, wherein the modified entity class name is the first identifier, the unique identifier field name is the second identifier, and the modified entity parameter object is the target data. After the domain layer intercepts the data modification request in String Aop mode, the data can be obtained by utilizing Java reflection mechanism in section logic according to annotated information to construct a cache queue. The buffer queue is used for storing the modified entity class names, the entity parameter objects and the unique identifier field names acquired by the domain layer, so that the application layer can acquire the data from the buffer queue and modify the corresponding data to be modified. In a preferred embodiment of the present invention, the structure of the cache queue may be as shown in FIG. 2.
In the embodiment of the invention, the first identifier may be a class name of the aggregation to be modified, or may be a class name of the aggregation to be modified plus a unique field for indicating the aggregation to be modified. The second identifier may be an object name corresponding to the data to be modified, or may be an object name corresponding to the data to be modified and a unique field for indicating the data to be modified.
In the embodiment of the invention, when the domain layer analyzes to obtain the first identifiers respectively corresponding to the plurality of to-be-modified aggregations, the domain layer can also write the first identifiers respectively corresponding to the plurality of to-be-modified aggregations, the second identifiers of the to-be-modified data in each to-be-modified aggregation and the target data corresponding to the to-be-modified data in each to-be-modified aggregation into the cache queue, so that the application layer can sequentially acquire the first identifiers, the second identifiers and the target data corresponding to each to-be-modified aggregation from the cache queue.
In the embodiment of the invention, after the domain layer analyzes the data modification request, the second identifier of the data to be modified and the target data corresponding to the data to be modified can be obtained, then the application layer searches the corresponding data to be modified in the database of the infrastructure layer according to the second identifier, and then the data to be modified is modified into the corresponding target data.
In the embodiment of the invention, after the domain layer analyzes the data modification request, a second identifier and corresponding target data thereof can be obtained, wherein the second identifier also corresponds to the data to be modified in the database of the infrastructure layer, and then the application layer modifies the corresponding data to be modified in the database of the infrastructure layer into the target data according to the second identifier.
In an embodiment of the present invention, as shown in fig. 3, the domain layer may include: an event generator, an event manager, and an event listener; wherein: the event generator records a first identifier and a second identifier of data to be modified in the aggregation to be modified corresponding to the first identifier, and generates a data modification event; the event generator sends a data modification event to the event manager so that the event manager notifies the event listener according to the data modification event; and the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager.
In the embodiment of the present invention, a method for the event listener to write the first identifier, the second identifier and the target data into the cache queue correspondingly may be as shown in fig. 4, and the method mainly includes the following steps:
step S401: reading data modification events from the event manager according to the notification of the event manager to obtain a first identifier and a second identifier;
Step S402: acquiring target data by using a java reflection mechanism according to the first identifier and the second identifier;
Step S403: and correspondingly writing the first identifier, the second identifier and the target data into a cache queue according to a preset read-write period.
The method has the advantages that the reading and writing period is preset for the event monitor, the asynchronous operation of intercepting the data modification request and writing the data modification request into the cache queue can be realized, namely, the domain layer does not write modification information into the cache queue immediately after intercepting the data modification request each time, but notifies the event monitor through generating the data modification event, and the event monitor correspondingly writes one or more groups of first identification, second identification and target data into the cache queue according to the reading and writing period, so that the reading and writing times of the cache queue are reduced, the calculation resources are saved, and the method is convenient for combining multiple modification operations of the same data to be modified.
Step S103: the application layer of the domain drive design architecture determines data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifies the data to be modified according to the target data.
In an embodiment of the present invention, the application layer may include an aggregation repository, where the aggregation repository is used to manage aggregation. The aggregation resource library obtains a first identifier of an aggregation to be modified through a reflection mechanism, then queries a cache queue according to the first identifier to determine whether an entity change list in the cache queue is empty, and if not, modifies the data to be modified to persist target data into the database. The entity change list comprises a second identifier, target data and a corresponding relation of the second identifier and the target data. Specifically, as shown in fig. 5, fig. 5 is a schematic diagram of main steps of a method for modifying data to be modified by an application layer according to an embodiment of the present invention, where the method mainly includes the following steps:
Step S501: and inquiring the cache queue to determine whether the entity change list in the cache queue is empty.
In the embodiment of the invention, if the entity change list is empty, which indicates that no data is changed, the application layer does not need to perform other operations related to modifying the data.
Step S502: and when the entity change list is not empty, acquiring the entity change list, and grouping the target data according to the second identification in the entity change list.
Step S503: and when the grouping determines that the same second identifier corresponds to a plurality of target data, merging the plurality of target data.
In the embodiment of the invention, due to asynchronous operation of the monitor, a plurality of target data may be corresponding to the same second identifier, i.e. a plurality of data modification requests may point to the same data to be modified. The aggregated repository may therefore group the target data according to a second identification in the entity change list, wherein the second identifications of the target data located in the same group are the same. When the same second identifier corresponds to a plurality of target data, the aggregation resource library can merge the plurality of target data. In a preferred embodiment of the present invention, when the aggregate resource library merges a plurality of target data, the target data closest to the current time in the plurality of target data may be selected as the merged result, so that when the same data to be modified is indicated to be modified by a plurality of data modification requests, the aggregate resource library can modify the data to be modified into the target data closest to the current time at one time, thereby reducing the read-write times of the database, saving the computing resources, and ensuring the operation performance of the domain drive design architecture.
Step S504: and accessing a database of the infrastructure layer according to the combined result, and modifying the data to be modified.
In an embodiment of the present invention, the domain drive design architecture further includes an infrastructure layer, where the database is located. The aggregation resource library can access the database of the infrastructure layer through Dao (DATA ACCESS Object ), and modify the data to be modified into target data, so as to complete the persistence operation on the target data.
According to the data processing method, when the domain layer of the domain driving design framework monitors a data modification request, the data modification request is intercepted and analyzed to obtain a first identifier of to-be-modified aggregation, a second identifier of to-be-modified data in the to-be-modified aggregation and target data corresponding to the to-be-modified data, and then the application layer of the domain driving design framework determines the to-be-modified data in the to-be-modified aggregation according to the first identifier and the second identifier and modifies the to-be-modified data according to the target data. When partial data in the aggregation is modified, the modified data is only updated, and the whole aggregation is not required to be updated in a full amount, so that the occupation of computing resources is reduced, CPU (Central processing Unit) overhead is reduced, and the running performance of the domain drive design architecture is not influenced.
Fig. 6 is a schematic diagram of the main modules of a domain drive design architecture according to an embodiment of the present invention.
As shown in fig. 6, a domain driving design architecture 600 according to an embodiment of the present invention includes: a domain layer 601 and an application layer 602; wherein:
The domain layer 601 is used for: monitoring whether a data modification request is received or not in real time, and intercepting the data modification request when the data modification request is monitored; analyzing the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified;
the application layer 602 is configured to: and determining the data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifying the data to be modified according to the target data.
In the embodiment of the present invention, when the domain layer 601 parses to obtain a plurality of first identifiers respectively corresponding to the to-be-modified aggregates, the domain layer 601 is further configured to: and correspondingly writing the first identifiers corresponding to the multiple to-be-modified aggregations, the second identifiers of the to-be-modified data in each to-be-modified aggregation and the target data corresponding to the to-be-modified data in each to-be-modified aggregation into a cache queue, so that an application layer sequentially acquires the first identifiers, the second identifiers and the target data corresponding to each to-be-modified aggregation from the cache queue.
In an embodiment of the present invention, the domain layer 601 further includes: an event generator, an event manager, and an event listener, wherein: the event generator records a first identifier and a second identifier of data to be modified in the aggregation to be modified corresponding to the first identifier, and generates a data modification event; the event generator sends a data modification event to the event manager, so that the event manager notifies the event monitor according to the data modification event, and the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager.
In the embodiment of the invention, the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager and a preset read-write period.
In the embodiment of the invention, an event monitor reads data modification events from an event manager according to the notification of the event manager to obtain a first identifier and a second identifier; the event monitor acquires target data by using a java reflection mechanism according to the first identifier and the second identifier, and correspondingly writes the first identifier, the second identifier and the target data into a cache queue.
In an embodiment of the present invention, when the same second identifier corresponds to a plurality of target data, the application layer 602 is further configured to: and modifying the data to be modified according to the target data closest to the current time in the target data.
In the embodiment of the present invention, the domain layer 601 intercepts the data modification request by String Aop.
According to the domain driving design framework, when the domain layer of the domain driving design framework monitors a data modification request, the data modification request is intercepted and analyzed to obtain a first identifier of to-be-modified aggregation, a second identifier of to-be-modified data in the to-be-modified aggregation and target data corresponding to the to-be-modified data, and then the application layer of the domain driving design framework determines the to-be-modified data in the to-be-modified aggregation according to the first identifier and the second identifier and modifies the to-be-modified data according to the target data. When partial data in the aggregation is modified, the modified data is only updated, and the whole aggregation is not required to be updated in a full amount, so that the occupation of computing resources is reduced, CPU (Central processing Unit) overhead is reduced, and the running performance of the domain drive design architecture is not influenced.
FIG. 7 illustrates an exemplary system architecture 700 to which a data processing method or a domain driven design architecture of embodiments of the present invention may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the terminal devices 701, 702, 703 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server providing support for shopping-type websites browsed by the user using the terminal devices 701, 702, 703. The background management server can analyze and other processing on the received data such as the product information inquiry request and the like, and feed back processing results (such as target push information and product information) to the terminal equipment.
It should be understood that the number of terminal devices, networks and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The architecture described in the embodiments of the present invention may be implemented in software or in hardware. The architecture described may also be provided in a processor, for example, as: a processor includes a domain layer and an application layer. Where the names of these architectures do not constitute a limitation on the architecture itself in some cases, for example, the domain layer may also be described as "architecture that monitors and intercepts data modification requests".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: the domain layer of the domain drive design architecture monitors whether a data modification request is received or not in real time, and intercepts the data modification request when the data modification request is monitored; the domain layer analyzes the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified; the application layer of the domain drive design architecture determines data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifies the data to be modified according to the target data.
According to the technical scheme of the embodiment of the invention, when the domain layer of the domain driving design framework monitors a data modification request, the data modification request is intercepted and analyzed to obtain a first identifier of an aggregate to be modified, a second identifier of data to be modified in the aggregate to be modified and target data corresponding to the data to be modified, and then the application layer of the domain driving design framework determines the data to be modified in the aggregate to be modified according to the first identifier and the second identifier and modifies the data to be modified according to the target data. When partial data in the aggregation is modified, the modified data is only updated, and the whole aggregation is not required to be updated in a full amount, so that the occupation of computing resources is reduced, CPU (Central processing Unit) overhead is reduced, and the running performance of the domain drive design architecture is not influenced.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A data processing method, applied to a domain-driven design architecture, comprising:
The domain layer of the domain drive design architecture monitors whether a data modification request is received or not in real time, and intercepts the data modification request when the data modification request is monitored;
The domain layer analyzes the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified; the modified entity class name, the entity parameter object and the unique identifier field name are marked in the data modification request in the form of notes; the first identifier is a modified entity class name or the modified entity class name plus a unique field for indicating the aggregation to be modified; the second identifier is a unique identifier field name or the unique identifier field name is added with a unique field for indicating the data to be modified;
The application layer of the domain driving design framework determines data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifies the data to be modified according to the target data.
2. The method of claim 1, when the domain layer parses the plurality of first identifiers respectively corresponding to the to-be-modified aggregates, the method further comprises:
the domain layer correspondingly writes a plurality of first identifiers corresponding to the to-be-modified aggregation, second identifiers of to-be-modified data in each to-be-modified aggregation and target data corresponding to the to-be-modified data in each to-be-modified aggregation into a cache queue, so that the application layer sequentially acquires the first identifiers, the second identifiers and the target data corresponding to each to-be-modified aggregation from the cache queue.
3. The method of claim 2, wherein the domain layer comprises: an event generator, an event manager and an event listener,
The event generator records the first identifier and the second identifier of the data to be modified in the aggregation to be modified corresponding to the first identifier, and generates a data modification event;
The event generator sends the data modification event to the event manager, so that the event manager notifies the event monitor according to the data modification event, and the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager.
4. The method of claim 3, wherein the step of,
And the event monitor correspondingly writes the first identifier, the second identifier and the target data into the cache queue according to the notification of the event manager and a preset read-write period.
5. The method of claim 3, wherein the event listener writing the first identifier, the second identifier, and the target data to the cache queue according to the notification of the event manager and a preset read-write cycle, comprising:
The event monitor reads the data modification event from the event manager according to the notification of the event manager to obtain the first identifier and the second identifier;
And the event monitor acquires the target data by using a java reflection mechanism according to the first identifier and the second identifier, and correspondingly writes the first identifier, the second identifier and the target data into a cache queue.
6. The method of claim 1, wherein when the same one of the second identifiers corresponds to a plurality of the target data, the method further comprises:
and modifying the data to be modified according to the target data closest to the current time in the target data.
7. The method according to any one of claims 1 to 6, wherein,
The domain layer intercepts the data modification request by String Aop.
8. A domain drive design architecture, comprising a domain layer and an application layer; wherein:
the domain layer is used for: monitoring whether a data modification request is received or not in real time, and intercepting the data modification request when the data modification request is monitored; analyzing the data modification request to obtain a first identifier of aggregation to be modified, a second identifier of data to be modified in the aggregation to be modified, and target data corresponding to the data to be modified; the modified entity class name, the entity parameter object and the unique identifier field name are marked in the data modification request in the form of notes; the first identifier is a modified entity class name or the modified entity class name plus a unique field for indicating the aggregation to be modified; the second identifier is a unique identifier field name or the unique identifier field name is added with a unique field for indicating the data to be modified;
the application layer is used for: and determining the data to be modified in the aggregation to be modified according to the first identifier and the second identifier, and modifying the data to be modified according to the target data.
9. A data processing electronic device, comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011349021.6A CN113821519B (en) | 2020-11-26 | 2020-11-26 | Data processing method and domain drive design architecture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011349021.6A CN113821519B (en) | 2020-11-26 | 2020-11-26 | Data processing method and domain drive design architecture |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113821519A CN113821519A (en) | 2021-12-21 |
CN113821519B true CN113821519B (en) | 2024-10-18 |
Family
ID=78924910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011349021.6A Active CN113821519B (en) | 2020-11-26 | 2020-11-26 | Data processing method and domain drive design architecture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113821519B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109522273A (en) * | 2018-11-15 | 2019-03-26 | 郑州云海信息技术有限公司 | A kind of method and device for realizing data write-in |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8595320B2 (en) * | 2010-11-22 | 2013-11-26 | International Business Machines Corporation | If-none-match for aggregated page distribution |
CN109460412A (en) * | 2018-11-14 | 2019-03-12 | 北京锐安科技有限公司 | Data aggregation method, device, equipment and storage medium |
CN110134550B (en) * | 2019-05-15 | 2024-06-18 | 腾讯科技(深圳)有限公司 | Data processing method, device and computer readable storage medium |
CN111125107A (en) * | 2019-12-23 | 2020-05-08 | 京东数字科技控股有限公司 | Data processing method, device, electronic equipment and medium |
CN111858779A (en) * | 2020-06-05 | 2020-10-30 | 北京旷视科技有限公司 | Data analysis method and device, electronic equipment and storage medium |
CN111858676B (en) * | 2020-07-24 | 2024-08-13 | 政采云有限公司 | Data processing method and device |
-
2020
- 2020-11-26 CN CN202011349021.6A patent/CN113821519B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109522273A (en) * | 2018-11-15 | 2019-03-26 | 郑州云海信息技术有限公司 | A kind of method and device for realizing data write-in |
Also Published As
Publication number | Publication date |
---|---|
CN113821519A (en) | 2021-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11921672B2 (en) | Query execution at a remote heterogeneous data store of a data fabric service | |
US20220327125A1 (en) | Query scheduling based on a query-resource allocation and resource availability | |
US11586627B2 (en) | Partitioning and reducing records at ingest of a worker node | |
US11580107B2 (en) | Bucket data distribution for exporting data to worker nodes | |
US11321321B2 (en) | Record expansion and reduction based on a processing task in a data intake and query system | |
US11599541B2 (en) | Determining records generated by a processing task of a query | |
US20200364223A1 (en) | Search time estimate in a data intake and query system | |
US20200050607A1 (en) | Reassigning processing tasks to an external storage system | |
US20190272271A1 (en) | Assigning processing tasks in a data intake and query system | |
US10331669B2 (en) | Fast query processing in columnar databases with GPUs | |
CN110019350A (en) | Data query method and apparatus based on configuration information | |
CN111190888A (en) | Method and device for managing graph database cluster | |
CN111125107A (en) | Data processing method, device, electronic equipment and medium | |
CN111666293A (en) | Database access method and device | |
CN111753226A (en) | Page loading method and device | |
CN111241189A (en) | Method and device for synchronizing data | |
CN110928594A (en) | Service development method and platform | |
CN113821519B (en) | Data processing method and domain drive design architecture | |
CN113672671A (en) | Method and device for realizing data processing | |
CN117609226A (en) | Information stream data storage method and device, electronic equipment and readable medium | |
CN113378346A (en) | Method and device for model simulation | |
CN113722007B (en) | Configuration method, device and system of VPN branch equipment | |
CN112214500A (en) | Data comparison method and device, electronic equipment and storage medium | |
CN114756173A (en) | Method, system, device and computer readable medium for file merging | |
CN113312053A (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |