技术领域Technical field
本说明书涉及计算机技术领域,尤其涉及一种数据库的数据写入方法及装置。This specification relates to the field of computer technology, and in particular, to a data writing method and device for a database.
背景技术Background technique
在软件开发过程中,数据库对于相关数据的组织、存储和管理起到了关键性的作用。出于对系统稳定性以及数据安全性的考虑,在数据库进行更换或升级前后的过渡期间,一般需要在原有的、未更换或升级数据库基础上额外部署一套新的、已更换或升级的数据库,并对两个数据库同时进行相同的写入操作。In the software development process, the database plays a key role in the organization, storage and management of relevant data. For the sake of system stability and data security, during the transition period before and after the database is replaced or upgraded, it is generally necessary to deploy an additional set of new, replaced or upgraded databases on the basis of the original, unreplaced or upgraded database. , and perform the same write operation on both databases at the same time.
在相关技术中,通常需要由开发人员分别为两个数据库编写功能重复的业务代码,导致代码改动量大,且容易影响到原有数据库的代码,进而降低整体开发效率。In related technologies, developers usually need to write business codes with duplicate functions for two databases respectively, resulting in a large amount of code changes and easily affecting the code of the original database, thereby reducing the overall development efficiency.
发明内容Contents of the invention
有鉴于此,本说明书提供一种数据库的数据写入方法及装置,以解决相关技术中的不足。In view of this, this specification provides a database data writing method and device to solve the deficiencies in related technologies.
具体地,本说明书是通过如下技术方案实现:Specifically, this specification is implemented through the following technical solutions:
根据本说明书的第一方面,提供了一种数据库的数据写入方法,所述方法包括:According to a first aspect of this specification, a data writing method for a database is provided, and the method includes:
基于面向切面编程拦截切入点,所述切入点对应于针对第一数据库的第一写入操作;Intercepting a pointcut based on aspect-oriented programming, the pointcut corresponding to the first write operation for the first database;
调用与所述切入点对应的目标通知,所述目标通知用于执行针对第二数据库的第二写入操作,所述第二写入操作与所述第一写入操作相同;Calling a target notification corresponding to the entry point, the target notification being used to perform a second write operation for the second database, the second write operation being the same as the first write operation;
在所述第二写入操作执行完成的情况下,调用所述切入点以执行所述第一写入操作。When the second write operation is completed, the entry point is called to execute the first write operation.
根据本说明书的第二方面,提供了一种数据库的数据写入装置,所述装置包括:According to a second aspect of this specification, a data writing device for a database is provided, and the device includes:
第一写入操作拦截单元,用于基于面向切面编程拦截切入点,所述切入点对应于针对第一数据库的第一写入操作;A first write operation interception unit configured to intercept entry points based on aspect-oriented programming, where the entry points correspond to the first write operation for the first database;
第二写入操作执行单元,用于调用与所述切入点对应的目标通知,所述目标通知用于执行针对第二数据库的第二写入操作,所述第二写入操作与所述第一写入操作相同;A second write operation execution unit is configured to call a target notification corresponding to the entry point. The target notification is used to execute a second write operation for the second database. The second write operation is related to the first write operation. A write operation is the same;
第一写入操作执行单元,用于在所述第二写入操作执行完成的情况下,调用所述切入点以执行所述第一写入操作。根据本说明书实施例的第三方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现如第一方面所述的方法的步骤。A first write operation execution unit is configured to call the entry point to execute the first write operation when the execution of the second write operation is completed. According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect are implemented.
根据本说明书实施例的第四方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如第一方面所述的方法的步骤。According to a fourth aspect of the embodiments of this specification, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the following is implemented: The steps of the method described in one aspect.
本说明书的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of this specification may include the following beneficial effects:
在本说明书的实施例中,通过引入面向切面编程技术,将针对第一数据库的第一写入操作作为切入点,并将针对第二数据库的第二写入操作作为该切入点的目标通知,使得针对第二写入操作可以切面的形式配合第一写入操作先后执行,较大程度地减低了第一写入操作与第二写入操作之间的业务代码影响,从而提高了整体开发效率。In the embodiment of this specification, by introducing aspect-oriented programming technology, the first write operation for the first database is used as the entry point, and the second write operation for the second database is used as the target notification of the entry point, The second write operation can be executed sequentially in conjunction with the first write operation in a cross-sectional manner, which greatly reduces the impact of the business code between the first write operation and the second write operation, thereby improving the overall development efficiency. .
附图说明Description of the drawings
为了更清楚地说明本说明书的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它附图。In order to explain the technical solutions of this specification more clearly, the drawings needed to be used in the embodiments or description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是本说明书一示例性实施例示出的一种数据库的数据写入方法的流程示意图;Figure 1 is a schematic flowchart of a data writing method for a database according to an exemplary embodiment of this specification;
图2是本说明书一示例性实施例示出的另一种数据库的数据写入方法的流程示意图;Figure 2 is a schematic flowchart of another data writing method for a database according to an exemplary embodiment of this specification;
图3是本说明书一示例性实施例示出的一种电子设备的示意结构图;Figure 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment of this specification;
图4是本说明书一示例性实施例示出的一种数据库的数据写入装置的结构示意图。Figure 4 is a schematic structural diagram of a data writing device for a database according to an exemplary embodiment of this specification.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与本说明书的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of this specification.
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the specification. As used in this specification and the appended claims, the singular forms "a," "the" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this specification, the first information may also be called second information, and similarly, the second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining."
相比传统的面向对象编程(Object Oriented Programming,OOP),面向切面编程(Aspect-Oriented Programming,AOP)是将程序结构的侧重点由“对象”转移至“切面”,并将与核心业务无关的,但又影响着多个程序类的公共行为抽取、封装到一个可重用模块(即上述切面),从而实现代码复用和模块解耦目的的编程方式。为便于下文的阅读与理解,在此对AOP中的部分术语进行简述:在AOP中,通知(Advice,又名增强)可以用于定义对应切面的具体功能和使用时机,根据通知的使用时机可以划分为前置通知(Befor)、后置通知(After)、返回通知(After-returning)、异常通知(After-throwing)和环绕通知(Around),各类通知遵循着“环绕通知前一部分->前置通知->切入点(Pointcut)对应的目标方法->异常通知/返回通知->后置通知->环绕通知后一部分->”的顺序执行,其中,切入点可以是上述通知作用在业务逻辑中的连接点(Join point),相比通知,切入点可以用于定义切面的使用位置。上述连接点则可以为业务逻辑执行过程中能够插入切面通知的一个“点”,以支持AOP的Spring框架为例,这个点可以是调用方法时、调用方法后、抛出异常时。切面可以利用这些点插入到应用的正常流程之中(此时这些点可视为上述切入点),并实现在上述目标方法的基础上添加新的行为。Compared with traditional object-oriented programming (Object Oriented Programming, OOP), aspect-oriented programming (Aspect-Oriented Programming, AOP) shifts the focus of the program structure from "objects" to "aspects" and removes aspects that have nothing to do with the core business. , but it also affects the programming method of extracting and encapsulating the public behaviors of multiple program classes into a reusable module (i.e., the above-mentioned aspects), thereby achieving code reuse and module decoupling. In order to facilitate the reading and understanding of the following, here is a brief description of some terms in AOP: In AOP, advice (also known as enhancement) can be used to define the specific functions and usage timing of the corresponding aspect. According to the usage timing of the notification It can be divided into pre-notification (Befor), post-notification (After), return notification (After-returning), exception notification (After-throwing) and surrounding notification (Around). Each type of notification follows the "previous part of the surrounding notification-" >Pre-notification->Target method corresponding to the pointcut (Pointcut)->Exception notification/return notification->Post-notification->The last part of the surrounding notification->" is executed in sequence, where the pointcut can be the above notification acting on Compared with notifications, join points in business logic can be used to define where aspects are used. The above connection point can be a "point" where aspect notifications can be inserted during the execution of business logic. Taking the Spring framework that supports AOP as an example, this point can be when a method is called, after a method is called, or when an exception is thrown. Aspects can use these points to be inserted into the normal flow of the application (at this time, these points can be regarded as the above-mentioned entry points), and add new behaviors based on the above-mentioned target methods.
图1是本说明书一示例性实施例示出的一种数据库的数据写入方法的流程示意图。Figure 1 is a schematic flowchart of a data writing method for a database according to an exemplary embodiment of this specification.
如图1所示,该方法可以包含以下步骤:As shown in Figure 1, the method can include the following steps:
S101,基于面向切面编程拦截切入点,所述切入点对应于针对第一数据库的第一写入操作。S101. Intercept the entry point based on aspect-oriented programming, where the entry point corresponds to the first write operation for the first database.
当用户希望在执行第一写入操作前、后执行下文的第二写入操作时,可以基于AOP将上述针对第一数据库的第一写入操作设置为对应程序中的切入点,以便于在执行第一写入操作时进行拦截。其中,上述第一数据库可以为业务代码中原本使用的数据库,第一写入操作设置可以根据预设的软件设计规范记录于相应的数据库操作文件中,或者也可以根据实际需求记录于自定义的文件位置,例如在MVC(Model View Controller,模型视图控制器)模式下实现的SSM(Spring SpringMVC MyBatis)框架中,上述第一写入操作可以被记录在用于直接对数据库进行操作的映射(mapper)层,本说明书中并不对此进行限制。When the user wants to perform the second write operation below before or after the first write operation, the above-mentioned first write operation for the first database can be set as the entry point in the corresponding program based on AOP, so as to facilitate Intercept when performing the first write operation. Among them, the above-mentioned first database can be the database originally used in the business code, and the first write operation setting can be recorded in the corresponding database operation file according to the preset software design specifications, or can also be recorded in a customized database according to actual needs. File location, for example, in the SSM (Spring SpringMVC MyBatis) framework implemented in the MVC (Model View Controller, Model View Controller) mode, the above-mentioned first write operation can be recorded in the mapper (mapper) used to directly operate the database ) layer, this specification does not limit this.
S102,调用与所述切入点对应的目标通知,所述目标通知用于执行针对第二数据库的第二写入操作,所述第二写入操作与所述第一写入操作相同。S102. Call the target notification corresponding to the entry point. The target notification is used to perform a second write operation for the second database. The second write operation is the same as the first write operation.
当拦截到上述切入点后,可以调用与所述切入点对应的目标通知,并通过该目标通知执行针对第二数据库的第二写入操作,其中,上述目标通知至少可以为前置通知或环绕通知,使得切面中的第二写入操作与切入点所对应的第一写入操作可以通过相应的执行顺序依次独立、有序地执行。此外,由于第二写入操作与第一写入操作相同,因此可以确保第一数据库与第二数据库之间的数据一致性。当然,所谓的一致性还需要第一数据库与第二数据库之间已存储的数据相同,否则即使第二写入操作与第一写入操作相同,在对应数据库中的操作结果可能也会不同(例如在第二数据库中删除一条仅存在与第一数据库的记录时,第二数据库会发生相关报错,在第一数据库与第二数据库中增加一条新记录时,了;两个数据库均不会发生相关报错)。After the above entry point is intercepted, the target notification corresponding to the entry point can be called, and the second write operation for the second database can be performed through the target notification, where the above target notification can be at least a forward notification or a surrounding Notification, so that the second write operation in the aspect and the first write operation corresponding to the entry point can be executed independently and in an orderly manner through the corresponding execution sequence. In addition, since the second write operation is the same as the first write operation, data consistency between the first database and the second database can be ensured. Of course, the so-called consistency also requires that the stored data between the first database and the second database are the same. Otherwise, even if the second write operation is the same as the first write operation, the operation results in the corresponding database may be different ( For example, when deleting a record in the second database that only exists in the first database, a related error will occur in the second database. When adding a new record in the first database and the second database, no error will occur in either database. related error).
上述第一写入操作与第二写入操作之间可以使用AOP预设的注释建立代码层面的关联。依然以上述SSM框架为例,第二写入操作所在的文件可以通过@aspect注解被识别为专门的AOP类,而第二写入操作所对应的目标通知可以通过@pointcut(第一写入操作的地址)的注解将上述第一写入操作所对应的方法作为切入点。A code-level association can be established between the above-mentioned first writing operation and the second writing operation using preset comments of AOP. Still taking the above SSM framework as an example, the file where the second write operation is located can be identified as a specialized AOP class through the @aspect annotation, and the target notification corresponding to the second write operation can be identified through @pointcut (the first write operation The annotation of the address) takes the method corresponding to the above-mentioned first write operation as the entry point.
本说明书的目标通知中的第二写入操作可以不预先配置对应第一写入操作的执行逻辑,而是根据第一写入操作实时确定对应的执行逻辑。The second write operation in the target notification of this specification may not pre-configure the execution logic corresponding to the first write operation, but determine the corresponding execution logic in real time based on the first write operation.
在一实施例中,目标通知中可以提取第一写入操作对应的数据库语句,并根据该数据库语句构建对应的执行逻辑,再根据构建的执行逻辑实现第二写入操作。在该实施例中,通过以上动态构建执行逻辑的方式可以节省目标通知中的因重复编写与第一写入操作相同第二写入操作所造成的冗杂代码,以实现一个目标通知匹配多个不同的第一写入操作的场景,进而在不修改第一写入操作的情况下灵活修改第二写入操作,提高整体开发效率In one embodiment, the database statement corresponding to the first write operation can be extracted from the target notification, the corresponding execution logic can be constructed based on the database statement, and the second write operation can be implemented based on the constructed execution logic. In this embodiment, the above method of dynamically constructing execution logic can save the redundant code in the target notification caused by repeatedly writing the second write operation that is the same as the first write operation, so as to realize that one target notification matches multiple different scenario of the first write operation, and then flexibly modify the second write operation without modifying the first write operation, improving overall development efficiency.
上述数据库语句可以是例如结构化查询语言(Structured Query Language,SQL)、Hibernate查询语言(Hibernate Query Language,HQL)或Java持久化查询语言(JavaPersistence query language,JPA)等语言,本说明书并不对此进行限制。The above-mentioned database statements may be in languages such as Structured Query Language (SQL), Hibernate Query Language (HQL) or Java Persistence Query Language (JPA). This specification does not cover this. limit.
上述提取第一写入操作中对应的数据库语句的方法可以通过相应语言的工具套件(例如SQL中提供的SqlHelper类的getNamespaceSql方法),本说明书也并不对此进行限制。The above method of extracting the corresponding database statement in the first write operation can be through a tool suite of the corresponding language (for example, the getNamespaceSql method of the SqlHelper class provided in SQL), and this specification does not limit this.
当然,考虑到第二数据库通常作为实际场景中将要替代原有数据库的新数据库,在替换/升级初期往往存在大量的数据存储异常需要开发人员进行排查、分析或解决,以及原有数据库可能发生的少量数据存储异常,在此过程中必然缺少不了数据库的退回操作,而退回操作实际上可以理解为针对已执行操作的逆向操作,因此可以通过上述工具套件对第一写入操作(或第二写入操作)中的相关写入数据进行提取,以便于下文执行回退操作,其中,所述相关写入数据可以是数据库语句中的数据表信息与对应的字段信息,本说明书中并不对此进行限制。此外,由于本说明书的第二写入操作与第一写入操作是基于AOP进行业务逻辑上的耦合,所以二者中任一方的代码并不对影响到另一方,相比相关技术中为同一文件下的第一写入操作和第二写入操作进行人工修改的方式,本说明书中的第一写入操作和第二写入操作在修复代码逻辑的场景中相互独立,彼此具有更好的可读性与稳定性。Of course, considering that the second database is usually used as a new database that will replace the original database in actual scenarios, there are often a large number of data storage anomalies that need to be investigated, analyzed, or solved by developers in the early stages of replacement/upgrade, as well as possible problems that may occur in the original database. When a small amount of data is stored abnormally, the rollback operation of the database is inevitable during this process. The rollback operation can actually be understood as the reverse operation of the executed operation. Therefore, the first write operation (or the second write operation) can be performed through the above tool suite. Extract the relevant write data in the input operation) to facilitate the subsequent execution of the rollback operation. The relevant write data may be the data table information and corresponding field information in the database statement, which is not discussed in this specification. limit. In addition, since the second write operation and the first write operation in this specification are coupled with business logic based on AOP, the code of either one does not affect the other. Compared with the same file in related technologies, The first write operation and the second write operation in this manual are manually modified. The first write operation and the second write operation in this specification are independent of each other in the scenario of repairing code logic, and have better reliability with each other. Readability and stability.
S103,在所述第二写入操作执行完成的情况下,调用所述切入点以执行所述第一写入操作。S103: When the second write operation is completed, call the entry point to execute the first write operation.
当第二写入操作执行完成后,可以基于AOP的特性继续执行第一写入操作,当第一写入操作也执行成功后,便可以保证第一数据库与第二数据库的数据一致性。After the second write operation is completed, the first write operation can be continued based on the characteristics of AOP. When the first write operation is also successfully executed, data consistency between the first database and the second database can be guaranteed.
本领域技术人员可以理解的是,在一方面,如果第二写入操作执行成功但第一写入操作执行失败,第二数据库也需要执行退回操作(第一数据库无需执行退回操作,理由同上)。在另一方面,根据AOP的特性以及目标通知的类型差异,第二写入操作执行完成可能并不意味着第二写入操作的执行成功,因此,如果第二写入操作执行失败,那么需要对第一写入操作是否执行,以及第一写入操作执行时如何回退进行分别讨论(注意,由于数据库中业务机制的原子性,第二写入操作的写入失败并不会影响到第二数据库,因此也无需对第二数据库执行退回操作)。Those skilled in the art can understand that, on the one hand, if the second write operation is executed successfully but the first write operation fails, the second database also needs to perform a rollback operation (the first database does not need to perform a rollback operation, for the same reason as above) . On the other hand, depending on the characteristics of AOP and the type of target notification, completion of the second write operation may not mean that the execution of the second write operation is successful. Therefore, if the execution of the second write operation fails, then it is necessary to Discuss respectively whether the first write operation is executed and how to roll back when the first write operation is executed (note that due to the atomicity of the business mechanism in the database, the failure of the second write operation will not affect the second write operation. Second database, so there is no need to perform a rollback operation on the second database).
对于第二写入操作执行成功但第一写入操作执行失败的情况,本说明书可以根据上述相关写入数据对已写入数据的第二数据库执行退回操作。For the situation where the second write operation is successfully executed but the first write operation fails, this specification can perform a rollback operation on the second database into which the data has been written based on the above-mentioned relevant write data.
在一实施例中,可以提取并记录数据库语句中的数据表信息与对应的字段信息,并在确定第一写入操作发生异常的情况下,根据记录的数据表信息与对应的字段信息对第二数据库进行回退操作,以确保第一数据库的第二数据库的一致性,其中,字段信息可以包含字段的名称、前后取值与对应的筛选条件。具体地,上述回退操作可以为:在数据库语句为插入语句的情况下,根据记录的数据表信息与对应的字段信息对第二数据库执行相应的删除操作,例如插入语句为“INSERT INTO<表名>(数据列1,数据列2,数据列3,…数据列N)VALUES(值1,值2,值3…值N)”的情况下,相应的删除操作的语句可以为“DELETE FROM<表名>WHERE<插入语句完成对应的记录行>”;在数据库语句为删除语句的情况下,根据记录的数据表信息与对应的字段信息对第二数据库执行相应的插入操作,例如删除语句为“DELETEFROM<表名>WHERE<筛选条件>”的情况下,相应的插入操作的语句可以为“INSERT INTO<表名>(被删除记录的数据列1…数据列N)VALUES(数据列1的值…数据列N的值)”;在数据库语句为更新语句的情况下,根据记录的数据表信息与对应的字段信息对第二数据库执行相应的更新操作,例如更新语句为“UPDATE<表名>SET<数据列=更新值>WHERE<筛选条件>”的情况下,相应的更新操作的语句可以为“UPDATE<表名>SET<数据列=原始值>WHERE<筛选条件>”。其中,各相应语句的确定方法可根据实际情况进行调整,本说明书中对此并不进行限制。In one embodiment, the data table information and corresponding field information in the database statement can be extracted and recorded, and when it is determined that an exception occurs in the first write operation, the third write operation can be performed based on the recorded data table information and corresponding field information. The second database performs a rollback operation to ensure the consistency of the first database and the second database, where the field information may include the name of the field, previous and subsequent values, and corresponding filtering conditions. Specifically, the above rollback operation may be: when the database statement is an insert statement, perform a corresponding delete operation on the second database according to the recorded data table information and corresponding field information. For example, the insert statement is "INSERT INTO < table In the case of "name > (data column 1, data column 2, data column 3,...data column N) VALUES (value 1, value 2, value 3...value N)", the corresponding delete operation statement can be "DELETE FROM <Table name>WHERE <Insert statement completes the corresponding record row>"; when the database statement is a delete statement, the corresponding insert operation, such as a delete statement, is performed on the second database based on the recorded data table information and corresponding field information. In the case of "DELETEFROM <table name> WHERE <filter condition>", the corresponding insert operation statement can be "INSERT INTO <table name> (data column 1 of the deleted record...data column N) VALUES (data column 1 The value of...the value of data column N)"; when the database statement is an update statement, the corresponding update operation is performed on the second database based on the recorded data table information and corresponding field information. For example, the update statement is "UPDATE<table Name>SET<data column=update value>WHERE<filter condition>", the corresponding update operation statement can be "UPDATE<table name>SET<data column=original value>WHERE<filter condition>". Among them, the determination method of each corresponding statement can be adjusted according to the actual situation, and this specification does not limit this.
在上一实施例中,第一写入操作发生的异常可以根据目标通知的不同在不同阶段中被捕获,例如:在目标通知为前置通知的情况下,可以调用对应切入点对应的后置通知,其中,后置通知用于捕获第一写入操作发送的操作异常;在目标通知为环绕通知的情况下,可以执行环绕通知中的检查操作,检查操作用于捕获第一写入操作发送的操作异常,并在通过目标通知捕获到至少一个操作异常的情况下,确定第一写入操作发生异常。其中,检查操作可以位于与前置通知对应的后置通知中,也可以位于环绕通知中位于第一写入操作之后的业务代码中。In the previous embodiment, the exception that occurs in the first write operation can be caught in different stages according to different target notifications. For example: when the target notification is a pre-notification, the post-instruction corresponding to the corresponding entry point can be called. Notification, where the post-notification is used to capture the operation exception sent by the first write operation; when the target notification is a surrounding notification, the check operation in the surrounding notification can be performed, and the check operation is used to capture the operation exception sent by the first write operation operation exceptions, and when at least one operation exception is captured through the target notification, it is determined that an exception occurs in the first write operation. The check operation may be located in the post-notification corresponding to the pre-notification, or in the business code located after the first write operation in the surrounding notification.
以上二者(至上述前置通知与上述环绕通知)在实现效果上基本一致,但在针对“第二写入操作发生异常后的第一写入操作”的执行逻辑上将会产生部分差异。The above two (the above-mentioned pre-notification and the above-mentioned surround notification) are basically the same in terms of implementation effect, but there will be some differences in the execution logic of "the first write operation after the second write operation is abnormal".
在一实施例中,目标通知为前置通知时,在确定第二写入操作发生异常的情况下,依然执行第一写入操作,并在第一写入操作写入成功的情况下对第一数据库进行退回。在该实施例中,受限AOP的前置通知中无法根据具体情况(例如第二写入操作发生异常)选择性跳过切入点的方法执行,所以还需要再次对第一数据库进行退回。In one embodiment, when the target notification is a pre-notification, when it is determined that an exception occurs in the second write operation, the first write operation is still performed, and if the first write operation succeeds, the second write operation is performed successfully. A database is returned. In this embodiment, the pre-notification of restricted AOP cannot selectively skip the execution of the entry point according to specific circumstances (for example, an exception occurs in the second write operation), so the first database needs to be returned again.
在一实施例中,所述目标通知为环绕通知,在确定第二写入操作发生异常的情况下,可以在环绕通知中取消调用切入点,以使所述第一写入操作取消执行。在该实施例中,由于AOP中的环绕通知可以通过“proceed()”这一方法主动调用切入点,因此可以通过类似判断语句的方式在第二写入操作发生异常等情况下跳过切入点的方法执行,进而减少执行第一写入操作所需的无意义的资源开销。In one embodiment, the target notification is a surrounding notification. If it is determined that an exception occurs in the second writing operation, the call pointcut can be canceled in the surrounding notification, so that the execution of the first writing operation is cancelled. In this embodiment, since the surrounding notification in AOP can actively call the entry point through the "proceed()" method, the entry point can be skipped when an exception occurs in the second write operation through a similar judgment statement. method execution, thereby reducing the meaningless resource overhead required to perform the first write operation.
下面以SSM框架下的java项目为例,介绍切面的设置与实际应用,图2是本说明书一示例性实施例示出的另一种数据库的数据写入方法的流程示意图,如图2所示,该过程包括:The following takes the java project under the SSM framework as an example to introduce the setting and practical application of aspects. Figure 2 is a flow chart of another database data writing method shown in an exemplary embodiment of this specification, as shown in Figure 2. The process includes:
S201,获取待检测程序的源文件。S201: Obtain the source file of the program to be detected.
在一实施例中,可以从项目管理仓库gitlab中通过gitclone命令获取待检测程序的源文件,所述源文件中包含了对应的源代码,假设该源代码中仅设计了针对作为原数据库、产品版本为Mysql5.0的第一数据库的业务逻辑,且该逻辑记录于“DataMapper”文件中,且该文件中仅包括了针对第一数据库的修改方法“NumberAdd1()”。In one embodiment, the source file of the program to be tested can be obtained from the project management warehouse gitlab through the gitclone command. The source file contains the corresponding source code. It is assumed that the source code is only designed for the original database, product The business logic of the first database is Mysql5.0, and this logic is recorded in the "DataMapper" file, and this file only includes the modification method "NumberAdd1()" for the first database.
S202,设置切面文件。S202, set the aspect file.
在一实施例中,假设需要对将上述第一数据库由Mysql5.0升级为Mysql8.0(以下简称第二数据库),那么可以在项目源码中添加实现对应第二数据库逻辑的类“databaserewrite.java”,并通过@aspect注解标注该类为AOP切面类。In one embodiment, assuming that the above-mentioned first database needs to be upgraded from Mysql5.0 to Mysql8.0 (hereinafter referred to as the second database), then the class "databaserewrite.java" that implements the logic corresponding to the second database can be added to the project source code. ”, and mark this class as an AOP aspect class through the @aspect annotation.
S203,设置切面文件中与切入点对应的目标通知。S203: Set the target notification corresponding to the entry point in the aspect file.
在一实施例中,可以在切面类文件databaserewrite.java中通过@Pointcut(execution(*.mapper.NumberAdd1())注解配置实现对指定的数据库操作(即方法NumberAdd1)实现拦截。当然,如果是需要对该mapper文件下的所有数据库操作方法进行拦截则可以配置为通过@Pointcut(execution(*.mapper.*)实现。进一步的,如果仅需对所有数据库操作方法中的插入、更新和删除语句进行拦截也可以通过类似In one embodiment, the @Pointcut(execution(*.mapper.NumberAdd1()) annotation configuration can be configured in the aspect class file databaserewrite.java to implement interception of the specified database operation (ie, the method NumberAdd1). Of course, if necessary Interception of all database operation methods under the mapper file can be configured to be implemented through @Pointcut(execution(*.mapper.*). Further, if only the insert, update and delete statements in all database operation methods are required to be intercepted, Interception can also be done via something like
@pointcut(execution(*.mapper.*[*insert*,*update*,*delete*]的方式实现。@pointcut(execution(*.mapper.*[*insert*,*update*,*delete*] method.
S204,在前置通知中提取并记录第一写入操作对应的SQL语句。S204: Extract and record the SQL statement corresponding to the first write operation in the pre-notification.
在一实施例中,假设第一写入操作对应的SQL语句为“UPDATE Table SET number=number+1WHERE ID>10”(相当于将名为“Table”的数据表中ID大于10的记录中的字段“number”的取值自增1),可以通过调用SqlHelper.getNamespaceSql方法将其进行提取与持久化。In one embodiment, it is assumed that the SQL statement corresponding to the first write operation is "UPDATE Table SET number=number+1WHERE ID>10" (equivalent to adding the records with IDs greater than 10 in the data table named "Table" to The value of the field "number" increases by 1) and can be extracted and persisted by calling the SqlHelper.getNamespaceSql method.
S205,提取SQL语句中的数据表信息与对应的字段信息。S205: Extract the data table information and corresponding field information in the SQL statement.
在一实施例中,还可以通过调用SqlHelper.getNamespaceSql方法获取上述SQL语句中的数据表信息“Table”与对应的字段信息,例如字段内容“number”,对应的取值“number+1”与记录筛选条件“ID>10”。In one embodiment, the data table information "Table" and corresponding field information in the above SQL statement can also be obtained by calling the SqlHelper.getNamespaceSql method, such as the field content "number", the corresponding value "number+1" and the record Filter condition "ID>10".
S206,通过SQL语句执行第二写入操作。S206, perform the second writing operation through the SQL statement.
在一实施例中,通过S204获取的SQL语句可以构建对应的执行逻辑,并根据构建的执行逻辑实现第二写入操作,即向第二数据库执行对应“UPDATE Table SET number=In one embodiment, the SQL statement obtained through S204 can construct corresponding execution logic, and implement the second write operation according to the constructed execution logic, that is, execute the corresponding "UPDATE Table SET number=" to the second database.
number+1WHERE ID>10”这一SQL语句的第二写入操作。The second write operation of the SQL statement "number+1WHERE ID>10".
S207,执行切入点中的第一写入操作。S207: Execute the first write operation in the entry point.
在一实施例中,假设第二写入操作执行成功,在第二写入操作执行完成的情况下,可以调用所述切入点以向第一数据库执行上述第一写入操作。In one embodiment, assuming that the second write operation is successfully executed, in the case where the second write operation is completed, the entry point can be called to execute the first write operation to the first database.
S208,在后置通知中判断是否存现数据存储异常。S208: Determine whether there is a data storage exception in the post-notification.
在一实施例中,后置通知是处于切入点之后执行的处理逻辑,因此可以通过ExceptionCatch语句捕获当前的方法在数据写入、更新或删除等过程中是否发生异常,如果没有发生异常,则执行S210,否则执行S209。In one embodiment, the post-notification is the processing logic executed after the entry point. Therefore, the ExceptionCatch statement can be used to capture whether an exception occurs in the current method during data writing, updating, or deletion. If no exception occurs, execute S210, otherwise execute S209.
S209,对第二数据库进行数据回退。S209: Perform data rollback on the second database.
在一实施例中,由于第一写入操作发生了异常,因此有必要对成功执行第二写入操作的第二数据库进行回退,具体地,可以根据S205提取的数据表信息与对应的字段信息构建上述SQL的逆向更新语句“UPDATE Table SET number=number-1WHERE ID>10”以还原原本更新的数据。In one embodiment, since an exception occurred in the first write operation, it is necessary to roll back the second database that successfully executed the second write operation. Specifically, the data table information extracted in S205 and the corresponding fields can be rolled back. Construct the reverse update statement "UPDATE Table SET number=number-1WHERE ID>10" of the above SQL to restore the originally updated data.
S210,提示写入成功。S210, prompts that the writing is successful.
在一实施例中,可以日志、表格或图像等形式向用户展示写入成功的消息。In one embodiment, the successful writing message may be displayed to the user in the form of a log, a table, or an image.
图3是一示例性实施例中的一种电子设备的示意结构图。请参考图4,在硬件层面,该电子设备包括处理器、内部总线、网络接口、内存以及非易失性存储器,当然还可能包括其他所需要的硬件。处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成数据库的数据写入装置。当然,除了软件实现方式之外,本说明书并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。FIG. 3 is a schematic structural diagram of an electronic device in an exemplary embodiment. Please refer to Figure 4. At the hardware level, the electronic device includes a processor, internal bus, network interface, memory and non-volatile memory, and of course may also include other required hardware. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data writing device for the database at the logical level. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logical unit, and may also be hardware or logic device.
与前述数据库的数据写入方法的实施例相对应,本说明书还提供了数据库的数据写入装置的实施例。Corresponding to the foregoing embodiments of the data writing method in the database, this specification also provides embodiments of a data writing device in the database.
请参考图4,图4是一示例性实施例示出的一种数据库的数据写入装置的结构示意图。Please refer to FIG. 4 , which is a schematic structural diagram of a data writing device for a database according to an exemplary embodiment.
如图4所示,在软件实施方式中,该装置可以包括:As shown in Figure 4, in a software implementation, the device may include:
第一写入操作拦截单元401,用于基于面向切面编程拦截切入点,所述切入点对应于针对第一数据库的第一写入操作;The first write operation interception unit 401 is configured to intercept entry points based on aspect-oriented programming, where the entry points correspond to the first write operation for the first database;
第二写入操作执行单元402,用于调用与所述切入点对应的目标通知,所述目标通知用于执行针对第二数据库的第二写入操作,所述第二写入操作与所述第一写入操作相同;The second write operation execution unit 402 is used to call the target notification corresponding to the entry point, the target notification is used to execute the second write operation for the second database, the second write operation is related to the second write operation. The first write operation is the same;
第一写入操作执行单元403,用于在所述第二写入操作执行完成的情况下,调用所述切入点以执行所述第一写入操作。The first write operation execution unit 403 is configured to call the entry point to execute the first write operation when the execution of the second write operation is completed.
可选的,所述第二写入操作中未配置对应的执行逻辑;所述第二写入操作执行单元402具体用于:Optionally, no corresponding execution logic is configured in the second write operation; the second write operation execution unit 402 is specifically used to:
提取所述第一写入操作对应的数据库语句;Extract the database statement corresponding to the first write operation;
根据所述数据库语句构建对应的执行逻辑;Construct corresponding execution logic according to the database statement;
根据构建的执行逻辑实现所述第二写入操作。The second write operation is implemented according to the built execution logic.
可选的,所述装置还包括:Optionally, the device also includes:
数据回退单元404,用于提取并记录所述数据库语句中的数据表信息与对应的字段信息;The data rollback unit 404 is used to extract and record the data table information and corresponding field information in the database statement;
在确定所述第一写入操作发生异常的情况下,根据记录的数据表信息与对应的字段信息对所述第二数据库进行回退操作,以确保所述第一数据库的所述第二数据库的一致性。When it is determined that the first write operation is abnormal, perform a rollback operation on the second database according to the recorded data table information and corresponding field information to ensure that the second database of the first database consistency.
可选的,所述目标通知为前置通知或环绕通知;所述数据回退单元404具体用于:Optionally, the target notification is a forward notification or a surround notification; the data rollback unit 404 is specifically used to:
在所述目标通知为前置通知的情况下,调用对应所述切入点对应的后置通知,所述后置通知用于捕获所述第一写入操作发送的操作异常;In the case where the target notification is a pre-notification, call the post-notification corresponding to the entry point, and the post-notification is used to capture the operation exception sent by the first write operation;
在所述目标通知为环绕通知的情况下,执行所述环绕通知中的检查操作,所述检查操作用于捕获所述第一写入操作发送的操作异常;In the case where the target notification is a surround notification, perform a check operation in the surround notification, where the check operation is used to capture the operation exception sent by the first write operation;
在通过所述目标通知捕获到至少一个操作异常的情况下,确定所述第一写入操作发生异常。If at least one operation exception is captured through the target notification, it is determined that an exception occurs in the first write operation.
可选的,所述数据回退单元404具体用于:Optionally, the data rollback unit 404 is specifically used to:
在所述数据库语句为插入语句的情况下,根据记录的数据表信息与对应的字段信息对所述第二数据库执行相应的删除操作;When the database statement is an insert statement, perform a corresponding delete operation on the second database according to the recorded data table information and corresponding field information;
在所述数据库语句为删除语句的情况下,根据记录的数据表信息与对应的字段信息对所述第二数据库执行相应的插入操作;When the database statement is a delete statement, perform a corresponding insertion operation on the second database according to the recorded data table information and corresponding field information;
在所述数据库语句为更新语句的情况下,根据记录的数据表信息与对应的字段信息对所述第二数据库执行相应的更新操作。When the database statement is an update statement, a corresponding update operation is performed on the second database according to the recorded data table information and corresponding field information.
可选的,所述目标通知为环绕通知,所述装置还包括:Optionally, the target notification is a surrounding notification, and the device further includes:
第二写入操作取消单元405,用于在确定所述第二写入操作发生异常的情况下,在所述环绕通知中取消调用所述切入点,以使所述第一写入操作取消执行。The second write operation canceling unit 405 is configured to cancel the call to the entry point in the surrounding notification when it is determined that an exception occurs in the second write operation, so that the execution of the first write operation is canceled. .
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For details on the implementation process of the functions and effects of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method, and will not be described again here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
本说明书中描述的主题及功能操作的实施例可以在以下中实现:数字电子电路、有形体现的计算机软件或固件、包括本说明书中公开的结构及其结构性等同物的计算机硬件、或者它们中的一个或多个的组合。本说明书中描述的主题的实施例可以实现为一个或多个计算机程序,即编码在有形非暂时性程序载体上以被数据处理装置执行或控制数据处理装置的操作的计算机程序指令中的一个或多个模块。可替代地或附加地,程序指令可以被编码在人工生成的传播信号上,例如机器生成的电、光或电磁信号,该信号被生成以将信息编码并传输到合适的接收机装置以由数据处理装置执行。计算机存储介质可以是机器可读存储设备、机器可读存储基板、随机或串行存取存储器设备、或它们中的一个或多个的组合。Embodiments of the subject matter and functional operations described in this specification may be implemented in digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or in A combination of one or more. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more of computer program instructions encoded on a tangible non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Multiple modules. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, which signal is generated to encode and transmit the information to a suitable receiver device for transmission by the data The processing device executes. Computer storage media may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
本说明书中描述的处理及逻辑流程可以由执行一个或多个计算机程序的一个或多个可编程计算机执行,以通过根据输入数据进行操作并生成输出来执行相应的功能。所述处理及逻辑流程还可以由专用逻辑电路—例如FPGA(现场可编程门阵列)或ASIC(专用集成电路)来执行,并且装置也可以实现为专用逻辑电路。The processes and logic flows described in this specification may be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows may also be performed by dedicated logic circuits, such as FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit), and the device may also be implemented as a dedicated logic circuit.
适合用于执行计算机程序的计算机包括,例如通用和/或专用微处理器,或任何其他类型的中央处理单元。通常,中央处理单元将从只读存储器和/或随机存取存储器接收指令和数据。计算机的基本组件包括用于实施或执行指令的中央处理单元以及用于存储指令和数据的一个或多个存储器设备。通常,计算机还将包括用于存储数据的一个或多个大容量存储设备,例如磁盘、磁光盘或光盘等,或者计算机将可操作地与此大容量存储设备耦接以从其接收数据或向其传送数据,抑或两种情况兼而有之。然而,计算机不是必须具有这样的设备。此外,计算机可以嵌入在另一设备中,例如移动电话、个人数字助理(PDA)、移动音频或视频播放器、游戏操纵台、全球定位系统(GPS)接收机、或例如通用串行总线(USB)闪存驱动器的便携式存储设备,仅举几例。Computers suitable for executing the computer program include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from read-only memory and/or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more mass storage devices for storing data, such as magnetic, magneto-optical or optical disks, or the like, or the computer will be operably coupled to such mass storage device to receive data therefrom or to It transmits data, or both. However, the computer is not required to have such a device. Additionally, the computer may be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a universal serial bus (USB) ) flash drives for portable storage devices, to name a few.
适合于存储计算机程序指令和数据的计算机可读介质包括所有形式的非易失性存储器、媒介和存储器设备,例如包括半导体存储器设备(例如EPROM、EEPROM和闪存设备)、磁盘(例如内部硬盘或可移动盘)、磁光盘以及CD ROM和DVD-ROM盘。处理器和存储器可由专用逻辑电路补充或并入专用逻辑电路中。Computer-readable media suitable for storage of computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (such as EPROM, EEPROM, and flash memory devices), magnetic disks (such as internal hard disks or removable memory devices). removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory may be supplemented by or incorporated into special purpose logic circuitry.
虽然本说明书包含许多具体实施细节,但是这些不应被解释为限制任何发明的范围或所要求保护的范围,而是主要用于描述特定发明的具体实施例的特征。本说明书内在多个实施例中描述的某些特征也可以在单个实施例中被组合实施。另一方面,在单个实施例中描述的各种特征也可以在多个实施例中分开实施或以任何合适的子组合来实施。此外,虽然特征可以如上所述在某些组合中起作用并且甚至最初如此要求保护,但是来自所要求保护的组合中的一个或多个特征在一些情况下可以从该组合中去除,并且所要求保护的组合可以指向子组合或子组合的变型。Although this specification contains many specific implementation details, these should not be construed to limit the scope of any invention or what is claimed, but rather serve primarily to describe features of specific embodiments of particular inventions. Certain features described in this specification as multiple embodiments can also be combined in a single embodiment. On the other hand, various features that are described in a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, while features may function in certain combinations as described above and may even be originally claimed as such, one or more features from a claimed combination may in some cases be removed from that combination, and as claimed A protected combination can point to a subcombination or a variant of a subcombination.
类似地,虽然在附图中以特定顺序描绘了操作,但是这不应被理解为要求这些操作以所示的特定顺序执行或顺次执行、或者要求所有例示的操作被执行,以实现期望的结果。在某些情况下,多任务和并行处理可能是有利的。此外,上述实施例中的各种系统模块和组件的分离不应被理解为在所有实施例中均需要这样的分离,并且应当理解,所描述的程序组件和系统通常可以一起集成在单个软件产品中,或者封装成多个软件产品。Similarly, although operations are depicted in a specific order in the drawings, this should not be construed as requiring that the operations be performed in the specific order shown, or sequentially, or that all illustrated operations be performed to achieve desired results. result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product , or packaged into multiple software products.
由此,主题的特定实施例已被描述。此外,附图中描绘的处理并非必需所示的特定顺序或顺次顺序,以实现期望的结果。在某些实现中,多任务和并行处理可能是有利的。Thus, specific embodiments of the subject matter have been described. Furthermore, the processes depicted in the figures do not necessarily require the specific order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。The above are only preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included in this specification. within the scope of protection.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310778504.5ACN116756164A (en) | 2023-06-28 | 2023-06-28 | A data writing method and device for a database |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310778504.5ACN116756164A (en) | 2023-06-28 | 2023-06-28 | A data writing method and device for a database |
| Publication Number | Publication Date |
|---|---|
| CN116756164Atrue CN116756164A (en) | 2023-09-15 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310778504.5APendingCN116756164A (en) | 2023-06-28 | 2023-06-28 | A data writing method and device for a database |
| Country | Link |
|---|---|
| CN (1) | CN116756164A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2010012230A1 (en)* | 2008-08-01 | 2010-02-04 | 华为技术有限公司 | Data synchronization method and device |
| US20170220613A1 (en)* | 2016-02-01 | 2017-08-03 | Smartshift Technologies, Inc. | Systems and methods for database orientation transformation |
| CN109766330A (en)* | 2018-12-29 | 2019-05-17 | 北京三快在线科技有限公司 | Data fragmentation method, device, electronic equipment and storage medium |
| CN112487097A (en)* | 2020-12-11 | 2021-03-12 | 杭州安恒信息技术股份有限公司 | Method, system and equipment for synchronizing distributed field data |
| CN113032468A (en)* | 2019-12-09 | 2021-06-25 | 浙江大搜车软件技术有限公司 | Data writing method, device and computer readable storage medium |
| CN113407619A (en)* | 2020-03-16 | 2021-09-17 | 北京沃东天骏信息技术有限公司 | Method and device for constructing data and system for synchronizing data between databases |
| CN114860744A (en)* | 2022-05-06 | 2022-08-05 | 中国联合网络通信集团有限公司 | Heterogeneous database synchronization method, device, electronic device and computer medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2010012230A1 (en)* | 2008-08-01 | 2010-02-04 | 华为技术有限公司 | Data synchronization method and device |
| US20170220613A1 (en)* | 2016-02-01 | 2017-08-03 | Smartshift Technologies, Inc. | Systems and methods for database orientation transformation |
| CN109766330A (en)* | 2018-12-29 | 2019-05-17 | 北京三快在线科技有限公司 | Data fragmentation method, device, electronic equipment and storage medium |
| CN113032468A (en)* | 2019-12-09 | 2021-06-25 | 浙江大搜车软件技术有限公司 | Data writing method, device and computer readable storage medium |
| CN113407619A (en)* | 2020-03-16 | 2021-09-17 | 北京沃东天骏信息技术有限公司 | Method and device for constructing data and system for synchronizing data between databases |
| CN112487097A (en)* | 2020-12-11 | 2021-03-12 | 杭州安恒信息技术股份有限公司 | Method, system and equipment for synchronizing distributed field data |
| CN114860744A (en)* | 2022-05-06 | 2022-08-05 | 中国联合网络通信集团有限公司 | Heterogeneous database synchronization method, device, electronic device and computer medium |
| Publication | Publication Date | Title |
|---|---|---|
| CN102934114B (en) | For the checkpoint of file system | |
| CN110209735B (en) | Database backup method, database backup device, computing device, and storage medium | |
| CN110659256B (en) | Multi-computer room synchronization method, computing device and computer storage medium | |
| KR101087364B1 (en) | Retraction infrastructure | |
| US20150213100A1 (en) | Data synchronization method and system | |
| US8380660B2 (en) | Database system, database update method, database, and database update program | |
| CN110019527B (en) | Slave library reading method, related device and equipment | |
| CN105528264B (en) | Data recovery method and system for preventing misoperation | |
| CN109189613A (en) | A kind of database data recovery method and relevant apparatus | |
| WO2022148185A1 (en) | Data packet updating method and apparatus, electronic device, and readable storage medium | |
| CN113535141A (en) | Database operation code generation method and device | |
| CN107391539A (en) | Transaction methods, server and storage medium | |
| CN117785546A (en) | Database backup method, system and computing device cluster | |
| CN112685431B (en) | Asynchronous caching method, device, system, electronic equipment and storage medium | |
| US20130262804A1 (en) | Data duplication system, data duplication method, and program thereof | |
| CN116756164A (en) | A data writing method and device for a database | |
| CN118192987A (en) | Source code construction method and device, computer program product and electronic equipment | |
| CN111881212A (en) | Method, device, equipment and storage medium for executing check point operation | |
| US7657664B2 (en) | Method and system for tracking device driver requests | |
| CN117909221A (en) | File testing method, device, electronic device and computer readable medium | |
| CN117591260A (en) | Task execution method, device, equipment, storage medium and program product | |
| CN110879764A (en) | Bitmap setting method, device and equipment and readable storage medium | |
| CN110681153B (en) | Game archive management system, method, computer device, and medium | |
| CN114579604B (en) | Database transaction implementation method and system of application layer | |
| CN111580953A (en) | Method and device for making a scheduling simulation scene, storage medium and electronic device |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |