Search

CN-121996280-A - Incremental change method and system based on version number

CN121996280ACN 121996280 ACN121996280 ACN 121996280ACN-121996280-A

Abstract

The invention discloses a version number-based incremental change method and a version number-based incremental change system, wherein the method comprises the following steps: three types of identification fields, namely version, state and deletion, are configured for the service data, and the value rule and service mapping relation of each field are defined, so that the unified identification of the data version attribute, the effective state and the deletion state is realized. And receiving a data change request, identifying a change type and target data, and executing operation only on the changed data, wherein the unchanged data retains original information. And synchronously updating three fields during changing, copying target data to generate a new data retention history state, and not modifying the core content of the original version. And a traceable storage mode is adopted to store the data of each iteration version and the field information, key operation information is recorded, unchanged data is not repeatedly stored, and full life cycle traceability of the data is realized. And receiving a version inquiry request, screening according to screening rules and returning a complete and valid data set of the target version. The accuracy requirement of business iteration on data management is met.

Inventors

  • HU JIANZHENG
  • Yuan Zhanquan
  • LU JIAXIN
  • XU JIANAN
  • LUO GUANGLEI
  • WU ENLONG
  • WANG LIANG
  • LIU QIAN

Assignees

  • 中国葛洲坝集团股份有限公司

Dates

Publication Date
20260508
Application Date
20251223

Claims (10)

  1. 1. An incremental change method based on version numbers is characterized by comprising the following steps: s1, configuring a version identification field, a state identification field and a deletion identification field for service data, defining a value rule and a service mapping relation of each field, and completing unified identification of the version attribute, the effective state and the deletion state of the service data through the three fields; s2, receiving a data change request, identifying a change type and target data, and executing corresponding change operation on the changed target data only, wherein unchanged data keep original field information unchanged; synchronously updating a version identification field, a state identification field and a deletion identification field corresponding to target data in the changing process, and keeping the state of historical data in a mode of copying the target data to generate new data without directly modifying the core content of the original version data; s3, storing the business data of each iteration version and the corresponding field information by adopting a storage mode with a tracing function, synchronously recording key operation information in the data changing process, completing tracing management of the whole life cycle of the business data, and not repeatedly storing unchanged data; s4, when the target version query request is received, screening the stored business data according to a preset screening rule, screening to obtain a complete effective data set corresponding to the target version, and returning.
  2. 2. The incremental change method according to claim 1, wherein the version identification field in S1 is used for distinguishing the iterative version to which the data belongs, the state identification field is used for identifying the validity of the data in the corresponding version, and the deletion identification field is used for identifying the deletion state of the data.
  3. 3. The incremental change method according to claim 2, wherein the version identification field is a positive integer, the version identification field value of the initial version is set to 1, and the version identification field value of each subsequent iteration version is sequentially incremented; The value of the state identification field is 0 or 1, the value of 1 indicates that the data is valid in the corresponding version and history tracing, and the value of 0 indicates that the data is invalid in the corresponding version; The value of the deletion identification field is 0 or 1, the value of 1 indicates that the data is marked for deletion, and the value of 0 indicates that the data is not deleted.
  4. 4. The incremental change method of claim 1 wherein the change operation in S2 comprises data modification, deletion, and recovery, wherein: When the data is modified, the target data is copied, new data is generated, the version identification field of the new data is updated to the next version number, the state identification field is set to 1, and the deletion identification field is set to 0; If the deleting state is required to be marked at the current version, copying the target data and updating the version identification field of the new data to the current version number, wherein the deleting identification field is set to be 1; When the data is recovered, the target data in the inactive state in the copy history version, namely, the state identification field is 0, generates new data and updates the version identification field of the new data to the current version number, the state identification field is set to be 1, and the deletion identification field is set to be 0.
  5. 5. The incremental changing method according to claim 1, wherein the step of storing the service data and the corresponding field information of each iteration version in S3 is as follows: Let the stored data set be , Any data item is , Unique identification for data, for distinguishing different service data, data item The corresponding version identification field takes the value as The state identification field takes on the value of The deletion identification field takes the value of The key operation information set in the data changing process is as follows , Any operation information is , For operation unique identification, for distinguishing different change operations, the mapping relation of the target data identification is that ; Wherein, the Characterizing data items as positive integers The iteration version is provided with an initial value of 1 and the subsequent iteration is sequentially increased; characterization data item with value of 0 or 1,1 Effective in corresponding version and history trace, 0 characterizes the data item Failure in the corresponding version; characterization data item with value of 0 or 1,1 Marked deleted, 0 characterizes the data item Not deleted; Including operation type, destination data identification, version change information and operation time related data, For association of And (3) with , Representation of Target data identification of (2) A kind of electronic device Consistent; The storage relationship satisfies And is also provided with That is, only the business data items of each iteration version and the related change operation information which accord with the field value rule are stored, and the business data items which are unchanged are not repeatedly incorporated By mapping relation The association of the operation information with the data item is achieved.
  6. 6. The incremental change method according to claim 1, wherein the key operation information in S3 at least includes an operation type, a target data identifier, version change information, and operation time related data.
  7. 7. The incremental change method based on version numbers according to claim 1, wherein the screening rule in S4 is constructed based on a deletion identification field, a version identification field and a status identification field, and the specific construction process is as follows: Set the target version number The version identification field of the data to be screened takes the value as The state identification field takes on the value of The deletion identification field takes the value of The target version of the active data set is The data validity determination function is ; Wherein, the An iteration version number specified by the corresponding query request for positive integers; the method is characterized in that the iteration version of the data is represented by a positive integer, the initial value is 1, and the subsequent iterations are sequentially increased; The value is 0 or 1,1 represents that the data is effective in the corresponding version and history tracing, and 0 represents that the data is invalid in the corresponding version; The value is 0 or 1,1 represents data is marked and deleted, and 0 represents data is not deleted; the binary judgment function is used for indicating that the data meets the effective requirement of the target version when the value is 1, and indicating that the data does not meet when the value is 0; The screening rule builds a mutually exclusive complement principle based on logic operation, and the decision logic is defined by the following formula: , namely, only when the value of the deletion identification field of the data is 0 and the value of the version identification field is equal to the target version number Or the value of the version identification field is smaller than the target version number And when the value of the state identification field is 1, the data is judged to be the complete valid data of the target version, and is incorporated into the data set of the target version, and finally the data set is passed through And constructing a screening rule.
  8. 8. The incremental change method according to claim 1, wherein the complete valid data set in S4 includes the undeleted data of the new version of the target and the undeleted and still valid data of the historical version.
  9. 9. An incremental change system based on version numbers, comprising: The multi-dimension identification field configuration unit is used for configuring version identification fields, state identification fields and deletion identification fields for service data, defining the value rule and service mapping relation of each field, and completing unified identification of the version attribute, the effective state and the deletion state of the service data through the three types of fields; The incremental change and history retaining unit is used for receiving a data change request, identifying a change type and target data, and executing corresponding change operation on the changed target data only, wherein unchanged data keeps original field information unchanged; The traceability storage and redundancy optimization unit is used for storing the business data of each iteration version and the corresponding field information by adopting a storage mode with traceability, synchronously recording key operation information in the data changing process, completing traceability management of the whole life cycle of the business data, and not repeatedly storing unchanged data; And the target version data set screening unit is used for screening the stored business data according to a preset screening rule when receiving the target version query request, screening to obtain a complete effective data set corresponding to the target version and returning.
  10. 10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program is executed by a processor for a version number based incremental change method according to any of claims 1-8.

Description

Incremental change method and system based on version number Technical Field The invention belongs to the technical field of business data management and version control, and particularly relates to an incremental change method and system based on version numbers. Background In the field of business data management, as business scale is enlarged and iteration speed is increased, data change frequency is continuously increased, and requirements on data version management, change tracing and storage efficiency are more stringent. In the current mainstream data change management mode, a full-volume update mode is partially adopted, that is, when data is changed each time, the whole data set is restored, and no distinction processing is performed on changed data and unchanged data. In this mode, even if only a single data item is changed, storage resources equivalent to the whole amount of data are occupied, so that the storage redundancy is greatly increased, and meanwhile, the whole amount of processing consumes a large amount of computation resources, so that the data change processing efficiency is reduced, and the high-frequency business iteration requirement is difficult to adapt. In addition, although incremental processing is attempted in some management methods, a standardized version and state identification mechanism is lacking, and the validity and deletion state of data in different iteration versions cannot be accurately identified only by simply recording update time or modifying logs to distinguish the data versions. When the historical version data is traced or the effective data of a specific version is queried, a great amount of log information is screened and checked one by one, so that the query efficiency is low, the screening result is easy to miss or error due to fuzzy identification, and a complete target version effective data set cannot be quickly acquired. Meanwhile, most of change management schemes in the prior art do not establish a perfect historical data retention mechanism, change is realized in a way of directly covering original data, historical version data is lost, a data change track cannot be traced, and when a service has a problem and needs to roll back to a historical version or check change reasons, reliable data basis is lacking. And a few schemes for retaining historical data are difficult to accurately match operation details corresponding to data change in the tracing process because no associated mapping of the data and the operation information is established, so that the problem positioning difficulty is increased. These problems together lead to insufficient accuracy, efficiency and traceability of service data management, which restricts the improvement of service iteration efficiency and problem processing capacity, and an efficient versioned incremental change management technology is needed to solve the above pain points. Disclosure of Invention The invention aims to solve the problems of redundancy storage, difficult version tracing and easy loss of historical data in service data change, and realizes standardized management of data versions by configuring three types of identification fields, executing increment change operation and adopting traceable storage and accurate screening rules, thereby improving the change processing efficiency, ensuring the traceability of the whole life cycle of the data and meeting the accuracy requirement of service iteration on data management. In response to the above-mentioned drawbacks or improvements of the prior art, the present invention provides a version number-based incremental change method, comprising: s1, configuring a version identification field, a state identification field and a deletion identification field for service data, defining a value rule and a service mapping relation of each field, and completing unified identification of the version attribute, the effective state and the deletion state of the service data through the three fields; s2, receiving a data change request, identifying a change type and target data, and executing corresponding change operation on the changed target data only, wherein unchanged data keep original field information unchanged; synchronously updating a version identification field, a state identification field and a deletion identification field corresponding to target data in the changing process, and keeping the state of historical data in a mode of copying the target data to generate new data without directly modifying the core content of the original version data; s3, storing the business data of each iteration version and the corresponding field information by adopting a storage mode with a tracing function, synchronously recording key operation information in the data changing process, completing tracing management of the whole life cycle of the business data, and not repeatedly storing unchanged data; s4, when the target version query request is received, screening