Data updating method and device applied to database, computer readable storage medium and electronic equipment
By establishing a data object cache library in the database, and determining the data objects to be updated based on the target database and the update task, the problem of resource congestion during the database update process is solved, and efficient data updates are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ASSET MANAGEMENT CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-08
AI Technical Summary
When updating data objects in a database, existing technologies require complex retrieval and identification of massive amounts of data objects, which leads to the consumption of database computing resources and affects normal services.
Establish a data object cache library. Based on the target database and the current update task, identify the data objects to be updated and update their parameter information in the target database to avoid searching and identifying them in the database.
It reduces the impact of database update processes on normal services, shortens the time required to identify data objects to be updated, and reduces the number of data objects identified by the database retrieval.
Smart Images

Figure CN121996667A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a data update method, apparatus, computer-readable storage medium, and electronic device applied to a database. Background Technology
[0002] As the scope of business continues to expand, service providers are gradually offering a wide variety of services, most of which require access to databases for retrieval.
[0003] In related technologies, updating data objects in a database is often necessary for service maintenance or adding new services. Currently, updating data objects in a database generally involves the following steps: First, based on the requirements of the update task, the data object to be updated is identified in the database; then, the data object to be updated is replaced with the new data object.
[0004] However, the number of data objects stored in the database continues to accumulate and increase over a long period as business needs change. Under these circumstances, the process of identifying the data object to be updated in the database requires complex retrieval and identification within a massive amount of data. This operation consumes a significant amount of database computing resources, severely limiting its ability to handle normal service requests and thus impacting the database's normal service. Summary of the Invention
[0005] To address the aforementioned technical problems, embodiments of this application provide a data update method, apparatus, computer-readable storage medium, and electronic device applied to a database, which can reduce the impact on normal database services when updating data objects in the database.
[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0007] According to one aspect of the embodiments of this application, a data update method applied to a database is provided, comprising: establishing a data object cache based on a target database and a current update task; wherein the data object cache includes data objects involved in the current update task in the target database; determining data objects to be updated corresponding to the data object cache according to the current update task; wherein the data objects to be updated corresponding to the data object cache are data objects that the data object cache needs to update according to the current update task; and updating the parameter information of the data objects to be updated in the current update task to the target database.
[0008] According to one aspect of the embodiments of this application, a data update apparatus for a database is provided, comprising: a caching module configured to establish a data object cache based on a target database and a current update task; wherein the data object cache includes data objects involved in the target database by the current update task; an identification module configured to determine, according to the current update task, a data object to be updated corresponding to the data object cache; wherein the data object to be updated corresponding to the data object cache is a data object in the data object cache that needs to be updated according to the current update task; and an update module configured to update the parameter information of the data object to be updated in the current update task to the target database.
[0009] In some embodiments of this application, based on the foregoing scheme, the caching module is further configured to: determine the data domain corresponding to the current update task; obtain the data objects of the target database under the data domain; and establish the data object cache library based on the data objects of the target database under the data domain.
[0010] In some embodiments of this application, based on the foregoing scheme, the identification module is further configured to: determine the target data object in the current update task; wherein the target data object is the data object to be updated by the current update task; if the target data object is included in the data object cache, and if the parameter information of the target data object in the data object cache is determined to be inconsistent with the parameter information of the target data object in the current update task, then the target data object is taken as the data object to be updated; if the target data object is not included in the data object cache, then the target data object is taken as the data object to be updated.
[0011] In some embodiments of this application, based on the foregoing scheme, the update module is further configured to: if it is determined that the data object cache includes the data object to be updated, then update the parameter information of the data object to be updated in the current update task to the target database; if it is determined that the data object cache does not include the data object to be updated, then create the data object to be updated in the target database, and update the parameter information of the data object to be updated in the current update task to the target database.
[0012] In some embodiments of this application, based on the foregoing scheme, the update module is further configured to: determine the data elements to be updated in the data object to be updated according to the parameter information of the data object to be updated in the current update task and the parameter information of the data object to be updated in the data object cache library; obtain the target update method corresponding to the data element to be updated; and update the parameter information of the data object to be updated in the current update task to the target database under the target update method.
[0013] In some embodiments of this application, based on the foregoing scheme, the update module is further configured to: obtain the identification information corresponding to the current update task; generate the latest data element version number based on the identification information; and use the latest data element version number as the data element version number of the data element to be updated in the target database.
[0014] In some embodiments of this application, based on the foregoing scheme, the caching module is further configured to: before establishing a data object cache library based on the target database and the current update task, obtain the update time of the target database and the import time of each update task in the update task library; and take the target update task in the update task library as the current update task, wherein the import time corresponding to the target update task is later than the update time.
[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a computer's processor, cause the computer to perform a data update method applied to a database as described in the above embodiments.
[0016] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the data update method applied to a database as described in the above embodiments.
[0017] In the technical solution of this application embodiment, a data object cache library can be established first based on the target database and the current update task. Then, the data objects to be updated corresponding to the data object cache library are determined according to the current update task. Finally, the parameter information of the data objects to be updated in the current update task is updated to the target database. Since the data object cache library is established by the data objects involved in the target database by the current update task, the data objects to be updated in the data object cache library that need to be updated according to the current update task are equivalent to the data objects to be updated in the target database that need to be updated according to the current update task. This avoids searching and identifying the data objects to be updated in the target database, and the data objects to be updated in the target database can be determined, thereby reducing the impact on the normal service of the target database when updating the data objects to be updated in the target database according to the current update task. At the same time, the data objects in the data object cache library are a subset of the data objects of the full set of data objects in the target database. Therefore, determining the data objects to be updated corresponding to the target database based on the subset of data objects in the data object cache library can also reduce the number of data objects searched and identified when determining the data objects to be updated corresponding to the target database, thereby shortening the time spent determining the data objects to be updated corresponding to the target database. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings: Figure 1 This is a flowchart illustrating a data update method applied to a database, as shown in an exemplary embodiment of this application; Figure 2 yes Figure 1 The flowchart of step S130 in the illustrated embodiment is shown in an example embodiment; Figure 3 yes Figure 1 A flowchart of step S130 in another example embodiment in the illustrated embodiment; Figure 4 yes Figure 1 The flowchart in an example embodiment preceding step S110 in the illustrated embodiment; Figure 5 This is a block diagram illustrating a data update apparatus applied to a database, as shown in an exemplary embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of this application. Detailed Implementation
[0019] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0020] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0021] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0022] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0023] It should be noted that "multiple" as mentioned in this article refers to two or more.
[0024] The technical solution of this application embodiment proposes a data update method applied to a database, which is detailed below. Figure 1 As shown. The method includes at least steps S110 to S130, which are described in detail below: In step S110, a data object cache library is established based on the target database and the current update task.
[0025] In the embodiments of this application, in order to update the data stored in the target database, a data object cache library can be established based on the target database and the current update task.
[0026] The target database is the database whose internally stored data objects need to be updated. The current update task includes the data object that needs to be updated in the target database, as well as the corresponding parameter information. The data object cache contains the data objects involved in the current update task within the target database.
[0027] The method of building a data object cache library based on the target database and the current update task can be flexibly configured as needed. In one example, the target data object in the current update task can be determined first. This target data object is the data object that the current update task indicates to be updated. Then, the data object that is the same as the target data object in the target database can be obtained. After that, the data object cache library is built based on the data object that is the same as the target data object in the target database.
[0028] For example, if the target data objects corresponding to the update target in the current update task are data objects B1, B2, and B3, then after determining that the target data objects corresponding to the update target in the current update task are data objects B1, B2, and B3, we can obtain the data objects B1, B2, and B3 that are identical to data objects B1, B2, and B3 in the target database. Then, we can build a data object cache library based on the data objects B1, B2, and B3 that are identical to data objects B1, B2, and B3 in the target database.
[0029] In another example, the data domain corresponding to the current update task can be determined first, and then the data objects in the target database under the data domain can be obtained. After that, a data object cache library can be built based on the data objects in the target database under the data domain. That is to say, each data object in the target database can be pre-configured with the corresponding data domain when stored, and the corresponding data domain can also be pre-configured in the current update task, so as to locate the data objects involved in the current update task in the target database. This shortens the time to access the target database and reduces the impact on the normal service of the target database during the update process.
[0030] For example, if the data domain corresponding to the current update task is data domain A, then after determining that the data domain of the current update task is data domain A, the data objects of the target database under data domain A can be obtained, and then a data object cache library can be built based on the data objects of the target database under data domain A.
[0031] In another example, the service type and data domain corresponding to the current update task can be determined first. Then, the data objects in the target database under the data domain of the service type can be obtained. After that, a data object cache library can be built based on the data objects in the target database under the data domain of the service type. That is to say, each data object in the target database can be pre-assigned to the corresponding service type when stored, and the current update task can also be pre-configured with the corresponding service type. This makes it easier to locate the data objects involved in the current update task in the target database, thereby further shortening the access time to the target database and reducing the impact on the normal service of the target database during the update process.
[0032] In step S120, the data object to be updated corresponding to the data object cache library is determined according to the current update task.
[0033] Among them, the data objects to be updated corresponding to the data object cache library are the data objects that the data object cache library needs to update according to the current update task.
[0034] In the embodiments of this application, after establishing a data object cache based on the target database and the current update task, the data objects to be updated corresponding to the data object cache can be determined according to the current update task. The data object cache consists of data objects involved in the target database by the current update task. In other words, the data objects to be updated corresponding to the data object cache determined by the current update task are equivalent to the data objects to be updated in the target database. Therefore, in determining the data objects to be updated in the target database, it is unnecessary to search and identify the data objects to be updated in the target database, thereby reducing the impact on the normal service of the target database when updating the data objects to be updated in the target database according to the current update task. Simultaneously, the data objects in the data object cache are a subset of all data objects in the target database. Therefore, determining the data objects to be updated in the target database based on the subset of data objects in the data object cache can further reduce the number of data objects searched and identified when determining the data objects to be updated in the target database, thereby shortening the time spent determining the data objects to be updated in the target database.
[0035] Specifically, in some embodiments of this application, the target data object in the current update task can be determined first. If the parameter information of the target data object in the data object cache is consistent with the parameter information of the target data object in the current update task, then the parameter information of the target data object in the current target database is determined to be the latest parameter information and does not need to be updated again according to the current update task. Conversely, if the parameter information of the target data object in the data object cache is determined to be inconsistent with the parameter information of the target data object in the current update task, then the target data object needs to be updated, and it can be used as the data object to be updated.
[0036] In some embodiments of this application, considering that the data objects in the data object cache are determined from the target database, and that the current update task is not only used to update the parameter information of existing data objects in the database, but also to add new data objects to the database to update the data, after determining the target data object in the current update task, and assuming that the target data object is included in the data object cache, if it is determined that the parameter information of the target data object in the data object cache is inconsistent with the parameter information of the target data object in the current update task, then it is determined that the target data object needs to be updated, and this target data object is then designated as the data object to be updated.
[0037] Correspondingly, if the target data object is not included in the data object cache library, it means that the current target database does not contain the target data object, and the target data object can be directly used as the data object to be updated.
[0038] In step S130, the parameter information of the data object to be updated in the current update task is updated to the target database.
[0039] In the embodiments of this application, after determining the data object to be updated corresponding to the data object cache library, the parameter information of the data object to be updated in the current update task can be updated to the target database, thereby synchronizing the parameter information of the data object to be updated in the target database with the parameter information in the current update task, and thus achieving the purpose of updating the target database.
[0040] The process of updating the parameter information of the data object to be updated in the current update task to the target database can be flexibly configured as needed. In one example, the parameter information of the data object to be updated in the target database can be directly replaced with the parameter information of the data object to be updated in the current update task to achieve the purpose of updating the parameter information of the data object to be updated in the current update task to the target database.
[0041] In another example, the parameter information of the data object to be updated in the data object cache can be replaced with the parameter information of the data object to be updated in the current update task. Then, after the preset update conditions are met, the parameter information of the data object to be updated in the target database can be replaced with the parameter information of the data object to be updated in the data object cache.
[0042] For example, preset update conditions include update time. After replacing the parameter information of the data object to be updated in the data object cache with the parameter information of the data object to be updated in the current update task, when the current time is the update time corresponding to the preset update conditions, the parameter information of the data object to be updated in the target database is replaced with the parameter information of the data object to be updated in the data object cache. This allows the update to be performed during the idle time of the target database, further reducing the impact on the normal service of the target database when updating the data object to be updated in the target database according to the current update task.
[0043] Considering that there are multiple target data objects in the current update task, meaning there may also be multiple data objects to be updated, the preset update condition can include an update quantity. After replacing the parameter information of the data object to be updated in the data object cache with the parameter information of the data object to be updated in the current update task, the update quantity is incremented by one. When the update quantity reaches the update quantity corresponding to the preset update condition, the parameter information of the data object to be updated in the target database is replaced with the parameter information of the data object to be updated in the data object cache. This allows for batch updates of the parameter information of the data object to be updated in the data object cache to the target database, thereby reducing the number of access requests to the target database and minimizing the impact on the normal service of the target database when updating the data objects to be updated in the target database according to the current update task.
[0044] In another example, after replacing the parameter information of the data object to be updated in the data object cache with the parameter information of the data object to be updated in the current update task, an object proxy can be established between the data object to be updated in the data object cache and the data object to be updated in the target database. That is, the data object to be updated in the data object cache is used as a proxy object for the data object to be updated in the target database. When the user accesses the target database to retrieve the data object to be updated, the object proxy can return the parameter information of the data object to be updated in the data object cache that has been replaced by the current update task to the user. This ensures that the user can obtain the parameter information of the data object to be updated after the current update task in a timely manner, and further reduces the impact on the normal service of the target database when updating the data object to be updated in the target database according to the current update task.
[0045] In some embodiments of this application, after establishing a data object cache library based on the target database and the current update task, an object proxy for each data object in the data object cache library can be established for the corresponding data object in the target database, so that the current update task can adjust any data object in the data object cache library.
[0046] See Figure 2 , Figure 2 Is Figure 1 The flowchart of step S130 in the illustrated embodiment is shown in an exemplary embodiment. Figure 2 As shown, the process of updating the parameter information of the data object to be updated in the current update task to the target database may include steps S210 to S220, which are described in detail below: Step S210: If it is determined that the data object cache library includes the data object to be updated, then the parameter information of the data object to be updated in the current update task is updated to the target database.
[0047] Step S220: If it is determined that the data object to be updated is not included in the data object cache, then a new data object to be updated is created in the target database, and the parameter information of the data object to be updated in the current update task is updated in the target database.
[0048] As can be seen from the above example, the data object to be updated can be a data object whose parameter information in the current update task is inconsistent with the parameter information in the data object cache, or it can be a data object that is in the current update task but is not in the data object cache.
[0049] Based on this, in the embodiments of this application, the process of updating the parameter information of the data object to be updated in the current update task to the target database can first determine whether the data object cache includes the data object to be updated, so as to determine the update method for updating the data object to be updated to the target database. Specifically, if it is determined that the data object cache includes the data object to be updated, it indicates that the target database also includes the data object to be updated, and the parameter information of the data object to be updated in the current update task can be directly updated to the target database to update the target database.
[0050] Conversely, if it is determined that the data object to be updated is not included in the data object cache, it means that the target database has not stored the data object to be updated before. In this case, the data object to be updated can be created in the target database first, and then the parameter information of the data object to be updated in the current update task can be updated in the target database. Thus, when the parameter information of the data object to be updated in the target database is replaced with the parameter information of the data object to be updated in the data object cache, the location of the data object to be updated can be obtained from the target database, thereby ensuring that the parameter information of the data object to be updated can be stored in the target database accordingly.
[0051] In addition, when the data object cache is used as the first update target and the target database is used as the second update target in step S130, after determining that the data object cache does not contain the data object to be updated, a new data object to be updated can be created in the data object cache. Thus, when the parameter information of the data object to be updated in the data object cache is replaced with the parameter information of the data object to be updated in the current update task, the location of the data object to be updated can be obtained from the data object cache.
[0052] See Figure 3 , Figure 3 Is Figure 1 The flowchart of step S130 in the illustrated embodiment is shown in an exemplary embodiment. Figure 3 As shown, the process of updating the parameter information of the data object to be updated in the current update task to the target database may include steps S310 to S330, which are described in detail below: In step S310, the data elements to be updated in the data object to be updated are determined based on the parameter information of the data object to be updated in the current update task and the parameter information of the data object to be updated in the data object cache library.
[0053] It should be noted that the parameter information in a data object is usually distinguished according to data elements. For example, there are common data elements used to represent common attribute information and additional characteristic data elements used to represent additional attribute information, so that users can find the information they need in the data object in the database.
[0054] In the embodiments of this application, since different data elements in a data object have different levels of importance, their update priorities also differ. Therefore, after identifying the data object to be updated, the data elements to be updated within the data object can be determined based on the parameter information of the data object in the current update task and the parameter information of the data object in the data object cache.
[0055] Among them, the data elements to be updated represent the data elements of the data objects to be updated in the data object cache that need to be updated according to the current update task.
[0056] In some embodiments of this application, the difference parameter information in the data object to be updated can be determined first based on the parameter information of the data object to be updated in the current update task and the parameter information of the data object to be updated in the data object cache library, and then the data elements corresponding to the difference parameter information can be used as the data elements to be updated.
[0057] For example, if the data object to be updated is data object B1, the difference parameters in the data object to be updated are determined to be C1 and C2 based on the parameter information of data object B1 in the current update task and the parameter information of data object B1 in the data object cache library. Then, the data elements corresponding to C1 and C2 are taken as the data elements to be updated.
[0058] In step S320, the target update method corresponding to the data element to be updated is obtained.
[0059] Different data elements can be pre-configured with update methods corresponding to their update priorities.
[0060] The process of obtaining the target update method for the data element to be updated can be approached in two ways. In one example, the update method corresponding to the data element to be updated can be directly used as the target update method. In another example, if there are multiple data elements to be updated, the target data element with the highest update priority among them is identified, and then the update method of the target data element is used as the target update method.
[0061] In step S330, under the target update mode, the parameter information of the data object to be updated in the current update task is updated to the target database.
[0062] In the embodiments of this application, after obtaining the target update method, the parameter information of the data object to be updated in the current update task can be updated to the target database under the target update method. This allows the data object to be updated to be updated according to the update priority of the data elements to be updated in the data object when updating the target database, thereby improving the service capability of the target database while avoiding affecting its normal service.
[0063] In addition, in some embodiments of this application, after determining the data elements to be updated in the data object to be updated, the identification information corresponding to the current update task can be obtained, and then the latest data element version number can be generated based on the identification information. Then, the latest data element version number is used as the data element version number of the data element to be updated in the target database, thereby realizing version management of different data elements in the data object and facilitating the determination of the update history path of the data element to be updated and the determination of the historical update content.
[0064] See Figure 4 , Figure 4 This is an instruction control method in data processing illustrated according to another exemplary embodiment. For example... Figure 4 As shown, in Figure 1 Before step S110 in the illustrated embodiment, the method may further include steps S410 to S420, which are described in detail below: Step S410: Obtain the update time of the target database and the import time of each update task in the update task library.
[0065] Step S420: Select the target update task in the update task library as the current update task.
[0066] In the above process, before establishing a data object cache library based on the target database and the current update task, the update time of the target database and the import time of each update task in the update task library can be obtained first. Then, the target update task in the update task library is used as the current update task, where the import time of the target update task is later than the update time. This allows for batch processing of update tasks simultaneously when updating the target database, reducing the number of access requests to the target database. Furthermore, it ensures that duplicate update tasks are avoided, thus preventing the waste of computing resources.
[0067] In some embodiments of this application, when importing or receiving an update task, the update task library can preprocess the data objects and corresponding attribute information in the update task. For example, it can perform validity cleanup on the data objects in the update task and format conversion on the attribute information of the data objects in the update task. This avoids having to perform validity judgment and / or format conversion again during the subsequent process of updating the parameter information of the data objects to be updated in the current update task to the target database. This reduces the impact on the normal service of the database when updating data objects in the database.
[0068] The following describes an apparatus embodiment of this application, which can be used to execute the data update method applied to a database in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the above embodiments of the data update method applied to a database.
[0069] Figure 5 A block diagram of a data update apparatus 100 applied to a database according to an embodiment of this application is shown.
[0070] Reference Figure 5 As shown, a data update apparatus 100 for a database according to an embodiment of this application includes: a caching module 110 configured to establish a data object cache based on a target database and a current update task; wherein the data object cache includes data objects involved in the current update task in the target database; an identification module 120 configured to determine the data object to be updated corresponding to the data object cache according to the current update task; wherein the data object to be updated corresponding to the data object cache is a data object in the data object cache that needs to be updated according to the current update task; and an update module 130 configured to update the parameter information of the data object to be updated in the current update task to the target database.
[0071] In some embodiments of this application, based on the foregoing scheme, the caching module 110 is further configured to: determine the data domain corresponding to the current update task; obtain the data objects of the target database in the data domain; and establish a data object cache library based on the data objects of the target database in the data domain.
[0072] In some embodiments of this application, based on the foregoing scheme, the identification module 120 is further configured to: determine the target data object in the current update task; wherein, the target data object is the data object to be updated by the current update task; if the target data object is included in the data object cache, and if the parameter information of the target data object in the data object cache is inconsistent with the parameter information of the target data object in the current update task, then the target data object is regarded as the data object to be updated; if the target data object is not included in the data object cache, then the target data object is regarded as the data object to be updated.
[0073] In some embodiments of this application, based on the foregoing scheme, the update module 130 is further configured to: if it is determined that the data object cache includes the data object to be updated, then update the parameter information of the data object to be updated in the current update task to the target database; if it is determined that the data object cache does not include the data object to be updated, then create a new data object to be updated in the target database, and update the parameter information of the data object to be updated in the current update task to the target database.
[0074] In some embodiments of this application, based on the foregoing scheme, the update module 130 is further configured to: determine the data elements to be updated in the data object to be updated according to the parameter information of the data object to be updated in the current update task and the parameter information of the data object to be updated in the data object cache library; obtain the target update method corresponding to the data elements to be updated; and update the parameter information of the data object to be updated in the current update task to the target database under the target update method.
[0075] In some embodiments of this application, based on the foregoing scheme, the update module 130 is further configured to: obtain the identification information corresponding to the current update task; generate the latest data element version number based on the identification information; and use the latest data element version number as the data element version number of the data element to be updated in the target database.
[0076] In some embodiments of this application, based on the foregoing scheme, the caching module 120 is further configured to: before establishing a data object cache library based on the target database and the current update task, obtain the update time of the target database and the import time of each update task in the update task library; and take the target update task in the update task library as the current update task, wherein the import time corresponding to the target update task is later than the update time.
[0077] It should be noted that the data update device 100 for databases provided in the above embodiments and the data update method for databases provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here.
[0078] Embodiments of this application also provide an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions that, when executed by the processor, implement the data update method applied to a database as described above.
[0079] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0080] It should be noted that, Figure 6 The computer system 200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0081] like Figure 6As shown, the computer system 200 includes a Central Processing Unit (CPU) 201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 202 or programs loaded from storage portion 208 into Random Access Memory (RAM) 203, such as performing the methods described in the above embodiments. The RAM 203 also stores various programs and data required for system operation. The CPU 201, ROM 202, and RAM 203 are interconnected via a bus 204. An Input / Output (I / O) interface 205 is also connected to the bus 204.
[0082] The following components are connected to I / O interface 205: an input section 206 including a keyboard, mouse, etc.; an output section 207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to I / O interface 205 as needed. Removable media 211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 210 as needed so that computer programs read from them can be installed into storage section 208 as needed.
[0083] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 209, and / or installed from removable medium 211. When the computer program is executed by central processing unit (CPU) 201, it performs various functions defined in the system of this application.
[0084] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0086] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0087] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0088] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0089] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0090] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0091] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data update method applied to a database, characterized in that, The method includes: A data object cache library is established based on the target database and the current update task; wherein, the data object cache library includes the data objects involved in the target database by the current update task; The data object to be updated corresponding to the data object cache is determined based on the current update task; wherein, the data object to be updated corresponding to the data object cache is the data object that the data object cache needs to update according to the current update task; Update the parameter information of the data object to be updated in the current update task to the target database.
2. The method according to claim 1, characterized in that, The establishment of a data object cache library based on the target database and the current update task includes: Determine the data domain corresponding to the current update task; Obtain the data objects of the target database within the data domain; The data object cache library is established based on the data objects in the data domain of the target database.
3. The method according to claim 1, characterized in that, The step of determining the data object to be updated corresponding to the data object cache library based on the current update task includes: Determine the target data object in the current update task; wherein, the target data object is the data object that the current update task indicates to be updated; If the target data object is included in the data object cache, and it is determined that the parameter information of the target data object in the data object cache is inconsistent with the parameter information of the target data object in the current update task, then the target data object is taken as the data object to be updated. If the target data object is not included in the data object cache library, then the target data object will be used as the data object to be updated.
4. The method according to claim 3, characterized in that, The step of updating the parameter information of the data object to be updated in the current update task to the target database includes: If it is determined that the data object to be updated is included in the data object cache library, then the parameter information of the data object to be updated in the current update task is updated to the target database. If it is determined that the data object to be updated is not included in the data object cache library, then the data object to be updated is created in the target database, and the parameter information of the data object to be updated in the current update task is updated in the target database.
5. The method according to claim 1, characterized in that, The step of updating the parameter information of the data object to be updated in the current update task to the target database includes: The data elements to be updated in the data object to be updated are determined based on the parameter information of the data object to be updated in the current update task and the parameter information of the data object to be updated in the data object cache library. Obtain the target update method corresponding to the data element to be updated; Under the target update method, the parameter information of the data object to be updated in the current update task is updated to the target database.
6. The method according to claim 5, characterized in that, The method further includes: Obtain the identification information corresponding to the current update task; Generate the latest data element version number based on the identification information; The latest data element version number is used as the data element version number of the data element to be updated in the target database.
7. The method according to claim 1, characterized in that, Before establishing the data object cache library based on the target database and the current update task, the method further includes: Obtain the update time of the target database and the import time of each update task in the update task library; The target update task in the update task library is taken as the current update task, wherein the import time of the target update task is later than the update time.
8. A data update device for a database, characterized in that, include: The caching module is configured to establish a data object cache library based on the target database and the current update task; wherein, the data object cache library includes the data objects involved by the current update task in the target database; The identification module is configured to determine the data object to be updated corresponding to the data object cache based on the current update task; wherein, the data object to be updated corresponding to the data object cache is the data object in the data object cache that needs to be updated according to the current update task; The update module is configured to update the parameter information of the data object to be updated in the current update task to the target database.
9. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by a computer's processor, cause the computer to perform the data update method for a database as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the data update method applied to a database as described in any one of claims 1 to 7.