Data management method and device, computer equipment and readable storage medium

By building a target branch version of the database and updating the data, the problems of historical data loss and errors caused by database data overwriting and updating in traditional technologies are solved, and efficient data version management and storage optimization are achieved.

CN120743874APending Publication Date: 2025-10-03BEIJING PACTERA JINXIN TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510653923.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

In traditional technologies, overwriting and updating business data in the database leads to the loss of historical data, and errors are prone to occur during updates, making it impossible to effectively manage different versions of business data.

Method used

By building the target branch version in the database, sending a branch submission request based on the target data source information, receiving and updating the data, and storing it in the target branch version, data management of different branch versions can be achieved to avoid duplicate records and loss of historical data.

Benefits of technology

It achieves precise version management of database data, reduces storage space usage, avoids loss of historical data, and ensures the accuracy and consistency of data updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743874A_ABST
    Figure CN120743874A_ABST
Patent Text Reader

Abstract

The invention relates to a data management method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: in response to a branch submission request, constructing a target branch version under a first target branch in a database according to branch information in the branch submission request; the branch information comprises target data source information corresponding to the first target branch; sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain target data corresponding to the first target branch in the target branch version; and storing the target data into the target branch version in the database. By adopting the method, the branch management of the database data can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a data management method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of business systems, the data iteration speed of business systems is getting faster and faster, and more and more business data is generated. Therefore, it is necessary to manage the different versions of business data in the database.

[0003] In traditional technology, as business systems are applied and run, business data in the database changes accordingly. After the business data in the business system is updated, the updated business data is synchronously updated in the database, that is, the updated business data is overwritten with the original business data, completing the update of the business data in the business system.

[0004] However, in the current traditional technology, the way of overwriting the original business data leads to the loss of historical business data, errors occur when updating data, and data records in the database are erroneous and cannot be repaired. Therefore, a data management method is urgently needed. Summary of the Invention

[0005] Based on this, it is necessary to provide a data management method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.

[0006] In a first aspect, the present application provides a data management method, comprising:

[0007] In response to a branch submission request, constructing a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0008] Sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0009] The target data is stored in the target branch version in the database.

[0010] In one embodiment, before constructing the target branch version under the first target branch in the database according to the branch information in the branch submission request in response to the branch submission request, the method further includes:

[0011] In response to the branch initialization request, initializing the base branch according to the target data source information in the branch initialization request;

[0012] In response to a first branch pull request corresponding to the base branch, construct a first target branch under the base branch, and store branch structure information of the first target branch in a branch information table;

[0013] The first pulled data of the target data source is backed up and stored in the first target branch.

[0014] In one embodiment, the method further comprises:

[0015] In response to a second branch pull request corresponding to the base branch, determining a pull data range corresponding to the second branch pull request, and sending a data pull request including the data pull range to a target data source;

[0016] Receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request based on the second pull data.

[0017] In one embodiment, sending a branch submission request based on the target data source information, receiving updated data sent by the target data source, and updating the original data of the previous branch version according to the updated data to obtain the target data of the first target branch under the target branch version includes:

[0018] Sending a branch submission request to the target data source according to the communication interface corresponding to the target data source information, instructing the target data source to query the updated data of the target data source according to the branch submission pre-processing interface, and sending the updated data to the branch system;

[0019] Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

[0020] In one embodiment, receiving the updated data sent by the target data source, and updating the original data of the previous branch version according to the updated data to obtain the target data of the first target branch under the target branch version, includes:

[0021] receiving update data sent by the target data source, parsing the update data, and determining a processing type corresponding to each to-be-updated field in the update data;

[0022] Based on the processing type corresponding to the to-be-updated field, the original data of the previous branch version is updated to obtain the target data of the first target branch under the target branch version.

[0023] In one embodiment, the method further comprises:

[0024] In response to a branch rollback request, determining the branch version to be rolled back and the target rollback branch version in the rollback information according to the rollback information in the branch rollback request;

[0025] The to-be-rolled-back branch version is updated based on the stored data in the target rollback branch version to obtain the target rollback branch version, and rollback information of the target rollback branch version is recorded; the rollback information includes a version identifier of the target rollback branch version.

[0026] In one embodiment, the method further comprises:

[0027] In response to a branch merge request, determining an original branch and a branch to be merged;

[0028] Determining difference data according to the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged;

[0029] The difference data is merged into the second stored data to obtain a merged branch.

[0030] In a second aspect, the present application further provides a data management device, comprising:

[0031] A first construction module is configured to construct, in response to a branch submission request, a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0032] An update module is configured to send a branch submission request to a target data source based on the target data source information, receive update data sent by the target data source, and update the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0033] The first storage module is configured to store the target data in the target branch version in a database.

[0034] In one embodiment, the apparatus further comprises:

[0035] an initialization module, configured to respond to a branch initialization request and initialize a base branch according to target data source information in the branch initialization request;

[0036] A second construction module is configured to construct a first target branch under the base branch in response to a first branch pull request corresponding to the base branch, and store branch structure information of the first target branch in a branch information table;

[0037] The second storage module is configured to store a backup copy of the first pulled data from the target data source to the first target branch.

[0038] In one embodiment, the apparatus further comprises:

[0039] A first determining module is configured to, in response to a second branch pull request corresponding to a base branch, determine a pull data range corresponding to the second branch pull request, and send a data pull request including the data pull range to a target data source;

[0040] The third construction module is configured to receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request according to the second pull data.

