Data processing method and device, electronic device, and computer-readable storage medium
By setting a post-function in the structured query statement and replacing the field name of the cascading field, the problem of cascading fields being difficult to display is solved, achieving a concise display effect based on user needs.
Patent Information
- Application Number
- CN202310408677.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-04-07
AI Technical Summary
Existing technologies make it difficult to display cascading fields on the front end according to user needs, especially in clinical trial data acquisition systems, where cascading fields such as province, city, and district information are difficult to display concisely.
By setting a post-function in the structured query statement, replacing it with the field name of the cascading field to be processed, and determining the parameters of the post-function based on the preset display format of the cascading field, the cascading field is processed to achieve the front-end display required by the user.
It enables cascading fields to be displayed according to user requirements in a preset format, improving the flexibility and efficiency of data display.
Smart Images

Figure CN116414859B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, specifically to a data processing method and apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] With the advancement of technology, Electronic Data Capture Systems (EDC) for clinical trials have become widely used. Users store the data collected through EDC systems in tables within a database for subsequent data analysis and result presentation. However, these tables often contain cascading fields, and due to the unique storage format of these fields, it is difficult to display them on the front end according to user requirements. Summary of the Invention
[0003] In view of this, embodiments of this application provide a data processing method and apparatus, electronic device, and computer-readable storage medium to solve the problem of difficulty in displaying cascaded field data on the front end according to user needs.
[0004] The first aspect of this application provides a data processing method, comprising: receiving a structured query statement for a data table to be processed, the structured query statement including a post-function, wherein the parameters of the post-function are determined based on a preset display format of the cascading fields to be processed in the data table; replacing the post-function in the structured query statement with the field names of the cascading fields to be processed, to obtain a transformed structured query statement, and temporarily storing the post-function in runtime memory; executing the transformed structured query statement to obtain query data including the cascading fields to be processed; and processing the cascading fields to be processed using the post-function to obtain the data processing results corresponding to the cascading fields to be processed, thereby obtaining the data processing results of the data table to be processed.
[0005] In one embodiment, processing the cascaded field to be processed using a post-function to obtain the data processing result corresponding to the cascaded field to be processed includes: parsing the cascaded field to be processed to obtain the level of each of the multiple subfields included in the cascaded field to be processed; and concatenating the multiple subfields based on the level of each of the multiple subfields and the first concatenation format parameter and the second concatenation format parameter in the post-function to obtain the data processing result corresponding to the cascaded field to be processed; wherein, the first concatenation format parameter is used to characterize the concatenation format of the concatenated subfields corresponding to each of the multiple subfields during the concatenation process, and the second concatenation format parameter is used to characterize the concatenation format of the number values included in each of the multiple subfields during the concatenation process.
[0006] In one embodiment, based on the respective levels of multiple subfields and the first and second concatenation format parameters in the post-function, multiple subfields are concatenated to obtain the data processing result corresponding to the cascading field to be processed. This includes: editing the number values in multiple subfields according to the concatenation format corresponding to the second concatenation format parameter and combining them with the keywords in multiple subfields to obtain the concatenated subfields corresponding to each of the multiple subfields; and concatenating the concatenated subfields corresponding to each character in multiple subfields based on the respective levels of multiple subfields and the concatenation format corresponding to the first concatenation format parameter to obtain the data processing result corresponding to the cascading field to be processed.
[0007] In one embodiment, concatenating multiple subfields based on their respective levels and the concatenation format corresponding to the first concatenation format parameter, includes: determining the levels of multiple concatenated subfields based on their respective levels; and concatenating multiple concatenated subfields in descending order of level using the concatenation format corresponding to the first concatenation format parameter to obtain the data processing result corresponding to the cascaded field to be processed.
[0008] In one embodiment, parsing the cascaded field to be processed to obtain the level of each of the multiple subfields included in the cascaded field to be processed includes: determining the number value included in each of the multiple subfields; and determining the level corresponding to each of the multiple subfields based on the number value included in each of the multiple subfields, wherein the number of digits in the number value has a negative correlation with the level.
[0009] In one embodiment, before receiving a structured query statement for a data table to be processed, the method further includes: determining object parameters of a post-function based on the field names of the cascading fields to be processed, wherein the object parameters are used to characterize the processing object of the post-function; determining a first concatenation format parameter included in the post-function based on a preset interval symbol between sub-fields of different levels in a preset display format; determining a second concatenation format parameter included in the post-function based on a preset identifier symbol of the number values included in each of the multiple sub-fields in the preset display format; and determining the post-function based on the sub-field parameters, the first concatenation format parameter, and the second concatenation format parameter.
[0010] In one embodiment, after processing the concatenated field to be processed using a post-function temporarily stored in runtime memory and obtaining the data processing result corresponding to the concatenated field to be processed, the method further includes: deleting the post-function from runtime memory.
[0011] A second aspect of this application provides a data processing apparatus, comprising a receiving module configured to receive a structured query statement for a data table to be processed, the structured query statement including a post-function, wherein the parameters of the post-function are determined based on a preset display format of the cascading fields to be processed in the data table; a conversion module configured to replace the post-function in the structured query statement with the field names of the cascading fields to be processed, to obtain a converted structured query statement, and temporarily store the post-function in runtime memory; an execution module configured to execute the converted structured query statement to obtain query data including the cascading fields to be processed; and a processing module configured to process the cascading fields to be processed using the temporary post-function to obtain the data processing results corresponding to the cascading fields to be processed, thereby obtaining the data processing results of the data table to be processed.
[0012] A third aspect of this application provides an electronic device, including: a processor; and a memory storing computer program instructions, wherein when the computer program instructions are executed by the processor, the processor performs the data processing method provided in the first aspect.
[0013] The fourth aspect of this application provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, cause the processor to perform the data processing method provided in the first aspect.
[0014] According to the data processing method provided in this application, after receiving a structured query statement for a data table to be processed, since the post-function is not a word directly representing the query object, the post-function is replaced with the field name of the cascading field to be processed for querying, resulting in query data including the cascading field to be processed. Furthermore, since the parameters of the post-function are determined based on the preset display format of the cascading field to be processed in the data table, processing the cascading field to be processed using the post-function enables the cascading field to be displayed according to the preset display format. In other words, by setting a post-function in the structured query statement, the purpose of displaying the cascading field to be processed on the front end according to user requirements is achieved. Attached Figure Description
[0015] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof.
[0016] Figure 1 The diagram shown is a system architecture diagram of a data processing method provided in an embodiment of this application.
[0017] Figure 2The diagram shown is a flowchart of a data processing method provided in an embodiment of this application.
[0018] Figure 3 The diagram shown is a flowchart illustrating the determination of a post-function according to an embodiment of this application.
[0019] Figure 4 The diagram shown is a flowchart illustrating how a post-function is used to process a cascaded field to obtain the data processing result corresponding to the cascaded field, according to an embodiment of this application.
[0020] Figure 5 The diagram shown is a flowchart illustrating how multiple subfields are concatenated to obtain the data processing result corresponding to the cascaded field to be processed, based on the respective levels of multiple subfields and the first and second concatenation format parameters in the post-function, according to an embodiment of this application.
[0021] Figure 6 The diagram shown is a structural schematic of a data processing apparatus provided in an embodiment of this disclosure.
[0022] Figure 7 The diagram shown is a structural schematic of a processing module provided in another embodiment of this disclosure.
[0023] Figure 8 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] In recent years, EDC (Electronic Data Collection) systems have been increasingly used by users due to their powerful and convenient functions. After collecting data using an EDC system, users store the collected data in a database by creating custom tables. A table is an object used to store data in a database. Users may subsequently need to analyze the data stored in the table and display the results. However, some fields stored in the table are cascading fields, such as geographical location information like provinces, cities, and districts. Cascading fields are difficult to display according to users' personalized needs.
[0026] For example, the form of table t1 in the database is shown in Table 1 below.
[0027] Table 1
[0028]
[0029]
[0030] The city field in the table is a cascading field, but if users want to display it on the front end in a more concise form, such as Jiangsu Province #Nanjing City #Gulou District, it is difficult to achieve in traditional technologies.
[0031] To address the aforementioned issues, this disclosure provides a data processing method. Upon receiving a structured query statement for a data table to be processed, since the post-function is not a word directly representing the query object, the post-function is replaced with the field name of the cascading field to be processed, resulting in query data including the cascading field. Furthermore, because the parameters of the post-function are determined based on the preset display format of the cascading field in the data table, processing the cascading field using the post-function ensures that it is displayed according to the preset format. In other words, by setting a post-function in the structured query statement, the goal of displaying the cascading field according to user requirements on the front end is achieved.
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] The following is combined Figure 1 An example is given to illustrate the system architecture of the data processing method.
[0034] like Figure 1 As shown, the data processing method provided in this embodiment involves a database system 110 and a user terminal 120.
[0035] In practical applications, users input a structured query statement for a data table to be processed on user terminal 120. The structured query statement includes a post-function, the parameters of which are determined based on the preset display format of the cascading fields to be processed in the data table. Database system 110 receives the structured query statement for the data table to be processed, replaces the post-function in the structured query statement with the field names of the cascading fields to be processed, obtaining a transformed structured query statement, and temporarily stores the post-function in runtime memory. Database system 110 executes the transformed structured query statement, obtains query data including the cascading fields to be processed, processes the cascading fields using the post-function, and obtains the data processing results corresponding to the cascading fields to be processed, thus obtaining the data processing results for the data table to be processed.
[0036] For example, the database system can be a relational database, including, but not limited to, MySQL database.
[0037] For example, database system 110 can be a distributed database, that is, the database has multiple servers (i.e., multiple server ends). Each server may have a complete copy of the data or a partial copy of the data, and has its own local database. Multiple servers located in different locations are interconnected through a network to form a complete, globally logically centralized, physically distributed large database.
[0038] In an optional example, the EDC system can also be integrated into the user terminal 120.
[0039] For example, user terminal 120 may include physical devices such as smartphones, desktop computers, tablets, and laptops.
[0040] It should be noted that the front end mentioned in this application is the user terminal 120.
[0041] In this embodiment, by setting a post-function in the structured query statement for the data table to be processed, the purpose of displaying cascading fields on the front end according to user needs is achieved.
[0042] Figure 2 The diagram shown is a schematic flowchart of a data processing method provided in an embodiment of this application. Figure 2 As shown, the data processing method includes the following steps.
[0043] Step S210: Receive a structured query statement for the data table to be processed. The structured query statement includes a post-function.
[0044] For example, the parameters of the post-function are determined based on the preset display format of the cascading fields to be processed in the data table.
[0045] Structured Query Language (SQL) is a database programming language. Databases execute SQL statements entered by users to meet their data processing needs. Data is stored in tables within a database, and the columns of a table are called fields. A table to be processed contains multiple fields; cascading fields to be processed refer to the fields that need to be processed and have a hierarchical connection.
[0046] Step S220: Replace the post-function in the structured query statement with the field name of the cascading field to be processed to obtain the transformed structured query statement, and temporarily store the post-function in the runtime memory.
[0047] Essentially, post-functions are not terms that directly represent the query object. Since the cascading fields to be processed need to be retrieved, and post-functions are not terms that directly represent the query object, they need to be transformed into terms that directly represent the query object.
[0048] It should be noted that in SQL, the field name after SELECT is the query object, and the words after WHERE are the query restrictions.
[0049] For example, after receiving a structured query statement, each query term in the structured query statement is traversed. When a query term is identified as a function identifier, it is determined to be a post-function. The post-function in the structured query statement is replaced with the field name of the cascading field to be processed, thereby transforming the post-function into a structured query statement representing the query object, and thus enabling the query of the cascading field to be processed.
[0050] For example, when receiving the SQL query `select name,cascadeFun(city,#,())from table 1`, it recognizes that `cascadeFun(city,#,())` is a post-function. `cascadeFun(city,#,())` has no effect during the query process; `city` is the cascading field to be processed. Therefore, `cascadeFun(city,#,())` is converted to `city`, resulting in the converted SQL query `select name,city from table 1`. `cascadeFun(city,#,())` is then stored in the data's runtime memory for later use.
[0051] Step S230: Execute the transformed structured query statement to obtain query data including the cascading fields to be processed.
[0052] The query object of the transformed structured query statement can include not only the cascading fields to be processed, but also other required fields. Running the transformed structured query statement will yield query data including the cascading fields to be processed.
[0053] Step S240: Use a post-function to process the cascading fields to be processed, and obtain the data processing results corresponding to the cascading fields to be processed, so as to obtain the data processing results of the data table to be processed.
[0054] After obtaining the cascading fields to be processed, a post-function is used to process the cascading fields. Since the post-function is specifically designed for the cascading fields to be processed, and its parameters are determined based on the preset display format of the cascading fields to be processed, using the post-function to process the cascading fields to be processed can make the cascading fields to be processed display according to the preset display format. In other words, the data processing result corresponding to the cascading fields is matched with the preset display format.
[0055] In an optional embodiment, after processing the concatenated fields using a post-function temporarily stored in runtime memory and obtaining the data processing result corresponding to the concatenated fields, the method further includes: deleting the post-function from runtime memory. Because the post-function can be deleted promptly, memory space is effectively released, improving database operating efficiency.
[0056] In this embodiment, after receiving a structured query statement for the data table to be processed, since the post-function is not a word directly representing the query object, the post-function is replaced with the field name of the cascading field to be processed, and the query is performed to obtain query data including the cascading field to be processed. Based on this, since the parameters of the post-function are determined based on the preset display format of the cascading field to be processed in the data table, processing the cascading field to be processed using the post-function enables the cascading field to be displayed according to the preset display format. In other words, by setting a post-function in the structured query statement, the purpose of displaying the cascading field to be processed on the front end according to user requirements is achieved.
[0057] Since post-functions are used to process the cascading fields after the data has been queried, i.e., they are used to process the cascading fields to be processed, it is necessary to determine the post-function based on the preset display format of the cascading fields to be processed before obtaining the structured query statement for the target table.
[0058] The following is combined Figure 3 Explain in detail how to determine the post-function.
[0059] Figure 3 The diagram shown is a flowchart illustrating the determination of a post-function according to an embodiment of this application. Figure 3 As shown, building a custom function involves the following steps.
[0060] Step S310: Determine the object parameters of the post-function based on the field names of the cascaded fields to be processed.
[0061] For example, the object parameter is used to characterize the processing object of the post-function.
[0062] For example, consider the cascading fields to be processed.
[0063] [{"name":"Jiangsu Province","code":"001"},{"name":"Nanjing City","code":"0012"},
[0064] For example, if the field name of the cascading field to be processed is city, then city is used as the object parameter of the post-function.
[0065] The above-mentioned method of replacing the post-function in the structured query statement with the field name of the cascading field to be processed results in a transformed structured query statement that can be executed by replacing the post-function with the object parameters included in the post-function.
[0066] Step S320: Based on the preset spacing symbols between subfields of different levels in the preset display format, determine the first concatenation format parameters included in the post-function.
[0067] Step S330: Based on the preset identifiers of the number values included in each of the multiple subfields in the preset display format, determine the second concatenation format parameters included in the post-function.
[0068] For example, the preset display format is a display format pre-set according to user needs. For instance, if a user wants to display provinces, cities, and districts in the following format: province (province code value)#city (city code value)#district (district code value), then province (province code value)#city (city code value)#district (district code value) is determined as the preset display format.
[0069] The default display format specifies the identifier between keywords and ID values in multiple subfields. This identifier is used as the second concatenation format parameter of the post-function. In other words, the second concatenation format parameter specifies the concatenation format of keywords and ID values in each of the multiple subfields within the cascading field to be processed. For the default display format, "Province (Province Code Value)#City (City Code Value)#District (District Code Value)," parentheses represent the second concatenation format parameter.
[0070] The default display format also specifies that different levels of subfields are separated by a certain separator, which is determined as the first concatenation format parameter of the post-function. In other words, the first concatenation format parameter specifies how the concatenated subfields (i.e., the already concatenated keywords and codes) should be concatenated during the processing of the cascading fields. For the default display format of province (province code value)#city (city code value)#district (district code value), # is the first concatenation format parameter.
[0071] Step S340: Determine the post-function based on the subfield parameter, the first concatenation format parameter, and the second concatenation format parameter.
[0072] For example, if city is an object parameter, # is the first concatenation format parameter, and () is the second concatenation format parameter, then the postfix function is cascadeFun(city,#,()).
[0073] In this embodiment, the purpose of constructing a post-function is achieved by determining the object parameters according to the field name of the target field and determining the first concatenation format parameters and the second concatenation format parameters according to the preset display format, thereby achieving the purpose of processing the concatenated fields to be processed after querying them.
[0074] Figure 4 The diagram shown is a flowchart illustrating how a post-function is used to process a cascading field to obtain the data processing result corresponding to that cascading field, according to an embodiment of this application. Figure 4 As shown, the following steps are involved in processing the cascaded fields to be processed using post-functions to obtain the data processing results corresponding to the cascaded fields to be processed.
[0075] Step S410: Parse the cascading field to be processed to obtain the level of each of the multiple subfields included in the cascading field to be processed.
[0076] The cascading fields to be processed are fields with hierarchical connections. These cascading fields include multiple subfields, each with a different level. The level of each subfield is analyzed to accurately display the cascading fields.
[0077] For example, parsing the cascading field to be processed to obtain the levels of each of the multiple subfields included in the cascading field can be performed by determining the number values included in each of the multiple subfields, and determining the level corresponding to each of the multiple subfields based on the number values included in each of the multiple subfields. Here, the number of digits in the number value has a negative correlation with the level. That is, the more digits in the number value, the lower the level, and the more digits in the number value, the higher the level.
[0078] For example, consider the following cascading fields to be processed: {"name":"Jiangsu Province", "code":"001"}, {"name":"Nanjing City", "code":"0012"}, and {"name":"Gulou District", "code":"00123"}. Here, {"name":"Jiangsu Province", "code":"001"} is one subfield, {"name":"Nanjing City", "code":"0012"} is another subfield, and {"name":"Gulou District", "code":"00123"} is yet another subfield.
[0079] The ID values of {"name":"Jiangsu Province", "code":"001"} are 3 digits long, {"name":"Nanjing City", "code":"0012"} are 4 digits long, and {"name":"Gulou District", "code":"00123"} are 5 digits long. Therefore, the level of {"name":"Jiangsu Province", "code":"001"} is higher than that of {"name":"Nanjing City", "code":"0012"}, and the level of {"name":"Nanjing City", "code":"0012"} is higher than that of {"name":"Gulou District", "code":"00123"}.
[0080] Step S420: Based on the level of each of the multiple subfields and the first and second concatenation format parameters in the post-function, the multiple subfields are concatenated to obtain the data processing result corresponding to the cascaded field to be processed.
[0081] During the determination of the post-function, it is known that the first concatenation format parameter is used to characterize the concatenation format of each of the multiple sub-fields during the concatenation process, and the second concatenation format parameter is used to characterize the concatenation format of the number values included in each of the multiple sub-fields during the concatenation process. Based on the level of each of the multiple sub-fields, the first concatenation format parameter and the second concatenation format parameter of the post-function, the multiple sub-fields are concatenated to obtain a data processing result that meets the user's display requirements.
[0082] Combination Figure 5 This document details how to concatenate multiple subfields based on their respective levels, the first concatenation format parameter in the post-function, and the second concatenation format parameter to obtain the data processing result corresponding to the cascaded field to be processed.
[0083] like Figure 5 As shown, the data processing results corresponding to the cascaded fields to be processed are obtained by concatenating multiple subfields based on their respective levels, the first concatenation format parameter and the second concatenation format parameter in the post-function. The steps include the following.
[0084] Step S510: According to the concatenation format corresponding to the second concatenation format parameter, edit the number values in multiple subfields and combine them with the keywords in multiple subfields to obtain the concatenation subfields corresponding to each of the multiple subfields.
[0085] For example, if the postfix function is cascadeFun(city,#,()), then the second concatenation format parameter is (). For the subfield {"name":"Jiangsu Province","code":"001"}, "name":"Jiangsu Province" is the keyword.
[0086] "code": "001" is the encoded value. After editing, the encoded value becomes (001), which, when combined with the keyword, results in the subfield "Jiangsu Province (001)".
[0087] Similarly, the concatenated subfields corresponding to {"name":"Nanjing City","code":"0012"} are Nanjing City (0012), and the concatenated subfields corresponding to {"name":"Gulou District","code":"00123"} are Gulou District (00123).
[0088] Step S520: Based on the level of each of the multiple subfields and the concatenation format corresponding to the first concatenation format parameter, concatenate the concatenation subfields corresponding to each character of the multiple subfields to obtain the data processing result corresponding to the cascaded field to be processed.
[0089] Specifically, based on the level of each of the multiple subfields, the level of the multiple concatenated subfields is determined. Using the concatenation format corresponding to the first concatenation format parameter, the multiple concatenated subfields are concatenated in order from high level to low level to obtain the data processing result corresponding to the cascaded field to be processed.
[0090] For example, if the postfix function is cascadeFun(city,#,()), then the first concatenation format parameter is #. Given {"name":"Jiangsu Province","code":"001"}>{"name":"Nanjing City","code":"0012"}>{"name":"Gulou District","code":"00123"} (> indicates a higher level).
[0091] Use # to concatenate the corresponding subfields of the above three subfields, that is, Jiangsu Province (001) # Nanjing City (0012) # Gulou District (00123).
[0092] In this embodiment, the parameters of the post-function are determined based on the preset display format of the cascading fields to be processed. The keywords and encoding values of each sub-field are edited using the concatenation format corresponding to the second concatenation format parameter to obtain the edited sub-field. Then, according to the level of each of the multiple sub-fields and the concatenation format corresponding to the first concatenation format parameter, the concatenated sub-fields corresponding to each character of the multiple sub-fields are concatenated. This achieves the purpose of using the post-function to process the cascading fields to be processed so that the cascading fields to be processed are displayed according to the preset display format, thereby meeting the individual needs of different users.
[0093] To better illustrate the data processing methods mentioned above, an example is given below using Table 1. The database is a pharmaceutical system database, and Table 1 represents the trial information of participants who used a certain drug from this company. Table 1 contains the participants' names, cities, ages, examination dates, and mean white blood cell counts after drug administration.
[0094] Users want the city field to be displayed in the user terminal according to the preset display format of province (number)#city (number)#district (number).
[0095] The database server receives the structured query language as `select name,cascadeFun(city,#,()) from table 1`. The server recognizes `cascadeFun(city,#,())` as a post-function. The object parameter in the post-function `cascadeFun(city,#,())` is `city`. `city` is used to replace `cascadeFun(city,#,())`, resulting in the transformed structured query statement `select name,city from table 1`. `cascadeFun(city,#,())` is then temporarily stored in the database's runtime memory.
[0096] Running `select name,city from table 1` retrieves the query data, which is temporarily stored in memory in the form of Table 2 below.
[0097] Table 2
[0098]
[0099]
[0100] The `cascadeFun(city,#,())` function, temporarily stored in memory, processes the `city` field (which is a cascaded field to be processed) to obtain the data processing result for the `city` field. See details of the processing procedure. Figure 4 and Figure 5 The example shown will not be described again here. The data processing results of the city field are Jiangsu Province (001)#Nanjing City (0012)#Gulou District (00123), Jiangsu Province (001)#Suqian City (0013)#Yanghe Town (00124), Shanghai (002)#Minhang District (0012), and Shanghai (002)#Xuhui District (0022).
[0101] The final data processing results of the structured query statement are shown in Table 3 below.
[0102] Table 3
[0103] Name name City city Zhang San Jiangsu Province (001) # Nanjing City (0012) # Gulou District (00123) Li Mei Jiangsu Province (001) # Suqian City (0013) # Yanghe Town (00124) Wang Wu Shanghai City (002) # Minhang District (0012) Zhao Qi Shanghai City (002) # Xuhui District (0022)
[0104] During the execution of the above structured query statement, a post-function is used to process the cascading fields to be processed, thereby achieving the purpose of displaying the cascading fields to be processed on the front end according to the user's requirements.
[0105] The above text combined Figures 2 to 5 The present disclosure describes in detail the method embodiments, which are then combined with the following. Figures 6 to 7 The present disclosure provides a detailed description of the apparatus embodiments. Furthermore, it should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be found in the foregoing method embodiments.
[0106] Figure 6 The diagram shown is a structural schematic of a data processing apparatus provided in an embodiment of this disclosure. Figure 6 As shown, the data processing apparatus 600 provided in this embodiment includes a receiving module 610, a conversion module 620, an execution module 630, and a processing module 640.
[0107] Specifically, the receiving module 610 is configured to receive a structured query statement for a data table to be processed. The structured query statement includes a post-function, wherein the parameters of the post-function are determined based on a preset display format of the cascading fields to be processed in the data table. The conversion module 620 is configured to replace the post-function in the structured query statement with the field names of the cascading fields to be processed, obtaining a converted structured query statement, and temporarily storing the post-function in runtime memory. The execution module 630 is configured to execute the converted structured query statement to obtain query data including the cascading fields to be processed. The processing module 640 is configured to process the cascading fields to be processed using the temporary post-function, obtaining the data processing results corresponding to the cascading fields to be processed, thereby obtaining the data processing results of the data table to be processed.
[0108] Figure 7 The diagram shown is a structural schematic of a processing module provided in another embodiment of this disclosure. Figure 6 Extending from the illustrated embodiment Figure 7 The illustrated embodiment will be described in detail below. Figure 7 The illustrated embodiments and Figure 6 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.
[0109] In this embodiment, the processing module 640 further includes a parsing unit 710 and a splicing unit 720. Specifically, the parsing unit 710 is configured to parse the cascaded field to be processed to obtain the levels of each of the multiple subfields included in the cascaded field to be processed. The splicing unit 720 is configured to splice the multiple subfields based on the levels of each of the multiple subfields and the first splicing format parameter and the second splicing format parameter in the post-function to obtain the data processing result corresponding to the cascaded field to be processed; wherein, the first splicing format parameter is used to characterize the splicing format of the spliced subfields corresponding to each of the multiple subfields during the splicing process, and the second splicing format parameter is used to characterize the splicing format of the number values included in each of the multiple subfields during the splicing process.
[0110] In one embodiment, the splicing unit 720 is further configured to edit the number values in multiple subfields and combine them with the keywords in multiple subfields according to the splicing format corresponding to the second splicing format parameter to obtain spliced subfields corresponding to each of the multiple subfields; based on the level of each of the multiple subfields and the splicing format corresponding to the first splicing format parameter, splice the spliced subfields corresponding to each character of the multiple subfields to obtain the data processing result corresponding to the cascaded field to be processed.
[0111] In one embodiment, the splicing unit 720 is further configured to determine the level of multiple splicing subfields based on the level of each of the multiple subfields; and to splice the multiple splicing subfields in order from high level to low level using the splicing format corresponding to the first splicing format parameter, so as to obtain the data processing result corresponding to the cascaded field to be processed.
[0112] In one embodiment, the parsing unit 710 is further configured to determine the number values included in each of the multiple subfields; and based on the number values included in each of the multiple subfields, determine the level corresponding to each of the multiple subfields, wherein the number of digits in the number value and the level are negatively correlated.
[0113] In some embodiments, the data processing device 600 further includes an input module, which determines the object parameters of the post-function based on the field names of the cascading fields to be processed. The object parameters are used to characterize the processing object of the post-function. Based on the preset interval symbols between sub-fields of different levels in the preset display format, it determines the first concatenation format parameters included in the post-function. Based on the preset identifier symbols of the number values included in each of the multiple sub-fields in the preset display format, it determines the second concatenation format parameters included in the post-function. After determining the post-function based on the sub-field parameters, the first concatenation format parameters, and the second concatenation format parameters, the input module is used to input a structured query statement.
[0114] In some embodiments, the data processing apparatus 600 further includes a deletion module. The deletion module is configured to delete post-functions in runtime memory.
[0115] Figure 8 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Figure 8 The electronic device 800 shown includes a memory 801, a processor 802, a communication interface 803, and a bus 804. The memory 801, processor 802, and communication interface 803 are interconnected via the bus 804.
[0116] The memory 801 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 801 may store a program, and when the program stored in the memory 801 is executed by the processor 802, the processor 802 and the communication interface 803 are used to execute the various steps of the data processing method of the embodiments of this disclosure.
[0117] The processor 802 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the data processing apparatus of this disclosure embodiment.
[0118] The processor 802 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the data processing method of this disclosure can be completed by the integrated logic circuits in the hardware of the processor 802 or by instructions in software form. The processor 802 described above can 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, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 801. The processor 802 reads the information in the memory 801 and, in conjunction with its hardware, performs the functions required by the units included in the data processing apparatus of this disclosure embodiment, or executes the data processing method of this disclosure method embodiment.
[0119] The communication interface 803 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the electronic device 800 and other devices or communication networks. For example, the communication interface 803 can receive promotional requests or promotional data.
[0120] Bus 804 may include a pathway for transmitting information between various components of electronic device 800 (e.g., memory 801, processor 802, communication interface 803).
[0121] It should be noted that, although Figure 8 The illustrated electronic device 800 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the electronic device 800 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the electronic device 800 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the electronic device 800 may only include the devices necessary for implementing the embodiments of this disclosure, and may not necessarily include... Figure 8 All the devices shown.
[0122] In addition to the methods, apparatus, and devices described above, embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform the various steps of the data processing methods provided in the various embodiments of this disclosure.
[0123] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include subfield-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0124] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform various steps of the data processing methods provided in the various embodiments of this disclosure.
[0125] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0127] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] In addition, the functional units in the various embodiments of this disclosure can be integrated into a similar region segmentation unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0131] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0132] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
[0133] The device block diagrams involved in this application are merely illustrative examples and are not intended to require or imply that connections, arrangements, or configurations must be made in the manner shown in the block diagrams. As those skilled in the art will recognize, modules and units of the device can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0134] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0135] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A data processing method, characterized in that, include: Receive a structured query statement for a data table to be processed, the structured query statement including a post-function, wherein the parameters of the post-function are determined based on a preset display format of the cascading fields to be processed in the data table to be processed; The post-function in the structured query statement is replaced with the field name of the cascading field to be processed to obtain the transformed structured query statement, and the post-function is temporarily stored in the runtime memory; Execute the transformed structured query statement to obtain query data including the cascading fields to be processed; The post-processing function is used to process the cascaded field to obtain the data processing result corresponding to the cascaded field to obtain the data processing result of the data table to be processed.
2. The data processing method according to claim 1, characterized in that, The step of processing the concatenated field to be processed using the post-function to obtain the data processing result corresponding to the concatenated field to be processed includes: Parse the cascading field to be processed to obtain the level of each of the multiple subfields included in the cascading field to be processed; Based on the respective levels of the multiple sub-fields and the first and second concatenation format parameters in the post-function, the multiple sub-fields are concatenated to obtain the data processing result corresponding to the cascaded field to be processed; Wherein, the first concatenation format parameter is used to characterize the concatenation format of each of the multiple subfields corresponding to the concatenation subfields during the concatenation process, and the second concatenation format parameter is used to characterize the concatenation format of the number values included in each of the multiple subfields during the concatenation process.
3. The data processing method according to claim 2, characterized in that, The process involves concatenating the multiple sub-fields based on their respective levels and the first and second concatenation format parameters in the post-function to obtain the data processing result corresponding to the cascaded field to be processed, including: According to the concatenation format corresponding to the second concatenation format parameter, the number values in the multiple subfields are edited and combined with the keywords in the multiple subfields to obtain the concatenation subfields corresponding to each of the multiple subfields; Based on the level of each of the multiple subfields and the concatenation format corresponding to the first concatenation format parameter, the concatenation subfields corresponding to each character of the multiple subfields are concatenated to obtain the data processing result corresponding to the cascaded field to be processed.
4. The data processing method according to claim 3, characterized in that, The step of concatenating the concatenated subfields corresponding to each character of the plurality of subfields based on their respective levels and the concatenation format corresponding to the first concatenation format parameter includes: Based on the level of each of the multiple sub-fields, determine the level of the multiple concatenated sub-fields; Using the concatenation format corresponding to the first concatenation format parameter, the multiple concatenation subfields are concatenated in order from high level to low level to obtain the data processing result corresponding to the cascaded field to be processed.
5. The data processing method according to any one of claims 2 to 4, characterized in that, The process of parsing the cascading field to be processed yields the levels of each of the multiple subfields included in the cascading field to be processed, including: Determine the number values included in each of the multiple subfields; Based on the number values included in each of the multiple subfields, the level corresponding to each of the multiple subfields is determined, wherein the number of digits in the number value has a negative correlation with the level.
6. The data processing method according to any one of claims 1 to 4, characterized in that, Before receiving the structured query statement for the data table to be processed, it also includes: Based on the field name of the cascaded field to be processed, the object parameter of the post-function is determined, and the object parameter is used to characterize the processing object of the post-function; Based on the preset spacing symbols between subfields of different levels in the preset display format, the first concatenation format parameters included in the post-function are determined; Based on the preset identifiers of the number values included in each of the multiple subfields in the preset display format, the second concatenation format parameters included in the post-function are determined; The post-function is determined based on the sub-field parameters, the first concatenation format parameters, and the second concatenation format parameters.
7. The data processing method according to any one of claims 1 to 4, characterized in that, After processing the concatenated field to be processed using the post-function temporarily stored in the running memory to obtain the data processing result corresponding to the concatenated field to be processed, the method further includes: Delete the post-function from the running memory.
8. A data processing apparatus, characterized in that, include: The receiving module is configured to receive a structured query statement for a data table to be processed. The structured query statement includes a post-function, wherein the parameters of the post-function are determined based on a preset display format of the cascading fields to be processed in the data table. The conversion module is configured to replace the post-function in the structured query statement with the field name of the cascading field to be processed, thereby obtaining the converted structured query statement, and temporarily store the post-function in the runtime memory; The execution module is configured to execute the transformed structured query statement to obtain query data including the cascading fields to be processed; The processing module is configured to use the post-function to process the cascaded field to be processed, and obtain the data processing result corresponding to the cascaded field to be processed, so as to obtain the data processing result of the data table to be processed.
9. An electronic device, characterized in that, include: processor; and A memory storing computer program instructions, which, when executed by the processor, enable the processor to perform the data processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the data processing method according to any one of claims 1-7.
Citation Information
Patent Citations
Device for importing data to database
CN103309945A