A version control method and system based on version number association dynamic configuration

By using a version number-based dynamic configuration method in a relational database, the problems of high learning costs and poor security of existing version control systems in relational databases are solved, achieving efficient multi-version storage of business data and reducing development and maintenance costs.

CN115576597BActive Publication Date: 2026-06-09CHINA CONSTRUCTION BANK

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-09-27
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing version control systems such as Git have high learning costs and poor security when applied to relational databases. They cannot meet the simple needs of storing multiple versions of business data and have high development and maintenance costs.

Method used

A version number-based dynamic configuration method is adopted, using an integer field as the version number to record changes in the version number of business data in a relational database. Multiple version records are achieved by increasing the version number value, thus avoiding the need to encapsulate a complex version control system.

Benefits of technology

It reduces learning and maintenance costs, improves performance, enables efficient multi-version storage of business data, and simplifies version control management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576597B_ABST
    Figure CN115576597B_ABST
Patent Text Reader

Abstract

The application relates to a version control method and system based on version number association dynamic configuration, first version identification and second version identification are added to update records to judge the version change relationship between the update records and existing related records, thereby realizing dynamic version number linkage control, and based on a relational database, multi-version storage of business data is realized, an integer type field is added as a version number, the version number value is changed every time business data is newly added or updated to realize multi-version records, and the cost caused by encapsulating a version control system is avoided, and the learning cost and development and maintenance cost are far lower than encapsulating a powerful version control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of application services and data processing technology, and in particular to a version control method and system based on dynamic configuration of version number association. Background Technology

[0002] During data usage, data content is often modified in real time according to needs, resulting in multiple different versions of data content belonging to the same data project. Therefore, corresponding solutions are needed to manage these different versions of data content. A version control system is a tool used to record changes to the content of one or more files, allowing for future retrieval and viewing of specific version revisions as needed. Version control systems can revert selected files to their previous state, compare details of file changes, reconstruct the specific factors that caused the differences between different versions of data content, and identify the personnel involved in the changes.

[0003] There are several version control systems available, such as Git, SVN, and CVS, with Git being the most popular. Git is an open-source distributed version control system developed based on the Linux kernel. Because Git uses a distributed repository approach, it does not require server-side software support, giving it a distributed, offline, and fast characteristic compared to other version control systems.

[0004] However, when using existing version control systems for reagent applications, numerous problems often arise due to differences in specific application scenarios. This is especially true for distributed version control systems like Git, whose internal processing logic and working mechanisms are not conventional, resulting in extremely high learning costs and long learning cycles. Furthermore, due to its open-source design, Git does not impose any access restrictions on browsing and modifying the repository, leading to poor code confidentiality and the potential security risk of exposing all data content through a fully cloned repository.

[0005] In reality, for routine and simple business needs, such as recording historical version values ​​of business data, no additional powerful features or optimization support are required to meet the needs. Therefore, there is no necessity to use a multi-functional version control system. Currently, many web applications use relational databases to store their business data. From both the perspective of actual needs and the practicality of application operation and maintenance management, there is a need for a solution that differs from existing version control systems, providing the necessary version control functions for multi-version storage of business data under relational databases, reducing the learning cost and development and maintenance cost of version control management. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention proposes a version control method and system based on dynamic configuration of version number association. It implements multi-version storage of business data based on a relational database. By adding an integer type field as the version number, the version number value is changed each time business data is added or updated to achieve multi-version recording. This avoids the huge costs associated with encapsulating a version control system. Both the learning cost and the development and maintenance cost are far lower than encapsulating a powerful version control system.

[0007] To achieve the above objectives, the technical solution adopted by the present invention includes:

[0008] A version control method based on dynamic configuration with version number association, characterized in that it includes:

[0009] S1. Obtain update records and add a first version identifier and a second version identifier to the update records; the first version identifier includes the fixed update date and update information of the corresponding update record; the second version identifier includes the version number, which is preset to a default value;

[0010] S2. Search the database based on the name of the updated record to determine if there is a related record already saved in the database. If there is no related record already saved in the database, save the updated record directly into the database.

[0011] S3. When it is determined that there are related records already saved in the database, further determine whether there is a first record with a version number of the default value among the related records. If it is determined that there is no first record, save the updated record directly into the database.

[0012] S4. When it is determined that a first record exists, modify and lock the version number of the first record according to the first preset rule, and then save the updated record directly into the database.

[0013] S5. After the update record is saved into the database, the first version identifier of the update record is used as the matching identifier to determine whether there is a second record in the relevant records whose first version identifier and matching identifier conflict with a preset. When it is determined that there is no second record, the version number corresponding to the update record is retained as the default value, and the update record is included in the scope of relevant records.

[0014] S6. When it is determined that a second record exists, modify and lock the version number of the update record according to the second preset rule, and then include the update record in the relevant record range.

[0015] Furthermore, step S4 also includes:

[0016] When it is determined that a first record exists, it is further determined whether there is a preset conflict between the first version identifier of the first record and the first version identifier of the update record. When it is determined that there is no preset conflict, the version number of the first record is modified and locked according to the first preset rule, and the update record is directly saved into the database.

[0017] When a preset conflict is detected, the version number corresponding to the first record is retained as the default value, and the version number of the updated record is modified and locked according to the second preset rule before being saved into the database.

[0018] Furthermore, the first preset rule includes:

[0019] Retrieve all second-version identifiers corresponding to the relevant records;

[0020] Identify the maximum value of the locked version number in the current second version identifier;

[0021] The preset version number step value is increased based on the maximum value of the locked version number in the current second version identifier, and the new version number is used to replace the original default value.

[0022] Furthermore, the preset conflict includes a mismatch between the fixed update date and / or a mismatch between update information, wherein the mismatch between update information includes a mismatch between the user who recorded the operation.

[0023] Furthermore, the second preset rule includes:

[0024] The new version number replaces the original default value with the indicator code set according to the preset conflict type.

[0025] Furthermore, the version number is an integer; the default value is 0; and the step value is 1.

[0026] This invention also relates to a version control system based on version number association and dynamic configuration, characterized in that it includes:

[0027] The update record preprocessing module is used to add a first version identifier and a second version identifier to the update record;

[0028] The database retrieval module is used to search the database based on the name of the updated record and determine whether there is a related record already stored in the database;

[0029] The first judgment module is used to determine whether there is a first record with a version number of the default value in the relevant records;

[0030] The second judgment module is used to determine whether there is a second record in the relevant records where the first version identifier and the matching identifier have a preset conflict;

[0031] The version number management module is used to modify the corresponding version number of the record;

[0032] The data storage module is used to update and save data records.

[0033] The present invention also relates to a computer-readable storage medium, characterized in that the storage medium stores a computer program, which, when executed by a processor, implements the above-described method.

[0034] The present invention also relates to an electronic device, characterized in that it includes a processor and a memory;

[0035] The memory is used to store the first version identifier and the second version identifier;

[0036] The processor is configured to execute the above method by invoking a first version identifier and a second version identifier.

[0037] The present invention also relates to a computer program product, including a computer program and / or instructions, characterized in that the computer program and / or instructions, when executed by a processor, implement the steps of the above-described method.

[0038] The beneficial effects of this invention are as follows:

[0039] The version control method and system based on version number association and dynamic configuration described in this invention realizes multi-version storage of business data based on relational database. By adding an integer type field as the version number, the version number value is changed every time business data is added or updated to realize multi-version records. This avoids the huge cost of encapsulating a version control system. Compared with encapsulating a version control system, it has lower cost, higher performance, and better maintainability. Whether from the perspective of learning cost or development and maintenance cost, it is far lower than encapsulating a powerful version control system. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the version control method based on version number association and dynamic configuration according to the present invention.

[0041] Figure 2 This is a schematic diagram of the version control system structure based on version number association and dynamic configuration according to the present invention. Detailed Implementation

[0042] To better understand the content of this invention, it will be described in detail with reference to the accompanying drawings and embodiments.

[0043] The first aspect of this invention relates to a process flow as follows: Figure 1 The version control method shown, which is based on version number association and dynamic configuration, includes:

[0044] S1. Obtain update records and add a first version identifier and a second version identifier to the update records; the first version identifier includes the fixed update date and update information of the corresponding update record; the second version identifier includes the version number, which is preset to a default value.

[0045] The version number is an independently established marker used to indicate the version change relationship between records. It is preferable to use an integer number to simplify the method execution process. Meanwhile, the default value actually represents the latest version record or the version record currently being processed, and is preferably 0 (or any specific non-reusable value). For version iterations, positive integers can be used for recording; the larger the version number, the newer the corresponding record version.

[0046] S2. Search the database based on the name of the updated record to determine if there is a related record already saved in the database. If there is no related record already saved in the database, save the updated record directly into the database.