[0041] In one embodiment, the update module is specifically configured to send a branch submission request to the target data source according to the communication interface corresponding to the target data source information, instruct the target data source to query the target data source for update data according to the branch submission pre-processing interface, and send the update data to the branch system;

[0042] Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

[0043] In one embodiment, the update module is specifically configured to receive update data sent by the target data source, parse the update data, and determine a processing type corresponding to each to-be-updated field in the update data;

[0044] Based on the processing type corresponding to the to-be-updated field, the original data of the previous branch version is updated to obtain the target data of the first target branch under the target branch version.

[0045] In one embodiment, the apparatus further comprises:

[0046] A second determining module is configured to respond to a branch rollback request and determine, according to the rollback information in the branch rollback request, a branch version to be rolled back and a target rollback branch version in the rollback information;

[0047] The rollback module is used to update the data of the branch version to be rolled back based on the stored data in the target rollback branch version, obtain the target rollback branch version, and record the rollback information of the target rollback branch version; the rollback information includes the version identifier of the target rollback branch version.

[0048] In one embodiment, the apparatus further comprises:

[0049] A third determining module, configured to determine an original branch and a branch to be merged in response to a branch merge request;

[0050] a fourth determining module, configured to determine difference data based on the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged;

[0051] A merging module is used to merge the difference data into the second stored data to obtain a merged branch.

[0052] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0053] In response to a branch submission request, constructing a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0054] Sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0055] The target data is stored in the target branch version in the database.

[0056] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0057] In response to a branch submission request, constructing a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0058] Sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0059] The target data is stored in the target branch version in the database.

[0060] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0061] In response to a branch submission request, constructing a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0062] Sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0063] The target data is stored in the target branch version in the database.

[0064] The above-described data management method, apparatus, computer device, computer-readable storage medium, and computer program product construct, in response to a branch commit request, a target branch version under a first target branch in a database based on the branch information in the branch commit request; the branch information includes target data source information corresponding to the first target branch; based on the target data source information, a branch commit request is sent to the target data source, update data sent by the target data source is received, and the original data of the previous branch version is updated based on the update data to obtain the target data corresponding to the first target branch in the target branch version; and the target data is stored in the target branch version in the database. By associating the branch version with the database of the target data source, this method enables precise version management of database data in the target data source, as well as data version management of database data from different target data sources in the branch system, and achieves centralized storage of data from different target data sources. Furthermore, data changes in different branch versions are recorded according to the update data, avoiding the recording of duplicate data. While enabling the branch system to uniformly store and version manage database data from different branch versions based on the database data dimension, it also reduces storage space usage in the branch system and avoids the loss of historical data in the target data source, thus achieving branch version management of database data. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0066] Figure 1 A diagram of an application environment of a data management method in one embodiment;

[0067] Figure 2 1 is a flow chart of a data management method according to an embodiment;

[0068] Figure 3 A schematic diagram of the process of initializing a base branch and pulling a first target branch in one embodiment;

[0069] Figure 4 A signaling diagram for performing branch management on business system database data in one embodiment;

[0070] Figure 5 A schematic diagram of a process for pulling a second target branch in one embodiment;

[0071] Figure 6 A schematic diagram of a process for implementing branch submission in one embodiment;

[0072] Figure 7 A schematic diagram of a process for updating data in a branch submission in one embodiment;

[0073] Figure 8 A schematic diagram of a flow chart for implementing branch rollback in one embodiment;

[0074] Figure 9 A schematic diagram of a process for implementing branch merging in one embodiment;

[0075] Figure 10 is a structural block diagram of a data management device in one embodiment;

[0076] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0078] The data management method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the branch system 102 communicates with the target data source 104 through the network. The branch system 102 is used to manage and store business data of different branch versions in the target data source 104. The branch system 102 can be integrated on the server, or it can be placed on the cloud or other network servers. In response to the branch submission request, the branch system 102 constructs the target branch version under the first target branch in the database according to the branch information in the branch submission request; the branch information includes the target data source information corresponding to the first target branch; the branch system 102 sends a branch submission request to the target data source based on the target data source information, receives the update data sent by the target data source, updates the original data of the previous branch version according to the update data, and obtains the target data corresponding to the first target branch in the target branch version; the branch system 102 stores the target data in the target branch version in the database. Among them, the branch system 102 can serve as a backup server for multiple target data sources 104 to realize centralized storage of multi-branch version business data in multiple target data sources 104.

[0079] In an exemplary embodiment, Figure 2 As shown, a data management method is provided, which is applied to Figure 1 The branch system in FIG. 1 is taken as an example to illustrate the process, including the following steps 202 to 206. Among them:

[0080] Step 202: In response to the branch submission request, a target branch version under the first target branch in the database is constructed according to the branch information in the branch submission request.

[0081] The branch information includes target data source information corresponding to the first target branch.

[0082] In an embodiment of the present application, a core interface for branch submission, namely a branch submission interface, is provided in the branch system, and the target data source can be the business system corresponding to the first target branch. When the business data of the business system changes, or when the storage data corresponding to the current branch version in the first target branch needs to be adjusted based on business needs, the user initiates a branch submission request on the front-end page to back up and store the business data in the current business system. The front-end page can be integrated into the front-end page of the business system, or it can be an independent front-end page of the branch system.

