Data processing method and device based on relational database, equipment and medium

By performing data mirroring and deletion operations in a relational database and saving the mirrored data to the recycle bin, the problems of data bloat and loss are solved, and efficient data processing and recovery are achieved.

CN119271681APending Publication Date: 2025-01-07NANJING YUTIAN ZHIYUN SIMULATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411346856.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In existing technologies, soft deletion leads to data bloat and decreased query performance, while hard deletion results in data loss that cannot be recovered, thus failing to effectively solve the problems of data bloat and data loss.

Method used

A data processing method based on relational databases is adopted. By obtaining data processing instructions from the source end, executing data mirroring and deletion instructions, temporarily storing the mirrored data in memory and saving it to the recycle bin, the data processing is achieved by combining software and hardware.

Benefits of technology

It effectively prevents the continuous increase of junk data, improves data query performance, ensures data consistency within a transaction, and supports data recovery operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271681A_ABST
    Figure CN119271681A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, device and equipment based on a relational database and a medium, and the method comprises the following steps: obtaining a source end data processing instruction which comprises a source end data deletion instruction and a source end data mirroring instruction; querying source end data from a database by using the source end data deletion instruction; executing the source end data mirroring instruction, performing mirroring processing on the source end data to obtain mirroring data, and temporarily storing the mirroring data in a memory; executing the source end data deletion instruction, deleting the source end data in the database, and storing the mirror image data to a recycle bin; and storing the mirror image data from the recycle bin to a database. According to the method, the mirror data corresponding to the deleted source end data can be stored in the recycle bin table in the database, continuous increase of junk data can be effectively prevented, the data query performance is improved, subsequent source end data recovery operation is achieved through the corresponding interface, and the data consistency can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, equipment and medium based on a relational database. Background Art

[0002] In general management systems, there are data deletion operations. In many scenarios, in order to facilitate data recovery or auditing, soft deletion is usually adopted by modifying the deletion flag field (is_deleted). Although soft deletion has the advantages of convenient data recovery and avoiding data loss, it has problems such as data expansion, continuous increase of junk data, complex query logic, decreased query performance, and data consistency. Direct hard deletion (physical deletion) does not have problems such as data expansion, but it will cause data loss and data cannot be recovered. Summary of the invention

[0003] The main problem to be solved by the present invention is to provide a data processing method, device, equipment and medium based on a relational database, so as to solve the problem that when deleting data in the prior art, data expansion occurs, resulting in a decrease in processing performance, or data cannot be recovered after being lost.

[0004] To solve the above technical problems, a technical solution adopted by the present invention is to provide a data processing method based on a relational database, the method comprising the following steps: obtaining a source data processing instruction, the source data processing instruction comprising a source data deletion instruction and a source data mirroring instruction; using the source data deletion instruction to query the source data from the database; executing the source data mirroring instruction, mirroring the source data to obtain mirrored data, and temporarily storing the mirrored data in a memory; executing the source data deletion instruction, deleting the source data in the database, and saving the mirrored data to a recycle bin; saving the mirrored data from the recycle bin to the database.

[0005] In some embodiments, the source data deletion instruction includes a source data identifier and a data deletion operation field; the source data mirroring instruction includes a source data identifier and a data mirroring operation field.

[0006] In some embodiments, the use of the source data deletion instruction to query the source data from the database includes the steps of: intercepting the source data deletion instruction to generate a source data query instruction; executing the source data query instruction to perform a source data query operation to obtain the source data.

[0007] In some embodiments, the source-end data processing instructions further include mirror data query instructions and source-end data recovery instructions, and the method further includes the steps of: executing the mirror data query instructions and source-end data recovery instructions to recover the source-end data.

[0008] In some embodiments, the mirror data query instruction includes a mirror data identifier and a data query operation field; the source data recovery instruction includes a source data identifier and a data recovery operation field.

[0009] In some embodiments, the execution of the mirror data query instruction and the source data recovery instruction to recover the source data includes the steps of: executing the mirror data query instruction, querying the mirror data, and generating the source data recovery instruction; executing the source data recovery instruction, recovering the source data, and deleting the mirror data.

[0010] The present invention also provides a data processing device based on a relational database, the device comprising: an instruction acquisition unit, used to acquire source-end data processing instructions, the source-end data processing instructions comprising source-end data deletion instructions and source-end data mirroring instructions; a data deletion unit, used to query source-end data from a database using the source-end data deletion instructions, and also used to execute the source-end data deletion instructions to delete the source-end data in the database; a data mirroring unit, used to execute the source-end data mirroring instructions, mirror the source-end data, obtain mirrored data, and temporarily store the mirrored data in a memory; a data recovery unit, used to save the mirrored data to a recycle bin, and also used to save the mirrored data from the recycle bin to the database.

[0011] In some embodiments, the device further includes: a data recovery unit, configured to execute the mirror data query instruction and the source data recovery instruction acquired by the instruction acquisition unit, and recover the source data.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0013] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0014] The beneficial effects of the present invention are as follows: the present invention discloses a data processing method, device, equipment and medium based on a relational database, the method comprising the following steps: obtaining a source data processing instruction, the source data processing instruction including a source data deletion instruction and a source data mirror instruction; using the source data deletion instruction, querying the source data from the database; executing the source data mirror instruction, mirroring the source data, obtaining the mirror data, and temporarily storing the mirror data in the memory; executing the source data deletion instruction, deleting the source data in the database, and saving the mirror data to the recycle bin; saving the mirror data from the recycle bin to the database. The data processing method of the present invention uses the data recycle bin technology commonly used in databases, and can realize the backup of the deleted source data to the recycle bin table in the database with only a very small amount of additional code, and the source data can be restored with one key through a general interface. Compared with the traditional soft deletion method, this method can effectively prevent the continuous increase of garbage data and improve the performance of data query; at the same time, there is no need to add the query condition of is_deleted=false in all places involving the query, and the recycle bin table and the source table are in one database, so that all operations can be implemented in one transaction, which can ensure the consistency of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of an embodiment of a data processing method based on a relational database of the present invention;

[0016] Figure 2 It is a schematic diagram of a data deletion process in an embodiment of a data processing method based on a relational database of the present invention;

[0017] Figure 3 This is a specific flow chart of step S2 in an embodiment of a data processing method based on a relational database of the present invention;

[0018] Figure 4 It is a schematic diagram of a project table storing all initial project data in an embodiment of a data processing method based on a relational database of the present invention;

[0019] Figure 5 It is a schematic diagram of a task table storing all initial task data in an embodiment of a data processing method based on a relational database of the present invention;

[0020] Figure 6 It is a schematic diagram of a project table after deleting corresponding project data in an embodiment of a data processing method based on a relational database of the present invention;

[0021] Figure 7 It is a schematic diagram of a task table after deleting corresponding task data in an embodiment of a data processing method based on a relational database of the present invention;

[0022] Figure 8 It is a schematic diagram of a recycle bin table after storing corresponding binary data in an embodiment of a data processing method based on a relational database of the present invention;

[0023] Fig. 9 It is a principle diagram of a data recovery process in an embodiment of a data processing method based on a relational database of the present invention;

[0024] Fig.10 This is a specific flow chart of step S6 in an embodiment of a data processing method based on a relational database of the present invention;

[0025] Fig.11 It is a schematic diagram of a recycle bin table after deleting corresponding binary data in an embodiment of a data processing method based on a relational database of the present invention;

[0026] Fig.12 It is a structural block diagram of an embodiment of a data processing device based on a relational database of the present invention;

[0027] Fig.13 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention;

[0028] Fig.14 It is a schematic block diagram of an embodiment of a computer-readable storage medium of the present invention. DETAILED DESCRIPTION

[0029] In order to facilitate the understanding of the present invention, the present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are provided in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

[0030] It should be noted that, unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more related listed items.

[0031] like Figure 1 and Figure 2 As shown, a data processing method based on a relational database of the present invention is shown, comprising the following steps:

[0032] Step S1: Obtain source-end data processing instructions, where the source-end data processing instructions include source-end data deletion instructions and source-end data mirroring instructions.

[0033] It should be noted that source data processing instructions are mainly generated through the business code layer, and then different types of instructions are sent to the corresponding API layer and JDBC proxy layer for execution. Source data deletion instructions include source data identification and data deletion operation fields. Source data mirroring instructions include source data identification and data mirroring operation fields. The source data identification is the unique identification of the source data, the data deletion operation field is a DELETE (delete) type SQL (Structured Query Language) statement, and the data mirroring operation field is an INSERT (insert) type SQL statement.

[0034] Among them, the business code layer can be regarded as a general external interface or human-computer interaction layer, which implements the corresponding data processing operations through manual input of the human-computer interaction interface. The API layer is an interface layer provided to the outside, including interfaces such as the recycle bin interface and the data mirror recording interface. Different modules can be called through different interfaces. The JDBC proxy layer is used for the proxy of data sources, database connections, and SQL compilation statement objects.

[0035] Step S2: Query the source data from the database using the source data deletion instruction.

[0036] It should be noted that the database includes multiple source tables, each of which stores and displays corresponding source data, and each source data corresponds to a source data identifier. The source data deletion instruction also includes the table information of the source data stored in the corresponding source table, and the table information includes the table name of the source table. Therefore, the source data deletion instruction can be expressed as "DELETE FROM [the table name of the source table] WHERE [the source data identifier]", that is, the data deletion operation field is "DELETE FROM[] WHERE[]".

[0037] like Figure 2 As shown, the JDBC proxy layer first receives the source data deletion instruction, then uses the source data deletion instruction to generate a source data query instruction, and finally queries the source data from the database according to the source data query instruction.

[0038] Specifically, if Figure 3 As shown, step S2 includes the following sub-steps:

[0039] Step S21: intercepting a source-side data deletion instruction and generating a source-side data query instruction.

[0040] Among them, the SQLRecognizer tool of the distributed transaction seata is first used to identify the SQL statement type and obtain table information, that is, to identify the source data deletion instruction. After the source data deletion instruction is identified, the before-image function beforeImage of the distributed transaction seata is used to intercept the source data deletion instruction, and obtain the source data identifier of the source data to be deleted and the table name of the corresponding source table. Finally, according to the source data identifier, the table name of the source table and other table information, a source data query instruction is generated. The source data query instruction includes the source data identifier and the data query operation field. The data query operation field is a SELECT (query) type SQL statement.

[0041] Furthermore, the source data query instruction also includes the table information of the source table, and the table information of the source table includes the table name of the source table and the data type of the source data in the table, and the data type includes the type of the source data identifier. Therefore, the source data query instruction can be expressed as "SELECT [data type of source data] FROM [table name of source table] WHERE [source data identifier] FOR UPDATE", that is, the data query operation field is "SELECT [] FROM [] WHERE [] FOR UPDATE". Among them, "FOR UPDATE" is to lock the source data to prevent the source data from being modified by other instructions during the query task of executing the source data query instruction.

[0042] Step S22: Execute the source data query instruction, perform the source data query operation, and obtain the source data.

[0043] Among them, according to the source data identifier and the data query operation field in the source data query instruction, and the table information of the corresponding source table, for a piece of source data corresponding to the source data identifier, the source data query operation is performed in the corresponding source table using the data query operation field to obtain specific data corresponding to all data types, that is, the source data is obtained.

[0044] For example, according to the source data deletion instruction "DELETE FROM project WHERE id=1", the source data query instruction "SELECT create_time,name,id FROM project WHERE id=1FOR UPDATE" is assembled, where id=1 is the source data identifier, project is the table name of the corresponding source table, and create_time, name and id are the data types of the source data in project. Using the above source data query instruction, the source data with the project identifier id 1 to be deleted can be queried in the project table project. The source data includes the specific data corresponding to the project creation time create_time, project name and project identifier id of the corresponding project.

[0045] Generally speaking, a complete source data has multiple data in the database. For example, a "project data" includes not only the main data stored in the project table project, but also some of its related sub-data, such as several "task data" under the project, and the "task data" is stored in the task table task. In this case, the corresponding source data deletion instruction includes two SQL statements, which are used to obtain the specific data corresponding to the same source data identifier stored in the project table project and the task table task, so as to obtain the source data.

[0046] In this embodiment, if Figure 4 and Figure 5 As shown, the source data stored in the source table in this database is displayed. The source table includes a project table project storing project data and a task table task storing task data. Among them, the project table project has two project data, and the task table task has five task data. One project data with id=1 in the project table project and three task data with project_id=1 in the task table task constitute a corresponding source data, and the source data identifier of this source data is project.id=task.project_id=1. One project data with id=2 in the project table project and two task data with project_id=2 in the task table task constitute a corresponding source data, and the source data identifier of this source data is project.id=task.project_id=2.

[0047] In this embodiment, based on the source data identifier project.id=task.project_id=1, a source data query instruction is obtained. By executing the source data query instruction, a project data with id=1 in the project table project and three task data with project_id=1 in the task table task can be obtained to form a corresponding source data.

[0048] In this process, the specific logic is to first assemble the DELETE (deletion) type SQL statement into the SELECT (query) type SQL statement according to the parsing result of the source data deletion instruction, and then use the SELECT (query) type SQL statement to fill in the corresponding source data identifier and the table information of the source table to obtain the source data query instruction. According to the source data query instruction, the source data to be deleted can be queried.

[0049] Step S3: Execute the source data mirroring instruction, mirror the source data, obtain the mirrored data, and temporarily store the mirrored data in the memory.

[0050] It should be noted that after querying the source data to be deleted through the JDBC proxy layer, the JDBC proxy layer then transmits the received source data mirroring instruction to the data mirroring recording interface, and implements the mirroring processing of the source data through the data mirroring recording interface. The mirroring processing is to record the mirror of the source data to be deleted, so as to obtain the mirrored data.

[0051] In this embodiment, a source data with a source data identifier of project.id=task.project_id=1 queried in step S2 is first mirrored to obtain corresponding mirrored data, and the mirrored data is temporarily stored in the memory.

[0052] Step S4: Execute the source data deletion instruction, delete the source data in the database, and save the mirror data to the recycle bin.

[0053] After temporarily storing the mirror data corresponding to the source data to be deleted in the memory, the source data deletion instruction can be executed to delete the source data in the corresponding source table in the database, and then the corresponding mirror data is saved in the recycle bin.

[0054] In this embodiment, according to the source data deletion instruction "DELETE FROM project, task WHEREproject.id=task.project_id=1", the source data with the source data identifier project.id=task.project_id=1 is deleted from the project table project and the task table task.

[0055] like Figure 6 and Figure 7 As shown, the corresponding project table project and task table task after the deletion operation are displayed. There is only one project data left in the project table project, and the original project data with id=1 has been successfully deleted; there are only two task data left in the task table task, and the original three task data with project_id=1 have been successfully deleted.

[0056] Afterwards, after the business code layer receives the completion of the deletion operation, it saves the mirror data corresponding to the deleted source data in the recycle bin through the recycle bin interface.

[0057] In this process, compared with the traditional soft deletion method, this method can effectively prevent the continuous increase of junk data and improve the performance of data query.

[0058] Step S5: Save the image data from the recycle bin to the database.

[0059] It should be noted that the database also includes a recycle bin table, which is used to store the binary data of the image data corresponding to the deleted source data. In this step, the developer decides when to use the recycle bin interface to call the last image data saving instruction according to the specific business situation and save the binary data of the image data to the recycle bin table.

[0060] Since binary data is easy to store, the UndoLogParser tool is first used to convert the data image temporarily stored in the recycle bin into binary data; then the image data saving instruction is used to save the corresponding binary data into the recycle bin table in the database.

[0061] Furthermore, the mirror data saving instruction includes a mirror data identifier, a data saving operation field, and table information of the recycle bin table. The mirror data identifier is a unique identifier of the binary data of the mirror data, the data saving operation field is an SQL statement of the INSERT (insert) type, and the table information of the recycle bin table includes the table name of the recycle bin table and the data type of the binary data of the mirror data in the table, and the data type includes the type of the mirror data identifier. Therefore, the mirror data saving instruction can be expressed as "INSERT INTO [table name of the recycle bin table] [data type of binary data] VALUES [specific data corresponding to the data type of binary data]", that is, the data saving operation field is "INSERT INTO [][] VALUES []".

[0062] In this embodiment, according to the mirror data saving instruction "INSERT INTO sys_recycle_bin (biz_type, biz_id, biz_name, create_time, content) VALUES (?,?,?,?,?)", the binary data of the mirror data is inserted into the recycle bin table sys_recycle_bin in the database. Among them, the five "?" correspond to the specific data corresponding to the five data types of the binary data of the mirror data, namely, the recycling data type biz_type, the recycling data identifier biz_id, the recycling data name biz_name, the recycling data creation time create_time and the recycling data text content.

[0063] like Figure 8 As shown in the figure, after the corresponding binary data is saved to the recycle bin table sys_recycle_bin in the database, the recycle bin table sys_recycle_bin with updated data can be obtained. It can be seen that after the image data is saved from the recycle bin to the database, a new piece of data is added to the recycle bin table sys_recycle_bin, which is the binary data of the corresponding image data.

[0064] In the present invention, the recycle bin table and the source end table are both in one database, so that all operations can be implemented in one transaction, and the consistency of data can be guaranteed.

[0065] Furthermore, if Figure 1 As shown, the method also includes the steps of:

[0066] Step S6: Restore the source data according to the mirror data query instruction and the source data recovery instruction.

[0067] It should be noted that the mirror data query instruction includes the mirror data identifier, data query operation field and table information of the recycle bin table. The source data recovery instruction includes the mirror data identifier, source data identifier, data recovery operation field and table information of the source table, as well as table information of the recycle bin table.

[0068] like Fig. 9 As shown, the source data identifier of the source data to be restored is input through the universal external interface, and the source data identifier corresponds to the mirror data identifier of the mirror data, so that the recycle bin interface can obtain the mirror data query instruction. After that, the recycle bin interface queries the mirror data according to the mirror data query instruction and generates a source data recovery instruction. The recycle bin interface then restores the corresponding source data in the database according to the source data recovery instruction. After the data is successfully recovered, it can be returned to the universal external interface and then displayed on the human-computer interaction interface.

[0069] Specifically, if Fig.10 As shown, step S6 includes the following sub-steps:

[0070] Step S61: execute the mirror data query instruction, query the mirror data, and generate a source end data recovery instruction.

[0071] The mirror data query instruction can be expressed as "SELECT [data type of binary data] FROM [table name of recycle bin table] WHERE [mirror data identifier]". First, the mirror data query instruction is sent to the recycle bin interface through the general data external interface. The recycle bin interface queries the binary data of the mirror data in the recycle bin table stored in the database according to the mirror data query instruction; then the UndoLogParser tool of the distributed transaction seata is used to parse the binary data of the mirror data, obtain the corresponding mirror data, and generate the source data recovery instruction.

[0072] In this embodiment, the mirror data identifier is the specific data corresponding to the two data types biz_type and biz_id. The table name of the recycle bin table is sys_recycle_bin, and the data type is content. Then, the mirror data query instruction is "SELECT content FROM sys_recycle_bin WHERE biz_type=Project and biz_id=1". By using this mirror data query instruction, the binary data corresponding to the mirror data can be queried in the recycle bin table sys_recycle_bin, specifically the specific data corresponding to the recycled data text content; and then the obtained binary data is parsed to obtain the corresponding mirror data.

[0073] Step S62: Execute the source data recovery instruction, restore the source data, and delete the mirror data.

[0074] Among them, the recycle bin interface executes the source data recovery instruction, uses the AbstractUndoExecutor tool of the distributed transaction seata, saves the mirror data to the corresponding source table, thereby recovering the source data and deleting the binary data corresponding to the mirror data in the recycle bin table.

[0075] In this embodiment, the biz_id=1 in the mirror data identifier corresponds to the source data identifier project.id=task.project_id=1. Therefore, according to the mirror data identifier and the source data identifier, the mirror data can be saved to the corresponding project table project and task table task, thereby restoring the source data. Then, the binary data of the corresponding mirror data in the recycle bin table is deleted, that is, the mirror data is deleted, so that the following can be obtained: Figure 4The project table project that stores all the initial project data shown in the figure is as follows Figure 5 The task table task that saves all initial task data as shown, and Fig.11 The recycle bin table sys_recycle_bin is shown after deleting the corresponding binary data.

[0076] At this time, the project data in the project table project is restored to two items; the task data in the task table task is restored to five items; and the binary data corresponding to the mirror data in the recycle bin table sys_recycle_bin is deleted.

[0077] In this embodiment, the recycle bin table and the source end table are both in one database, so that all operations can be implemented in one transaction, thereby ensuring data consistency.

[0078] Based on the same inventive concept, Fig.12 As shown, the present invention also provides a data processing device based on a relational database, the device comprising:

