A data processing method, device, storage medium and electronic device
Patent Information
- Application Number
- CN202211738119.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-12-30
AI Technical Summary
[0003]在现有技术中,在对数据库内的待处理数据的处理过程中,当向数据库发送的数据处理指令中的修改语句不包含针对待处理数据的数据约束字段(例如,主键)时,通常会出现将其他数据一同误处理的情况,从而导致数据库内存储的数据出现存储错误,甚至丢失的问题
[0035] In the data processing method provided in this specification, based on the obtained data operation statements that do not contain constraints for querying specified data, candidate data is retrieved from the database, and the data to be processed selected by the user from the candidate data is determined. The data processing instructions for processing the data to be processed are rewritten according to the physical address in the database corresponding to the data to be processed, and the data to be processed is processed according to the modified data processing instructions.
Smart Images

Figure CN115905267B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of Internet technology, and in particular to a data processing method, apparatus, storage medium and electronic device. Background Technology
[0002] With the continuous development of the Internet, society has entered the era of big data, and database systems are usually used to store and manage data information (such as private data) generated by people's daily activities.
[0003] In the existing technology, when processing data to be processed in a database, if the modification statement in the data processing instruction sent to the database does not contain data constraint fields (e.g., primary keys) for the data to be processed, other data may be mistakenly processed along with it, resulting in storage errors or even data loss in the database. Summary of the Invention
[0004] This specification provides a data processing method and apparatus to partially solve the aforementioned problems existing in the prior art.
[0005] The following technical solution is adopted in this specification:
[0006] This specification provides a data processing method, including:
[0007] Obtain data manipulation statements input by the user, wherein the data manipulation statements do not contain data constraints for filtering specified data;
[0008] Based on the data manipulation statements, each candidate data is filtered from the database and the address of each candidate data in the database is determined;
[0009] The data selected by the user from the candidate data is determined as the data to be processed;
[0010] Based on the address of the data to be processed in the database, the data operation statement is rewritten to obtain the rewritten data operation statement;
[0011] The data to be processed is processed according to the rewritten data operation statements.
[0012] Optionally, according to the data manipulation statement, filtering out candidate data from the database and determining the address of each candidate data in the database specifically includes:
[0013] Add a pre-defined field for querying the address to the data manipulation statement;
[0014] Based on the data operation statement that adds the specified field, retrieve each candidate data from the database and determine the address of each candidate data in the database.
[0015] Optionally, based on the address of the data to be processed in the database, the data operation statement is rewritten to obtain the rewritten data operation statement, specifically including:
[0016] The preset specified field for querying the address is added to the data operation statement to rewrite the data operation statement, resulting in a rewritten data operation statement.
[0017] Optionally, the data operation statement is rewritten based on the address of the data to be processed in the database, specifically including:
[0018] The data manipulation statement is parsed to determine whether it contains data constraints on the data to be processed.
[0019] If not, rewrite the data operation statement according to the address of the data to be processed in the database.
[0020] Optionally, the method further includes:
[0021] When it is determined that the data operation statement contains data constraints on the data to be processed, the data to be processed is processed according to the data operation statement.
[0022] This specification provides a data processing apparatus, including:
[0023] The acquisition module acquires the data operation statement input by the user, wherein the data operation statement does not contain data constraints for filtering specified data;
[0024] The filtering module, based on the data operation statement, filters out each candidate data from the database and determines the address of each candidate data in the database;
[0025] The determination module determines the data selected by the user from the candidate data as the data to be processed.
[0026] The rewriting module rewrites the data operation statement based on the address of the data to be processed in the database, thereby obtaining the rewritten data operation statement;
[0027] The processing module processes the data to be processed according to the rewritten data operation statements.
[0028] Optionally, the filtering module is specifically used to add a preset specified field for querying addresses to the data operation statement; and to query each candidate data from the database and determine the address of each candidate data in the database according to the data operation statement with the specified field added.
[0029] Optionally, the rewriting module is specifically used to add the preset specified field for querying the address to the data operation statement to rewrite the data operation statement and obtain the rewritten data operation statement.
[0030] Optionally, the rewriting module is specifically used to parse the data operation statement to determine whether the data operation statement contains data constraints on the data to be processed; if not, to rewrite the data operation statement according to the address of the data to be processed in the database.
[0031] Optionally, the processing module is further configured to process the data to be processed according to the rewritten data operation statement.
[0032] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data processing method.
[0033] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described data processing method.
[0034] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:
[0035] In the data processing method provided in this specification, based on the obtained data operation statements that do not contain constraints for querying specified data, candidate data is retrieved from the database, and the data to be processed selected by the user from the candidate data is determined. The data processing instructions for processing the data to be processed are rewritten according to the physical address in the database corresponding to the data to be processed, and the data to be processed is processed according to the modified data processing instructions.
[0036] As can be seen from the above method, this method uses the physical address of the data to be processed in the database as a constraint that can uniquely identify the data to be processed. The data processing instructions are rewritten, and when the data to be processed is processed using the rewritten data processing instructions, the data to be processed can be processed accurately, avoiding the problem of other candidate data being misprocessed. Attached Figure Description
[0037] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and their descriptions, serving to explain this specification and do not constitute an undue limitation thereof.
[0038] In the picture:
[0039] Figure 1 This is a flowchart illustrating one data processing method described in this specification.
[0040] Figure 2 This is a schematic diagram of a data processing device provided in this specification;
[0041] Figure 3 The corresponding information provided in this specification Figure 1 A schematic diagram of an electronic device. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0043] With the advent of the big data era, the diverse needs of people in their daily activities have led to a rapid increase in the amount of data in information systems. Therefore, database systems are commonly used to store and manage this data. In practice, users frequently have needs to process data within database systems, which typically include modifying, deleting, and adding data.
[0044] The typical process of processing data in a database is as follows: First, the user can input data manipulation statements into the database's client. These statements are used to retrieve specified data from the various database entries. In response to the received user input, the database retrieves candidate data as a result set, which is then displayed to the user, usually in tabular form. Next, the database's client receives data processing instructions, which include modification statements. The database then processes the data in the result set according to these modification statements.
[0045] In existing technologies, taking an update statement as an example, the format of an update statement is typically: `update table_name set column_name = X value where column_name = Y value`. Normally, to avoid accidental data modification, the "where column_name = Y value" clause in the update statement should uniquely identify the data to be processed, meaning it contains a combination of columns with unique constraints, such as the primary key column. However, when the modification statement in the data processing instruction does not contain a primary key column or any other combination of columns with unique constraints, the database will process all candidate data under that column name in the result set.
[0046] For example, a database contains a table named T_WITH_PK, which has a primary key COL1. Using the data manipulation statement `select COL1, COL2 from T_WITH_PK where COL1 in(1,2)`, the result set is shown in Table 1.
[0047] 1 A1 2 A1
[0048] Table 1
[0049] To change A1 to B1 under the condition COL=1, to avoid accidentally modifying COL2=A1 corresponding to COL1=2, the user-entered database modification statement needs to include a unique constraint to match COL2=A1 corresponding to COL1=1. Specifically, to avoid accidentally modifying COL2=A1 corresponding to COL1=2, the user-entered database modification statement can be: UPDATE T_WITH_PK SET COL2=B1 WHERE COL1=1. Here, the modification statement uses the primary key COL1 as the WHERE condition to match the rows to be modified. In this way, the database can uniquely identify the data to be processed based on the primary key, i.e., COL2=A1, and will not modify A1 corresponding to COL1=2 to B1 as well.
[0050] In practice, for the database to accurately locate the data to be processed by the user, the data processing instructions sent to the database must include primary keys or other fields as data constraint fields for the data to be processed. These columns represent unique constraints on the data to be processed, and are used as rows to be modified under the WHERE clause. If we compare the result set displayed in tabular form to an Excel spreadsheet, when modifying a specific piece of data, the row and column number must be explicitly specified for Excel to identify the unique data to be processed. Similarly, if the data processing instructions only contain column names without specifying the rows to be modified under the WHERE clause, the unique data to be processed cannot be identified. This would result in all data under the column names specified in the data processing instructions being processed, leading to erroneous data updates and potentially causing the loss of private data in the database.
[0051] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0052] Figure 1 This is a flowchart illustrating one data processing method described in this specification, which specifically includes the following steps:
[0053] S100: Obtain the data operation statement input by the user, wherein the data operation statement does not contain data constraints for filtering specified data.
[0054] The subject executing the data processing method provided in this specification can be an electronic device where the database server is located, such as a laptop or mobile phone, or a database client that communicates with the database server. This specification does not limit this.
[0055] For ease of explanation, the following example will only use the server where the database is located as the execution subject.
[0056] It should be noted beforehand that, in the process of data processing in a database system, to avoid data misprocessing, the modification statements sent to the database must include a combination of columns with primary keys or other unique constraints as the WHERE condition to match the data to be modified. Therefore, based on the above, the data processing method provided in this manual can utilize the ROWID in the database system as the row to be matched in the WHERE condition, enabling the database to uniquely identify the data to be processed, thereby avoiding the misprocessing of other data.
[0057] First, let's briefly explain ROWID in a database. Each row of data in a database table has a unique identifier, namely ROWID. Internally, the database logic typically uses ROWID to access data. ROWID represents the physical location of that row of data within the database. Therefore, in this embodiment, ROWID is referred to as the physical address corresponding to the data. It can point to the address of the data file where the block containing that row of data is stored in the data table, or it can directly locate the address of that row itself within the data block. ROWID is unique.
[0058] Databases can represent ROWID using base64 encoding, which is the physical address of each row of data. The encoded characters include A-Z, a-z, 0-9, +, and / . ROWID contains the following: the data file number where the object is located, the block number where the object is located, the position of the object's row within the block, and the object number.
[0059] Therefore, if the physical address (ROWID corresponding to the data to be processed) is used as the row to be matched and modified in the WHERE condition of the data processing instruction, the database can determine the unique data to be processed and will not mistakenly process other data.
[0060] Based on the above-described steps for processing data in the database, in this embodiment of the specification, it is necessary to first query the data to be processed, and then process the data to be processed, that is, the data query stage and the data processing stage.
[0061] Therefore, the server can obtain the data manipulation statement input by the user, which does not contain data constraints for filtering specified data. The specified data is the data the user needs to process, and the data constraints can be understood as the fields corresponding to the primary key or other arbitrary uniqueness constraints of the specified data contained in the data manipulation statement.
[0062] S102: Based on the data operation statement, filter out each candidate data from the database and determine the address of each candidate data in the database.
[0063] Since the data manipulation statement does not contain data constraints for filtering specified data, in order to ensure that the database has rows that match the WHERE condition to uniquely identify the data to be processed during the data processing stage, the field of the physical address used to query the data can be extended to the query data entered by the user during the data query stage, so as to rewrite the data manipulation statement.
[0064] Specifically, the pre-defined fields used for querying physical addresses can be added to the user-input data operation statement for rewriting, resulting in a rewritten data operation statement.
[0065] The database can then execute the rewritten data manipulation statements, filtering out the corresponding data from the database as candidate data. For each candidate data, its address in the database can be determined. This address represents the storage location of the candidate data in the database, specifically represented by the candidate data's ROWID.
[0066] S104: Determine the data selected by the user from the candidate data as the data to be processed.
[0067] S106: Based on the address of the data to be processed in the database, rewrite the data operation statement to obtain the rewritten data operation statement.
[0068] S108: Process the data to be processed according to the rewritten data operation statement.
[0069] In the embodiments of this specification, steps S104 to S108 belong to the data processing stage.
[0070] The database can display the candidate data to the user in a table format, where each candidate data constitutes a filtered result set, and each candidate data has a corresponding column name. In response to user actions such as clicking on a data point within the candidate data, the database determines that the user has selected that data from the candidate data and treats it as the data to be processed.
[0071] As can be seen from step S102, the database has determined the address of each candidate data in the database. Therefore, the address of the data to be processed in the database is known.
[0072] During the data processing phase, in order to accurately locate the data to be processed, the database can rewrite the data processing instructions based on the address of the data to be processed in the database. The data processing instructions include at least update statements, which include at least modification and deletion statements.
[0073] Specifically, the database responds to the received data processing instructions as raw data processing instructions, and parses the data operation statements corresponding to the raw data processing instructions to determine whether the raw data processing instructions contain data constraint fields for the data to be processed.
[0074] If the original data processing instruction contains fields corresponding to data constraints on the data to be processed, it means that the database can uniquely determine the data to be processed based on the fields corresponding to the columns that have unique constraints on the data to be processed, and will not misprocess other data among the candidate data except for the data to be processed. Therefore, the database can directly execute the original data processing instruction.
[0075] If the original data processing instruction does not contain the fields corresponding to the data constraints on the data to be processed, it means that the original data processing does not contain the fields corresponding to the primary key or other unique arbitrary constraint column combinations as the rows to be modified by the WHERE condition. In this case, the database may mistakenly process other data with the same value as the data to be processed. Therefore, the original data processing instruction can be rewritten according to the address of the data to be processed in the database to obtain the rewritten data processing instruction, and then the database can be made to execute the rewritten data processing instruction.
[0076] Finally, the database can execute data processing instructions containing fields corresponding to data constraints on the data to be processed, so as to uniquely determine the data to be processed from each candidate data, and process the data to be processed according to the content of the data processing instructions based on the rewritten data operation statements.
[0077] based on Figure 1 The data processing method described herein, based on data operation statements that do not contain fields corresponding to data constraints used to query specified data, retrieves candidate data from the database and determines the data to be processed selected by the user from these candidate data. It then rewrites the data processing instructions for processing the data to be processed based on the database address corresponding to the data to be processed, and processes the data according to the modified instructions. This method uses the database address of the data to be processed as a constraint that uniquely identifies the data to be processed. By rewriting the data processing instructions and then using the modified instructions to process the data to be processed, the method can accurately process the data to be processed and avoid the problem of misprocessing other candidate data.
[0078] Users can either input data operation statements into the database first, and after obtaining the candidate data, input data processing instructions into the database, or input both data operation statements and data processing instructions into the database together. This manual does not impose any restrictions on this.
[0079] It's worth noting that while users can directly input data manipulation statements containing fields for querying the database's corresponding address, in many real-world applications, the database system users are not database professionals. They typically use pre-written data manipulation statements, directly inputting them into the database, and the database receives the same data processing instructions. When users modify these statements or instructions, errors are highly likely, preventing normal use of the database system and increasing its complexity. Therefore, the data processing method provided in this manual modifies the received statements or instructions (excluding those containing fields corresponding to data constraints on the data to be processed) on the backend after receiving user input, eliminating the need for user modification. This reduces the operational complexity of the database while ensuring it doesn't misprocess other data.
[0080] To facilitate understanding of the data processing methods provided in this specification, a simple example will be used to illustrate this application.
[0081] Continuing with the previous example, during the data query phase, the database receives the user-input data operation statement: `select COL2 from T_WITH_PK`. Parsing this statement reveals that it lacks the fields corresponding to the data constraints used to query the specified data, such as the primary key field. Therefore, a pre-defined field for the address used to query the data (i.e., the ROWID field) can be added to the data operation statement, resulting in the rewritten statement: `select ROWID, COL2 from T_WITH_PK`. After executing this rewritten statement, the database obtains the result set shown in Table 2.
[0082] *AAEPAQEAwAEAAAA= A1 *AAEPAQEAwAIAAAA= A1
[0083] Table 2
[0084] In this way, the database will display all the data under column name COL2 in the data table as candidate data, and at the same time, for each candidate data, the database can determine the corresponding address in the database.
[0085] Afterwards, based on the user's selection, the database determined that the data to be processed was COL2 = A1 in the first row of Table 2. Therefore, based on the ROWID of the first row in Table 2, the database can rewrite the update statement for the data to be processed as follows:
[0086] update"T_WITH_PK"set"COL2"='A2'where ROWID='*AAEPAQEAwAEAAAA='
[0087] In this way, the database can update only the data to be processed based on the rewritten update statement, without modifying the data in the second row of Table 2, thus avoiding the problem of accidentally processing other data.
[0088] Furthermore, to avoid increasing the complexity of database operations, the above rewriting operations are only performed on the database backend and are not displayed on the frontend. Users will not be aware that their input data operation statements and data processing instructions have been rewritten.
[0089] Specifically, when the database receives a data operation statement from the user, it can extend the built-in method to add a pre-defined field used to query the address of the data in the database to the data operation statement, thereby rewriting the user's input data operation statement. Since the specified field is added to the data operation statement in an extended built-in way, the database will not display the content corresponding to the specified field when displaying the result set. That is, the database will not show the user the address (ROWID) of each candidate data in the database on the front end.
[0090] Therefore, based on the above explanation, in this embodiment, the data manipulation statement can be rewritten as: Select ROWID As "__ODC_INTERNAL_ROWID__", COL2 from T_WITH_PK. When the database executes the rewritten data manipulation statement, upon reading ROWID As "__ODC_INTERNAL_ROWID__", it will hide the column named __ODC_INTERNAL_ROWID__. Therefore, ROWID will be hidden in the database front-end, and only COL2 will actually be displayed to the user. The result set that the user can see is shown in Table 3.
[0091] A1 A1
[0092] Table 3
[0093] It is worth noting that after receiving a data processing instruction, the database can parse the data operation statements in the instruction. If the data operation statements contain fields corresponding to the data constraints of the instruction to be processed, that is, if the received data processing instruction contains columns with unique constraints on the data to be processed, the database can use the columns with unique constraints in the instruction to generate rows that match the WHERE conditions of the instruction. If not, the database will check if the instruction contains the address of the data to be processed. If so, the database can use the address of the data to be processed to generate rows that match the WHERE conditions of the data to be processed.
[0094] If the data processing instruction does not contain a column for uniqueness constraints on the data to be processed, nor does it contain an address for the data to be processed, it can be determined whether the data processing instruction also contains a hidden physical address corresponding to the data to be processed. If it does, the database can use the hidden physical address of the data to be processed to generate a row that modifies the WHERE condition matching for the data to be processed.
[0095] If none of the data processing instructions meet the above conditions, in order to avoid misprocessing other data in the database, the database may refuse to execute the data processing instructions and issue an error message. At the same time, it will display a prompt message on the client to inform the user that editing of the data to be processed is not supported.
[0096] To make it easier to understand, you can draw an analogy to an Excel spreadsheet. For example, a table might contain user names, ID numbers, and genders. If you want to change the gender of a target user, using the target user's name as the matching condition will often mistakenly change the gender of users with the same name if duplicate names exist. However, each user's ID number is unique. If you use the target user's ID number as the matching condition, this misprocessing problem won't occur. Here, the target user's ID number acts as the column for uniqueness constraints on the data being processed, serving as the row for the WHERE clause when changing a user's gender.
[0097] Therefore, based on the data processing method provided in this specification, the number corresponding to the row where the target user is located can be used as the matching condition. This will prevent the gender of other users from being misprocessed. Using the code corresponding to the row where the target user is located as the matching condition is equivalent to generating the row with the WHERE condition matching based on the physical address of the data to be processed in this solution.
[0098] Additionally, the database can parse the received data processing instruction upon initial receipt to determine whether it contains data manipulation statements. If so, the database can execute steps S100 to S108. Specifically, the database can break down the database statements contained in the data processing instruction and identify them character by character to determine whether the database statements meet preset conditions. If so, it can be determined that the data processing instruction contains data manipulation statements. For example, if it is determined that the received database statement contains a select field but not an into field, it is determined that the user has entered a data manipulation statement.
[0099] The above describes one or more embodiments of the data processing method provided in this specification. Based on the same idea, this specification also provides corresponding data processing devices, such as... Figure 2 As shown.
[0100] Figure 2 This specification provides a schematic diagram of a data processing device, which specifically includes:
[0101] The acquisition module 200 acquires the data operation statement input by the user, wherein the data operation statement does not contain data constraints for filtering specified data;
[0102] The filtering module 202 filters out each candidate data from the database and determines the address of each candidate data in the database according to the data operation statement.
[0103] The determining module 204 determines the data selected by the user from the candidate data as the data to be processed;
[0104] The rewriting module 206 rewrites the data operation statement according to the address of the data to be processed in the database, and obtains the rewritten data operation statement.
[0105] The processing module 208 processes the data to be processed according to the rewritten data operation statement.
[0106] Optionally, the filtering module 202 is specifically used to add a preset specified field for querying the address to the data operation statement; and to query each candidate data from the database and determine the address of each candidate data in the database according to the data operation statement with the specified field added.
[0107] Optionally, the rewriting module 206 is specifically used to add the preset specified field for querying the address to the data operation statement to rewrite the data operation statement and obtain the rewritten data operation statement.
[0108] Optionally, the rewriting module 206 is specifically used to parse the data operation statement to determine whether the data operation statement contains data constraints on the data to be processed; if not, rewrite the data operation statement according to the address of the data to be processed in the database.
[0109] Optionally, the processing module 208 is further configured to process the data to be processed according to the data operation statement when it is determined that the data operation statement contains data constraints on the data to be processed.
[0110] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The provided data processing methods.
[0111] This instruction manual also provides Figure 3 The diagram shows a schematic structural representation of the electronic device. Figure 3 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The data processing method described herein. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.
[0112] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0113] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0114] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0115] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0116] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0117] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0120] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0121] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0122] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0123] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0124] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0125] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0126] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0127] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A data processing method, comprising: Obtain data manipulation statements input by the user, wherein the data manipulation statements do not contain data constraints for filtering specified data; Based on the data manipulation statements, each candidate data is filtered from the database and the address of each candidate data in the database is determined; The candidate data is displayed to the user, and in response to the user's selection operation on any of the candidate data, the data selected by the user from the candidate data is determined as the data to be processed. Based on the address of the data to be processed in the database, the data operation statement is rewritten to obtain the rewritten data operation statement; The data to be processed is processed according to the rewritten data operation statements.
2. The method as described in claim 1, wherein filtering candidate data from the database and determining the address of each candidate data in the database according to the data operation statement specifically includes: Add a pre-defined field for querying the address to the data manipulation statement; Based on the data operation statement that adds the specified field, retrieve each candidate data from the database and determine the address of each candidate data in the database.
3. The method as described in claim 2, wherein the data operation statement is rewritten based on the address of the data to be processed in the database to obtain the rewritten data operation statement, specifically including: The preset specified field for querying the address is added to the data operation statement to rewrite the data operation statement, resulting in a rewritten data operation statement.
4. The method as described in claim 1, wherein rewriting the data operation statement based on the address of the data to be processed in the database specifically includes: The data manipulation statement is parsed to determine whether it contains data constraints on the data to be processed. If not, rewrite the data operation statement according to the address of the data to be processed in the database.
5. The method of claim 1, further comprising: When it is determined that the data operation statement contains data constraints on the data to be processed, the data to be processed is processed according to the data operation statement.
6. A data processing apparatus, comprising: The acquisition module acquires the data operation statement input by the user, wherein the data operation statement does not contain data constraints for filtering specified data; The filtering module, based on the data operation statement, filters out each candidate data from the database and determines the address of each candidate data in the database; The determination module displays the candidate data to the user and, in response to the user's selection operation on any data in the candidate data, determines the data selected by the user from the candidate data as the data to be processed. The rewriting module rewrites the data operation statement based on the address of the data to be processed in the database, thereby obtaining the rewritten data operation statement; The processing module processes the data to be processed according to the rewritten data operation statements.
7. The apparatus of claim 6, wherein the filtering module is specifically configured to: add a preset specified field for querying the address to the data operation statement; and, according to the data operation statement with the specified field added, query each candidate data from the database and determine the address of each candidate data in the database.
8. The apparatus of claim 7, wherein the rewriting module is specifically used to add the preset specified field for querying the address to the data operation statement to rewrite the data operation statement and obtain the rewritten data operation statement.
9. The apparatus of claim 6, wherein the rewriting module is specifically configured to parse the data operation statement to determine whether the data operation statement contains data constraints on the data to be processed; if not, rewrite the data operation statement according to the address of the data to be processed in the database.
10. The apparatus of claim 6, wherein the processing module is further configured to process the data to be processed according to the rewritten data operation statement.
11. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 5.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Database data change method and device
CN113986939A
Data updating method and device, terminal equipment and storage medium
CN114116750A
Distributed database statement execution method and device, equipment and storage medium
CN115495528A