[0083] After receiving a branch submission request initiated by a user, the branch system responds to the branch submission request. First, the branch system parses the branch submission request and determines the branch information carried in the branch submission request. Then, the branch system constructs the target branch version under the first target branch in the database according to the branch information. The target branch version is the version to be submitted of the first target branch in the branch submission request. The target branch version can be the next branch version of the current latest branch version, or it can be a user-defined branch version. At the same time, a branch version information table is also provided in the branch system. After the target branch version is constructed, the branch information of the newly created target branch version is recorded in the branch version information table.

[0084] Taking the software development and testing scenario as an example, when the software development team wants to add a new feature to business system A, in order to avoid affecting the existing stable version, the developer will pre-initiate a branch pull request in the branch system to obtain the first target branch. Then, after the developer completes a portion of the code writing for the first target branch in business system A, the developer submits a target branch version corresponding to the first target branch to back up and save the current development progress. For example, an e-commerce system plans to develop a "live streaming with goods" feature. The branch system submits a request based on the branch and creates a target branch version of the current development progress under the first target branch of the e-commerce system.

[0085] Step 204: Send a branch submission request to the target data source based on the target data source information, receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data corresponding to the first target branch in the target branch version.

[0086] The previous branch version is the version before the target branch version, that is, the original branch version.

[0087] In this embodiment of the present application, upon receiving a branch submission request, the branch system determines the target data source information based on the branch information and sends the branch submission request to the target data source based on the target data source information. The target data source performs a data query based on the received branch submission request, collects the updated data involved in the branch submission request, and then feeds the updated data back to the branch system.

[0088] After sending a request, the branch system initiates a listening mechanism, awaiting a response from the target data source. Based on the feedback from the target data source, the branch system can use polling or event-driven methods to receive updated data. Optionally, after receiving the updated data, the branch system performs a integrity check on the updated data. This includes checking whether the updated data is formatted correctly, contains required fields, and meets the expected data quantity. For example, if the updated data is a list of incremental user information, each newly added user's information will be checked to ensure that the required fields, such as name, age, and contact information, are included.

[0089] Based on the operation type (e.g., insert, update, delete) in the updated data, the branch system performs the corresponding operation on the original data to update the original data and obtain the target data of the target branch version. The original branch version only needs to record the corresponding updated data to restore the target data of the target branch version, without having to record the entire data, thus reducing the resource usage of the branch system.

[0090] Step 206: Store the target data in the target branch version in the database.

[0091] In embodiments of the present application, before storing the target data in the target branch version of the database, the branch system may also clean the target data, including removing invalid characters and duplicate records. For example, it may delete extra spaces in a user's name. Alternatively, the branch system may convert the target data to an appropriate format based on the database's storage requirements. For example, if the database requires date fields to be stored in a specific format, the date data may be converted accordingly.

[0092] The branch system uses database connection information (for example, the database's IP (Internet Protocol) address, port number, user name, password, etc.) to establish a connection with the database. For example, the branch system is written based on a Java program and connects to the database through JDBC. After the branch system is connected to the database, it inserts the target data into the target branch version in batches. After the storage operation is completed, the branch system will return the storage result to inform the user whether the target data has been successfully stored. If the storage fails, detailed error information will be provided, such as database connection failure, data format error, etc. The data storage information corresponding to the branch submission request will also be recorded, including information such as the storage time, version identifier, and data volume of the target data in the target branch version, so as to trace the branch management operation.

[0093] By associating branch versions with the database of the target data source, the above-described data management method enables precise version management of the database data in the target data source, as well as data version management of the database data of different target data sources in the branch system. This also enables centralized storage of data from different target data sources. Furthermore, data changes in different branch versions are recorded according to updated data, avoiding the recording of duplicate data. While enabling the branch system to uniformly store and version manage database data of different branch versions based on the database data dimension, it also reduces storage space usage in the branch system and avoids the loss of historical data in the target data source, thus achieving branch version management of database data.

[0094] In an exemplary embodiment, Figure 3 As shown, before step 202, it is necessary to pre-build a base branch and a first target branch under the base branch to implement the subsequent management of the multi-branch version database data in the first target branch. The method also includes steps 302 to 306.

[0095] Step 302: In response to the branch initialization request, initialize the base branch according to the target data source information in the branch initialization request.

[0096] In the embodiment of the present application, when it is necessary to perform branch management on the database data of the business system or business platform, such as Figure 4 As shown, the user triggers the initialization operation of the base branch corresponding to the business system (or business platform) on the front-end page. The user can select the target data source information on the front-end page to determine the scope of database data to be branched. For example, the user can choose to branch the database data of the entire business platform, in which case the target data source information includes the database of each business system in the business platform. Alternatively, the user can branch a portion of the business data in the database of a specific business system, in which case the target data source information will clearly point to the database portion where these specific business data are located.

[0097] The branch system responds to the branch initialization request initiated by the user, such as Figure 4As shown, the front-end page initiates a call to the branch initialization interface and performs branch logic processing in the branch system. Specifically, the branch initialization interface starts initializing the base branch based on the target data source information carried in the branch initialization request, including creating the basic structure of the base branch, setting the initial state of the base branch, and obtaining the initial data from the target data source to complete the initialization of the base branch. Among them, different base branches can be branches for managing database data for different business systems. In other words, the branch system can independently perform branch management operations on database data for each business system. When the branch system calls the branch initialization interface, it will provide a unique identifier for each base branch. With this unique identifier, the branch system can clearly distinguish different base branches. The base branch can be presented as a branch tree. The branch tree structure has greater flexibility and scalability, and can better meet the database data branch management needs in complex business scenarios.

[0098] Step 304 : In response to the first branch pull request corresponding to the base branch, a first target branch under the base branch is constructed, and branch structure information of the first target branch is stored in a branch information table.

[0099] In an embodiment of the present application, after completing the initialization of the base branch, the user can build target branches for different business scenarios under the base branch. For example, the user can create a target branch for developers to use for development, and create a target branch for testers to use for testing. Different target branches have the ability to isolate data.

[0100] The branch system responds to the user's first branch pull request, which includes the branch number or a commit version number of the first target branch. It then constructs the first target branch based on the base branch, allocating independent storage space and identification to the first target branch, copying and migrating the data in the base branch according to the user-specified data range, and storing the branch structure information of the first target branch in the branch information table. The branch information table is used to record the relevant information of all target branches to facilitate subsequent branch management, query, and tracing.

[0101] Step 306: back up and store the first pulled data from the target data source to the first target branch.

[0102] In an embodiment of the present application, the branch system determines the rules for pulling data from the target data source based on the branch pull request initiated by the user. For example, the user constructs a first branch pull request based on conditions such as the type of data, time range, and business identifier. For example, if the database of an e-commerce business system is to be branch managed, the user may choose to pull order data within the last month as the first pulled data. Then, the branch system sends a data pull request containing the data pulling rules to the target data source, and receives the first pulled data fed back by the target data source. Finally, the branch system locates the storage location of the branch in the storage system based on the unique identifier and storage path information of the first target branch, and stores the first pulled data in a backup copy in the storage location corresponding to the first target branch.

[0103] In this embodiment, by constructing a base branch, building a first target branch under the base branch, and backing up the first data pulled from the target data source to the first target branch according to the target branch's dimensions, this achieves refined branch management of business system database data. This provides independent and flexible database data branch management for different business systems, allowing branch scopes to be determined based on specific business needs to meet diverse business scenarios. Furthermore, by constructing a branch tree structure of base and target branches, as well as a data backup and storage mechanism, data security and traceability are enhanced, providing a foundation for branch management of database data.

[0104] In an exemplary embodiment, Figure 5 As shown, during the application of the branch system, a second target branch can be constructed according to business needs to achieve data isolation of database data under different business purposes. The method further includes steps 502 to 504.

[0105] Step 502: In response to the second branch pull request corresponding to the base branch, determine a data pull range corresponding to the second branch pull request, and send a data pull request including the data pull range to the target data source.

[0106] In this embodiment, when a user generates a new business requirement, they can initiate a second branch pull request in the branch system to build a second target branch independent of the first target branch. The second branch pull request may come from a user's operation on the front-end page or be initiated by other automated programs.

[0107] After receiving a pull request for a second branch corresponding to the base branch, the branch system first parses the request. It extracts key information from the request, determines the data pull range corresponding to the request, and further checks the legitimacy of the request, including whether the user or program initiating the request has the corresponding branch pull permission and whether the pull data range is within the permitted data range.

[0108] If the branch system determines that the second branch pull request is legitimate, the branch system generates a data pull request based on the second branch pull request. Specifically, the branch system determines the target data source and data pull range based on the second branch pull request, and constructs a data pull request that the target data source can recognize based on the target data source identifier and the pull data range. Then, the branch system sends the data pull request to the target data source, which can be a database or other data storage node of the business system. The data pull request contains clear data filtering conditions so that the target data source can accurately provide the data required for the second branch pull request.

[0109] Specifically, a branch system can provide an extended interface to the target data source. For example, a branch system can uniformly provide an extended interface to multiple business systems. Each business system imports the branch system's interface dependency package and implements the extended interface provided by the branch system. Taking the branch pull pre-processing interface as an example, before responding to a second branch pull request, the branch system calls the branch pull pre-processing interface. The business system then performs a special validation on the second branch pull request to determine whether a new branch can be pulled from a specific branch. For example, after receiving a second branch pull request initiated by a user, the branch system triggers a call to the branch pull pre-processing interface. The branch pull pre-processing interface passes key information such as the base branch identifier and the data pull range to the business system. The business system performs logical processing according to the branch pull pre-processing interface provided by the branch system and feeds back the pre-processing results of the branch pull pre-processing interface to the branch system. If the validation fails, a message indicating that the pull is not allowed is returned. If the validation passes, a message indicating that the pull is allowed is returned, and the branch system then sends a data pull request containing the data pull range to the business system.

[0110] Step 504: Receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request according to the second pull data.

[0111] In an embodiment of the present application, when the target data source receives a data pull request from a branch system, it filters and extracts the corresponding data based on the data pull range in the data pull request to obtain second-pull data. The second-pull data is then fed back to the branch system, and the second-pull data is determined to be the feedback data corresponding to the data pull request. Furthermore, the branch system receives the second-pull data fed back by the target data source. Optionally, during the receiving process, the branch system can perform integrity checks and verification on the second-pull data to ensure the accuracy and availability of the data.

[0112] After receiving the second pull data, the branch system constructs the second target branch corresponding to the second branch pull request based on the second pull data. Specifically, the branch system creates the basic structure of the second target branch, stores the second pull data in the storage location corresponding to the second target branch, and sets the initial state of the second target branch. Simultaneously, the branch system records relevant information about the second target branch (e.g., branch name, creation time, base branch identifier, and target data source identifier) ​​in the branch information table for subsequent branch query and management.

[0113] In a specific embodiment, taking e-commerce business as an example, in order to meet different business needs, such as data analysis, promotion activity simulation, etc., users (such as data analysis teams) need to perform branch management on order data, etc. Figure 4 As shown, a user initiates a request to pull a new branch from a specific branch on the front-end page of a business system (this page can be integrated with the branch system or independent of it). The request includes information about the base branch, such as the base branch's identifier and the data range to be pulled. In response to the user's request to pull a new branch, the branch system performs branch logic processing and calls the branch pull pre-processing interface, instructing the business system to perform special validation according to the branch pull pre-processing interface and pass the base branch information to the business system. After receiving the base branch information from the branch system, the business system performs validation according to its own business rules. For example, it checks whether the order data corresponding to the base branch is in a normal state and whether there are any outstanding payments or refunds. If the validation passes, the business system returns a message to the branch system allowing the pull; if the validation fails, it returns a message disallowing the pull.

[0114] If the branch system receives a request for permission from the business system, it proceeds with the subsequent branch pull operation. If it receives a request for permission, it terminates the branch pull process and sends a notification to the business system, which then displays this notification to the user. After passing pre-processing verification, the branch system pulls data from the source branch and creates a new target branch based on the information in the user request. This involves extracting a specified range of data from the business system's data source (such as an order database) and storing it in the storage location corresponding to the new branch.

[0115] Optionally, the branch system also provides a branch pull post-processing interface to the business system. After completing the creation of the second target branch, the branch system calls the branch pull post-processing interface to instruct the business system to perform subsequent processing based on its own business needs. For example, after the branch system completes the creation of the second target branch, the branch system calls the branch pull post-processing interface to pass the identification and other information of the second target branch to the business system. The business system synchronizes the inventory data to the database table corresponding to the second target branch to ensure that the inventory information in the second target branch is consistent with the actual business situation; or sends a notification to relevant personnel to inform them that the new branch has been successfully created.

[0116] In this embodiment, a second target branch is constructed based on the acquired second-pull data, providing an independent and isolated environment for business operations. This allows various business processes, such as data analysis, testing, and simulation, to be performed without affecting the original data or other branches, enhancing the flexibility and security of data processing. Furthermore, by constructing different target branches, version management and traceability are implemented for each target branch, facilitating continuous business optimization and troubleshooting, and improving the controllability and stability of the overall business.

[0117] In an exemplary embodiment, Figure 6 As shown, step 204 includes steps 602 to 604. Among them:

[0118] Step 602: Send a branch submission request to the target data source according to the communication interface corresponding to the target data source information, instruct the target data source to query the updated data of the target data source according to the branch submission pre-processing interface, and send the updated data to the branch system.

[0119] In an embodiment of the present application, the branch system sends a branch submission request to the target data source based on the communication interface between the target data source and the branch system, that is, initiates a request for calling the branch submission pre-interface, wherein the branch submission request is used by the branch system to declare to the target data source that the operation to be processed by the branch system is to build the current branch version under the first target branch. Furthermore, after the target data source receives the branch submission request from the branch system, it calls the branch submission pre-processing interface according to the branch submission data range corresponding to the branch submission request, and queries the database of the target data source for updated data within the branch submission data range through the processing logic provided by the branch submission pre-processing interface, and feeds the updated data back to the branch system. Specifically, taking the business system as the target data source as an example, the business system queries the business data in the database table at the time of the previous branch submission based on the branch submission pre-processing interface provided by the branch system, and compares the business data corresponding to the previous branch submission with the business data at the current time to determine and obtain the updated data of the target data source.

[0120] Step 604: Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

[0121] In an embodiment of the present application, a branch system receives updated data from a target data source via a communication interface and performs an integrity check on the updated data. After completing the integrity check on the updated data, the branch system queries the original data corresponding to the previous branch version in the first target branch, using this as the basis for the update. It then analyzes changes to the business data in the updated data according to a preset branch commit algorithm and performs data update operations such as replacement, addition, or deletion on the original data to obtain the target data for the first target branch under the target branch version. Specifically, after the target data (full data) is generated, the branch system creates a commit version node. This commit version node points to the generated target data and serves as an identifier for this branch commit operation. This commit version node allows users to easily access the complete data under that version for operations such as version management, data recovery, and code review. For example, users can view different commit version nodes to understand the data changes for each version, troubleshoot issues, or conduct comparative analysis of historical data. After completing the update of the original data, the branch system stores the target data under the target branch version of the first target branch, providing accurate data support for subsequent business processing.

[0122] In this embodiment, the branch system updates the original data after receiving the updated data, thereby obtaining the target data of the first target branch under the target branch version, realizing data synchronization and update between the target data source and the branch system, ensuring the timeliness and accuracy of the branch system data, and providing a reliable data foundation for subsequent various business operations in each branch version of the first target branch. At the same time, it realizes the branch version management of the database data in the target data source, enhances the data processing capability in the branch system, avoids the loss of database data in the target data source, and further improves data stability.

[0123] In an exemplary embodiment, Figure 7 As shown, step 604 includes steps 702 to 704. Among them:

[0124] Step 702: Receive the update data sent by the target data source, parse the update data, and determine the processing type corresponding to each to-be-updated field in the update data.

[0125] In this embodiment of the present application, a branch system receives update data from a target data source via a predefined communication interface. This update data is the data that has changed within the scope of a specific branch's submission data, as determined by the target data source, after searching and filtering its database based on the branch's submission request. The branch system then parses the received update data. Specifically, data parsing is based on the rules and protocols of the data format. Different data formats have specific syntax and structures. For example, JSON (JavaScript Object Notation) uses key-value pairs to represent data, and XML (Extensible Markup Language) uses tags to organize data. The branch system implements a corresponding parser to convert the received update data into an internal data structure based on these rules for subsequent processing. The parser typically uses lexical analysis and syntactic analysis to decompose the data string into tokens and construct data objects according to grammatical rules. The branch system then determines the processing type corresponding to each field to be updated in the update data. Fields to be updated are fields that have changed compared to the original data in the previous branch version. For each field to be updated, the branch system determines the corresponding processing type. Processing types may include insert (indicating that the field is newly added), update (indicating that the value of the field has changed), delete (indicating that the field needs to be removed from the original data), etc.

[0126] Step 704 : Based on the processing type corresponding to the field to be updated, update the original data of the previous branch version to obtain the target data of the first target branch under the target branch version.

[0127] In an embodiment of the present application, the branch system obtains the original data of the previous branch version of the first target branch from its own storage, and updates the original data of the previous branch version based on the processing type corresponding to the field to be updated. For example, if the processing type corresponding to a field to be updated is an insert operation, the branch system will add the field to be updated and its corresponding field value to the corresponding position in the original data; if the processing type corresponding to a field to be updated is a replace operation, the branch system will replace the original value of the corresponding field in the original data with the new value of the field to be updated; if the processing type corresponding to a field to be updated is a delete operation, the branch system will remove the field to be updated and its corresponding value from the original data. Then, the branch system obtains the target data of the first target branch under the target branch version.

[0128] In this embodiment, by parsing the updated data of the target data source and determining the processing type of each field to be updated, the branch system can accurately identify data changes and provide clear guidance for subsequent update processing. Based on the processing type corresponding to the field to be updated, the original data of the previous branch version is updated, which can avoid unnecessary processing of the entire data set, greatly improve the efficiency of data updates, and reduce the resource consumption of the branch system. At the same time, the use of incremental updates not only realizes branch management for the database data of the target data source, but also ensures that the target data of the first target branch under the target branch version is highly consistent with the data of the target data source, thereby improving the accuracy and reliability of the data.

[0129] In an exemplary embodiment, Figure 8 As shown, the branch system also supports rolling back the branch version, and the method further includes steps 802 to 804.

[0130] Step 802 : In response to the branch rollback request, determine the branch version to be rolled back and the target rollback branch version in the rollback information according to the rollback information in the branch rollback request.

[0131] In an embodiment of the present application, a core interface for branch rollback, namely a branch rollback interface, is provided in the branch system. In data warehouse or database data management, the database data may be updated or modified in batches. If an error occurs in the update operation, resulting in data inconsistency or error, the data can be restored to its previous correct state through branch rollback. For example, when a user performs business processing on a branch version in a target branch, the business processing fails. At this time, the user can select a branch version as the target rollback branch version and perform a branch rollback on the branch version to be rolled back.

[0132] The user first selects the branch version to be rolled back on the front-end page. The front-end constructs a branch rollback request based on the branch ID corresponding to the branch version to be rolled back. The branch system responds to the branch rollback request and, based on the rollback information included in the rollback request, determines the branch version to be rolled back and the target rollback branch version. The target rollback branch version is a historical branch version selected by the user, and the data in the historical branch version is assumed to be correct and stable.

[0133] Step 804: Update the branch version to be rolled back based on the stored data in the target rollback branch version to obtain the target rollback branch version, and record the rollback information of the target rollback branch version.

[0134] The rollback information includes the version identifier of the target rollback branch version.

[0135] In an embodiment of the present application, the branch system updates the stored data of the target rollback branch version with the data of the branch version to be rolled back, that is, uses the data in the target rollback branch version to overwrite the current data of the branch version to be rolled back, thereby restoring the branch version to be rolled back to the state of the target rollback branch version, thereby obtaining the target rollback branch version. After completing the data update, the branch system will record the rollback information of the rolled back branch version, where the rollback information may include the rollback time, the target rollback branch version, the version identifier of the branch version to be rolled back, etc., for subsequent auditing, tracing, and management.

[0136] In this embodiment, through the fallback mechanism of the branch system, errors in business processing of database data in the branch system can be corrected immediately, the stability and accuracy of the data in the branch version can be guaranteed, and complete functions are provided for branch management of database data.

[0137] In an exemplary embodiment, Figure 9 As shown, the branch system also supports merging branches, and the method further includes steps 902 to 906. In which:

[0138] Step 902: In response to the branch merge request, determine the original branch and the branch to be merged.

[0139] In an embodiment of the present application, a core interface for branch merging, namely a branch merge interface, is also provided in the branch system. When performing business analysis or other processing on the database data of the target data source, the original branch can be used as the main branch to store the business data for business analysis, and the branch to be merged can be the analysis result obtained after business processing is performed on the business data in the main branch. For example, the amount data of the business data is summarized according to a preset period to obtain the total amount corresponding to each preset period. After the business analysis, the analysis results need to be merged into the business data of the main branch. At this time, the user can merge the original branch with the branch to be merged after the data processing of the branch to be merged is completed, and initiate a branch merge request. In response to the branch merge request initiated by the user, the branch system first parses the branch merge request to determine the original branch and the branch to be merged contained in the branch merge request.

[0140] Optionally, the branch system also provides a branch merge pre-processing interface to the target data source. Before the branch system responds to the branch merge request and enters the process of determining the original branch and the branch to be merged, the branch system will call the branch merge pre-processing interface. The target data source responds to the branch merge pre-processing interface and verifies the branch merge request to determine whether the merge operation can be performed. For example, in the database of an e-commerce business system, the product information branch may contain basic product information, price, inventory and other data. Before performing a branch merge, it is necessary to ensure that these key information recorded for each product are complete, otherwise errors may occur in the merged data.

[0141] Step 904 : Determine difference data based on the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged.

[0142] In an embodiment of the present application, after determining the original branch and the branch to be merged, the branch system will obtain the storage data corresponding to the original branch and the branch to be merged, respectively, and record them as the first storage data (original branch) and the second storage data (branch to be merged). The branch system compares the first storage data and the second storage data through a preset branch merging algorithm to determine the difference between the first storage data and the second storage data, that is, to obtain the difference data. Among them, the preset branch merging algorithm is used to create a temporary table in the database to store the difference data. The content of the difference data record may include the table name, field name, original value, new value, type of data change (for example, addition, modification, deletion), etc. of the difference data, so that the difference data can be accurately applied during subsequent merge operations.

[0143] Differential data may include newly added data items, modified data values, or deleted data items. For example, in database data version management, differential data may include newly added terminals, modified field values, or deleted fields in a business system.

[0144] Step 906: Merge the difference data into the second stored data to obtain a merged branch.

[0145] In an embodiment of the present application, the branch system merges the difference data between the first storage data and the second storage data into the second storage data, realizes the branch merging of the original branch and the branch to be merged, and finally uses the second storage data of the merged difference data as the merged branch after the merger.

[0146] After the merge operation is completed, the merged branch contains all valid data from the original branch and the branch to be merged, achieving the unification and synchronization of database data. After the branch system completes the branch merge, the branch system also stores the difference data between the original branch and the branch to be merged in the merge data registration table.

[0147] Optionally, after completing the data merge, the branch system calls the branch merge post-processing interface to instruct the target data source to perform a series of data processing and maintenance operations on the database after the branch merge. For example, in a large data warehouse, the amount and distribution of data after the branch merge may have changed, and the original index may not be able to effectively support query operations. The target data source then rebuilds the index of the database after the branch merge, and rebuilding the index can optimize query efficiency. Alternatively, the data in the database may interact with front-end applications, reporting systems, etc. After the branch merge, the target data source needs to synchronize the updated data to these related systems to ensure data consistency.

[0148] In this embodiment, through branch merging, the data of the original branches used for different business processing can be isolated, so that different original branches can be aggregated into the same branch to be merged through branch merging, reducing the impact of data processing errors in different original branches, and improving the merging function of branch version management of database data, ensuring the data consistency and integrity of branch version management of database data.

[0149] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0150] Based on the same inventive concept, embodiments of the present application also provide a data management device for implementing the aforementioned data management method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more data management device embodiments provided below can be found in the above-mentioned limitations of the data management method and will not be repeated here.

[0151] In an exemplary embodiment, Figure 10 As shown, a data management device 1000 is provided, comprising: a first construction module 1001, an update module 1002 and a first storage module 1003, wherein:

[0152] The first construction module 1001 is configured to respond to a branch submission request and construct a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0153] Update module 1002 is configured to send a branch submission request to a target data source based on the target data source information, receive update data sent by the target data source, and update the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version;

[0154] The first storage module 1003 is configured to store the target data in a target branch version in the database.

[0155] In one embodiment, the apparatus 1000 further includes:

[0156] an initialization module, configured to respond to a branch initialization request and initialize a base branch according to target data source information in the branch initialization request;

[0157] A second construction module is configured to construct a first target branch under the base branch in response to a first branch pull request corresponding to the base branch, and store branch structure information of the first target branch in a branch information table;

[0158] The second storage module is configured to store a backup copy of the first pulled data from the target data source to the first target branch.

[0159] In one embodiment, the apparatus 1000 further includes:

[0160] A first determining module is configured to, in response to a second branch pull request corresponding to a base branch, determine a pull data range corresponding to the second branch pull request, and send a data pull request including the data pull range to a target data source;

[0161] The third construction module is used to receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request according to the second pull data.

[0162] In one embodiment, the update module 1002 is specifically configured to send a branch submission request to the target data source according to the communication interface corresponding to the target data source information, instruct the target data source to query the target data source for updated data according to the branch submission pre-processing interface, and send the updated data to the branch system;

[0163] Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

[0164] In one embodiment, the update module 1002 is specifically configured to receive update data sent by a target data source, parse the update data, and determine a processing type corresponding to each to-be-updated field in the update data;

[0165] Based on the processing type corresponding to the field to be updated, the original data of the previous branch version is updated to obtain the target data of the first target branch under the target branch version.

[0166] In one embodiment, the apparatus 1000 further includes:

[0167] A second determining module is configured to respond to the branch rollback request and determine the branch version to be rolled back and the target rollback branch version in the rollback information according to the rollback information in the branch rollback request;

[0168] The rollback module is used to update the data of the target rollback branch version based on the stored data in the target rollback branch version, obtain the target rollback branch version, and record the rollback information of the target rollback branch version; the rollback information includes the version identifier of the target rollback branch version.

[0169] In one embodiment, the apparatus 1000 further includes:

[0170] A third determining module, configured to determine an original branch and a branch to be merged in response to a branch merge request;

[0171] A fourth determining module, configured to determine difference data based on the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged;

[0172] The merging module is used to merge the difference data into the second stored data to obtain a merged branch.

[0173] Each module in the above-mentioned data management device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0174] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store database data of a target data source. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data management method is implemented.

[0175] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0176] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0177] In response to the branch submission request, construct a target branch version under the first target branch in the database according to the branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch;