[0079] The instruction acquisition unit 101 is used to acquire source-end data processing instructions, where the source-end data processing instructions include source-end data deletion instructions and source-end data mirroring instructions.

[0080] The data deletion unit 102 is used to query the source data to be deleted from the database using the source data deletion instruction, and is also used to execute the source data deletion instruction to delete the source data to be deleted from the database.

[0081] The data mirroring unit 103 is used to execute the source data mirroring instruction, mirror the source data to be deleted, obtain the mirrored data, and temporarily store the mirrored data in the memory;

[0082] The data recovery unit 104 is used to save the image data to the recycling bin, and is also used to save the image data from the recycling bin to the database.

[0083] Furthermore, the device also includes a data recovery unit 105, which is used to execute the mirror data query instruction and the source data recovery instruction obtained by the instruction acquisition unit 101, and recover the deleted source data.

[0084] In the present invention, other technical features in the above-mentioned data processing device based on relational database are the same as the features disclosed in the above-mentioned method embodiment, and will not be repeated here.

[0085] Based on the same inventive concept, the present application also provides an electronic device, which includes a processor, a memory and a communication circuit, and the processor is connected to the memory and the communication circuit respectively; wherein the communication circuit is used for communication connection, the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above method.

[0086] See also Fig.13 The electronic device described in the embodiment of the present application may specifically include a processor 210 and a memory 220. The memory 220 is coupled to the processor 210.

[0087] The processor 210 is used to control the operation of the electronic device. The processor 210 may also be referred to as a CPU (Central Processing Unit). The processor 210 may be an integrated circuit chip having the ability to process signals. The processor 210 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 210 may also be any conventional processor, etc.

[0088] The memory 220 is used to store computer programs, and may be a RAM, a ROM, or other types of storage terminals. Specifically, the memory 220 may include one or more computer-readable storage media, which may be non-transitory or transient. The memory 220 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage terminals, flash memory storage terminals. In some embodiments, the non-transitory computer-readable storage medium in the memory 220 is used to store at least one program code.

[0089] The processor 210 is used to execute the computer program stored in the memory 220 to implement the methods described in the various method embodiments of the present application.

[0090] In some embodiments, the electronic device may further include: a peripheral terminal interface 230 and at least one peripheral terminal. The processor 210, the memory 220 and the peripheral terminal interface 230 may be connected via a bus or a signal line. Each peripheral terminal may be connected to the peripheral terminal interface 230 via a bus, a signal line or a circuit board. Specifically, the peripheral terminal includes: at least one of a radio frequency circuit 240, a display screen 250, an audio circuit 260 and a power supply 270.

[0091] The peripheral terminal interface 230 may be used to connect at least one peripheral terminal related to I / O (Input / output) to the processor 210 and the memory 220. In some embodiments, the processor 210, the memory 220, and the peripheral terminal interface 230 are integrated on the same chip or circuit board; in some other implementations, any one or two of the processor 210, the memory 220, and the peripheral terminal interface 230 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0092] The radio frequency circuit 240 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 240 communicates with the communication network and other IoT devices through electromagnetic signals, and the radio frequency circuit 240 is the communication circuit of the electronic device. The radio frequency circuit 240 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 240 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, an operator identity module card, and the like. The radio frequency circuit 240 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 240 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0093] The display screen 250 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 250 is a touch display screen, the display screen 250 also has the ability to collect touch signals on the surface or above the surface of the display screen 250. The touch signal can be input to the processor 210 as a control signal for processing. At this time, the display screen 250 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 250 can be one, set on the front panel of the electronic device; in other embodiments, the display screen 250 can be at least two, respectively set on different surfaces of the electronic device or in a folding design; in other embodiments, the display screen 250 can be a flexible display screen, set on a curved surface or a folding surface of the electronic device. Even, the display screen 250 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 250 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0094] The audio circuit 260 may include a microphone and a speaker. The microphone is used to collect sound waves from the operator and the environment, and convert the sound waves into electrical signals and input them into the processor 210 for processing, or input them into the radio frequency circuit 240 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged in different parts of the electronic device. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 210 or the radio frequency circuit 240 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 260 may also include a headphone jack.

[0095] The power supply 270 is used to power various components in the electronic device. The power supply 270 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 270 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0096] For a detailed description of the functions and execution processes of each functional module or component in the electronic device embodiment of the present application, reference can be made to the description in the above-mentioned method embodiments of the present application, which will not be repeated here.

[0097] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the various embodiments of the electronic devices described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0098] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0100] Based on the same inventive concept, the present application also provides a computer-readable storage medium storing a computer program, which can be executed by a processor to implement the above method.

[0101] See also Fig.14 , if the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 300. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions / computer programs to enable an IoT device (which can be a personal computer, server, or network terminal, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks, and electronic terminals such as computers, mobile phones, laptops, tablet computers, cameras, etc. having the above-mentioned storage media.

[0102] The description of the execution process of the program data in the computer-readable storage medium can refer to the description in the above-mentioned method embodiments of the present application, and will not be repeated here.

[0103] It can be seen that the present invention discloses a data processing method, device, equipment and medium based on a relational database, the method comprising the following steps: obtaining source data processing instructions, the source data processing instructions including source data deletion instructions and source data mirroring instructions; using the source data deletion instructions, querying the source data from the database; executing the source data mirroring instructions, mirroring the source data, obtaining the mirrored data, and temporarily storing the mirrored data in the memory; executing the source data deletion instructions, deleting the source data in the database, and saving the mirrored data to the recycle bin; saving the mirrored data from the recycle bin to the database. This method can make the mirrored data corresponding to the deleted source data be saved in the recycle bin table in the database, which can effectively prevent the continuous increase of garbage data, improve the performance of data query, and realize the subsequent source data recovery operation through the corresponding interface, and the recycle bin table and the source table are in one database, so that all operations can be implemented in one transaction, which can ensure the consistency of data.

[0104] The above are only embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent structural transformations made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are included in the protection scope of the present invention.

Claims

1. A data processing method based on a relational database, characterized in that: The method comprises the following steps: Obtaining source-end data processing instructions, wherein the source-end data processing instructions include source-end data deletion instructions and source-end data mirroring instructions; Utilize the source data deletion instruction to query the source data from the database; Execute the source data mirroring instruction, perform mirroring processing on the source data, obtain mirrored data, and temporarily store the mirrored data in the memory; Execute the source data deletion instruction, delete the source data in the database, and save the mirror data to a recycle bin; The mirror data is saved from the recycle bin to the database.

2. The data processing method according to claim 1, characterized in that: The source data deletion instruction includes a source data identifier and a data deletion operation field; the source data mirroring instruction includes a source data identifier and a data mirroring operation field.

3. The data processing method according to claim 1, characterized in that: The method of using the source data deletion instruction to query the source data from the database includes the steps of: Intercepting the source data deletion instruction and generating a source data query instruction; Execute the source data query instruction, perform a source data query operation, and obtain the source data.

4. The data processing method according to claim 1, characterized in that: The source end data processing instruction also includes a mirror data query instruction and a source end data recovery instruction, and the method also includes the steps of: Execute the mirror data query instruction and the source data recovery instruction to recover the source data.

5. The data processing method according to claim 4, characterized in that: The mirror data query instruction includes a mirror data identifier and a data query operation field; the source end data recovery instruction includes a source end data identifier and a data recovery operation field.

6. The data processing method according to claim 5, characterized in that: The executing the mirror data query instruction and the source data recovery instruction to recover the source data comprises the steps of: Executing the mirror data query instruction, querying the mirror data, and generating the source end data recovery instruction; Execute the source data recovery instruction, recover the source data, and delete the mirror data.

7. A data processing device based on a relational database, characterized in that: The device comprises: An instruction acquisition unit, used to acquire a source-end data processing instruction, wherein the source-end data processing instruction includes a source-end data deletion instruction and a source-end data mirroring instruction; A data deletion unit, used to query source data from a database using the source data deletion instruction, and also used to execute the source data deletion instruction to delete the source data in the database; A data mirroring unit, used to execute the source end data mirroring instruction, mirror the source end data, obtain mirrored data, and temporarily store the mirrored data in a memory; The data recovery unit is used to save the image data to a recycling bin, and is also used to save the image data from the recycling bin to the database.

8. The data processing device according to claim 7, characterized in that: The device also includes: The data recovery unit is used to execute the mirror data query instruction and the source data recovery instruction acquired by the instruction acquisition unit to recover the source data.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.

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