[0047] In such cases, it is usually the earliest record version in a set of records. At this time, the record can be stored directly and used as the relevant record for subsequent updated versions.

[0048] S3. When it is determined that there is a relevant record already saved in the database, further determine whether there is a first record with a version number of the default value among the relevant records. If it is determined that there is no first record, save the updated record directly into the database.

[0049] If a relevant record already exists in the database, the first step is to determine its status. Typically, the relevant record will contain a newer version record preceding the updated record, with its version number retained as the default value. However, in some special data processing scenarios, there might be cases where the relevant record does not contain a version number with the default value, such as when the version number is specified to be modified. In this case, the updated record can be directly used as the latest version, retaining the default version number.

[0050] S4. When it is determined that a first record exists, modify and lock the version number of the first record according to the first preset rule, and then save the updated record directly into the database.

[0051] In particular, when a first record exists, it is preferable to use the first version identifier to first determine the update record attributes and identify its version update attributes. Specifically, when it is determined that a first record exists, it is further determined whether there is a preset conflict between the first version identifier of the first record and the first version identifier of the update record. If no preset conflict is determined, the version number of the first record is modified and locked according to the first preset rule, and the update record is directly saved into the database. If a preset conflict is determined, the version number corresponding to the first record is retained as the default value, and the version number of the update record is modified and locked according to the second preset rule before being saved into the database.

[0052] Through the above operations, it can be ensured that the update record is correctly recorded, the data content is updated according to the update record, and the original related records will not become unusable due to the addition of the update record. Instead, the version number will be automatically and dynamically adjusted according to the first preset rule based on the version identification after the update record is added, so as to ensure that the relationship between different version records is clear and knowable.

[0053] Preferably, the first preset rule may include: obtaining all second version identifiers corresponding to the relevant records; identifying the maximum value of the locked version number in the current second version identifier; and adding a preset version number step value (e.g., directly adding 1 to the version number of the new version) to replace the original default value as the new version number.

[0054] The first preset rule is a method for handling version numbers between records, based on a clear version relationship between update records and related records. In practice, users can use any applicable method to represent the version number change relationship between update records and related records. This embodiment uses one possible method to illustrate the implementation of the first preset rule, but it is not a complete limitation on the version number change rule.

[0055] S5. After the update record is saved into the database, the first version identifier of the update record is used as the matching identifier to determine whether there is a second record in the relevant records whose first version identifier and matching identifier conflict with a preset value. When it is determined that there is no second record, the version number corresponding to the update record is retained as the default value, and the update record is included in the scope of relevant records.

[0056] Among them, the preset conflict is a method for verifying the consistency and rationality of records between different versions, and the preferred method is to verify using the first version identifier. Since the first version identifier does not change after being added to the corresponding record, it can be used to represent the inherent attributes of the corresponding record for verification, matching and other operations.

[0057] Preferably, the preset conflicts can include mismatches in fixed update dates and / or update information, particularly mismatches in update information that may include mismatches in the user who performed the update operation. A fixed update date corresponds to a specific update time point for a record, which can be the start time, end time, or upload time of that version of the record. Since each record's fixed update date is unique, when different records contain the same fixed update date, or when an update record's fixed update date is earlier than a related record, it can be considered that the current version update contains some unreasonable or potential error. Therefore, a special version number can be used to prompt the user. Similarly, for update information, such as the user who performed the update operation, if the judgment result differs from the expected situation, it can be considered that there are some questions about the update record, and the user needs to be specifically prompted.

[0058] S6. When it is determined that a second record exists, modify and lock the version number of the update record according to the second preset rule, and then include the update record in the relevant record range.

[0059] Unlike the first preset rule, the second preset rule is not intended to satisfy the version change relationship between update records and related records, but rather to provide necessary prompts for potential problems with update records. Preferably, the second preset rule can replace the original default value with a new version number based on an indicator code set according to the preset conflict type, thereby achieving specific labeling of update records.

[0060] Another aspect of this invention relates to a version control system based on version number association and dynamic configuration, the structure of which is as follows: Figure 2 As shown, it includes:

[0061] The update record preprocessing module is used to add a first version identifier and a second version identifier to the update record;

[0062] The database retrieval module is used to search the database based on the name of the updated record and determine whether there is a related record already stored in the database;

[0063] The first judgment module is used to determine whether there is a first record with a version number of the default value in the relevant records;

[0064] The second judgment module is used to determine whether there is a second record in the relevant records where the first version identifier and the matching identifier have a preset conflict;

[0065] The version number management module is used to modify the corresponding version number of the record;