[0178] Send a branch submission request to the target data source based on the target data source information, receive the updated data sent by the target data source, and update the original data of the previous branch version according to the updated data to obtain the target data corresponding to the first target branch in the target branch version;

[0179] Store the target data in the target branch version in the database.

[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0181] In response to the branch initialization request, initializing the base branch according to the target data source information in the branch initialization request;

[0182] In response to a first branch pull request corresponding to the base branch, construct a first target branch under the base branch, and store branch structure information of the first target branch in a branch information table;

[0183] The first pulled data from the target data source is backed up and stored in the first target branch.

[0184] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0185] In response to a second branch pull request corresponding to the base branch, determining a pull data range corresponding to the second branch pull request, and sending a data pull request including the data pull range to a target data source;

[0186] Receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request based on the second pull data.

[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0188] According to the communication interface corresponding to the target data source information, a branch submission request is sent to the target data source, instructing the target data source to query the updated data of the target data source according to the branch submission pre-processing interface, and send the updated data to the branch system;

[0189] Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

[0190] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0191] Receive the update data sent by the target data source, parse the update data, and determine the processing type corresponding to each field to be updated in the update data;

[0192] Based on the processing type corresponding to the field to be updated, the original data of the previous branch version is updated to obtain the target data of the first target branch under the target branch version.

