A data processing method, device, equipment and medium
By changing the transaction isolation level to repeatable read in high concurrency scenarios and cache multiple parameter tables, the problem of non-repeatable read when the database isolation level is read submitted is solved, and data consistency is improved.
Patent Information
- Application Number
- CN202411930993.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-08
AI Technical Summary
In high concurrency scenarios, when the isolation level of the database is read when it has been submitted, the three parameter tables of HAS, HSB, and HSC may have problems that cannot be read repeatedly, resulting in business exceptions.
Create a new target transaction, change the isolation level to repeatable reads, and cache multiple parameter tables into the target cache to avoid non-repeatable reads.
Ensure that the time synchronization offset of multiple parameter table sessions is at the same time, improving the consistency of data writing and avoiding business exceptions.
Smart Images

Figure CN119782328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, equipment and medium. Background Art
[0002] A transaction is a unit of concurrency control and a sequence of operations defined by the user. These operations are either all done or none of them, so it is an indivisible unit of work.
[0003] If there are three parameter tables HAS, HSB, and HSC in a transaction, in order to ensure data write consistency, the three parameter tables are read separately and the data is encapsulated into the cache. However, since the data modification is performed in a high-concurrency scenario and the database isolation level is Read Committed, the three parameter tables HAS, HSB, and HSC may have non-repeatable read problems, resulting in business abnormalities. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device and medium to solve the problem of non-repeatable reading between multiple parameter tables and improve the consistency of data writing.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Get multiple parameter tables to be cached;
[0007] Determine whether the isolation level corresponding to multiple parameter tables is non-repeatable read;
[0008] If so, a new target transaction is created, the isolation level is changed to repeatable read, and the multiple parameter tables are cached in the target cache.
[0009] Through the above method, the transaction isolation level at the session level is changed to repeatable read, which avoids the change of the cache data model structure and solves the problem of non-repeatable read. The time synchronization offset of multiple parameter table sessions is at the same time, ensuring data consistency.
[0010] In an optional implementation, caching multiple parameter tables into a target cache includes:
[0011] If there are a first parameter table, a second parameter table, and a third parameter table, then
[0012] In an optional implementation, changing the isolation level to repeatable read includes:
[0013] Create a new target annotation; wherein the isolation level in the target annotation is changed from non-repeatable read to repeatable read;
[0014] A target annotation is added to the target transaction to change the isolation level in the target transaction from non-repeatable read to repeatable read.
[0015] Through the above method, the isolation level of the transaction is changed by adding annotations to avoid the problem of non-repeatable read.
[0016] In an optional implementation, before caching the plurality of parameter tables into the target cache, the method further includes:
[0017] Traverse the preset cache list;
[0018] The cache objects in the preset cache list corresponding to the plurality of parameter tables are used to cache the plurality of parameter tables into the preset cache list.
[0019] Through the above method, multiple parameter tables can be cached in a preset cache list in sequence.
[0020] In an optional implementation, before using the cache objects in the preset cache list corresponding to the plurality of parameter tables respectively to cache the plurality of parameter tables in the preset cache list, the method further includes:
[0021] Get the cache timestamp and preset timestamp of the current moment;
[0022] Determine whether the preset timestamp is greater than the cache timestamp;
[0023] If so, the cache objects corresponding to the multiple parameter tables in the preset cache list are used to cache the multiple parameter tables into the preset cache list.
[0024] By comparing the cache timestamp at the current moment with the preset timestamp through the above method, the timeliness and consistency of the cached data can be ensured, and the problem of inconsistent cached data can be avoided.
[0025] In an optional implementation, before caching the multiple parameter tables into the target cache, the method further includes:
[0026] An encapsulation timestamp is set for the multiple parameter tables; wherein the encapsulation timestamp is used to make the data sections of the multiple parameter tables be at the same time.
[0027] Through the above method, it is possible to ensure that the data sections of multiple parameter tables are at the same time, which helps to maintain the consistency and accuracy of the data and avoid data layout problems.
[0028] In an optional implementation, obtaining multiple parameter tables to be cached includes:
[0029] In response to a query instruction for multiple parameter tables, a table association query statement is used to obtain multiple parameter tables from a target database.
[0030] The above method avoids the need to read multiple parameter tables separately, and can integrate data from different parameter tables that have related relationships. By connecting data through relationships such as primary keys and foreign keys, the integrity of the database can be maintained.
[0031] In a second aspect, the present application provides a data processing device, the device comprising:
[0032] An acquisition module is used to acquire multiple parameter tables to be cached;
[0033] A judgment module is used to judge whether the isolation level corresponding to multiple parameter tables is non-repeatable read;
[0034] Processing module, used to create a new target transaction, change the isolation level to repeatable read, and cache multiple parameter tables into the target cache
[0035] In an optional implementation, when the isolation level is changed to repeatable read, the processing module is specifically configured to:
[0036] Create a new target annotation; the isolation level in the target annotation is changed from non-repeatable read to repeatable read;
[0037] A target annotation is added to the target transaction to change the isolation level in the target transaction from non-repeatable read to repeatable read.
[0038] In an optional implementation, before using a preset cache list and cache objects corresponding to each of the plurality of parameter tables to cache the plurality of parameter tables into the preset cache list, the processing module is further configured to:
[0039] Get the cache timestamp and preset timestamp of the current moment;
[0040] Determine whether the preset timestamp is greater than the cache timestamp;
[0041] If so, the cache objects corresponding to the plurality of parameter tables in the preset cache list are used to cache the plurality of parameter tables in the preset cache list.
[0042] In an optional implementation, before caching the multiple parameter tables into the target cache, the processing module is further configured to:
[0043] An encapsulation timestamp is set for multiple parameter tables; wherein the encapsulation timestamp is used to make the data sections of the multiple parameter tables at the same time.
[0044] In an optional implementation, when acquiring multiple parameter tables to be cached, the acquisition module is specifically used to:
[0045] In response to a query instruction for multiple parameter tables, a table association query statement is used to obtain multiple parameter tables from a target database.
[0046] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the data processing method described in the first aspect above.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, which includes a program code. When the program code is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the data processing method described in the first aspect above.
[0048] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the data processing method as described in the first aspect.
[0049] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0051] Figure 1 A schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0055] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can represent two situations: A and B are directly connected and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0056] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0057] In addition, in the technical solution of this application, the acquisition, dissemination, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0058] The following is a brief introduction to the design concept of the embodiment of the present application:
[0059] A transaction is a unit of concurrency control and a sequence of operations defined by the user. These operations are either all done or none of them, so it is an indivisible unit of work.
[0060] If there are three parameter tables, HAS, HSB, and HSC, in a transaction, in order to ensure data write consistency, the three parameter tables are read separately and the data is encapsulated into the cache. However, since the data modification is performed in a high-concurrency scenario and the database isolation level is read committed, the three parameter tables HAS, HSB, and HSC may have non-repeatable read problems, resulting in business abnormalities.
[0061] Specifically, HSA is the accounting condition definition table, HSB is the accounting type mapping main table, and HSC is the accounting type mapping sub-table. Each table contains two fields, namely, multi-entity identifier and general ledger source number, which are used as parameter separators. The main and sub-tables of the accounting type mapping have a primary-foreign key association. When synchronizing the accounting type mapping parameter data of a component, a full overwrite write method is adopted, that is, the original data of a component in the table is deleted first, and then the new data in the file is imported and submitted to the database at the same time. Due to architectural design reasons, separate reading is adopted when reading and the data is encapsulated into a cache object. At the same time, because the writing action is performed with high concurrency, there will be a problem that the primary key in HSB cannot be found in HSC due to high-frequency transaction writing.
[0062] In view of this, the present application provides a data processing method, which includes: first, obtaining multiple parameter tables to be cached; then, determining whether the isolation level corresponding to the multiple parameter tables is non-repeatable read; if so, creating a new target transaction, changing the isolation level to repeatable read, and caching the multiple parameter tables into the target cache. Through the above method, the problem of non-repeatable read can be avoided, and the time synchronization offsets of multiple parameter tables are at the same time, ensuring data consistency.
[0063] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0064] (1) Isolation level: refers to the transaction isolation level proposed in database operations to effectively ensure the correctness of concurrent read data. These levels are described from the perspective of allowed concurrent side effects (for example, dirty reads or virtual reads) to ensure that a transaction must be isolated from the resources or data of other transactions.
[0065] (2) Read Committed: The lowest isolation level, which allows transactions to read changes that have not been committed by other transactions. This may result in dirty reads, that is, reading data that has not been committed by other transactions.
[0066] (3) Repeatable read: Ensures that the results of reading the same data multiple times within the same transaction are consistent, avoiding non-repeatable reads. However, phantom reads may occur, that is, executing the same query twice within the same transaction may return different result sets.
[0067] (3) Database: In short, it can be regarded as an electronic filing cabinet for storing electronic files. Users can add, query, update, delete, and other operations on the data in the files. The so-called database is a collection of data that is stored together in a certain way, can be shared with multiple users, has a small degree of redundancy, and is independent of the application.
[0068] The data processing method provided by the exemplary embodiment of the present application is described below with reference to the accompanying drawings.
[0069] See also Figure 1 As shown, it is a schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application. The specific implementation flow of the method is as follows:
[0070] S1: Obtain multiple parameter tables to be cached.
[0071] In the embodiment of the present application, the multiple parameter tables may be respectively an HSA parameter definition table, an HSB parameter main table, and an HSC parameter sub-table.
[0072] Specifically, the data distribution of HSA, HSB, and HSC is as follows:
[0073] Table 1 shows the data distribution of HSA, Table 2 shows the data distribution of HSB, and Table 3 shows the data distribution of HSC.
[0074] Table 1
[0075] Key Value AK1 {mid1, gid1, aval1} AK2 {mid2, gid2, aval2}
[0076] Table 2
[0077]
[0078]
[0079] Table 3
[0080] Key Value CK1 {bpk1,cval11}{bpk1cval12}{bpk1,cval13} CK2 {bpk1,cval21}{bpk1,cval22}{bpk1,cval23}
[0081] In the embodiment of the present application, if the data in multiple parameter tables need to be modified, it is necessary to clarify the structure of the parameter table to be queried and the timestamp field to be maintained. Then, the data of the three parameter tables HSA, HSB, and HSC are queried from the database according to the timestamp field, and the data is processed and loaded according to the query results, and the timestamp used in the query process is updated for use in the next query.
[0082] It should be noted that the timestamp can be used to identify the order of global submission of each event, so as to reflect the order of transactions in real time. The timestamp can be a physical clock, a logical clock, a hybrid physical clock or a hybrid logical clock, which is not specifically limited in the embodiments of the present application. However, it should be noted that the timestamp format needs to be consistent with the timestamp format in the database.
[0083] In an optional implementation, in response to a query instruction for multiple parameter tables, a table association query statement is used to obtain multiple parameter tables from a target database.
[0084] For example, in the embodiment of the present application, the table association query statement may be select * from HSB b, HSC c where b.bpk_id = c.bpk_id. The above method can obtain data corresponding to multiple parameter tables to be cached from the target database.
[0085] S2: Determine whether the isolation level corresponding to multiple parameter tables is non-repeatable read.
[0086] In the embodiment of the present application, when multiple parameter tables are obtained, it is also necessary to determine the isolation levels corresponding to the multiple parameter tables, and determine whether the isolation levels corresponding to the multiple parameter tables are non-repeatable reads.
[0087] For example, in a MySQL database, the current session or global transaction isolation level can be obtained through an SQL query statement.
[0088] By entering an SQL query statement, a string will be returned, indicating the transaction isolation level set in the current session. The returned string can include read uncommitted, which is the lowest level of database transaction isolation, allowing one transaction to read data that has not been committed by another transaction, read committed, at this isolation level, each read operation within the transaction will obtain the latest data status. Therefore, reading the same row of data multiple times within the same transaction may result in different data being seen, repeatable read, transactions using the repeatable read isolation level can retrieve the same set of rows multiple times and perform any operations on them until a commit or rollback operation terminates the transaction, serializable, which is the highest level of data volume transaction isolation, and can ensure that parallel execution between transactions has a serialized effect, that is, each transaction is executed sequentially without concurrent execution.
[0089] In the above four isolation levels, both Read Committed and Read Uncommitted will result in non-repeatable reads. Therefore, when it is found that the current isolation level is Read Committed or Read Uncommitted, step S3 is executed.
[0090] S3: Create a new target transaction, change the isolation level to repeatable read, and cache multiple parameter tables in the target cache.
[0091] In the embodiment of the present application, if the current isolation level is Read Committed or Read Uncommitted, it means that there may be a non-repeatable read situation at present. In order to avoid the non-repeatable read situation, the current isolation level needs to be modified.
[0092] In an optional implementation, a preset cache list is traversed through a cache loading method, and then cache objects corresponding to each of the multiple parameter tables in a preset cache category are used to cache the multiple parameter tables into the preset cache list.
[0093] Exemplarily, a cache loading method may be used to traverse the cacheList object, and the data of HSA, HSB, and HSC may be loaded and encapsulated in the cache list respectively.
[0094] In an optional implementation method, when caching the three parameter tables HSA, HSB, and HSC, it is also necessary to obtain the current timestamp and the preset timestamp. When the cache timestamp and the preset timestamp are obtained, it is determined whether the preset timestamp is greater than the cache timestamp. When the preset timestamp is greater than the cache timestamp, the cache objects corresponding to the multiple parameter tables in the preset cache list are used to cache the multiple parameter tables into the preset cache list.
[0095] It should be noted that when the data in the database changes, the corresponding cache timestamp will be updated to reflect the latest status of the data. Setting the cache timestamp to be less than the preset timestamp can reduce the problem of cache data inconsistency caused by data update delays. As long as the cache timestamp is less than the preset timestamp, it can be guaranteed that the data of multiple parameter tables will be updated before the preset timestamp arrives, thereby ensuring data consistency.
[0096] In addition, in an optional implementation, it is also necessary to set an encapsulation timestamp for multiple parameter tables, and the encapsulation timestamp is used to make the data sections of multiple parameter tables at the same time. By setting a unified encapsulation timestamp, it can be ensured that the relevant data obtained at a certain point in time is consistent, and that multiple parameter tables involved during a transaction use the same timestamp to mark the data status.
[0097] Furthermore, when objects of multiple parameter tables are encapsulated into cacheList, transaction control is added to the application implementation method so that the data obtained from the database is not affected by other transactions.
[0098] In an optional implementation, a new target annotation is created, and the isolation level of the session-level transaction is changed to repeatable read in the target annotation. Then, the target annotation is added to the target transaction, so that the isolation level of the target transaction is changed from non-repeatable read to repeatable read.
[0099] When creating a new target transaction, you can add an annotation to the cache loading method. For example, the annotation is @Transactional(propagation=Propagation.REQUIRES_NEW), so as to display the target transaction. It should be noted that the annotation of this step can be combined with the target annotation of changing the isolation level as mentioned above into one annotation.
[0100] Through the above method, the transaction isolation level at the session level is changed to repeatable read, which avoids the change of the cache data model structure and solves the problem of non-repeatable read. The time synchronization offset of multiple parameter table sessions is at the same time, ensuring data consistency.
[0101] Further, based on the same technical concept, the embodiment of the present application provides a data processing device, which is used to implement the above method flow of the embodiment of the present application. Figure 3 As shown, the device includes: an acquisition module 201, a judgment module 202 and a processing module 203, wherein:
[0102] An acquisition module 201 is used to acquire multiple parameter tables to be cached;
[0103] A judgment module 202 is used to judge whether the isolation level corresponding to the plurality of parameter tables is non-repeatable read;
[0104] The processing module 203 is used to create a new target transaction, change the isolation level to repeatable read, and cache multiple parameter tables in the target cache.
[0105] In an optional implementation, when the isolation level is changed to repeatable read, the processing module 203 is specifically configured to:
[0106] Create a new target annotation; the isolation level in the target annotation is changed from non-repeatable read to repeatable read;
[0107] A target annotation is added to the target transaction to change the isolation level in the target transaction from non-repeatable read to repeatable read.
[0108] In an optional implementation, before using a preset cache list and cache objects corresponding to each of the plurality of parameter tables to cache the plurality of parameter tables into the preset cache list, the processing module 203 is further configured to:
[0109] Get the cache timestamp and preset timestamp of the current moment;
[0110] Determine whether the preset timestamp is greater than the cache timestamp;
[0111] If so, the cache objects corresponding to the plurality of parameter tables in the preset cache list are used to cache the plurality of parameter tables in the preset cache list.
[0112] In an optional implementation, before caching the multiple parameter tables into the target cache, the processing module 203 is further configured to:
[0113] An encapsulation timestamp is set for multiple parameter tables; wherein the encapsulation timestamp is used to make the data sections of the multiple parameter tables at the same time.
[0114] In an optional implementation, when acquiring multiple parameter tables to be cached, the acquisition module 201 is specifically used to:
[0115] In response to a query instruction for multiple parameter tables, a table association query statement is used to obtain multiple parameter tables from a target database.
[0116] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which can implement the data processing method provided in the above embodiment of the present application. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. Figure 3 As shown, the electronic device may include:
[0117] At least one processor 301, and a memory 302 connected to the at least one processor 301. The specific connection medium between the processor 301 and the memory 302 is not limited in the embodiment of the present application. Figure 3 In the example, the processor 301 and the memory 302 are connected via the bus 300. The bus 300 is connected to the memory 302 via the bus 300. Figure 3 The bus 300 is represented by a bold line, and the connection between other components is only for schematic illustration and is not intended to be limiting. The bus 300 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 301 can also be called a controller, and there is no limitation on the name.
[0118] In the embodiment of the present application, the memory 302 stores instructions that can be executed by at least one processor 301. The at least one processor 301 can execute a data processing method discussed above by executing the instructions stored in the memory 302. The processor 301 can implement Figure 2 The functions of each module in the device shown.
[0119] Among them, the processor 301 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 302 and calling data stored in the memory 302, the various functions of the device and process data, the device can be monitored as a whole.
[0120] In one possible design, the processor 301 may include one or more processing units, and the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 301. In some embodiments, the processor 301 and the memory 302 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0121] The processor 301 may be a general-purpose processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a data processing method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0122] The memory 302 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 302 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 302 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 302 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0123] By designing and programming the processor 301, the code corresponding to a data processing method introduced in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 1 The steps of a data processing method in the embodiment shown are as follows: How to design and program the processor 301 is a technique known to those skilled in the art and will not be described in detail here.
[0124] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes a data processing method discussed above.
[0125] In some possible implementations, the present application also provides various aspects of a data processing method that can also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a data processing method according to various exemplary implementations of the present application described above in this specification.
[0126] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the data processing methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the data processing method, the implementation of the above-mentioned computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0127] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0128] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a server, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] Program code for performing the operations of the present application may be written using any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data processing method, characterized in that: The method comprises: Get multiple parameter tables to be cached; Determine whether the isolation level corresponding to the multiple parameter tables is non-repeatable read; If so, a new target transaction is created, the isolation level is changed to repeatable read, and the multiple parameter tables are cached in the target cache.
2. The method according to claim 1, characterized in that Changing the isolation level to repeatable read includes: Create a new target annotation; wherein the isolation level in the target annotation is changed from non-repeatable read to repeatable read; The target annotation is added to the target transaction to change the isolation level in the target transaction from non-repeatable read to repeatable read.
3. The method according to claim 1, characterized in that Caching the plurality of parameter tables into a target cache includes: Traverse the preset cache list; The cache objects in the preset cache list corresponding to the plurality of parameter tables are used to cache the plurality of parameter tables into the preset cache list.
4. The method according to claim 3, characterized in that Before caching the plurality of parameter tables in the preset cache list using the cache objects corresponding to the plurality of parameter tables respectively, the method further comprises: Get the cache timestamp and preset timestamp of the current moment; Determine whether the preset timestamp is greater than the cached timestamp; If so, the cache objects in the preset cache list corresponding to the plurality of parameter tables are used to cache the plurality of parameter tables into the preset cache list.
5. The method according to claim 1, characterized in that Before caching the plurality of parameter tables into the target cache, the method further includes: An encapsulation timestamp is set for the multiple parameter tables; wherein the encapsulation timestamp is used to make the data sections of the multiple parameter tables at the same time.
6. The method according to claim 1, characterized in that The obtaining of multiple parameter tables to be cached includes: In response to the query instruction of the plurality of parameter tables, a table association query statement is used to obtain the plurality of parameter tables from the target database.
7. A data processing device, characterized in that: The device comprises: An acquisition module is used to acquire multiple parameter tables to be cached; A judgment module, used to judge whether the isolation level corresponding to the plurality of parameter tables is non-repeatable read; The processing module then creates a new target transaction, changes the isolation level to repeatable read, and caches the multiple parameter tables in the target cache.
8. The device according to claim 7, characterized in that When the isolation level is changed to repeatable read, the processing module is specifically used for: Create a new target annotation; wherein the isolation level in the target annotation is changed from non-repeatable read to repeatable read; The target annotation is added to the target transaction to change the isolation level in the target transaction from non-repeatable read to repeatable read.
9. The device according to claim 7, characterized in that Before caching the plurality of parameter tables into the target cache, the processing module is further used to: Traverse the preset cache list; The cache objects in the preset cache list corresponding to the plurality of parameter tables are used to cache the plurality of parameter tables into the preset cache list.
10. The device according to claim 9, characterized in that Before using the preset cache list and the cache objects corresponding to the plurality of parameter tables respectively to cache the plurality of parameter tables in the preset cache list, the processing module is further used to: Get the cache timestamp and preset timestamp of the current moment; Determine whether the preset timestamp is greater than the cached timestamp; If so, the cache objects in the preset cache list corresponding to the plurality of parameter tables are used to cache the plurality of parameter tables in the preset cache list.
11. The device according to claim 7, characterized in that Before caching the plurality of parameter tables into the target cache, the processing module is further used for: An encapsulation timestamp is set for the multiple parameter tables; wherein the encapsulation timestamp is used to make the data sections of the multiple parameter tables at the same time.
12. The device according to claim 7, characterized in that When acquiring multiple parameter tables to be cached, the acquisition module is specifically used to: In response to the query instruction of the plurality of parameter tables, a table association query statement is used to obtain the plurality of parameter tables from the target database.
13. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
15. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.