[0066] The data storage module is used to update and save data records.

[0067] By using this system, the aforementioned computational processing methods can be executed and the corresponding technical effects can be achieved.

[0068] Embodiments of the present invention also provide a computer-readable storage medium capable of implementing all the steps of the methods in the above embodiments, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements all the steps of the methods in the above embodiments.

[0069] Embodiments of the present invention also provide an electronic device for performing the above-described method. As an implementation device for the method, the electronic device includes at least a processor and a memory. In particular, the memory stores data and related computer programs required for performing the method, such as a first version identifier and a second version identifier. The processor calls the data and programs in the memory to execute all the steps of the method and obtain the corresponding technical effect.

[0070] Preferably, the electronic device may include a bus architecture, which may include any number of interconnected buses and bridges. The bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same element, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor during operation.

[0071] Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operating control) used may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a buffer, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices, which can store the aforementioned data information, and may also store programs for executing the information, and the processor can execute the program stored in the memory to achieve information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it can be a button or touch input device; the power supply is used to provide power to the electronic device; the display is used to display images and text, for example, it can be an LCD display. The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which can be the same as in conventional mobile communication terminals. Based on different communication technologies, multiple communication modules can be incorporated into the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor can include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor is coupled to a central processing unit, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.

[0072] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0073] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0074] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0075] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0076] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A version control method based on dynamic configuration with version number association, characterized in that, include: S1. Obtain update records and add a first version identifier and a second version identifier to the update records; the first version identifier includes the fixed update date and update information of the corresponding update record; the second version identifier includes the version number, which is preset to a default value; S2. Search the database based on the name of the updated record to determine if there is a related record already saved in the database. If there is no related record already saved in the database, save the updated record directly into the database. S3. When it is determined that there are related records already saved in the database, further determine whether there is a first record with a version number of the default value among the related records. If it is determined that there is no first record, save the updated record directly into the database. S4. When it is determined that a first record exists, modify and lock the version number of the first record according to the first preset rule, and then save the updated record directly into the database. S5. After the update record is saved into the database, the first version identifier of the update record is used as the matching identifier to determine whether there is a second record in the relevant records whose first version identifier and matching identifier conflict with a preset. When it is determined that there is no second record, the version number corresponding to the update record is retained as the default value, and the update record is included in the scope of relevant records. S6. When it is determined that a second record exists, modify and lock the version number of the update record according to the second preset rule, and then include the update record in the relevant record range.

2. The method as described in claim 1, characterized in that, Step S4 further includes: When it is determined that a first record exists, it is further determined whether there is a preset conflict between the first version identifier of the first record and the first version identifier of the update record. When it is determined that there is no preset conflict, the version number of the first record is modified and locked according to the first preset rule, and the update record is directly saved into the database. When a preset conflict is detected, the version number corresponding to the first record is retained as the default value, and the version number of the updated record is modified and locked according to the second preset rule before being saved into the database.

3. The method as described in claim 1 or 2, characterized in that, The first preset rule includes: Retrieve all second-version identifiers corresponding to the relevant records; Identify the maximum value of the locked version number in the current second version identifier; The preset version number step value is increased based on the maximum value of the locked version number in the current second version identifier, and the new version number is used to replace the original default value.

4. The method as described in claim 1 or 2, characterized in that, The preset conflicts include mismatches in fixed update dates and / or update information, and the mismatches in update information include mismatches in recording operation users.

5. The method as described in claim 4, characterized in that, The second preset rule includes: The new version number replaces the original default value with the indicator code set according to the preset conflict type.

6. The method as described in claim 3, characterized in that, The version number is an integer; the default value is 0; the step value is 1.

7. A version control system based on version number association and dynamic configuration, characterized in that, To implement the method according to any one of claims 1 to 6, comprising: The update record preprocessing module is used to add a first version identifier and a second version identifier to the update record; The database retrieval module is used to search the database based on the name of the updated record and determine whether there is a related record already stored in the database; The first judgment module is used to determine whether there is a first record with a version number of the default value in the relevant records; The second judgment module is used to determine whether there is a second record in the relevant records where the first version identifier and the matching identifier have a preset conflict; The version number management module is used to modify the corresponding version number of the record; The data storage module is used to update and save data records.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 6.

9. An electronic device, characterized in that, Including processor and memory; The memory is used to store the first version identifier and the second version identifier; The processor is configured to execute the method of any one of claims 1 to 6 by invoking a first version identifier and a second version identifier.

10. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.