Storage data storage method and device, equipment and medium
By obtaining operational status and data processing rules of the storage data in the field -driven design architecture, the operating complexity and concurrency problems of data preservation are solved, and efficient data operation and preservation is achieved.
Patent Information
- Application Number
- CN202411301642.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-28
AI Technical Summary
In the domain-driven design architecture, there are problems such as duplicate development, complex operation, concurrency problems and operation sequence control when warehousing data are saved.
All filter data are sorted through the operation status in the physical attribute, determine the operating status and obtain the corresponding data processing rules, and perform data processing and preservation.
The control of the data operation order is realized, the unique key conflict is avoided, the feasibility and processing efficiency of the data operation is improved, and the complexity of repeated development and operation is reduced.
Smart Images

Figure CN119376616A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data persistence, and in particular to a method, device, equipment and medium for storing warehouse data. Background Art
[0002] As software systems become increasingly complex, domain-driven design architectures have emerged. In the domain-driven design architecture, developers will design highly correlated data into an aggregate, and then write, read, or modify the aggregate as a complete unit, and save the data to the corresponding data warehouse for persistent storage after the operation is completed.
[0003] In the prior art, during the development of domain-driven design, there are several problems when storing and saving data: Duplicate development: The saving function of each warehouse is implemented separately, which leads to low development efficiency. Complex operation: Manual processing of logical deletion, data update and other operations is complex and error-prone. Concurrency issues: When operating on aggregate roots, concurrent operations are not effectively prevented, which can easily lead to data inconsistency. Operation sequence control: In some scenarios, it is necessary to delete first and then add, and there is a lack of unified operation sequence control. Aggregate root locking: The locking of aggregate roots and the updating of business version numbers need to be handled manually, which is easy to miss. Summary of the invention
[0004] The embodiments of the present invention provide a warehouse data storage method, device, equipment and medium to solve the problems of repeated development, complex operation, concurrency and operation sequence control in the prior art.
[0005] A method for storing warehouse data, comprising: Acquire at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one entity attribute corresponding to one filtered data; Sorting all the filtered data according to the operation status in each of the entity attributes to obtain a data sorting result corresponding to each of the filtered data; Determine the operation status corresponding to each of the filtered data according to the data sorting result, and obtain the data processing rule corresponding to each of the operation status; Data processing is performed on all the filtered data corresponding to the operation status according to the data processing rules corresponding to each operation status, and data preservation is performed to obtain a data preservation result.
[0006] A storage data storage device, comprising: A data filtering module, used to obtain at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one filtered data corresponds to one entity attribute; A data sorting module, used to sort all the filtered data according to the operation status in each of the entity attributes, and obtain a data sorting result corresponding to each of the filtered data; A processing rule module, used to determine the operation status corresponding to each of the filtered data according to the data sorting result, and obtain the data processing rule corresponding to each of the operation status; The data saving module is used to perform data processing and data saving on all the filtered data corresponding to the operation status according to the data processing rules corresponding to each operation status, so as to obtain a data saving result.
[0007] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the above-mentioned warehouse data preservation method.
[0008] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the warehouse data storage method is implemented.
[0009] The above-mentioned warehouse data preservation method, device, equipment and medium, the present invention sorts all filtered data by the operation status in the entity attribute, realizes the order of control operation, avoids unique key conflict, and improves the feasibility of data operation. Through the operation status corresponding to each filtered data in the data sorting result, it is convenient to obtain the data processing rules, thereby improving the processing efficiency of the filtered data. All filtered data are processed and saved by the data processing rules, realizing the ability of general storage of warehouses, avoiding repeated development of different warehouses, and solving the problem of complex operations when processing data, thereby improving the efficiency of the development of general storage capabilities of warehouses. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0011] Figure 1 is a flow chart of a method for storing warehouse data in one embodiment of the present invention; Figure 2is a flow chart of step S10 of the warehouse data preservation method in one embodiment of the present invention; Figure 3 is a flowchart of step S20 of the warehouse data preservation method in one embodiment of the present invention; Figure 4 is a flow chart of step S30 of the warehouse data preservation method in one embodiment of the present invention; Figure 5 is a flowchart of step S40 of the warehouse data preservation method in one embodiment of the present invention; Figure 6 is a flowchart of step S402 of the warehouse data preservation method in one embodiment of the present invention; Figure 7 is a flow chart of step S403 of the warehouse data preservation method in one embodiment of the present invention; Figure 8 is a principle block diagram of a storage data storage device in one embodiment of the present invention; Fig. 9 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0013] In one embodiment, if Figure 1 As shown, a method for storing warehouse data is provided, comprising the following steps: S10: Acquire at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one filtered data corresponds to one entity attribute.
[0014] Understandably, the entity data to be processed refers to the entity data to be saved. The filtered data refers to the data that meets the requirements, such as newly added entity data, modified entity data, etc. One filtered data corresponds to one entity attribute. The entity attribute refers to the primary key ID, operation status, creation time, modification time, and other attributes of each filtered data in the general format.
[0015] Specifically, at least one entity data to be processed is obtained from one or more entity lists. Then, all entity data to be processed are filtered, that is, preset filtering rules are obtained, and all entity data to be processed are filtered by the preset filtering rules, that is, the preset filtering rules are matched with each entity data to be processed. When the entity data to be processed meets the preset filtering rules, the entity data to be processed is deleted, and the next entity data to be processed is matched with the preset filtering rules. When the entity data to be processed does not meet the preset filtering rules, the entity data to be processed is retained and determined as the filtering data. In this way, at least one filtering data is filtered out from all entity data to be processed. All filtering data are parsed, and a preset parsing tool is obtained. All filtering data are parsed by the preset parsing tool to obtain corresponding entity attributes from each filtering data. Among them, one filtering data corresponds to one entity attribute, and each entity attribute includes multiple attributes.
[0016] S20: Sorting all the filtered data according to the operation status in each of the entity attributes to obtain a data sorting result corresponding to each of the filtered data.
[0017] Understandably, the data sorting result refers to the order of arrangement of all filtered data, which is used to characterize the position of each filtered data. The operation status refers to the operation action on the data, for example, data status such as adding, modifying, updating, deleting, and not changing.
[0018] Specifically, all the filter data are sorted by the operation status corresponding to each entity attribute, that is, by the priority of the operation status corresponding to each filter data, so as to obtain the data sorting result corresponding to each filter data. Among them, when the priority of the operation status corresponding to the filter data is the same, the data can be sorted by other attributes in the entity data, or when the priority of the operation status corresponding to the filter data is the same, the order can be irrelevant.
[0019] S30: Determine the operation status corresponding to each of the filtered data according to the data sorting result, and obtain the data processing rule corresponding to each of the operation status.
[0020] It can be understood that the data processing rules refer to the methods of operating and saving data corresponding to each operating state.
[0021] Specifically, the position of each filter data in the data sorting result is determined through the data sorting result, and the operation state corresponding to each filter data is determined through the position of the filter data in the data sorting result, that is, the operation state is determined according to the position through the sorting result of the operation state in the entity attribute in the data sorting result. Then, the corresponding data processing rule is obtained through the operation state, that is, the preset processing rule library is obtained, and the operation state and the rule state in the preset processing rule library are matched, so as to obtain the rule matching result corresponding to each operation state. When the rule matching result indicates that the operation state and the rule state match successfully, the data processing rule corresponding to the rule state that successfully matches the operation state is obtained from the preset processing rule library.
[0022] S40: performing data processing on all the filtered data corresponding to the operation status according to the data processing rules corresponding to each operation status and executing data preservation to obtain a data preservation result.
[0023] It can be understood that the data saving result refers to the result of storing the filtered data in the general warehouse.
[0024] Specifically, each filter data in the data sorting result is divided according to the operation state, so as to obtain the filter data corresponding to each operation state. Then, all the filter data corresponding to the operation state are processed and saved by the data processing rules corresponding to each operation state, that is, when the operation state is the new addition state, the data processing rule is determined to be the new addition data rule, and all the filter data corresponding to the operation state of the new addition state are processed and saved by the new addition data rule, so as to obtain the new addition data saving result; when the operation state is the modification state, the data processing rule is determined to be the modification data rule, and all the filter data corresponding to the operation state of the modification state are processed and saved by the modification data rule, so as to obtain the modified data saving result; when the operation state is the update and delete state, the data processing rule is determined to be the update and delete data rule, and all the filter data corresponding to the operation state of the update and delete state are processed and saved by the update and delete data rule, so as to obtain the updated data saving result.
[0025] In the warehouse data preservation method of the present invention, all filtered data are sorted by the operation status in the entity attributes, so as to realize the control operation order, avoid the unique key conflict, and improve the feasibility of data operation. Through the operation status corresponding to each filtered data in the data sorting result, it is convenient to obtain the data processing rules, thereby improving the processing efficiency of the filtered data. All filtered data are processed and saved by the data processing rules, so as to realize the ability of warehouse general preservation, avoid repeated development of different warehouses, and solve the problem of complex operation when processing data, thereby improving the efficiency of warehouse general preservation capability development.
[0026] In one embodiment, if Figure 2 As shown, in the step S10, all the entity data to be processed are filtered to obtain at least one filtered data, including: S101, acquiring entity attributes corresponding to each entity data to be processed, and determining an operation status in the entity attributes corresponding to each entity data to be processed.
[0027] S102, obtaining a state screening rule, matching a preset state in the state screening rule with an operation state corresponding to each entity data to be processed, and obtaining a state matching result corresponding to each entity data to be processed.
[0028] S103, when the state matching result indicates that the preset state and the operating state match successfully, delete the to-be-processed entity data corresponding to the operating state that matches successfully the preset state, and obtain at least one filtered data corresponding to the operating state that does not match successfully the preset state.
[0029] Understandably, entity attributes refer to attributes set by adopting a specified general format, such as primary key ID, operation status, creation time, modification time, etc. Operation status refers to the operation behavior on data, such as adding new data, modifying data, updating and deleting data, and unchanged data. The state matching result is used to characterize whether the preset state and the operation state match successfully. The state filtering rule refers to the rule for filtering out unnecessary entity data to be processed by the operation state. The preset state refers to the operation state set in advance to delete the corresponding data.
[0030] Specifically, after obtaining the entity data to be processed, the entity attributes corresponding to each entity data to be processed are obtained, that is, the entity data to be processed is parsed, so as to obtain the entity attributes corresponding to the entity data to be processed. Then, the operation state in the entity data is detected, that is, the location of the operation state in the entity attribute can be found through field query, so as to determine the operation state in the entity attribute corresponding to each entity data to be processed. Further, the state screening rule is obtained, and all the entity data to be processed are filtered by the state screening rule, that is, the preset state in the state screening rule is matched with the operation state of each entity data to be processed respectively, so as to detect whether the operation state is the same as the preset state, and the state matching result corresponding to each entity data to be processed can be obtained. When the state matching result indicates that the preset state and the operation state match successfully, the entity data to be processed corresponding to the operation state that matches the preset state successfully is deleted. When the state matching result indicates that the preset state and the operation state do not match successfully, the entity data to be processed corresponding to the operation state that does not match successfully the preset state is retained, and the retained entity data to be processed is determined as the filtered data.
[0031] That is, in this embodiment, the operation state is determined by obtaining the entity attributes corresponding to each entity data to be processed. The state matching result is obtained through the state screening rule, thereby filtering the data and obtaining the filtered data, ensuring that all data are changed data.
[0032] In one embodiment, if Figure 3 As shown, in the step S20, all the filtered data are sorted by the operation status in each entity attribute to obtain a data sorting result corresponding to each filtered data, including: S201, determining the operation status corresponding to each of the filtering data according to the entity attribute, and acquiring the status priority corresponding to each of the operation status.
[0033] S202, sorting the filtered data corresponding to each of the operation states according to the state priority to obtain a data sorting result corresponding to each of the filtered data.
[0034] It can be understood that the state priority refers to the priority level of each operation state, for example, the priority of newly added data is higher than the priority of modified data, and so on.
[0035] Specifically, after obtaining the filter data, the filter data are parsed to obtain the entity attributes corresponding to the filter data, and then the operation status corresponding to the filter data in the entity attributes is obtained through the field information. And the state priority corresponding to each operation state is determined by the preset priority rule, that is, the priority of all operation states is sorted according to the priority in the preset priority rule, so as to determine the state priority corresponding to each operation state. Further, the filter data corresponding to each operation state is sorted by the state priority, that is, the filter data is sorted according to the state priority according to the state priority of the operation state corresponding to the filter data, so as to obtain the data sorting result corresponding to each filter data. For example, if the state priority of the filter data with the newly added operation state is greater than the state priority of the filter data with the modified operation state, the newly added filter data is ranked before the modified filter data. Among them, when the state priority of the operation state of two or more filter data is the same, the filter data with the same state priority can be sorted by the creation time and modification time in the entity attribute to obtain the data sorting result.
[0036] That is, in this embodiment, the operation state of the filtered data is determined through entity attributes, and then the priority of each operation state is determined. All filtered data are sorted by state priority, and the data sorting results are obtained, ensuring the order of control operations, thereby preventing unique key conflicts.
[0037] In one embodiment, if Figure 4 As shown, in step S30, that is, according to the data sorting result, determining the operation state corresponding to each of the filtered data, and obtaining the data processing rules corresponding to each of the operation states, includes: S301 , determining an operation state corresponding to each of the filtering data according to the state priority corresponding to each of the filtering data in the data sorting result.
[0038] S302, matching the operation status with the rule status in a preset processing rule library to obtain a rule matching result.
[0039] S303: When the rule matching result indicates that the operation state and the rule state are matched successfully, obtain a data processing rule corresponding to the rule state that successfully matches the operation state.
[0040] Understandably, the rule matching result is used to characterize whether the operation status and the rule status match successfully. The rule status refers to the operation status corresponding to the data processing rule in the preset processing rule base. The preset processing rule base refers to the collection of various data processing methods, such as how to save the newly added filtering data.
[0041] Specifically, after obtaining the data sorting result, the operation state corresponding to each filter data is determined according to the state priority corresponding to each filter data in the data sorting result, that is, the operation state corresponding to each filter data is determined according to the position of the filter data in the data sorting result. Then, the preset processing rule library is obtained, and the operation state corresponding to each filter data is matched with the rule state in the preset processing rule library, so as to obtain the rule matching result corresponding to each operation state. When the rule matching result indicates that the operation state and a certain rule state are matched successfully, the processing rule corresponding to the rule state in the preset processing rule library is determined as the data processing rule corresponding to the operation state. Among them, there is at least one operation state in the data sorting result, so it is necessary to match at least once to obtain at least one data processing rule.
[0042] That is, in this embodiment, the operation status of the filtered data is determined by the status priority in the data sorting result, and the rule matching result is obtained by the rule status in the preset processing rule library, thereby realizing the determination of the data processing rule.
[0043] In one embodiment, if Figure 5 As shown, in the step S40, data processing is performed on all the filtered data corresponding to the operation state and data is saved by using the data processing rules corresponding to each operation state, and a data saving result is obtained, including: S401, when the operation state is a newly added state, determine that the data processing rule is a newly added data rule, and perform data processing and data preservation on all the filtered data corresponding to the operation state being the newly added state through the newly added data rule to obtain a newly added data preservation result.
[0044] S402, when the operation state is the modification state, determining that the data processing rule is a modification data rule, and performing data processing and data preservation on all the filtered data corresponding to the operation state being the modification state through the modification data rule to obtain a modification data preservation result.
[0045] S403, when the operation state is the update and delete state, when it is determined that the data processing rule is the update and delete data rule, all the filtered data corresponding to the operation state of the update and delete state are processed and saved through the update and delete data rule to obtain an updated data saving result.
[0046] Understandably, the newly added data saving result refers to the saving result of the data whose operation status is newly added. The modified data saving result refers to the saving result of the data whose operation status is modified. The updated data saving result refers to the saving result of the data whose operation status is updated and deleted.
[0047] Specifically, after obtaining the data processing rule, when the operation state is the new state, the data processing rule is the new data rule, and the new data rule is used to process and save all the filter data corresponding to the operation state of the new state, that is, according to the processing method of the new data rule, all the filter data of the operation state of the new state are updated, and then, the updated data is saved using the batch saving method of MyBatis-Plus for all the filter data of the operation state of the new state, so as to obtain the new data saving result. Then, when the operation state is the modified state, the data processing rule is the modified data rule, and the data corresponding to the operation state of the modified state is updated by modifying the data rule, and then, according to the saving method of the modified data rule, all the filter data of the operation state of the modified state are saved, so as to obtain the modified data saving result. Among them, if it is detected that the filter data of the operation state of the modified state is aggregate root data, the customized updateByWrapper method is used to lock and save, otherwise, the batch update method of MyBatis-Plus by ID is used to update and save. Furthermore, when the operation state is the update and delete state, the data processing rule is determined to be the update and delete data rule, and all the filter data corresponding to the operation state of the update and delete state are updated by the update and delete data rule, and then all the filter data are saved according to the saving method of the update and delete data rule, so as to obtain the update data saving result. Among them, if it is detected that the operation state is the modification state and the filter data is the aggregate root data, the custom updateByWrapper method is used to save it, otherwise, the MyBatis-Plus update and delete state method through the wrapper is used to save it.
[0048] That is, in this embodiment, through different data rules, the preservation of filtered data in different operation states is realized, and the acquisition of new data preservation results, modified data preservation results and updated data preservation results is realized, thereby realizing the ability of general warehouse to preserve data, solving the problems of repeated development, complex operations and concurrency, and thus improving development efficiency and the reliability of data operations.
[0049] In one embodiment, if Figure 6As shown, in the step S402, that is, through the modification data rule, data processing is performed on all the filtered data corresponding to the operation state being the modification state and data preservation is performed to obtain the modification data preservation result, and the modification data preservation result includes the aggregate root data preservation result and the batch update preservation result; including: S4021, detect whether all the filtered data corresponding to the operation state of the modification state is aggregate root data.
[0050] S4022: When the filtered data is aggregate root data, the custom method in the data modification rule is used to process all the aggregate root data and save the data to obtain the aggregate root data saving result.
[0051] S4023, when the filtered data is not aggregate root data, all the filtered data are batch updated and data saved through the batch update function in the data modification rule to obtain a batch update and save result.
[0052] Understandably, aggregate root data refers to a special entity in an aggregate, which is the entry point and the only access point of the aggregate, responsible for managing and coordinating entities and value objects within the aggregate. Aggregate root is used in domain-driven design to manage the boundaries and consistency of business objects when building complex software systems.
[0053] Specifically, detect whether all the filtered data with the modified operation status are aggregate root data, that is, detect whether the filtered data can access the entities and value objects inside the aggregate. When the filtered data can be accessed through the process data, determine that the filtered data is aggregate root data. In this way, determine all the aggregate root data in all the filtered data with the modified operation status. If it is aggregate root data, use the custom updateByWrapper method to process all aggregate root data and save the data, that is, check the business version number to lock the aggregate root through the checked business version number, and update the business version number, that is, use QueryWrapper to build query conditions to determine the business version number, and perform the business version number update operation to save the data after the update operation is performed, so as to obtain the aggregate root data saving result. Further, when the filtered data is not aggregate root data, batch update all filtered data by modifying the batch update function in the data rule, that is, use the updateBatchById method of MyBatis-Plus to batch update all filtered data, and save the updated data to the general warehouse, so as to obtain the batch update and save result.
[0054] That is, in this embodiment, the aggregate root data is screened, the aggregate root data is saved by a custom method, and the aggregate root data saving result is obtained. All filtered data are updated in batches through the batch update function, the filtered data is saved, and the batch update saving result is obtained, thereby reducing repeated development and improving development efficiency.
[0055] In one embodiment, if Figure 7 As shown, in the step S403, data processing is performed on all the filtered data corresponding to the operation state of the update and delete state according to the update and delete data rule, and data is saved to obtain the update data saving result, including: S4031, detect whether all the filtered data whose operation status is update and delete status are aggregate root data.
[0056] S4032, when it is detected that the filtered data is not aggregate root data, the update and delete status wrapper in the update and delete data rule is used to update the fields of all the filtered data corresponding to the operation status of the update and delete status and save the data to obtain the updated data saving result.
[0057] Understandably, the update delete status wrapper refers to a custom updateDeleteStatusByWrapper method that is used to update the logical deletion field. Updating the delete status refers to the operation of marking a record as deleted by changing the value of the delete status field in the record in database management.
[0058] Specifically, after determining that the data processing rule is a data modification rule, detect whether all filtered data with an operation status of update and delete is aggregate root data, that is, detect whether each filtered data can access the entities and value objects inside the aggregate. When it cannot be accessed through the filtered data, it is detected that the filtered data is not aggregate root data. By updating the delete status wrapper, the fields of all filtered data corresponding to the operation status of update and delete are updated and data is saved, that is, the logical deletion field is updated through the custom updateDeleteStatusByWrapper method, that is, UpdateWrapper is used to construct update conditions and set new deletion status, and the updated data is saved in the general warehouse, thereby obtaining the updated data saving result.
[0059] In another embodiment, when the process data can be accessed, it is determined that the filtered data with the detection and operation status of update and deletion is the aggregate root data, and a custom updateByWrapper method is used to process all aggregate root data and perform data preservation, that is, check the business version number, lock the aggregate root through the checked business version number, and update the business version number, that is, use QueryWrapper to construct the query conditions to determine the business version number, and perform the business version number update operation, so as to obtain the aggregate root data preservation result.
[0060] That is, in this embodiment, through the customized update and delete status wrapper, the field update of all filtered data corresponding to the operation status of the update and delete status is realized, thereby realizing the preservation of all filtered data, and then realizing the acquisition of the saved results of the updated data, reducing repeated development and improving development efficiency.
[0061] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0062] In one embodiment, a storage data storage device is provided, and the storage data storage device corresponds to the storage data storage method in the above embodiment. Figure 8 As shown, the storage data storage device includes a file data filtering module 10, a data sorting module 20, a processing rule module 30 and a data storage module 40. The functional modules are described in detail as follows: The data filtering module 10 is used to obtain at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one filtered data corresponds to one entity attribute; A data sorting module 20, used to sort all the filtered data according to the operation status in each of the entity attributes, and obtain a data sorting result corresponding to each of the filtered data; A processing rule module 30, for determining the operation status corresponding to each of the filtered data according to the data sorting result, and obtaining the data processing rule corresponding to each of the operation status; The data saving module 40 is used to perform data processing and data saving on all the filtering data corresponding to the operation state according to the data processing rules corresponding to each operation state, so as to obtain a data saving result.
[0063] Optionally, the data filtering module 10 includes: An entity attribute unit, used to obtain entity attributes corresponding to each of the entity data to be processed, and determine an operation state in the entity attributes corresponding to each of the entity data to be processed; A state matching result unit, used for acquiring a state screening rule, matching a preset state in the state screening rule with an operation state corresponding to each of the entity data to be processed, and obtaining a state matching result corresponding to each of the entity data to be processed; The filtering data unit is used to delete the to-be-processed entity data corresponding to the operating state that successfully matches the preset state when the state matching result indicates that the preset state and the operating state successfully match, and obtain at least one filtering data corresponding to the operating state that does not successfully match the preset state.
[0064] Optionally, the data sorting module 20 includes: An operation status unit, used to determine the operation status corresponding to each of the filtering data according to the entity attribute, and obtain the status priority corresponding to each of the operation status; The data sorting unit is used to sort the filtering data corresponding to each of the operating states according to the state priority to obtain a data sorting result corresponding to each of the filtering data.
[0065] Optionally, the processing rule module 30 includes: A state priority unit, used to determine the operation state corresponding to each of the filtering data according to the state priority corresponding to each of the filtering data in the data sorting result; A rule matching result unit, used for matching the operation state with the rule state in the preset processing rule library to obtain a rule matching result; The data processing rule unit is used to obtain the data processing rule corresponding to the rule state that successfully matches the operation state when the rule matching result indicates that the operation state and the rule state successfully match.
[0066] Optionally, the data storage module 40 includes: A newly added data rule unit is used to determine that the data processing rule is a newly added data rule when the operation state is a newly added state, and perform data processing and data preservation on all the filtered data corresponding to the operation state being the newly added state through the newly added data rule to obtain a newly added data preservation result; A data modification rule unit, configured to determine, when the operation state is the modification state, that the data processing rule is a data modification rule, and to perform data processing and data preservation on all the filtered data corresponding to the operation state being the modification state through the data modification rule, to obtain a modified data preservation result; An update and delete data rule unit is used to determine that the data processing rule is an update and delete data rule when the operation state is the update and delete state, and to perform data processing and data preservation on all the filtered data corresponding to the operation state being the update and delete state through the update and delete data rule to obtain an updated data preservation result.
[0067] Optionally, the data modification rule unit, the modified data saving result includes the aggregate root data saving result and the batch update saving result; including: Modify the aggregate root detection subunit, used to detect whether all the filtered data corresponding to the operation state being the modification state is the aggregate root data; A batch saving subunit is used for, when the filtered data is aggregate root data, using the custom method in the data modification rule to perform data processing and data saving on all the aggregate root data to obtain the aggregate root data saving result; The batch update subunit is used to batch update all the filtered data and save the data through the batch update function in the data modification rule when the filtered data is not aggregate root data, so as to obtain a batch update saving result.
[0068] Optionally, the updating and deleting data rule unit includes: An update aggregate root detection subunit is used to detect whether all the filtered data whose operation status is update and delete status is aggregate root data; The field update subunit is used to update the fields of all the filtered data corresponding to the update and delete state of the operation through the update and delete state wrapper in the update and delete data rule when it is detected that the filtered data is not the aggregate root data, and to perform data preservation to obtain the updated data preservation result.
[0069] This application further provides Fig. 9 A computer device is shown, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the warehouse data preservation method.
[0070] For the specific definition of computer equipment, processors and their various units and modules, please refer to the definition of the warehouse data preservation method above, which will not be repeated here. Each module in the above-mentioned processor can be implemented in whole or in part by software, hardware and a combination thereof. It can be understood that the processor includes a processor, a memory, a network interface and a database connected by a device bus. Each module of the processor can be embedded in or independent of the processor in hardware form, or can be stored in the memory in software form, so that the processor can call and execute the operations corresponding to the above modules. Among them, the processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device, a computer program and a database. The internal memory provides an environment for the operation of the operating device and the computer program in the non-volatile storage medium. The database is used to store the data used by the warehouse data preservation method in the above-mentioned embodiment. The network interface is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a warehouse data preservation method is implemented.
[0071] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned warehouse data preservation method when executed by a processor.
[0072] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0073] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0074] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for storing warehouse data, characterized in that: include: Acquire at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one entity attribute corresponding to one filtered data; Sorting all the filtered data according to the operation status in each of the entity attributes to obtain a data sorting result corresponding to each of the filtered data; Determine the operation status corresponding to each of the filtered data according to the data sorting result, and obtain the data processing rule corresponding to each of the operation status; Data processing is performed on all the filtered data corresponding to the operation status according to the data processing rules corresponding to each operation status, and data preservation is performed to obtain a data preservation result.
2. The warehouse data storage method according to claim 1, characterized in that: The filtering process of all the entity data to be processed to obtain at least one filtered data includes: Acquire entity attributes corresponding to each of the entity data to be processed, and determine the operation status in the entity attributes corresponding to each of the entity data to be processed; Acquire a status screening rule, match a preset status in the status screening rule with an operation status corresponding to each of the entity data to be processed, and obtain a status matching result corresponding to each of the entity data to be processed; When the state matching result indicates that the preset state and the operating state match successfully, the entity data to be processed corresponding to the operating state that matches the preset state successfully is deleted, and at least one filtering data corresponding to the operating state that does not match the preset state successfully is obtained.
3. The warehouse data storage method according to claim 1, characterized in that: The step of sorting all the filtered data by the operation status in each of the entity attributes to obtain a data sorting result corresponding to each of the filtered data includes: Determine the operation state corresponding to each of the filtering data according to the entity attributes, and obtain the state priority corresponding to each of the operation states; The filtering data corresponding to each of the operating states are sorted according to the state priority to obtain a data sorting result corresponding to each of the filtering data.
4. The warehouse data storage method according to claim 1, characterized in that: Determining the operation status corresponding to each of the filtered data according to the data sorting result, and obtaining the data processing rule corresponding to each of the operation status, includes: Determining the operation state corresponding to each of the filtering data according to the state priority corresponding to each of the filtering data in the data sorting result; Matching the operation status with the rule status in a preset processing rule library to obtain a rule matching result; When the rule matching result indicates that the operation state and the rule state are matched successfully, a data processing rule corresponding to the rule state that successfully matches the operation state is obtained.
5. The warehouse data storage method according to claim 1, characterized in that: The step of performing data processing on all the filtered data corresponding to the operation states and saving the data by using the data processing rules corresponding to each operation state to obtain the data saving result includes: When the operation state is a newly added state, determining that the data processing rule is a newly added data rule, and performing data processing and data preservation on all the filtered data corresponding to the operation state being the newly added state by using the newly added data rule, to obtain a newly added data preservation result; When the operation state is the modification state, determining that the data processing rule is a modification data rule, and performing data processing and data saving on all the filtered data corresponding to the operation state being the modification state according to the modification data rule, to obtain a modification data saving result; When the operation state is the update and delete state, it is determined that the data processing rule is the update and delete data rule, and all the filtered data corresponding to the operation state being the update and delete state are processed and saved through the update and delete data rule to obtain an updated data saving result.
6. The warehouse data storage method according to claim 5, characterized in that: The modified data saving result includes the aggregate root data saving result and the batch update saving result; The step of performing data processing and data saving on all the filtered data corresponding to the operation state being the modification state by the modification data rule to obtain the modification data saving result includes: Detect whether all the filtered data corresponding to the operation state being a modification state is aggregate root data; When the filtered data is aggregate root data, the user-defined method in the data modification rule is used to process all the aggregate root data and save the data to obtain an aggregate root data saving result; When the filtered data is not aggregate root data, all the filtered data are batch updated and data saved through the batch update function in the data modification rule to obtain a batch update and save result.
7. The warehouse data storage method according to claim 5, characterized in that: The step of performing data processing and data saving on all the filtered data corresponding to the operation state being the update and delete state by the update and delete data rule to obtain an update data saving result includes: Detect whether all the filtered data whose operation status is update and delete status is aggregate root data; When it is detected that the filtered data is not aggregate root data, the update and delete state wrapper in the update and delete data rule is used to update the fields of all the filtered data corresponding to the operation state of the update and delete state and save the data to obtain the updated data saving result.
8. A storage data storage device, characterized in that: include: A data filtering module, used to obtain at least one piece of entity data to be processed in the entity list, and filter all the entity data to be processed to obtain at least one filtered data; one filtered data corresponds to one entity attribute; A data sorting module, used to sort all the filtered data according to the operation status in each of the entity attributes, and obtain a data sorting result corresponding to each of the filtered data; A processing rule module, used to determine the operation status corresponding to each of the filtered data according to the data sorting result, and obtain the data processing rule corresponding to each of the operation status; The data saving module is used to perform data processing and data saving on all the filtered data corresponding to the operation status according to the data processing rules corresponding to each operation status, so as to obtain a data saving result.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is used to execute the warehouse data preservation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the warehouse data storage method according to any one of claims 1 to 7 is implemented.