[0193] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0194] In response to the branch rollback request, determining the branch version to be rolled back and the target rollback branch version in the rollback information according to the rollback information in the branch rollback request;

[0195] The data of the to-be-rolled-back branch version is updated based on the stored data in the target rollback branch version to obtain the target rollback branch version, and the rollback information of the target rollback branch version is recorded; the rollback information includes the version identifier of the target rollback branch version.

[0196] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0197] In response to a branch merge request, determining an original branch and a branch to be merged;

[0198] Determine difference data based on the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged;

[0199] The difference data is merged into the second stored data to obtain a merged branch.

[0200] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0201] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in each of the above-described method embodiments. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data must comply with relevant regulations.

[0202] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. 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. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0203] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0204] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A data management method, characterized in that: The method is applied to a branch system, and includes: In response to a branch submission request, constructing a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch; Sending a branch submission request to the target data source based on the target data source information, receiving update data sent by the target data source, and updating the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version; The target data is stored in the target branch version in the database.

2. The method according to claim 1, characterized in that Before constructing, in response to the branch submission request, the target branch version under the first target branch in the database according to the branch information in the branch submission request, the method further includes: In response to the branch initialization request, initializing the base branch according to the target data source information in the branch initialization request; In response to a first branch pull request corresponding to the base branch, construct a first target branch under the base branch, and store branch structure information of the first target branch in a branch information table; The first pulled data of the target data source is backed up and stored in the first target branch.

3. The method according to claim 1, characterized in that The method further comprises: In response to a second branch pull request corresponding to the base branch, determining a pull data range corresponding to the second branch pull request, and sending a data pull request including the data pull range to a target data source; Receive second pull data corresponding to the pull data range, and construct a second target branch corresponding to the second branch pull request based on the second pull data.

4. The method according to claim 1, wherein The step of sending a branch submission request based on the target data source information, receiving updated data sent by the target data source, and updating the original data of the previous branch version according to the updated data to obtain the target data of the first target branch under the target branch version includes: Sending a branch submission request to the target data source according to the communication interface corresponding to the target data source information, instructing the target data source to query the updated data of the target data source according to the branch submission pre-processing interface, and sending the updated data to the branch system; Receive the updated data sent by the target data source, update the original data of the previous branch version according to the updated data, and obtain the target data of the first target branch under the target branch version.

5. The method according to claim 4, characterized in that The receiving the updated data sent by the target data source, and updating the original data of the previous branch version according to the updated data to obtain the target data of the first target branch under the target branch version, includes: receiving update data sent by the target data source, parsing the update data, and determining a processing type corresponding to each to-be-updated field in the update data; Based on the processing type corresponding to the to-be-updated field, the original data of the previous branch version is updated to obtain the target data of the first target branch under the target branch version.

6. The method according to claim 1, characterized in that The method further comprises: In response to a branch rollback request, determining the branch version to be rolled back and the target rollback branch version in the rollback information according to the rollback information in the branch rollback request; The to-be-rolled-back branch version is updated based on the stored data in the target rollback branch version to obtain the target rollback branch version, and rollback information of the target rollback branch version is recorded; the rollback information includes a version identifier of the target rollback branch version.

7. The method according to claim 1, characterized in that The method further comprises: In response to a branch merge request, determining an original branch and a branch to be merged; Determining difference data according to the first stored data corresponding to the original branch and the second stored data corresponding to the branch to be merged; The difference data is merged into the second stored data to obtain a merged branch.

8. A data management device, characterized in that: The device comprises: A first construction module is configured to construct, in response to a branch submission request, a target branch version under a first target branch in the database according to branch information in the branch submission request; the branch information includes target data source information corresponding to the first target branch; An update module is configured to send a branch submission request to a target data source based on the target data source information, receive update data sent by the target data source, and update the original data of the previous branch version according to the update data to obtain the target data corresponding to the first target branch in the target branch version; The first storage module is configured to store the target data in the target branch version in a database.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data flash-back query method and device based on dot database

    CN117033398A

  • Customizing repository in table-based customization scenario

    CN118152392A