WO2021068689A1 - 数据处理方法和相关装置 - Google Patents

数据处理方法和相关装置 Download PDF

Info

Publication number
WO2021068689A1
WO2021068689A1 PCT/CN2020/113108 CN2020113108W WO2021068689A1 WO 2021068689 A1 WO2021068689 A1 WO 2021068689A1 CN 2020113108 W CN2020113108 W CN 2020113108W WO 2021068689 A1 WO2021068689 A1 WO 2021068689A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
lock
data unit
unit
operated
Prior art date
Application number
PCT/CN2020/113108
Other languages
English (en)
French (fr)
Inventor
李海翔
卢卫
杜小勇
王童童
潘安群
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to JP2022515069A priority Critical patent/JP7375173B2/ja
Priority to KR1020227004713A priority patent/KR20220031110A/ko
Priority to EP20874981.2A priority patent/EP3992808A4/en
Publication of WO2021068689A1 publication Critical patent/WO2021068689A1/zh
Priority to US17/513,815 priority patent/US20220050818A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Definitions

  • This application relates to the field of data processing, in particular to a data processing method, device, server and storage medium.
  • the data in the relational database is stored in the form of tuples, which can be regarded as a table.
  • Each row in the table (that is, each data record in the database) is a tuple, and each column It is an attribute.
  • Transaction processing is a technology for processing data in a database.
  • a computer executes a transaction, it often needs to access one or more tuples.
  • the concurrent access control technology is to solve the conflict problem that the computer may cause when accessing the same tuple at the same time in the process of executing multiple transactions at the same time.
  • transaction A needs to read the tuple
  • transaction B needs to modify the tuple at the same time, which may cause conflicts.
  • the common method is to stagger the execution time of transaction A and transaction B.
  • the embodiments of the present application provide a data processing method, device, server, and storage medium, which can improve the efficiency of data processing.
  • the embodiment of the present application provides a data processing method, including:
  • the operation instruction including operation type information and data unit information to be operated corresponding to the data unit to be operated;
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the operation type information includes a first operation type and a second operation type
  • the lock detection includes a first lock detection and a second lock detection
  • the detection result includes the first lock detection Result and the second lock detection result
  • Performing lock detection on the data unit to be operated based on the lock state information and the operation type information to obtain a detection result includes:
  • the operation type information is the first operation type, perform a first lock detection on the data unit to be operated based on the lock state information to obtain a first lock detection result;
  • the operation type information is the second operation type, performing a second lock detection on the data unit to be operated based on the lock state information to obtain a second lock detection result;
  • the locking processing includes a first locking processing and a second locking processing, and the performing the locking processing on the data unit to be operated based on the detection result includes:
  • the lock status information includes a data lock of a data unit in the target data group, and the data lock includes a first data lock and a second data lock;
  • Performing a first lock detection on the data unit to be operated based on the lock state information to obtain a first lock detection result includes:
  • the performing the first lock processing on the data unit to be operated based on the first lock detection result includes:
  • the first data lock of the operation instruction is added to the data unit to be operated in the lock state information based on the first lock detection result.
  • the lock status information includes a data lock of a data unit in the target data group, and the data lock includes a first data lock and a second data lock;
  • Performing a second lock detection on the data unit to be operated based on the lock state information to obtain a second lock detection result includes:
  • the performing second lock processing on the data unit to be operated based on the second lock detection result includes:
  • the method before the acquiring operation instruction, the method further includes:
  • the data group set includes a first data group and a plurality of second data groups
  • Grouping the data units based on the number of historical operations and the preset value range to obtain a data group set includes:
  • the data unit includes a plurality of data sub-units
  • the generating a second data group corresponding to the data unit and adding the data unit to the second data group corresponding to the data unit includes:
  • the multiple data subunits are added to the second data group corresponding to the data unit.
  • the method before querying the target data group in the data group set according to the data unit information to be operated, the method further includes:
  • the instruction type of the group update instruction is a user group type
  • the instruction type of the grouping update instruction is an automatic grouping type
  • the data units in the data group set are automatically grouped again.
  • automatically regrouping the data units in the data group set includes:
  • the group update instruction includes the number of groups
  • the regrouping of the data units in the data group set by using the grouping update instruction includes:
  • the data units in the data group set are equally divided into the grouped number of data groups, and a grouped data group set is obtained.
  • the method further includes:
  • the historical operation information of the data unit is updated based on the operation instruction.
  • the lock status information includes a data lock of a data unit in the target data group
  • the method After executing the operation instruction to perform the operation corresponding to the operation type information on the data unit to be operated, the method further includes:
  • the data lock corresponding to the operation instruction is deleted for the data unit to be operated.
  • the embodiment of the present application also provides a data processing device, including:
  • An obtaining unit for obtaining an operation instruction including operation type information and data unit information to be operated corresponding to the data unit to be operated;
  • a query unit configured to query a target data group in a data group set according to the information of the data unit to be operated, the data group set including at least one data group, and the data group including at least one data unit;
  • the data lock unit is used to obtain the lock state information of the target data group
  • a detection unit configured to perform lock detection on the data unit to be operated based on the lock state information and the operation type information to obtain a detection result
  • a locking unit configured to perform locking processing on the data unit to be operated based on the detection result
  • the execution unit is configured to execute the operation instruction after completing the lock processing to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores multiple instructions, and the instructions are suitable for loading by a processor to execute any kind of data provided in the embodiments of the present application. Steps in the processing method.
  • An embodiment of the present application also provides a server, including a memory storing multiple instructions; the processor loads instructions from the memory to execute steps in any data processing method provided in the embodiments of the present application.
  • the embodiments of the present application also provide a computer program product, when the computer program product is executed, it is used to execute the steps in any data processing method provided in the embodiments of the present application.
  • the embodiment of the application can obtain operation instructions, which can include operation type information and data unit information to be operated corresponding to the data unit to be operated; according to the data unit information to be operated, the target data group can be queried in the data group set, and the data group set It may include at least one data group, and the data group may include at least one data unit; acquiring lock state information of the target data group; performing lock detection on the data unit to be operated based on the lock state information and operation type information to obtain the detection result; treat based on the detection result
  • the operation data unit performs the lock processing; when the lock processing is completed, the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the data unit to be operated can be locked according to the target data group to which the data unit to be operated belongs, so as to execute the operation instruction.
  • the present application can reduce the amount of calculation for acquiring lock state information and locking processing, thereby improving the efficiency of data processing while ensuring safety.
  • Figure 1a is a schematic diagram of an application scenario of a data processing method provided by an embodiment of the present application
  • FIG. 1b is a schematic diagram of the first flow of a data processing method provided by an embodiment of the present application.
  • FIG. 1c is a schematic diagram of the structure of a data group of a data processing method provided by an embodiment of the present application.
  • FIG. 1d is a schematic diagram of locking state information of a data processing method provided by an embodiment of the present application.
  • Fig. 2a is a schematic diagram of a second flow of a data processing method provided by an embodiment of the present application.
  • 2b is a schematic diagram of specific lock state information of the data processing method provided by an embodiment of the present application.
  • 2c is a schematic diagram of the architecture of the distributed data server of the data processing method provided by an embodiment of the present application.
  • Figure 3 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Table 1 shows the user data table, as follows:
  • Each tuple includes data of four attributes of the user, which are user number, user name, user age, and group to which the user belongs.
  • the first type of access can refer to reading data
  • the second type of access can mean writing data
  • the first type of access can mean writing data
  • the second type of access can mean reading data, and so on.
  • transaction A and transaction B can operate on the user data table:
  • transaction A starts to execute first. Before transaction A executes to read the user name of tuple A, tuple A needs to be locked first. After transaction A locks successfully and completes the reading, transaction B starts to execute, because transaction B needs to wait If there is no data lock on the tuple A, the user group of the tuple A can be written, and the story service B needs to wait until t10 to lock the tuple A.
  • the embodiments of the present application provide a data processing method and related device, which can resolve the above-mentioned conflict and misjudgment situation, thereby improving data processing efficiency.
  • the data processing apparatus may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices.
  • the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer (Personal Computer, PC) and other devices;
  • the server can be a single server or a server cluster composed of multiple servers.
  • the data processing apparatus may also be integrated in multiple electronic devices.
  • the data processing apparatus may be integrated in multiple servers, and the data processing method of the present application is implemented by the multiple servers.
  • the electronic device can be integrated in a server, and the server can obtain an operation instruction.
  • the operation instruction includes operation type information and data unit information to be operated corresponding to the data unit to be operated; according to the information of the data unit to be operated in the data group collection Query the target data group in the query target data group, the data group set includes at least one data group, the data group includes at least one data unit; the lock state information of the target data group is acquired; the lock state information and the operation type information are used to perform lock detection on the data unit to be operated to obtain Detection result; lock processing is performed on the data unit to be operated based on the detection result; when the lock processing is completed, the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • this solution can determine whether the lock can be locked and execute the operation instruction according to the lock state information of the target data group corresponding to the data unit to be operated, so as to perform the transaction corresponding to the operation corresponding to the operation type information on the data unit to be operated.
  • This solution can The conflict is judged more accurately, so as to solve the problem of low data processing efficiency caused by the above-mentioned misjudgment of the conflict.
  • a data processing method is provided. As shown in FIG. 1b, the specific flow of the data processing method may be as follows:
  • the operation instruction includes operation type information and data unit information to be operated corresponding to the data unit to be operated.
  • the operation instruction may be an operation instruction that refers to data in the database, and may include operation type information of the operation instruction, and data unit information to be operated corresponding to the data unit to be operated to be operated by the operation instruction.
  • the method of obtaining the operation instruction may be obtained from a network server through the network, or may be generated and obtained periodically by an electronic device integrated with a data processing device, and a technician may also operate the electronic device.
  • the data processing device obtains the operating instructions generated by the electronic device, and so on.
  • the data processing device can obtain the operating instructions issued by the technician.
  • the technician can import the update file into the database server.
  • the database server can follow the update file And the update operation of the technician generates multiple operation instructions.
  • the operation type information can record specific operation methods on the data, such as reading data, deleting data, updating data, modifying data, writing data, and so on.
  • the data unit operated by the operation instruction can be recorded in the data unit information to be operated.
  • the data unit is composed of data particles that store the data information in the database, and the granularity can describe the degree of refinement of the data particles stored in the database. , The finer the granularity of the data particles in the database, the higher the degree of refinement of the database; the coarser the granularity of the data particles in the database, the lower the degree of refinement of the database.
  • the data particle refers to the smallest unit used to store data information in the database.
  • Table 1 there are 8 data particles in Table 1, which are 0001 (user number of tuple A), Alan (user name of tuple A), 18 (user age of tuple A), student (yuan Group A users belong to), 0002 (user number of tuple B), Bryan (user name of tuple B), 26 (age of users of tuple B), lawyer (group of users of tuple B).
  • the data unit can be composed of one or more data particles.
  • Table 1 can include two data units, namely Tuple A and Tuple B.
  • one data unit that is, tuple A
  • the other data unit that is, tuple B
  • has 4 data particles which are 0002, Bryan, and 26. , Lawyer.
  • Table 1 may include four data units, which are user number, user name, user age, and lawyer to which the user belongs.
  • one data unit namely user number
  • the other data unit namely user name
  • has 2 data particles namely Alan and Bryan
  • another data unit namely user Age
  • has 2 data particles which are 18 and 26
  • the last data unit that is, the user's group
  • the current data unit of the database is a tuple composed of multiple data particles, where a tuple is a row of data in the data table structure stored in the database, for example, refer to Table 1, when the database is stored
  • the tuple refers to each row in the table 1, that is, table 1 includes two tuples, namely tuple A and tuple B.
  • tuple A consists of 4 data particles, which can be expressed as tuple A (0001, Alan, 18, student);
  • tuple B consists of 4 data particles, which can be expressed as tuple B (0002, Bryan, 26 , Lawyer).
  • the way the data unit is composed of data particles can be determined according to the initial settings of the database, or can be modified according to the settings of the database by the technicians, that is, the granularity of the data unit is modified to be smaller than the granularity of the tuple.
  • the data group set may include one or more data groups, and each data group may include one or more data units.
  • Table 1 is a data group set. There is only one data group in the data group set.
  • the data group is tuple A and tuple B.
  • the data group can have 8 data units, each of which is tuple A.
  • User number, user name, user age, user group, and tuple B user number, user name, user age, user group.
  • the data units can be automatically allocated to the data group in advance, so that the data unit allocation is reasonable, thereby further reducing the probability of conflict misjudgment.
  • the data units are grouped based on the number of historical operations and the preset value range to obtain a data group set.
  • the preset value range can be set by those skilled in the art, can also be obtained through the network, and can also be obtained according to the previously calculated misjudgment probability, and so on.
  • the historical operation information of the data unit refers to the operation instructions recorded in the historical time, that is, the operation type information of the data unit to be operated in the historical time is recorded. Based on these historical operation information, the number of times that each data unit has been operated from the historical moment to the present moment, that is, the number of historical operations, can be counted.
  • the data group set may include a first data group and a plurality of second data groups
  • the step of "grouping data units based on the number of historical operations and a preset value range to obtain a data group set" may include the following step:
  • the data unit is added to the first data group;
  • the data units with high historical operation probability can be regarded as the computers that are more likely to cause conflicts when processing these data units. Therefore, these data units that are more likely to cause conflicts are divided into a group, and the data units that are not prone to conflicts are divided into groups. Being in a group can effectively reduce the conflict misjudgment rate and reduce the amount of calculation, especially when there are too many data units.
  • the data unit may include multiple data sub-units, and the steps: "generate a second data group corresponding to a data unit, and add the data unit to the data unit
  • the corresponding second data group may include the following specific steps:
  • the method of the second data group is: while the historical operation probability of each second data group belongs to the preset value range, its historical operation probability is equal to the sum of the historical operation probabilities of all data units in the second data group .
  • n is the number of data units in the second data group.
  • a data group set may include multiple data groups, and each data group may include multiple data units.
  • the target data group corresponding to the data unit to be operated can be queried in the data group set according to the information of the data unit to be operated.
  • the target data group corresponding to the data unit to be operated can be queried in the data group set shown in FIG. 1c.
  • data group 2 may be determined as the target data group.
  • this solution can automatically update the data set set frequently, so that the determination of conflicts can be more accurate, so each time before step 102, the following steps can be included to prevent omission of conflicts:
  • the instruction type of the group update instruction is a user group type
  • the instruction type of the group update instruction is an automatic grouping type
  • the data units in the data group set are automatically grouped again.
  • the group update instruction may be an instruction used to update the data group set.
  • the group update instruction may be set and issued by the user, or may be generated periodically by itself, or may be obtained from the network.
  • the group update instruction may have multiple types.
  • the group update instruction may be a user group type or an automatic group type.
  • the group update instruction may also be a mixed group type.
  • the group update instruction of the user group type means that the group update instruction is a group update instruction issued by the user
  • the group update instruction of the automatic group type means that the group update instruction is a group update instruction automatically generated by a computer.
  • the step "automatically regroup data units in the data group set” may include the following steps:
  • the data units are grouped based on the number of historical operations and the preset value range to obtain a re-automatically grouped data group set.
  • the group update instruction may include the number of groups, and the step of "using the group update instruction to regroup data units in the data group set" may include the following steps:
  • the data units in the data group set are equally divided into grouped data groups to obtain a grouped data group set.
  • the group update instruction of the user group type may include the number of groups set by the user.
  • the 100 data units are divided into 5 groups, and each group includes 20 data units.
  • a group update instruction of a mixed grouping type may also be provided.
  • the specific mixed grouping method is a mixture of the above-mentioned user grouping method and the computer automatic grouping method. body.
  • the group update instruction of the user group type can be obtained, the data units are grouped in advance according to the group update instruction of the user group type, and the data of these pre-user groupings are further automatically grouped in the subsequent data processing scenario.
  • the lock state information refers to the state information of the data locks of all data units in the data group
  • the data lock is a virtual concept used to represent the lock state of the data unit or the data group.
  • the status information of the data lock can indicate the type of the data lock
  • the data lock can include multiple types.
  • the data lock can include a read lock (shared lock) type data lock and a write lock (exclusive lock) type data lock. ,and many more.
  • the lock status information can be expressed by identification, text, symbols, etc., for example, 0 means no data lock, 1 means data lock of read lock type, 2 means data lock of write lock type, and so on.
  • data locks can be divided into first data locks and second data locks.
  • data group A can have a mapping relationship with lock state information A
  • data group B can have a lock state information B. Mapping relations.
  • the lock status information A contains the status information of the data lock of the data unit in the data group A, for example, the first data lock added by the transaction A to the data unit x in the data group A, and the transaction B to the data unit y in the data group A The second data lock added.
  • the operation type information may include the first operation type and the second operation type
  • the lock detection may include the first lock detection and the second lock detection
  • the detection result may include the first lock detection result and the second lock detection result. result.
  • Step 104 may include the following steps:
  • the operation type information is the first operation type
  • the second lock detection result is performed on the data unit to be operated based on the lock state information to obtain the second lock detection result.
  • the data lock may include a first data lock and a second data lock.
  • the step of "performing a first lock detection on the data unit to be operated based on the lock status information to obtain a first lock detection result" may include the following steps:
  • the step "performing the second lock detection on the data unit to be operated based on the lock state information to obtain the second lock detection result" may include the following steps:
  • the lock processing may include a first lock processing and a second lock processing
  • step 105 may include the following steps:
  • step of "performing the first lock processing on the data unit to be operated based on the first lock detection result” may include the following steps:
  • the first data lock of the operation instruction is added to the data unit to be operated in the lock state information of the target data group.
  • the step of "performing the second lock processing on the data unit to be operated based on the second lock detection result” may include the following steps:
  • the second data lock of the operation instruction is added to the data unit to be operated in the lock state information of the target data group.
  • data locks can include multiple types.
  • data locks can include read locks (shared locks) and write locks (exclusive locks).
  • the write lock can be called the first data lock
  • the read lock can be called the second data lock.
  • the relationship between the two locks can be as follows:
  • the read lock and read lock of the data unit to be operated can coexist, the read lock and write lock of the data unit to be operated are mutually exclusive, and the write lock and write lock of the data unit to be operated are mutually exclusive.
  • the transaction B can add the read lock of the transaction B to the data unit Q, but not the data Unit Q plus transaction B's write lock; assuming that data unit Q already has transaction A's write lock, transaction B cannot add transaction B's read lock to data unit Q, nor can transaction B add transaction B to data unit Q Write lock.
  • the operation type information may include a first operation type and a second operation type
  • the lock processing includes a first lock processing and a second lock processing.
  • step 104 may include the following steps:
  • the operation type information is the first operation type, perform the first lock processing on the data unit to be operated based on the lock state information;
  • the data unit to be operated is subjected to the second lock processing based on the lock state information.
  • the first operation type may be a write type
  • the second operation type may be a read type, and so on.
  • the first locking process may refer to adding a write lock to the data unit to be operated
  • the second locking process may refer to adding a read lock to the data unit to be operated, and so on.
  • the data unit to be operated may have transaction locks added by multiple transactions.
  • the lock status information may include the data lock of the data unit in the target data group.
  • the first data lock of the operation instruction is added to the lock status information of the target data group for the data unit to be operated.
  • the data unit to be operated may have transaction locks added by multiple transactions.
  • the lock status information may include the data lock of the data unit in the target data group.
  • the second data lock of the operation instruction is added to the lock status information of the target data group for the data unit to be operated.
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the operation instruction can be executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • each time an operation instruction is executed after the operation corresponding to the operation type information is performed on the data unit to be operated, the execution can be saved in the historical operation information, so that the data group set can be updated through automatic grouping, thereby reducing the number of subsequent operations.
  • the calculation amount of data processing improves the efficiency of data processing, so after step 105, the following steps may also be included:
  • the lock status information may include the data lock of the data unit in the target data group, and the operation instruction is executed to unlock the data unit to be operated in a timely manner after the operation corresponding to the operation type information can improve the efficiency of other transaction processing data.
  • the following steps may also be included:
  • the data lock corresponding to the operation instruction is deleted for the data unit to be operated.
  • the embodiment of the present application can obtain operation instructions and data group sets.
  • the data group set includes at least one data group, the data group includes at least one data unit, and the operation instruction includes operation type information and data to be operated corresponding to the data unit to be operated.
  • Unit information query the target data group corresponding to the data unit to be operated in the data group set according to the information of the data unit to be operated; obtain the lock status information of the target data group; perform lock processing on the data unit to be operated based on the lock status information and operation type information ;
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • this solution can perform corresponding lock processing for the unit to be operated according to the target data group to which the unit to be operated belongs, so as to execute the operation instruction.
  • the present application can reduce the amount of calculation for acquiring lock state information and locking processing, thereby improving the efficiency of data processing while ensuring safety.
  • the user before the data group set is automatically updated, the user can specify how the data unit is allocated to the data group.
  • the user can specify that all the data units in the odd-numbered columns in Table 1 are divided into one data group, and all the data units in the even-numbered columns are divided into one data group; for another example, the odd-numbered rows in Table 1 ( That is, all the data units in the tuples of 1, 3, 5... are divided into a data group, and all the data units in the even-numbered rows (that is, the tuples of the 2, 4, 6%) Divided into a data group.
  • the user can set the number of groups to 4, and specify that all the data units in Table 1 are divided into 4 groups.
  • the user can set the number of groups to 2, specify that every two columns of data units in Table 1 are grouped into one group, and so on.
  • the user grouping method can adjust the granularity of conflict detection, so that the granularity is reduced from tuples to data groups set by users, thereby reducing the amount of information maintenance. For example, suppose transaction T1 accesses the data unit x and data unit y of the tuple. If the user divides the data unit x and the data unit y into the same data group, after the transaction T1 is executed (that is, step 207), only Record that transaction T1 accessed the array.
  • this embodiment can automatically update the data group set.
  • the computer can automatically update the data group set by judging the data units that are prone to conflicts in the data units.
  • these data units that are prone to conflicts can be called conflict-prone units, and the data units that are not prone to conflicts are referred to here. It is called a unit that is not easy to conflict. Then, each unit that is easy to conflict is used as a data group, and the unit that is not easy to conflict is added to n data groups.
  • n is a positive integer
  • the specific size of n can be specified by the user, can also be set by a person skilled in the art, and can also be determined according to the number of units that are not prone to conflicts.
  • the way to determine the conflict-prone unit and the non-conflict-prone unit is as follows:
  • the data units are grouped based on the number of historical operations and the preset value range to obtain a re-automatically grouped data group set.
  • the preset value range is 10 to positive infinity
  • the historical operation times of each data unit in the data group set can be counted according to the historical operation information, and the data unit with the historical operation times from 10 to positive infinity is determined as the conflict-prone unit, otherwise It is a non-conflict unit.
  • the operation instruction includes operation type information and information of the data unit to be operated, and query the target data group corresponding to the data unit to be operated in the data group set according to the information of the data unit to be operated, and obtain the information of the target data group Lock status information.
  • the operation type information can be a read type and a write type. Assuming that the data unit to be operated is data unit c, referring to FIG. 1c, the target data group to which the data unit to be operated belongs is data group 2.
  • the lock status information of data group 2 can be obtained, where the lock status information of data group 2 records the write lock added by the current transaction A on data unit a, and the current transaction B in data unit c Read lock added on.
  • the data unit to be operated is data unit c, and the data unit c currently has a read lock added by transaction B. Based on the read lock and the operation type information, the data unit to be operated can be locked.
  • the read lock and the read lock can coexist, the read lock and the write lock are mutually exclusive, and the write lock and the write lock are mutually exclusive.
  • the data unit c currently has the read lock added by transaction B, if the operation type information shows the read type
  • the read lock of this transaction can be added; if the operation type information shows the write type, the lock fails.
  • the operation data unit deletes the data lock of the operation instruction.
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated, and the historical operation information of the data unit is updated according to the operation instruction, and it is the data unit to be operated in the lock status information of the target data group Delete the data lock of the operation instruction.
  • the distributed database architecture in Fig. 2c adopts this data processing scheme, wherein the distributed database adopts the method of database sub-database and data sub-table for data storage and processing.
  • the coordination system can be Zookeeper (a distributed computing system), Spark (a distributed computing system), and so on.
  • the database is divided into M groups to obtain M database groups, and each group includes a primary database server and N standby database servers, so as to achieve load balancing.
  • the operation instruction issued by the user is assigned to the corresponding database group by the coordination system, so that the data written by the user is scattered and stored in different database groups.
  • the data packet is split into multiple tables and stored in different database groups according to the split logic.
  • gateways such as gateway 1, gateway 2...gateway n can push the data table to the coordination system, and the coordination system can save it in the form of tasks and send it to the main database in the database
  • the server or standby database server collects the results returned by the primary and standby database servers in each group of databases, and returns the results to the user.
  • the database can pull tasks from the coordination system, switch the active and standby database servers in each group of databases, and monitor the status of the database and upload it to the coordination system.
  • the embodiment of the present application can automatically update the data set set, the updated data set set includes at least one data set, the data set includes at least one data unit; the operation instruction is obtained, and the operation instruction includes operation type information and waiting information.
  • the lock status information is the data lock of the data unit to be operated to delete the operation instruction. Therefore, the embodiments of the present application can improve the concurrency of transactions and the throughput of the database while ensuring the accuracy of conflict detection, thereby improving the efficiency of
  • the embodiments of the present application also provide multiple grouping methods, so that the granularity of conflict detection can be changed by the user or automatically, and the amount of calculation can be further reduced while ensuring the accuracy of conflict detection.
  • an embodiment of the present application also provides a data processing device.
  • the data processing device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices.
  • the terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, or a personal computer (Personal Computer, PC) and other devices;
  • the server may be a single server or a server cluster composed of multiple servers.
  • the data processing device can also be integrated in multiple electronic devices.
  • the data processing device can be integrated in multiple servers, and the multiple servers form a distributed server cluster to implement the data processing method of the present application. .
  • the embodiments of the present application provide a data processing device, wherein the data processing device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices.
  • the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, etc.
  • the server can be a single server or a server cluster composed of multiple servers.
  • the data processing device may include an acquisition unit 301, a query unit 302, a data lock unit 303, a detection unit 304, a lock unit 305, and an execution unit 306 as follows:
  • the obtaining unit 301 may be used to obtain an operation instruction.
  • the operation instruction includes operation type information and data unit information to be operated corresponding to the data unit to be operated.
  • the obtaining unit 301 may further include obtaining subunits, statistics subunits, and grouping subunits before performing the step "obtain operation instructions, which include operation type information and data unit information to be operated", as follows:
  • the obtaining subunit can be used to obtain the preset value range and historical operation information of the data unit.
  • the statistics subunit can be used to count the number of historical operations of each data unit based on historical operation information.
  • the grouping subunit can be used to group the data units based on the number of historical operations and the preset value range to obtain a data group set.
  • the data group set may include a first data group and a plurality of second data groups
  • the grouping subunit may include a probability submodule, a first data group generation submodule, a first data group adding submodule, and Add sub-modules to the second data group, as follows:
  • the probability sub-module can be used to calculate the historical operation probability of each data unit based on the number of historical operations
  • the first data group generation sub-module may be used to generate a first data group
  • the first data group adding submodule can be used to add the data unit to the first data group
  • the data unit may include multiple data sub-units, and the first data group adding sub-module may be specifically used for:
  • the query unit 302 may query the target data group in the data group set according to the information of the data unit to be operated.
  • the data group set includes at least one data group, and the data group includes at least one data unit.
  • the query unit 302 before the query unit 302 is used to query the target data group corresponding to the data unit to be operated in the data group set according to the information of the data unit to be operated, it may include an update subunit, a user update subunit, and an automatic update subunit. Used for:
  • the instruction type of the group update instruction is a user group type
  • the instruction type of the group update instruction is an automatic grouping type
  • the data units in the data group set are automatically grouped again.
  • the update subunit is used to obtain group update instructions.
  • the user update subunit can be used to regroup the data units in the data group set by using the group update instruction.
  • the automatic update subunit can be used to automatically regroup the data units in the data group set.
  • the automatic update subunit can be specifically used for:
  • the data units are grouped based on the number of historical operations and the preset value range to obtain a re-automatically grouped data group set.
  • the user update subunit can be specifically used for:
  • the data units in the data group set are equally divided into grouped data groups to obtain a grouped data group set.
  • the data lock unit 303 may be used to obtain the lock state information of the target data group.
  • the detection unit 304 may be configured to perform lock detection on the data unit to be operated based on the lock state information and the operation type information to obtain the detection result.
  • the operation type information includes a first operation type and a second operation type
  • the lock detection includes a first lock detection and a second lock detection
  • the detection result includes the first lock detection result and the second lock detection result.
  • the detection unit 304 may be specifically used to:
  • the operation type information is the first operation type
  • the second lock detection result is performed on the data unit to be operated based on the lock state information to obtain the second lock detection result.
  • Locking unit 305
  • the locking unit 305 may be configured to perform locking processing on the data unit to be operated based on the detection result.
  • the locking processing may include a first locking processing and a second locking processing
  • the locking unit 305 may be specifically used for:
  • the execution unit 306 may be configured to execute an operation instruction after the lock processing is completed to perform an operation corresponding to the operation type information on the data unit to be operated.
  • the execution unit 306 may also be used to:
  • the lock status information may include the data lock of the data unit in the target data group.
  • the execution unit 306 executes the operation instruction to perform the operation corresponding to the operation type information on the data unit to be operated, the execution unit 306 may also be used for :
  • the data unit to be operated deletes the data lock of the operation instruction.
  • each of the above data units can be implemented as independent entities, or can be combined arbitrarily, and implemented as the same or several entities.
  • the data processing device of this embodiment obtains the operation instruction by the acquisition unit.
  • the operation instruction includes the operation type information and the data unit information to be operated corresponding to the data unit to be operated;
  • the query unit collects the data group according to the information of the data unit to be operated Query the target data group in the query target data group, the data group set includes at least one data group, the data group includes at least one data unit;
  • the data lock unit obtains the lock status information of the target data group;
  • the detection unit treats the operation data based on the lock status information and the operation type information
  • the unit performs lock detection to obtain the detection result;
  • the lock unit performs lock processing on the data unit to be operated based on the detection result; when the execution unit completes the lock processing, the operation instruction is executed to correspond to the operation type information of the data unit to be operated Operation.
  • the embodiment of the solution can reduce the amount of calculation, the embodiment of the solution can improve the efficiency of data processing.
  • the embodiment of the present application also provides an electronic device, which may be a terminal, a server, or other devices.
  • the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, etc.
  • the server can be a single server or a server cluster composed of multiple servers.
  • the electronic device of this embodiment is a server as an example for detailed description.
  • FIG. 4 it shows a schematic diagram of the structure of the server involved in the embodiment of the present application:
  • the server may include one or more processing core processors 401, one or more computer-readable storage medium memory 402, power supply 403, input module 404, communication module 405 and other components.
  • processing core processors 401 one or more computer-readable storage medium memory 402, power supply 403, input module 404, communication module 405 and other components.
  • power supply 403 input module 404
  • communication module 405 communication module 405 and other components.
  • FIG. 4 does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or a combination of certain components, or different component arrangements. among them:
  • the processor 401 is the control center of the server. It uses various interfaces and lines to connect various parts of the entire server, and by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, Perform various functions of the server and process data to monitor the server as a whole.
  • the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user For interface and application programs, the modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 401.
  • the memory 402 may be used to store software programs and modules.
  • the processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402.
  • the memory 402 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of the server, etc.
  • the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the memory 402 may further include a memory controller to provide the processor 401 with access to the memory 402.
  • the server also includes a power supply 403 for supplying power to various components.
  • the power supply 403 may be logically connected to the processor 401 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
  • the power supply 403 may also include any components such as one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
  • the server may further include an input module 404, which may be used to receive inputted numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • an input module 404 which may be used to receive inputted numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the server may further include a communication module 405.
  • the communication module 405 may include a wireless module.
  • the server may perform short-distance wireless transmission through the wireless module of the communication module 405, thereby providing users with wireless broadband Internet access.
  • the communication module 405 can be used to help users send and receive emails, browse webpages, and access streaming media.
  • the server may also include a display data unit, etc., which will not be repeated here.
  • the processor 401 in the server loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the executable file stored in the memory.
  • the application program in 402 realizes various functions, as follows:
  • an operation instruction which includes operation type information and data unit information to be operated corresponding to the data unit to be operated;
  • the data group set includes at least one data group, and the data group includes at least one data unit;
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • an embodiment of the present application provides a computer-readable storage medium in which multiple instructions are stored, and the instructions can be loaded by a processor to execute the steps in any data processing method provided in the embodiments of the present application .
  • the instruction can perform the following steps:
  • an operation instruction which includes operation type information and data unit information to be operated corresponding to the data unit to be operated;
  • the data group set includes at least one data group, and the data group includes at least one data unit;
  • the operation instruction is executed to perform the operation corresponding to the operation type information on the data unit to be operated.
  • the storage medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
  • the embodiments of the present application also provide a computer program product, which is used to execute steps in any data processing method when the computer program product is executed.

Abstract

一种数据处理方法和相关装置,涉及数据处理领域。该方法包括:获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息(101);根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元(102);获取目标数据组的锁定状态信息(103);基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果(104);基于检测结果对待操作数据单元进行加锁处理(105);当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作(106)。该方法根据待操作单元所属的目标数据组来为待操作单元进行对应的加锁处理,由此,可以在保证安全的同时,提升数据处理的效率。

Description

数据处理方法和相关装置
本申请要求于2019年10月10日提交中国专利局、申请号201910959838.6、申请名称为“数据处理方法、装置、服务器和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,具体涉及一种数据处理方法、装置、服务器和存储介质。
背景技术
关系数据库中的数据是以元组(tuple)的形式存储的,可以将其看作一张表,该表中的每一行(即数据库中的每条数据记录)都是一个元组,每一列就是一个属性。
事务处理是一种处理数据库中数据的技术,计算机执行一个事务时常常需要对一个或多个元组进行访问等。其中,并发访问控制技术是为了解决计算机在同时执行多个事务的过程中,同时访问同一元组可能导致的冲突问题。比如,事务A需要读取元组,而事务B同时需要修改该元组时,可能会导致冲突,为了解决冲突问题,常用的方法是将事务A和事务B的执行时间错开。
然而,目前的并发访问控制技术很容易产生冲突误判,由此导致这些被误判为冲突的多个并发事务必须错开执行时间,无法同时执行,从而使得执行事务的并发度低下,因此,目前基于并发访问控制技术的数据处理方法效率低下。
发明内容
本申请实施例提供一种数据处理方法、装置、服务器和存储介质,可以提升数据处理的效率。
本申请实施例提供一种数据处理方法,包括:
获取操作指令,所述操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
根据所述待操作数据单元信息在数据组集合中查询目标数据组,所述数据组集合包括至少一个数据组,所述数据组包括至少一个数据单元;
获取所述目标数据组的锁定状态信息;
基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果;
基于所述检测结果对所述待操作数据单元进行加锁处理;
当完成所述加锁处理后,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作。
在一些实施例中,所述操作类型信息包括第一操作类型、第二操作类型,所述加锁检测包括第一加锁检测和第二加锁检测,所述检测结果包括第一加锁检测结果和第二加锁检测结果;
基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果,包括:
当所述操作类型信息为第一操作类型时,基于所述锁定状态信息对所述待操作数据单元进行第一加锁检测,得到第一加锁检测结果;
当所述操作类型信息为第二操作类型时,基于所述锁定状态信息对所述待操作数据单元进行第二加锁检测得到第二加锁检测结果;
所述加锁处理包括第一加锁处理和第二加锁处理,所述基于所述检测结果对待操作数据单元进行加锁处理,包括:
基于所述第一加锁检测结果对所述待操作数据单元进行第一加锁处理;
或,基于所述第二加锁检测结果对所述待操作数据单元进行第二加锁处理。
在一些实施例中,所述锁定状态信息包括所述目标数据组中数据单元的数据锁,所述数据锁包括第一数据锁、第二数据锁;
基于所述锁定状态信息对所述待操作数据单元进行第一加锁检测,得到第一加锁检测结果,包括:
基于所述锁定状态信息确定所述待操作数据单元对应的全部数据锁;
当所述全部数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第一加锁检测结果;
所述基于所述第一加锁检测结果对所述待操作数据单元进行第一加锁处理,包括:
基于所述第一加锁检测结果在所述锁定状态信息中为所述待操作数据单元添加所述操作指令的第一数据锁。
在一些实施例中,所述锁定状态信息包括所述目标数据组中数据单元的数据锁,所述数据锁包括第一数据锁、第二数据锁;
基于所述锁定状态信息对所述待操作数据单元进行第二加锁检测得到第二加锁检测结果,包括:
基于所述目标数据组的锁定状态信息确定所述待操作数据单元对应的全部数据锁;
当所述待操作数据单元对应的数据锁只包括第二数据锁时,得到第二加锁检测结果;
当所述待操作数据单元对应的数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第二加锁检测结果;
所述基于所述第二加锁检测结果对所述待操作数据单元进行第二加锁处理,包括:
基于所述第二加锁检测结果在所述锁定状态信息中为所述待操作数据单元添加所述操作指令的第二数据锁。
在一些实施例中,所述获取操作指令之前,还包括:
获取预设数值范围、数据单元的历史操作信息;
基于所述历史操作信息统计每个数据单元的历史操作次数;
基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到所述数据组集合。
在一些实施例中,所述数据组集合包括一个第一数据组和多个第二数据组;
基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到数据组集合,包括:
基于所述历史操作次数计算每个数据单元的历史操作概率;
生成一个第一数据组;
当所述数据单元的历史操作概率不属于所述预设数值范围时,将所述数据单元添加到第一数据组;
当所述数据单元的历史操作概率属于所述预设数值范围时,生成一个所述数据单元对应的第二数据组,将所述数据单元添加到所述数据单元对应的第二数据组。
在一些实施例中,所述数据单元包括多个数据子单元;
所述生成一个所述数据单元对应的第二数据组,将所述数据单元添加到所述数据单元对应的第二数据组,包括:
生成所述数据单元对应的第二数据组;
将所述多个数据子单元添加到所述数据单元对应的第二数据组。
在一些实施例中,根据所述待操作数据单元信息在数据组集合中查询目标数据组之前,还包括:
获取分组更新指令;
当所述分组更新指令的指令类型为用户分组类型时,采用所述分组更新指令所述对所述数据组集合中的数据单元进行重新分组;
当所述分组更新指令的指令类型为自动分组类型时,对所述数据组集合中的数据单元进行重新自动分组。
在一些实施例中,对所述数据组集合中的数据单元进行重新自动分组,包括:
获取预设数值范围、数据单元的历史操作信息;
基于所述历史操作信息统计数据组集合中每个数据单元的历史操作次数;
基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到重新自动分组后的数据组集合。
在一些实施例中,所述分组更新指令包括分组数量;
采用所述分组更新指令所述对所述数据组集合中的数据单元进行重新分组,包括:
将所述数据组集合中的数据单元均分为所述分组数量个数据组,得到分组后的数据组集合。
在一些实施例中,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作之后,还包括:
获取数据单元的历史操作信息;
基于所述操作指令更新所述数据单元的历史操作信息。
在一些实施例中,所述锁定状态信息包括所述目标数据组中数据单元的数据锁;
执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作之后,还包括:
在所述目标数据组的锁定状态信息中为所述待操作数据单元删除所述操作指令对应的数据锁。
本申请实施例还提供一种数据处理装置,包括:
获取单元,用于获取操作指令,所述操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
查询单元,用于根据所述待操作数据单元信息在数据组集合中查询目标数据组,所述数据组集合包括至少一个数据组,所述数据组包括至少一个数据单元;
数据锁单元,用于获取所述目标数据组的锁定状态信息;
检测单元,用于基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果;
加锁单元,用于基于所述检测结果对所述待操作数据单元进行加锁处理;
执行单元,用于当完成所述加锁处理后,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行本申请实施例所提供的任一种数据处理方法中的步骤。
本申请实施例还提供一种服务器,包括存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行本申请实施例所提供的任一种数据处理方法中的步骤。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品被执行时,用于执行本申请实施例所提供的任一种数据处理方法中的步骤。
本申请实施例可以获取操作指令,该操作指令可以包括操作类型信息和待操作数据单元对应的待操作数据单元信息;根据待操作数据单元信息可以在数据组集合中查询目标数据组,数据组集合可以包括至少一个数据组,数据组可以包括至少一个数据单元;获取目标数据组的锁定状态信息;基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果;基于检测结果对待操作数据单元进行加锁处理;当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
在本申请中,可以根据待操作数据单元所属的目标数据组来为待操作数据单元进行对应的加锁处理,从而执行该操作指令。由此,本申请可以降低获取锁定状态信息以及加锁处理时的计算量,从而在保证安全的同时,提升数据处理的效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a是本申请实施例提供的数据处理方法的应用场景示意图;
图1b是本申请实施例提供的数据处理方法的第一种流程示意图;
图1c是本申请实施例提供的数据处理方法的数据组的结构示意图;
图1d是本申请实施例提供的数据处理方法的锁定状态信息的示意图;
图2a是本申请实施例提供的数据处理方法的第二种流程示意图;
图2b是本申请实施例提供的数据处理方法的具体的锁定状态信息的示意图;
图2c是本申请实施例提供的数据处理方法的分布式数据服务器的架构示意图;
图3是本申请实施例提供的数据处理装置的结构示意图;
图4是本申请实施例提供的电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
表1所示的是用户数据表,如下:
表1
Figure PCTCN2020113108-appb-000001
其中,包括元组A和元组B,每个元组中包括用户的四个属性的数据,分别为用户编号、用户名称、用户年龄、用户所属群体。
计算机执行一个事务时常常需要对一个或多个元组进行访问,访问的方式具有多种,包括第一类访问、第二类访问等等,比如,第一类访问可以指读取数据、第二类访问可以表示写入数据;再比如,第一类访问可以指写入数据、第二类访问可以表示读取数据,等等。
在相关技术中,为了防止冲突,事务在进行访问前之前需要给元组加上数据锁,并在完成访问之后给元组解除数据锁,以使其他事务无法访问这些加锁的元组,直到这些元组解锁,从而规避数据错误地处理,导致数据处理效率低下。
比如,参考表2中的事务A和事务B,事务A和事务B可以对该用户数据表进行操作:
表2
时刻 事务A 事务B
t1 给元组A加锁  
t2 读取元组A的用户名称  
t3 ... 检测元组A上的数据锁
t4 ... ...
t5 ... ...
t6 给元组B加锁 ...
t7 写入元组B的用户所属群体 ...
t8 提交事务 ...
t9 解锁 ...
t10   给元组A加锁
t11   写入元组A的用户所属群体
t12   给元组B加锁
t13   读取元组B的用户年龄
t14   提交事务
t15   解锁
可知,事务A首先开始执行,在事务A执行读取元组A的用户名称前首先需要对元组A加锁,事务A加锁成功并完成读取后事务B开始执行,由于事务B需要等待元组A上没有数据锁后才能写入元组A的用户所属群体,故事务B需要等待到t10时刻才能给元组A加锁。
然而可知的是,事务A读取元组A的用户名称和事务B写入元组A的用户所属群体并不会产生冲突,但目前的冲突检测机制依旧将这种情况误判为冲突。
本申请实施例提供一种数据处理方法和相关装置,可以解决上述冲突误判的情况,进而提升数据处理效率。
其中,该数据处理装置具体可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、个人电脑(Personal Computer,PC)等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。
在一些实施例中,该数据处理装置还可以集成在多个电子设备中,比如,该数据处理装置可以集成在多个服务器中,由多个服务器来实现本申请的数据处理方法。
参考图1a,该电子设备可以集成在服务器中,该服务器可以获取操作指令,该操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元;获取目标数据组的锁定状态信息;基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果;基于检测结果对待操作数据单元进行加锁 处理;当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
由此,本方案可以根据待操作数据单元对应的目标数据组的锁定状态信息来判断是否可以加锁并执行操作指令,以对待操作数据单元进行操作类型信息对应的操作对应的事务,本方案可以更加准确地判断冲突,从而解决上述冲突误判导致的数据处理效率低下的问题。
以下分别进行详细说明。需说明的是,以下实施例的序号不作为对实施例优选顺序的限定。
在本实施例中,提供了一种数据处理方法,如图1b所示,该数据处理方法的具体流程可以如下:
101、获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息。
其中,操作指令可以是指针对数据库中数据的操作指令,可以包括该操作指令的操作类型信息,以及该操作指令要操作的待操作数据单元对应的待操作数据单元信息。
在一种可能的实现方式中,获取操作指令的方法可以是通过网络从网络服务器中获取,也可以由集成了数据处理装置的电子设备定时生成从而获取,还可以由技术人员操作该电子设备,数据处理装置获取该电子设备产生的操作指令,等等。
比如,在一些实施例中,数据处理装置可以获取技术人员发出的操作指令,在数据库更新场景中,技术人员可以将更新文件导入数据库服务器,在更新文件导入的过程中,数据库服务器可以根据更新文件以及技术人员的更新操作生成多个操作指令。
其中,操作类型信息中可以记录具体对数据的操作方法,比如,读取数据、删除数据、更新数据、修改数据、写入数据,等等。
其中,待操作数据单元信息中可以记录操作指令所操作的数据单元,数据单元由数据库中保存数据信息的数据颗粒构成,其中,粒度(granularity)可以描述数据库中所保存的数据颗粒的细化程度,数据库中数据颗粒的粒度越细,该数据库的细化程度越高;数据库中数据颗粒的粒度越粗,该数据库的细化程度越低。
其中,数据颗粒是指数据库中用于保存数据信息的最小单位。
比如,参考表1,表1中具有8个数据颗粒,分别为0001(元组A的用户编号)、Alan(元组A的用户名称)、18(元组A的用户年龄)、student(元组A的用户所属群体),以及0002(元组B的用户编号)、Bryan(元组B的用户名称)、26(元组B的用户年龄)、lawyer(元组B的用户所属群体)。
数据单元可以由一个或多个数据颗粒构成,比如,表1中可以包括两个数据单元,分别为元组A和元组B。其中,一个数据单元(即元组A)具有4个数据颗粒,分别为0001、 Alan、18、student;另一个数据单元(即元组B)具有4个数据颗粒,分别为0002、Bryan、26、lawyer。
再比如,表1中可以包括四个数据单元,分别为用户编号、用户名称、用户年龄、用户所属群体(lawyer)。其中,一个数据单元(即用户编号)具有2个数据颗粒,分别为001和0002;另一个数据单元(即用户名称)具有2个数据颗粒,分别为Alan和Bryan;又一个数据单元(即用户年龄)具有2个数据颗粒,分别为18和26;最后一个数据单元(即用户所属群体)具有2个数据颗粒,分别为student和lawyer。
需要注意的是,目前数据库的数据单元是由多个数据颗粒构成的元组,其中,元组(tuple)是数据库中所存数据表结构中的一行数据,比如,参考表1,当数据库中存有表1所示的数据表时,则元组指该表1中的每一行,即表1包括两个元组,分别为元组A和元组B。其中,元组A由4个数据颗粒组成,可以表示为元组A(0001,Alan,18,student);元组B由4个数据颗粒组成,可以表示为元组B(0002,Bryan,26,lawyer)。
在本方案中,数据单元由数据颗粒构成的方式可以根据数据库的初始设定确定,也可以根据技术人员对该数据库的设置进行修改,即数据单元的粒度大小修改为小于元组的粒度大小。
其中,数据组集合中可以包括一个或多个数据组,每个数据组中都可以包括一个或多个数据单元。比如,假设表1为一个数据组集合,该数据组集合中只有一个数据组,该数据组为元组A和元组B,该数据组中可以具有8个数据单元,分别为元组A的用户编号、用户名称、用户年龄、用户所属群体,以及元组B的用户编号、用户名称、用户年龄、用户所属群体。
在一些实施例中,可以预先自动地将数据单元分配到数据组中,使得数据单元分配合理,从而进一步降低冲突误判的概率,步骤101之后可以包括如下步骤:
获取预设数值范围、数据单元的历史操作信息;
基于历史操作信息统计每个数据单元的历史操作次数;
基于历史操作次数和预设数值范围对数据单元进行分组处理,得到数据组集合。
其中,预设数值范围可以由本领域技术人员设置,也可以通过网络获取,还可以根据以往计算的误判概率获得,等等。
数据单元的历史操作信息是指历史时间内记录的操作指令,即记录了在历史时间内对待操作数据单元的操作类型信息。基于这些历史操作信息可以统计每个数据单元的从历史时刻到现在时刻的被操作的次数即历史操作次数。
在一些实施例中,数据组集合可以包括一个第一数据组和多个第二数据组,步骤“基于历史操作次数和预设数值范围对数据单元进行分组处理,得到数据组集合”可以包括如下步骤:
基于历史操作次数计算每个数据单元的历史操作概率;
生成一个第一数据组;
当数据单元的历史操作概率不属于预设数值范围时,将数据单元添加到第一数据组;
当数据单元的历史操作概率属于预设数值范围时,生成一个数据单元对应的第二数据组,将数据单元添加到数据单元对应的第二数据组。
比如,将历史操作概率高的数据单元可以视为计算机在处理这些数据单元时更容易产生冲突,故将这些更容易产生冲突的数据单元单独分为一组、将不容易产生冲突的数据单元分到一个组内可以有效地降低冲突误判率,同时降低计算量,特别是在数据单元过多的情况下。
在一些实施例中,为了尽量减少数据组的数量,从而降低内存消耗,数据单元可以包括多个数据子单元,步骤:“生成一个数据单元对应的第二数据组,将数据单元添加到数据单元对应的第二数据组”可以包括如下具体步骤::
生成数据单元对应的第二数据组;
将多个数据子单元添加到数据单元对应的第二数据组。
其中,第二数据组的方式是:每个第二数据组的历史操作概率在属于预设数值范围的同时,其历史操作概率等于该第二数据组组内所有数据单元的历史操作概率的和。
比如,参考如下公式:
Figure PCTCN2020113108-appb-000002
其中,n为第二数据组组内数据单元的数量。
102、根据待操作数据单元信息在数据组集合中查询目标数据组。
参考图1c,数据组集合中可以包括多个数据组,每个数据组可以包括多个数据单元。
根据待操作数据单元信息可以在数据组集合中查询待操作数据单元对应的目标数据组。
比如,根据待操作数据单元信息可以在图1c所示的数据组集合中查询待操作数据单元对应的目标数据组。譬如,假设待操作数据单元信息将数据单元c作为待操作数据单元,则可以将数据组2确定为目标数据组。
在一些实施例中,本方案可以经常自动的更新数据组集合,使得冲突的判定可以更加准确,故每次在步骤102之前还可以包括如下步骤,来防止遗漏冲突:
获取分组更新指令;
当分组更新指令的指令类型为用户分组类型时,采用分组更新指令对数据组集合中的数据单元进行重新分组;
当分组更新指令的指令类型为自动分组类型时,对数据组集合中的数据单元进行重新自动分组。
其中,分组更新指令可以是用于更新数据组集合的指令,该分组更新指令可以由用户设定并发出,也可以由自身周期性地产生,还可以从网络获取。
其中,分组更新指令可以具有多种类型,比如,分组更新指令可以为用户分组类型,也可以为自动分组类型,在一些实施例中,分组更新指令还可以为混合分组类型。
其中,用户分组类型的分组更新指令是指该分组更新指令是由用户发出的分组更新指令,自动分组类型的分组更新指令是指该分组更新指令是计算机自动产生的分组更新指令。
在一些实施例中,步骤“对数据组集合中的数据单元进行重新自动分组”可以包括如下步骤:
获取预设数值范围、数据单元的历史操作信息;
基于历史操作信息统计数据组集合中每个数据单元的历史操作次数;
基于历史操作次数和预设数值范围对数据单元进行分组处理,得到重新自动分组后的数据组集合。
在一些实施例中,分组更新指令可以包括分组数量,步骤“采用分组更新指令对数据组集合中的数据单元进行重新分组”可以包括如下步骤:
将数据组集合中的数据单元均分为分组数量个数据组,得到分组后的数据组集合。
其中,用户分组类型的分组更新指令中可以包括用户设置的分组数量。
比如,用户将分组数量设为5,假设一共有100个数据单元,则将该100个数据单元分为5组,每组中包括20个数据单元。
在一些实施例中,为了提高冲突检测的准确性、减少用户的操作难度,还可以提供一种混合分组类型的分组更新指令,具体混合分组的方式为上述用户分组方式和计算机自动分组方式的混合体。
比如,可以获取用户分组类型的分组更新指令,根据该用户分组类型的分组更新指令预先进行数据单元的分组,并在之后的数据处理场景中,对这些预先用户分组的数据进行进一步的自动分组。
103、获取目标数据组的锁定状态信息。
其中,锁定状态信息是指数据组中所有数据单元的数据锁的状态信息,数据锁为一种虚拟概念,用于表示数据单元或数据组的锁定状态。
其中,数据锁的状态信息可以表示数据锁的类型,数据锁可以包括多种类型,比如,数据锁可以包括读锁(共享锁)类型的数据锁和写锁(排它锁)类型的数据锁,等等。
其中,锁定状态信息可以由标识、文字、符号等进行表达,比如,0表示没有数据锁,1表示读锁类型的数据锁,2表示写锁类型的数据锁,等等。
比如,在一些实施例中,数据锁可以分为第一数据锁和第二数据锁,参考图1d,数据组A可以与锁定状态信息A具有映射关系,数据组B可以与锁定状态信息B具有映射关系。
锁定状态信息A中具有数据组A中数据单元的数据锁的状态信息,譬如,事务A对数据组A中数据单元x加上的第一数据锁,以及事务B对数据组A中数据单元y加上的第二数据锁。
104、基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果。
其中,操作类型信息可以包括第一操作类型、第二操作类型,加锁检测可以包括第一加锁检测和第二加锁检测,检测结果可以包括第一加锁检测结果和第二加锁检测结果。
步骤104可以包括以下步骤:
基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果,包括:
当操作类型信息为第一操作类型时,基于锁定状态信息对待操作数据单元进行第一加锁检测,得到第一加锁检测结果;
当操作类型信息为第二操作类型时,基于锁定状态信息对待操作数据单元进行第二加锁检测得到第二加锁检测结果。
其中,数据锁可以包括第一数据锁、第二数据锁,步骤“基于锁定状态信息对待操作数据单元进行第一加锁检测,得到第一加锁检测结果”可以包括以下步骤:
基于目标数据组的锁定状态信息确定待操作数据单元对应的全部数据锁;
当全部数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第一加锁检测结果。
步骤“基于锁定状态信息对待操作数据单元进行第二加锁检测,得到第二加锁检测结果”可以包括以下步骤:
基于目标数据组的锁定状态信息确定待操作数据单元对应的全部数据锁;
当全部数据锁只包括第二数据锁时,得到第二加锁检测结果;
当全部数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第二加锁检测结果。
105、基于检测结果对待操作数据单元进行加锁处理。
其中,加锁处理可以包括第一加锁处理和第二加锁处理,步骤105可以包括以下步骤:
基于第一加锁检测结果对待操作数据单元进行第一加锁处理;
或,基于第二加锁检测结果对待操作数据单元进行第二加锁处理。
其中,步骤“基于第一加锁检测结果对待操作数据单元进行第一加锁处理”可以包括以下步骤:
基于第一加锁检测结果在目标数据组的锁定状态信息中为待操作数据单元添加操作指令的第一数据锁。
步骤“基于第二加锁检测结果对待操作数据单元进行第二加锁处理”可以包括以下步骤:
基于第二加锁检测结果在目标数据组的锁定状态信息中为待操作数据单元添加操作指令的第二数据锁。
其中,数据锁可以包括多种类型,比如,数据锁可以包括读锁(共享锁)和写锁(排它锁)。其中,写锁可以称为第一数据锁,读锁可以称为第二数据锁,这两种锁间的关系可以如下:
待操作数据单元的读锁与读锁可以共存,待操作数据单元的读锁与写锁互斥,待操作数据单元的写锁与写锁互斥。
比如,数据单元Q将要被操作指令A对应的事务A处理时,假设数据单元Q已经具有事务A的读锁时,事务B可以对数据单元Q加上事务B的读锁,但是不可以对数据单元Q加上事务B的写锁;假设数据单元Q已经具有事务A的写锁时,事务B不可以对数据单元Q加上事务B的读锁,也不可以对数据单元Q加上事务B的写锁。
在一些实施例中,为了进一步区分读写操作,从而降低冲突检测的准确度,操作类型信息可以包括第一操作类型、第二操作类型,加锁处理包括第一加锁处理和第二加锁处理,步骤104可以包括如下步骤:
当操作类型信息为第一操作类型时,基于锁定状态信息对待操作数据单元进行第一加锁处理;
当操作类型信息为第二操作类型时,基于锁定状态信息对待操作数据单元进行第二加锁处理。
比如,第一操作类型可以是写入类型,第二操作类型可以是读取类型,等等。
比如,第一加锁处理可以指对待操作数据单元加上写锁,第二加锁处理可以指对待操作数据单元加上读锁,等等。
待操作数据单元可以具有多个事务添加的事务锁,在一些实施例中,锁定状态信息可以包括目标数据组中数据单元的数据锁,数据锁可以包括第一数据锁、第二数据锁,步骤“基于锁定状态信息对待操作数据单元进行第一加锁处理”可以包括如下步骤:
基于目标数据组的锁定状态信息确定待操作数据单元对应的全部数据锁;
当全部数据锁中既不包括第一数据锁,也不包括第二数据锁时,在目标数据组的锁定状态信息中为待操作数据单元添加操作指令的第一数据锁。
待操作数据单元可以具有多个事务添加的事务锁,在一些实施例中,锁定状态信息可以包括目标数据组中数据单元的数据锁,数据锁可以包括第一数据锁、第二数据锁,步骤“基于锁定状态信息对待操作数据单元进行第二加锁处理”可以包括如下步骤:
基于目标数据组的锁定状态信息确定待操作数据单元对应的全部数据锁;
当全部数据锁只包括第二数据锁时,在目标数据组的锁定状态信息中为待操作数据单元添加操作指令的第二数据锁;
当待操作数据单元对应的数据锁中既不包括第一数据锁,也不包括第二数据锁时,在目标数据组的锁定状态信息中为待操作数据单元添加操作指令的第二数据锁。
106、当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
当加锁完成后,才可以执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
当加锁失败时,需要重新检测是否还存在冲突,从而等待其他事务解锁,直到冲突消失,完成加锁后执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
在一些实施例中,每次执行操作指令,以对待操作数据单元进行操作类型信息对应的操作后可以将此次执行保存到历史操作信息中,以便于通过自动分组更新数据组集合,从而降低之后数据处理的计算量、提高数据处理的效率,故步骤105之后,还可以包括如下步骤:
获取数据单元的历史操作信息;
基于操作指令更新数据单元的历史操作信息。
在一些实施例中,锁定状态信息可以包括目标数据组中数据单元的数据锁,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作后及时解锁可以提高其他事务处理数据的效率,故步骤105之后,还可以包括如下步骤:
在目标数据组的锁定状态信息中为待操作数据单元删除操作指令对应的数据锁。
由上可知,本申请实施例可以获取操作指令和数据组集合,数据组集合包括至少一个数据组,数据组包括至少一个数据单元,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;根据待操作数据单元信息在数据组集合中查询待操作数据单元对应的目标数据组;获取目标数据组的锁定状态信息;基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁处理;当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。由此本方案可以根据待操作单元所属的目标数据组来为待操作单元进行对应的加锁处理,从而执行该操作指令。由此,本申请可以降低获取锁定状态信息以及加锁处理时的计算量,从而在保证安全的同时提升数据处理的效率。
根据上述实施例所描述的方法,以下将作进一步详细说明。
在本实施例中,将以数据处理装置集成在数据库服务器中为例,对本申请实施例的方法进行详细说明。
如图2a所示,一种数据处理方法具体流程如下:
201、自动地更新数据组集合,该更新后的数据组集合包括至少一个数据组,数据组包括至少一个数据单元。
本实施例中,在自动地更新数据组集合之前,数据组集合可以由用户指定数据单位如何分配到数据组中。
比如,参考表1,用户可以指定将表1中奇数列中的所有数据单位分为一个数据组、将偶数列中的所有数据单位分为一个数据组;再比如,将表1中奇数行(即第1、3、5...号的元组)中的所有数据单位分为一个数据组、将偶数行(即第2、4、6...号的元组)中的所有数据单位分为一个数据组。
再比如,参考表1,用户可以设置分组数量为4,指定将表1中所有的数据单元均分为4组。
再比如,参考表1,用户可以设置分组数量为2,指定将表1中每隔2列的数据单元分为一组,等等。
具体的用户分组原理相同,方式多样,在此不作细述。
用户分组方式可以调整冲突检测的粒度大小,使得粒度从元组缩小为用户设定的数据组,从而减小了信息的维护量。比如,假设事务T1访问了元组的数据单元x和数据单元y,若用户将数据单元x和数据单元y分为同一个数据组,则当执行完事务T1之后(即步骤207),仅需要记录事务T1访问了该数组。
在一些实施例中,用户在某些情况下可能难以设置合适的冲突检测粒度的大小,(即数据组的分组),为了降低冲突误判的概率,本实施例可以自动地更新数据组集合。
计算机自动地更新数据组集合的方式可以是,通过判断数据单元中容易产生冲突的数据单元,在此可以将这些容易产生冲突的数据单元其称为易冲突单元,将不容易产生冲突的数据单元称为不易冲突单元,然后,将每个易冲突单元单独作为一个数据组,将不易冲突单元添加到n个数据组中。
其中,n为正整数,具体n的大小可以由用户指定,也可以由本领域技术人员设置,还可以根据不易冲突单元的数量决定。
在一种可能的实现方式中,判断易冲突单元和不易冲突单元的方式如下:
首先,获取预设数值范围、数据单元的历史操作信息;
基于历史操作信息统计数据组集合中每个数据单元的历史操作次数;
基于历史操作次数和预设数值范围对数据单元进行分组处理,得到重新自动分组后的数据组集合。
比如,预设数值范围为10至正无穷,根据历史操作信息可以统计数据组集合中每个数据单元的历史操作次数,将历史操作次数属于10至正无穷的数据单元确定为易冲突单元,否则为不易冲突单元。
202、获取操作指令,其中,该操作指令包括操作类型信息和待操作数据单元信息,并根据待操作数据单元信息在数据组集合中查询待操作数据单元对应的目标数据组,获取目标数据组的锁定状态信息。
操作类型信息可以是读取类型和写入类型,假设待操作数据单元为数据单元c,参考图1c,该待操作数据单元所属的目标数据组为数据组2。
则获取数据组2的锁定状态信息。
比如,参考图2b,可以获取数据组2的锁定状态信息,其中,数据组2的锁定状态信息记录了当前的事务A在数据单元a上添加的写锁,以及当前的事务B在数据单元c上添加的读锁。
203、基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁处理。
此时,待操作数据单元是数据单元c,数据单元c上当前具有事务B添加的读锁,则基于该读锁,以及操作类型信息可以对待操作数据单元进行加锁处理。
由于读锁与读锁可以共存,读锁与写锁互斥,写锁与写锁互斥,则当数据单元c上当前具有事务B添加的读锁时,若操作类型信息表现为读取类型时,则可以在待操作数据单元上添加本次事务的读锁;若操作类型信息表现为写入类型时,则加锁失败。
比如,事务T要对某一元组的某一数据单元加写锁时,可以参考如下步骤:
获取该元组的锁定状态信息;
如果锁定状态信息没有数据锁,则加锁成功;
否则加锁失败。
比如,事务T要对某一元组的某一数据单元加读锁时,可以参考如下步骤:
获取该元组的锁定状态信息;
如果锁定状态信息没有数据锁,则加锁成功;
如果锁定状态信息有数据锁,检查待操作数据单元具有的数据锁;
如果待操作数据单元具有的数据锁中没有写锁,则加锁成功;
否则加锁失败。
204、当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作,以及根据操作指令更新数据单元的历史操作信息,并在目标数据组的锁定状态信息中为待操作数据单元删除操作指令的数据锁。
假如加锁失败,则等待事务B对待操作数据单元解锁,然后完成加锁处理,并执行操作指令,以对待操作数据单元进行操作类型信息对应的操作,以及根据操作指令更新数据单元的历史操作信息,并在目标数据组的锁定状态信息中为待操作数据单元删除操作指令的数据锁。
若加锁成功,则执行操作指令,以对待操作数据单元进行操作类型信息对应的操作,以及根据操作指令更新数据单元的历史操作信息,并在目标数据组的锁定状态信息中为待操作数据单元删除操作指令的数据锁。
例如,参考图2c,在图2c中的分布式数据库架构采用了本数据处理方案,其中,该分布式数据库采用了数据库分库、数据分表的方式进行数据的存储与处理。
其中,协调系统可以是Zookeeper(一种分布式计算系统)、Spark(一种分布式计算系统),等等。
其中,数据库分为M组即得到M个数据库组,每组中包括一个主数据库服务器和N个备数据库服务器,从而达到负载均衡。
每当用户输入数据时,用户发出的操作指令被协调系统分配给相应的数据库组,使得用户写入的数据被分散并存放到不同的数据库组。
比如,将用户输入的一张数据表拆分为多个表,并分散存储到不同的数据库组中;再比如,根据用户输入的一张数据表中数据的逻辑关系,按照某些条件将该数据包拆分为多个表,并按拆分逻辑分散存储到不同的数据库组中。
每当用户输入一张数据表时,网关例如网关1、网关2……网关n可以将数据表推送给协调系统,协调系统可以以任务的形式进行保存,并将其发送给数据库中的主数据库服务 器或备数据库服务器,然后,收集每组数据库中主备数据库服务器返回的结果,将结果返回给用户。
其中,数据库可以从协调系统中拉取任务,并切换每组数据库中的主备数据库服务器,以及监控数据库的状态并将其上传给协调系统。
由此,在图2c所示的采用了本数据处理方案的分布式数据库架构中,可以保证读写数据时数据的原子性和一致性,从而保证了冲突检测准确性的情况下提高事务的并发度,以及数据库的吞吐量,从而提升数据处理的效率。
由上可知,本申请实施例可以自动地更新数据组集合,该更新后的数据组集合包括至少一个数据组,数据组包括至少一个数据单元;获取操作指令,该操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;根据待操作数据单元信息在数据组集合中查询待操作数据单元对应的目标数据组;获取目标数据组的锁定状态信息;基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁处理;当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作;根据操作指令更新数据单元的历史操作信息,并在目标数据组的锁定状态信息中为待操作数据单元删除操作指令的数据锁。由此,本申请实施例可以在保证冲突检测准确性的情况下提高事务的并发度,以及数据库的吞吐量,从而提升数据处理的效率。
此外,本申请实施例还提供了多种分组的方法,使得冲突检测的粒度大小可以由用户或自动地改变,可以在保证冲突检测准确性的情况下进一步降低计算量。
为了更好地实施以上方法,本申请实施例还提供一种数据处理装置,该数据处理装置具体可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、或者个人电脑(Personal Computer,PC)等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。在一些实施例中,该数据处理装置还可以集成在多个电子设备中,比如,数据处理装置可以集成在多个服务器中,由多个服务器构成分布式服务器集群来实现本申请的数据处理方法。
本申请实施例提供一种数据处理装置,其中,该数据处理装置具体可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、个人电脑等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。
在本实施例中,将以数据处理装置集成在分布式服务器集群中为例,对本申请实施例的方法进行详细说明。
例如,如图3所示,该数据处理装置可以包括获取单元301、查询单元302、数据锁单元303、检测单元304、加锁单元305以及执行单元306如下:
(一)获取单元301:
获取单元301可以用于获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息。
在一些实施例中,获取单元301在执行步骤“获取操作指令,操作指令包括操作类型信息和待操作数据单元信息”之前,还可以包括获取子单元、统计子单元、以及分组子单元,如下:
(1)获取子单元:
获取子单元可以用于获取预设数值范围、数据单元的历史操作信息。
(2)统计子单元:
统计子单元可以用于基于历史操作信息统计每个数据单元的历史操作次数。
(3)分组子单元:
分组子单元可以用于基于历史操作次数和预设数值范围对数据单元进行分组处理,得到数据组集合。
在一些实施例中,数据组集合可以包括一个第一数据组和多个第二数据组,该分组子单元可以包括概率子模块、第一数据组生成子模块、第一数据组添加子模块以及第二数据组添加子模块,如下:
概率子模块可以用于基于历史操作次数计算每个数据单元的历史操作概率;
第一数据组生成子模块可以用于生成一个第一数据组;
当数据单元的历史操作概率不属于预设数值范围时,第一数据组添加子模块可以用于将数据单元添加到第一数据组;
当数据单元的历史操作概率属于预设数值范围时,第二数据组添加子模块可以用于生成一个数据单元对应的第二数据组,将数据单元添加到数据单元对应的第二数据组。
在一些实施例中,数据单元可以包括多个数据子单元,第一数据组添加子模块具体可以用于:
生成数据单元对应的第二数据组;
将多个数据子单元添加到数据单元对应的第二数据组。
(二)查询单元302:
查询单元302可以根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元。
在一些实施例中,查询单元302在用于根据待操作数据单元信息在数据组集合中查询待操作数据单元对应的目标数据组之前,可以包括更新子单元、用户更新子单元以及自动更新子单元用于:
获取分组更新指令;
当分组更新指令的指令类型为用户分组类型时,采用分组更新指令对数据组集合中的数据单元进行重新分组;
当分组更新指令的指令类型为自动分组类型时,对数据组集合中的数据单元进行重新自动分组。
其中,更新子单元,用于获取分组更新指令。
当分组更新指令的指令类型为用户分组类型时,用户更新子单元可以用于采用分组更新指令对数据组集合中的数据单元进行重新分组。
当分组更新指令的指令类型为自动分组类型时,自动更新子单元可以用于对数据组集合中的数据单元进行重新自动分组。
在一些实施例中,自动更新子单元具体可以用于:
获取预设数值范围、数据单元的历史操作信息;
基于历史操作信息统计数据组集合中每个数据单元的历史操作次数;
基于历史操作次数和预设数值范围对数据单元进行分组处理,得到重新自动分组后的数据组集合。
在一些实施例中,用户更新子单元具体可以用于:
将数据组集合中的数据单元均分为分组数量个数据组,得到分组后的数据组集合。
(三)数据锁单元303:
数据锁单元303可以用于获取目标数据组的锁定状态信息。
(四)检测单元304:
检测单元304可以用于基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果。其中,操作类型信息包括第一操作类型、第二操作类型,加锁检测包括第一加锁检测和第二加锁检测,检测结果包括第一加锁检测结果和第二加锁检测结果。
在一些实施例中,检测单元304具体可以用于:
当操作类型信息为第一操作类型时,基于锁定状态信息对待操作数据单元进行第一加锁检测,得到第一加锁检测结果;
当操作类型信息为第二操作类型时,基于锁定状态信息对待操作数据单元进行第二加锁检测得到第二加锁检测结果。
(五)加锁单元305:
加锁单元305可以用于基于检测结果对待操作数据单元进行加锁处理。
其中,加锁处理可以包括第一加锁处理和第二加锁处理,加锁单元305具体可以用于:
基于第一加锁检测结果对待操作数据单元进行第一加锁处理;
或,基于第二加锁检测结果对待操作数据单元进行第二加锁处理。
(六)执行单元306:
执行单元306可以用于当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
在一些实施例中,执行单元306在执行操作指令,以对待操作数据单元进行操作类型信息对应的操作之后,还可以用于:
获取数据单元的历史操作信息;
基于操作指令更新数据单元的历史操作信息。
在一些实施例中,锁定状态信息可以包括目标数据组中数据单元的数据锁,执行单元306在执行操作指令,以对待操作数据单元进行操作类型信息对应的操作之后,执行单元306还可以用于:
在目标数据组的锁定状态信息中为待操作数据单元删除操作指令的数据锁。
在实施时,以上各个数据单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个数据单元的具体实施可参见前面的方法实施例,在此不再赘述。
由上可知,本实施例的数据处理装置由获取单元获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;由查询单元根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元;由数据锁单元获取目标数据组的锁定状态信息;由检测单元基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果;由加锁单元基于检测结果对待操作数据单元进行加锁处理;由执行单元当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
由于本方案实施例可以降低计算量,由此,本方案实施例可以提升数据处理的效率。
本申请实施例还提供一种电子设备,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、个人电脑等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。
在本实施例中,将以本实施例的电子设备是服务器为例进行详细描述,比如,如图4所示,其示出了本申请实施例所涉及的服务器的结构示意图:
该服务器可以包括一个或者一个以上处理核心的处理器401、一个或一个以上计算机可读存储介质的存储器402、电源403、输入模块404以及通信模块405等部件。本领域技术人员可以理解,图4中示出的服务器结构并不构成对服务器的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
处理器401是该服务器的控制中心,利用各种接口和线路连接整个服务器的各个部分,通过运行或执行存储在存储器402内的软件程序和/或模块,以及调用存储在存储器402内的数据,执行服务器的各种功能和处理数据,从而对服务器进行整体监控。在一些实施例中,处理器401可包括一个或多个处理核心;在一些实施例中,处理器401可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器401中。
存储器402可用于存储软件程序以及模块,处理器401通过运行存储在存储器402的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据服务器的使用所创建的数据等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器402还可以包括存储器控制器,以提供处理器401对存储器402的访问。
服务器还包括给各个部件供电的电源403,在一些实施例中,电源403可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源403还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该服务器还可包括输入模块404,该输入模块404可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
该服务器还可包括通信模块405,在一些实施例中通信模块405可以包括无线模块,服务器可以通过该通信模块405的无线模块进行短距离无线传输,从而为用户提供了无线的宽带互联网访问。比如,该通信模块405可以用于帮助用户收发电子邮件、浏览网页和访问流式媒体等。
尽管未示出,服务器还可以包括显示数据单元等,在此不再赘述。具体在本实施例中,服务器中的处理器401会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现各种功能,如下:
获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元;
获取目标数据组的锁定状态信息;
基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果;
基于检测结果对待操作数据单元进行加锁处理;
当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。
由上可知,本方案实施例可以降低计算量,从而提升数据处理的效率。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本申请实施例所提供的任一种数据处理方法中的步骤。例如,该指令可以执行如下步骤:
获取操作指令,操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
根据待操作数据单元信息在数据组集合中查询目标数据组,数据组集合包括至少一个数据组,数据组包括至少一个数据单元;
获取目标数据组的锁定状态信息;
基于锁定状态信息以及操作类型信息对待操作数据单元进行加锁检测,得到检测结果;
基于检测结果对待操作数据单元进行加锁处理;
当完成加锁处理后,执行操作指令,以对待操作数据单元进行操作类型信息对应的操作。
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
由于该存储介质中所存储的指令,可以执行本申请实施例所提供的任一种数据处理方法中的步骤,因此,可以实现本申请实施例所提供的任一种数据处理方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品被执行时,用于执行任一种数据处理方法中的步骤。
以上对本申请实施例所提供的一种数据处理方法、装置、服务器和计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (16)

  1. 一种数据处理方法,所述方法由电子设备执行,所述方法包括:
    获取操作指令,所述操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
    根据所述待操作数据单元信息在数据组集合中查询目标数据组,所述数据组集合包括至少一个数据组,所述数据组包括至少一个数据单元;
    获取所述目标数据组的锁定状态信息;
    基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果;
    基于所述检测结果对所述待操作数据单元进行加锁处理;
    当完成所述加锁处理后,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作。
  2. 如权利要求1所述的数据处理方法,所述操作类型信息包括第一操作类型、第二操作类型,所述加锁检测包括第一加锁检测和第二加锁检测,所述检测结果包括第一加锁检测结果和第二加锁检测结果;
    基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果,包括:
    当所述操作类型信息为第一操作类型时,基于所述锁定状态信息对所述待操作数据单元进行第一加锁检测,得到第一加锁检测结果;
    当所述操作类型信息为第二操作类型时,基于所述锁定状态信息对所述待操作数据单元进行第二加锁检测得到第二加锁检测结果;
    所述加锁处理包括第一加锁处理和第二加锁处理,所述基于所述检测结果对所述待操作数据单元进行加锁处理,包括:
    基于所述第一加锁检测结果对所述待操作数据单元进行第一加锁处理;
    或,
    基于所述第二加锁检测结果对所述待操作数据单元进行第二加锁处理。
  3. 如权利要求2所述的数据处理方法,所述锁定状态信息包括所述目标数据组中数据单元的数据锁,所述数据锁包括第一数据锁、第二数据锁;
    基于所述锁定状态信息对所述待操作数据单元进行第一加锁检测,得到第一加锁检测结果,包括:
    基于所述锁定状态信息确定所述待操作数据单元对应的全部数据锁;
    当所述全部数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第一加锁检测结果;
    所述基于所述第一加锁检测结果对所述待操作数据单元进行第一加锁处理,包括:
    基于所述第一加锁检测结果在所述锁定状态信息中为所述待操作数据单元添加所述操作指令的第一数据锁。
  4. 如权利要求2所述的数据处理方法,所述锁定状态信息包括所述目标数据组中数据单元的数据锁,所述数据锁包括第一数据锁、第二数据锁;
    基于所述锁定状态信息对所述待操作数据单元进行第二加锁检测得到第二加锁检测结果,包括:
    基于所述目标数据组的锁定状态信息确定所述待操作数据单元对应的全部数据锁;
    当所述待操作数据单元对应的数据锁只包括第二数据锁时,得到第二加锁检测结果;
    当所述待操作数据单元对应的数据锁中既不包括第一数据锁,也不包括第二数据锁时,得到第二加锁检测结果;
    所述基于所述第二加锁检测结果对所述待操作数据单元进行第二加锁处理,包括:
    基于所述第二加锁检测结果在所述锁定状态信息中为所述待操作数据单元添加所述操作指令的第二数据锁。
  5. 如权利要求1所述的数据处理方法,所述获取操作指令之前,还包括:
    获取预设数值范围、数据单元的历史操作信息;
    基于所述历史操作信息统计每个数据单元的历史操作次数;
    基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到所述数据组集合。
  6. 如权利要求5所述的数据处理方法,所述数据组集合包括一个第一数据组和多个第二数据组;
    基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到所述数据组集合,包括:
    基于所述历史操作次数计算每个数据单元的历史操作概率;
    生成一个第一数据组;
    当所述数据单元的历史操作概率不属于所述预设数值范围时,将所述数据单元添加到所述第一数据组;
    当所述数据单元的历史操作概率属于所述预设数值范围时,生成一个所述数据单元对应的第二数据组,将所述数据单元添加到所述数据单元对应的第二数据组。
  7. 如权利要求6所述的数据处理方法,所述数据单元包括多个数据子单元;
    所述生成一个所述数据单元对应的第二数据组,将所述数据单元添加到所述数据单元对应的第二数据组,包括:
    生成所述数据单元对应的第二数据组;
    将所述多个数据子单元添加到所述数据单元对应的第二数据组。
  8. 如权利要求1所述的数据处理方法,根据所述待操作数据单元信息在数据组集合中查询目标数据组之前,还包括:
    获取分组更新指令;
    当所述分组更新指令的指令类型为用户分组类型时,采用所述分组更新指令所述对所述数据组集合中的数据单元进行重新分组;
    当所述分组更新指令的指令类型为自动分组类型时,对所述数据组集合中的数据单元进行重新自动分组。
  9. 如权利要求8所述的数据处理方法,对所述数据组集合中的数据单元进行重新自动分组,包括:
    获取预设数值范围、数据单元的历史操作信息;
    基于所述历史操作信息统计数据组集合中每个数据单元的历史操作次数;
    基于所述历史操作次数和所述预设数值范围对所述数据单元进行分组处理,得到重新自动分组后的数据组集合。
  10. 如权利要求8所述的数据处理方法,所述分组更新指令包括分组数量;
    采用所述分组更新指令所述对所述数据组集合中的数据单元进行重新分组,包括:
    将所述数据组集合中的数据单元均分为所述分组数量个数据组,得到分组后的数据组集合。
  11. 如权利要求1所述的数据处理方法,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作之后,还包括:
    获取数据单元的历史操作信息;
    基于所述操作指令更新所述数据单元的历史操作信息。
  12. 如权利要求1所述的数据处理方法,所述锁定状态信息包括所述目标数据组中数据单元的数据锁;
    执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作之后,还包括:
    在所述锁定状态信息中为所述待操作数据单元删除所述操作指令对应的数据锁。
  13. 一种数据处理装置,包括:
    获取单元,用于获取操作指令,所述操作指令包括操作类型信息和待操作数据单元对应的待操作数据单元信息;
    查询单元,用于根据所述待操作数据单元信息在数据组集合中查询目标数据组,所述数据组集合包括至少一个数据组,所述数据组包括至少一个数据单元;
    数据锁单元,用于获取所述目标数据组的锁定状态信息;
    检测单元,用于基于所述锁定状态信息以及所述操作类型信息对所述待操作数据单元进行加锁检测,得到检测结果;
    加锁单元,用于基于所述检测结果对所述待操作数据单元进行加锁处理;
    执行单元,用于当完成所述加锁处理后,执行所述操作指令,以对所述待操作数据单元进行所述操作类型信息对应的操作。
  14. 一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1~12任一项所述的数据处理方法中的步骤。
  15. 一种服务器,包括处理器和存储器,所述存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行如权利要求1~12任一项所述的数据处理方法中的步骤。
  16. 一种计算机程序产品,当所述计算机程序产品被执行时,用于执行权利要求1-12任一项所述的数据处理方法中的步骤。
PCT/CN2020/113108 2019-10-10 2020-09-03 数据处理方法和相关装置 WO2021068689A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2022515069A JP7375173B2 (ja) 2019-10-10 2020-09-03 データ処理方法及び関連装置、並びにコンピュータプログラム
KR1020227004713A KR20220031110A (ko) 2019-10-10 2020-09-03 데이터 처리 방법 및 관련 장치
EP20874981.2A EP3992808A4 (en) 2019-10-10 2020-09-03 DATA PROCESSING METHODS AND RELATED DEVICE
US17/513,815 US20220050818A1 (en) 2019-10-10 2021-10-28 Data processing method and related apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910959838.6A CN110765143B (zh) 2019-10-10 2019-10-10 数据处理方法、装置、服务器和存储介质
CN201910959838.6 2019-10-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/513,815 Continuation US20220050818A1 (en) 2019-10-10 2021-10-28 Data processing method and related apparatus

Publications (1)

Publication Number Publication Date
WO2021068689A1 true WO2021068689A1 (zh) 2021-04-15

Family

ID=69331625

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113108 WO2021068689A1 (zh) 2019-10-10 2020-09-03 数据处理方法和相关装置

Country Status (6)

Country Link
US (1) US20220050818A1 (zh)
EP (1) EP3992808A4 (zh)
JP (1) JP7375173B2 (zh)
KR (1) KR20220031110A (zh)
CN (1) CN110765143B (zh)
WO (1) WO2021068689A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765143B (zh) * 2019-10-10 2022-08-02 腾讯科技(深圳)有限公司 数据处理方法、装置、服务器和存储介质
US11947551B2 (en) * 2022-05-27 2024-04-02 Maplebear Inc. Automated sampling of query results for training of a query engine
CN115145737B (zh) * 2022-08-31 2022-12-30 维塔科技(北京)有限公司 动态加锁方法、电子设备及计算机可读存储介质
CN116331044B (zh) * 2023-05-31 2023-08-04 山东芯演欣电子科技发展有限公司 一种用于直流充电桩的充电数据存储系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150213105A1 (en) * 2012-10-11 2015-07-30 Tencent Technology (Shenzhen) Company Limited Data processing method, apparatus, and storage medium
CN108153812A (zh) * 2017-11-24 2018-06-12 广州高清视信数码科技股份有限公司 数据通信的方法、装置、计算机设备及存储介质
CN108287835A (zh) * 2017-01-09 2018-07-17 腾讯科技(深圳)有限公司 一种数据清理方法及装置
CN109634974A (zh) * 2018-12-04 2019-04-16 郑州云海信息技术有限公司 一种数据处理方法、系统及相关组件
CN110765143A (zh) * 2019-10-10 2020-02-07 腾讯科技(深圳)有限公司 数据处理方法、装置、服务器和存储介质

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5887167A (en) * 1995-11-03 1999-03-23 Apple Computer, Inc. Synchronization mechanism for providing multiple readers and writers access to performance information of an extensible computer system
US7933881B2 (en) 2006-03-17 2011-04-26 Microsoft Corporation Concurrency control within an enterprise resource planning system
CN102508872A (zh) * 2011-10-12 2012-06-20 恒生电子股份有限公司 一种基于内存的联机处理系统的数据处理方法及系统
US10650021B2 (en) * 2013-12-03 2020-05-12 Red Hat, Inc. Managing data operations in an integrated database system
US9569481B1 (en) * 2013-12-10 2017-02-14 Google Inc. Efficient locking of large data collections
CN104793988B (zh) * 2014-01-20 2019-01-22 阿里巴巴集团控股有限公司 跨数据库分布式事务的实现方法和装置
JP6361223B2 (ja) 2014-03-27 2018-07-25 日本電気株式会社 トランザクションシステム
EP3278239B1 (en) * 2015-04-01 2019-08-14 AB Initio Technology LLC Processing database transactions in a distributed computing system
CN104834558B (zh) * 2015-05-19 2018-06-01 北京京东尚科信息技术有限公司 一种数据处理的方法及系统
CN106610865A (zh) * 2015-10-21 2017-05-03 阿里巴巴集团控股有限公司 一种数据加锁及解锁的方法及装置
CN107066480B (zh) * 2016-12-20 2020-08-11 创新先进技术有限公司 主备数据库的管理方法、系统及其设备
CN109815227B (zh) * 2018-12-13 2024-04-16 平安科技(深圳)有限公司 数据锁管理方法、装置、计算机设备及存储介质
US11593806B2 (en) * 2019-03-25 2023-02-28 Yuh-Shen Song Illicit proceeds tracking system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150213105A1 (en) * 2012-10-11 2015-07-30 Tencent Technology (Shenzhen) Company Limited Data processing method, apparatus, and storage medium
CN108287835A (zh) * 2017-01-09 2018-07-17 腾讯科技(深圳)有限公司 一种数据清理方法及装置
CN108153812A (zh) * 2017-11-24 2018-06-12 广州高清视信数码科技股份有限公司 数据通信的方法、装置、计算机设备及存储介质
CN109634974A (zh) * 2018-12-04 2019-04-16 郑州云海信息技术有限公司 一种数据处理方法、系统及相关组件
CN110765143A (zh) * 2019-10-10 2020-02-07 腾讯科技(深圳)有限公司 数据处理方法、装置、服务器和存储介质

Also Published As

Publication number Publication date
CN110765143B (zh) 2022-08-02
EP3992808A1 (en) 2022-05-04
JP2022547673A (ja) 2022-11-15
US20220050818A1 (en) 2022-02-17
KR20220031110A (ko) 2022-03-11
JP7375173B2 (ja) 2023-11-07
EP3992808A4 (en) 2022-11-16
CN110765143A (zh) 2020-02-07

Similar Documents

Publication Publication Date Title
WO2021068689A1 (zh) 数据处理方法和相关装置
US8285709B2 (en) High-concurrency query operator and method
US20120054280A1 (en) Sharing Cloud Data Resources With Social Network Associates
US20160140205A1 (en) Queries involving multiple databases and execution engines
US10452655B2 (en) In-memory cursor duration temp tables
US7461057B2 (en) Query plan execution by implementation of plan operations forming a join graph
WO2019228015A1 (zh) 基于移动端NoSQL数据库的索引创建方法及装置
WO2024060956A1 (zh) 一种混合数据库管理方法、装置、混合数据库及电子设备
US20220261391A1 (en) Auto unload
US9672231B2 (en) Concurrent access for hierarchical data storage
US8589451B1 (en) Systems and methods for generating a common data model for relational and object oriented databases
Yassien et al. RDBMS, NoSQL, Hadoop: a performance-based empirical analysis
WO2017107130A1 (zh) 数据查询方法和数据库系统
US10860579B2 (en) Query planning and execution with reusable memory stack
US20070239763A1 (en) Method for representing and recreating object dependencies from one database system to another
US8832157B1 (en) System, method, and computer-readable medium that facilitates efficient processing of distinct counts on several columns in a parallel processing system
US20060122963A1 (en) System and method for performing a data uniqueness check in a sorted data set
CN109710629B (zh) 数据访问方法、装置、服务器和存储介质
US11720402B2 (en) Fast shutdown of large scale-up processes
WO2018218504A1 (zh) 数据查询的方法和装置
WO2024046352A2 (zh) 数据查询方法、装置、计算机设备及存储介质
US20230334050A1 (en) Systems and methods for spilling data for hash joins
Wei et al. A Highly Accurate Data Synchronization and Full-text Search Algorithm for Canal and Elasticsearch
CN116089417A (zh) 信息获取方法、装置、存储介质及计算机设备
CN113051441A (zh) 实体对象的存储设计及管理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20874981

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020874981

Country of ref document: EP

Effective date: 20220126

ENP Entry into the national phase

Ref document number: 20227004713

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2022515069

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE