A data processing method and device for a software product
By determining the column information of event attributes in the target table within the event data analysis system, the performance degradation caused by an excessive number of table columns was resolved, enabling more efficient data storage and retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, when storing event data, event data analysis systems often have too many columns in the table due to the strong correlation between the columns and event attributes, which reduces system performance and query efficiency.
By acquiring the software product identifier, event identifier, and event attributes of the event data to be stored, the column information of each event attribute in the target table is determined, and the data is stored in the target table based on this information. The columns in the target table are no longer strongly associated with a certain event attribute, allowing different cells to carry different event attributes.
This reduces the number of columns required to store event data, improving the performance and query efficiency of the event data analysis system.
Smart Images

Figure CN117312309B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a data processing method and apparatus for software products. Background Technology
[0002] With the development of computer technology, more and more software products (such as applications) have emerged. When users use software products, various events are generated. These events can be broken down into "which module of the software product performed what operation at what time," for example, module A1 of software A was used for browsing on *year*month*day*hour*minute*second. An event data analysis system can store event data corresponding to multiple software products to facilitate subsequent analysis or processing of this event data. The event data includes at least one event attribute.
[0003] Currently, event data analysis systems can store event data corresponding to one or more software products in the same table, with one event data point corresponding to one row in the table. Furthermore, when storing event data, the table columns are associated with event attributes; one event attribute corresponds to one column in the table, and each cell in that column contains data related to the associated event attribute. Therefore, when there are many event attributes, the number of columns in the table will also be large. A large number of columns in the table will reduce the performance that the event data analysis system can provide.
[0004] Therefore, there is an urgent need for a solution to address the above problems. Summary of the Invention
[0005] To solve, or at least partially solve, the above-mentioned technical problems, this application provides a data processing method and apparatus.
[0006] In a first aspect, embodiments of this application provide a data processing method for a software product, the method comprising:
[0007] Obtain event data to be stored, the event data to be stored includes: a software product identifier, an event identifier, and at least one event attribute, the software product identifier is used to identify the software product that generated the event data to be stored, the event identifier is used to identify the event corresponding to the event data to be stored, and the event attribute is an attribute of the event;
[0008] Determine the column information of each event attribute in the target table, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes;
[0009] Based on the column information of each event attribute in the target table, the event data to be stored is stored in the target table.
[0010] Optionally, determining the column information of each of the at least one event attribute in the target table includes:
[0011] Obtain the metadata corresponding to the software product, the metadata including the column information of each event attribute in the target table among several event attributes corresponding to the software product;
[0012] Based on the metadata, determine the column information corresponding to each of the at least one event attribute in the target table.
[0013] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0014] If the metadata includes column information corresponding to each of the at least one event attribute in the target table, then the column information corresponding to each event attribute in the target table is obtained from the metadata.
[0015] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0016] If the metadata does not include column information corresponding to some or all of the event attributes in the target table, then column information corresponding to each of the event attributes in the target table is generated based on the metadata.
[0017] Optionally, the method further includes:
[0018] Add the column information corresponding to each event attribute in the target table from some or all of the event attributes to the metadata.
[0019] Optionally, the method further includes:
[0020] Receive a first query statement, which is used to query the target event attribute corresponding to the software product;
[0021] Based on the metadata, determine the target column information of the target event attribute in the target table;
[0022] Based on the target column information, the first query statement is processed to obtain a second query statement that includes the target column information;
[0023] The target event attributes are queried based on the second query statement.
[0024] Secondly, embodiments of this application provide a data processing apparatus for a software product, the apparatus comprising:
[0025] An acquisition unit is used to acquire event data to be stored, the event data to be stored including: a software product identifier, an event identifier, and at least one event attribute, the software product identifier is used to identify the software product that generated the event data to be stored, the event identifier is used to identify the event corresponding to the event data to be stored, and the event attribute is an attribute of the event;
[0026] The first determining unit is used to determine the column information of each event attribute in the target table, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes.
[0027] A storage unit is used to store the event data to be stored in the target table based on the column information of each event attribute in the target table.
[0028] Optionally, the first determining unit is configured to:
[0029] Obtain the metadata corresponding to the software product, the metadata including the column information of each event attribute in the target table among several event attributes corresponding to the software product;
[0030] Based on the metadata, determine the column information corresponding to each of the at least one event attribute in the target table.
[0031] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0032] If the metadata includes column information corresponding to each of the at least one event attribute in the target table, then the column information corresponding to each event attribute in the target table is obtained from the metadata.
[0033] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0034] If the metadata does not include column information corresponding to some or all of the event attributes in the target table, then column information corresponding to each of the event attributes in the target table is generated based on the metadata.
[0035] Optionally, the device further includes:
[0036] The metadata update unit is used to add the column information corresponding to each event attribute in the target table in some or all of the event attributes to the metadata.
[0037] Optionally, the device further includes:
[0038] A receiving unit is configured to receive a first query statement, wherein the first query statement is used to query a target event attribute corresponding to the software product.
[0039] The second determining unit is used to determine the target column information of the target event attribute in the target table based on the metadata;
[0040] The third determining unit is used to process the first query statement based on the target column information to obtain a second query statement including the target column information;
[0041] The query unit is used to query the target event attributes based on the second query statement.
[0042] Thirdly, embodiments of this application provide an electronic device, the device including a processor and a memory;
[0043] The processor is configured to execute instructions stored in the memory to cause the device to perform the method as described in any one of the first aspects above.
[0044] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that instruct a device to perform the method as described in any one of the first aspects above.
[0045] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects above.
[0046] Compared with the prior art, the embodiments of this application have the following advantages:
[0047] This application provides a data processing method, which includes: acquiring event data to be stored, the event data to be stored including a software product identifier, an event identifier, and at least one event attribute. The software product identifier identifies the software product that generated the event data to be stored, the event identifier identifies the event corresponding to the event data to be stored, and the event attribute is an attribute of the event. After acquiring the event data to be stored, the column information of each event attribute in a target table can be determined. After determining the column information of each event attribute in the target table, the event data to be stored is stored in the target table based on the column information of each event attribute in the target table. In this application embodiment, the target table includes multiple columns, at least one of which is a target column, and at least two cells in the target column carry different event attributes. In other words, in this application embodiment, the columns in the target table are no longer strongly correlated with a particular event attribute; for a target column, different cells can carry different event attributes, thereby reducing the number of columns used to store event data and correspondingly improving the performance provided by the event data analysis system. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A schematic diagram of a table for storing event data provided in an embodiment of this application;
[0050] Figure 2 A flowchart illustrating a data processing method for a software product provided in an embodiment of this application;
[0051] Figure 3 A flowchart illustrating a data query method for a software product provided in an embodiment of this application;
[0052] Figure 4 A schematic diagram illustrating a data storage method for a software product provided in this application embodiment;
[0053] Figure 5 This is a schematic diagram of the structure of a data processing device for a software product provided in an embodiment of this application. Detailed Implementation
[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0055] The inventors of this application discovered through research that, in an event data analysis system, when storing event data, the columns of the table are associated with event attributes. One event attribute corresponds to one column in the table, and each cell in that column contains data related to the associated event attribute. Therefore, when there are many event attributes, the number of columns in the table will also be large. This can be combined with... Figure 1 Please provide an explanation. Figure 1 This is a schematic diagram of a table for storing event data provided in an embodiment of this application.
[0056] like Figure 1 As shown, Table 1 includes several columns. The first column is the event data number, which can start from 1. The second column is the identifier of the software product that generated the event data, and the third column is the event identifier. Columns starting from the fourth column are used to store the values of event attributes, and each column is associated with one event attribute. Figure 1 As shown, the fourth column is associated with attribute 1, the fifth column with attribute 2, the sixth column with attribute 3, the seventh column with attribute 4, the eighth column with attribute 5, and the ninth column with attribute 6.
[0057] In one example, if event 1 of software product A includes attribute 1, attribute 2, and attribute 3, then the event data 1 corresponding to event 1 is stored in the table as follows: Figure 1 As shown. If event 2 of software product B includes attributes 4, 5, and 6, then the event data 2 corresponding to event 2 is stored in the table as follows: Figure 1 As shown. In Figure 1 In the text, the specific values of each event property in a cell are represented by "**".
[0058] In practical applications, a particular software product can generate a large number of events, and correspondingly, a large number of event attributes. Furthermore, an event data analysis system can store data generated by multiple software products, resulting in a massive number of event attributes to be stored. Since the event data analysis system associates table columns with event attributes when storing event data—one event attribute corresponding to one column—this leads to a very large number of columns in the table.
[0059] A large number of columns in a table can reduce the performance of an event data analysis system. This is because the system periodically generates event data files based on the table, and too many columns reduce the efficiency of this process. Consequently, when the system receives a query for event data, it cannot promptly return the corresponding query results based on the generated data files, thus lowering its overall performance.
[0060] To address the aforementioned issues, embodiments of this application provide a data processing method and apparatus that can improve the performance offered by a data analysis system.
[0061] The various non-limiting embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0062] Exemplary methods
[0063] See Figure 2 This figure is a flowchart illustrating a data processing method for a software product according to an embodiment of this application. In one example, the method can be executed by a data processing service, which stores event data to be stored into a target table in an event data analysis system. The data processing service can be understood as a functional module that processes data.
[0064] In this embodiment, the method may include, for example, the following steps: S101-S103.
[0065] S101: Obtain event data to be stored, the event data to be stored includes: software product identifier, event identifier and at least one event attribute, the software product identifier is used to identify the software product that generated the event data to be stored, the event identifier is used to identify the event corresponding to the event data to be stored, and the event attribute is the attribute of the event.
[0066] In this embodiment, after a user triggers a corresponding operation based on the software product, the software product generates event data to be stored and sends the event data to the data processing service. In one example, the software product can directly send the event data to be stored to the data processing service. In another example, the software product can also send the event data to be stored to the data processing service through an event data receiving service and a message middleware. Specifically, the software product can send the event data to be stored to the event data receiving service, and the event data receiving service can then send the event data to the data processing service through the message middleware. The event data receiving service can be understood as a functional module that provides data receiving functionality, and the message middleware provides a message transmission channel between the data processing service and the event data receiving service.
[0067] In this embodiment, the event data to be stored includes a software product identifier, an event identifier, and at least one event attribute. The software product identifier identifies the software product that generated the event data; for example, the software product identifier can be the name of the software product that generated the event data. The event identifier identifies the event corresponding to the event data; for example, the event identifier is the event name of the event corresponding to the event data. The at least one event attribute is an attribute of the event corresponding to the event data. This embodiment does not specifically limit the event attributes; event attributes can be related to their corresponding events. For example, if the event is browsing, the event attributes can be attributes related to the browsing object. For example, if the browsing object is a video, the event attributes can include: video name, video duration, and video type, etc. Similarly, if the browsing object is a book, the event attributes can include: book name, book publication information, and book author, etc.
[0068] S102: Determine the column information of each event attribute in the target table, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes.
[0069] After acquiring the event data to be stored, the data processing service can further store the event data into a target table. Specifically, the data processing service can first determine the column information of each event attribute in the target table.
[0070] In this embodiment, the target table may include multiple columns, at least one of which is a target column. At least two cells within the target column carry different event attributes. In other words, in this embodiment, columns in the target table are no longer strongly associated with a specific event attribute; different cells within the target column can carry different event attributes, thereby reducing the number of columns in the target table. The specific implementation of S102 will be described below.
[0071] In one example, S102 may include the following steps A1-A2 in its specific implementation.
[0072] A1: Obtain the metadata corresponding to the software product. The metadata includes column information of each attribute in the target table for each of the several event attributes corresponding to the software product.
[0073] A2: Based on the metadata, determine the column information corresponding to each event attribute in the target table.
[0074] In one example, the data processing service may store metadata corresponding to multiple software products. For a specific software product, its metadata indicates the column information of the event attribute corresponding to that software product in the target table. In one example, the metadata may include the event attribute and the column index of the event attribute in the target table, where the column index may be, for example, a column number. For example, this can be understood in conjunction with Table 1 below, which is an illustration of the metadata corresponding to a software product A provided in an embodiment of this application.
[0075] Table 1
[0076] Serial Number Event Properties Column Index 1 Attribute 1 1 2 Attribute 2 2 3 Attribute 3 3
[0077] Among them, the event attributes corresponding to the software product refer to the event attributes of the events generated by the software product. For a certain event attribute, the column information corresponding to the event attribute in the target table is used to indicate the specific column in the target table where the cell storing the event attribute is located.
[0078] The data processing service can use the software product identifier included in the event data to be stored as an index to query its stored metadata, thereby obtaining the metadata corresponding to the software product that generated the event data to be stored. Furthermore, based on the metadata obtained from the query, the column information of each event attribute in the at least one event attribute in the target table is determined.
[0079] In this embodiment, step A2 can be implemented in multiple ways. Two possible implementations are described below. In one possible implementation, if the metadata includes column information corresponding to each of the at least one event attribute in the target table, that is, if the metadata allows querying the column information corresponding to each of the at least one event attribute in the target table, then in this case, the column information corresponding to each event attribute in the target table can be directly obtained from the metadata. For example, this can be understood in conjunction with Table 1. Assuming the event data to be stored includes attribute 1, attribute 2, and attribute 3, then based on the metadata shown in Table 1, the column index corresponding to attribute 1 can be determined to be 1, the column index corresponding to attribute 2 to be 2, and the column index corresponding to attribute 3 to be 3.
[0080] In another possible implementation, if the metadata does not include column information corresponding to some or all of the event attributes in the target table, i.e., the column information corresponding to some or all of the aforementioned event attributes in the target table cannot be determined based on the metadata, then in this case, the data processing service can generate column information corresponding to each of the event attributes in the target table based on the current metadata. For example, the column index corresponding to some or all of the event attributes in the target table can be determined by sequentially increasing the column index based on the maximum column index included in the metadata. For example, referring to Table 1, assuming the event data to be stored includes attribute 1, attribute 4, and attribute 5, based on the metadata shown in Table 1, the column index corresponding to attribute 1 can be determined to be 1. However, the column index corresponding to attribute 4 and attribute 5 cannot be determined to be 2. Therefore, the column index corresponding to attribute 4 and attribute 5 in the target table can be determined by sequentially increasing the column index based on the maximum column index 3 included in the metadata shown in Table 1. For example, the column index corresponding to attribute 4 in the target table can be determined to be 4, and the column index corresponding to attribute 5 in the target table can be determined to be 5.
[0081] In one example, after generating the column information corresponding to each event attribute in the target table based on the metadata, the column information corresponding to each event attribute in the target table can be added to the metadata to obtain updated metadata. This way, when the data processing service subsequently receives event data generated by the application, it can determine the column information corresponding to the event attributes in the target table based on the updated metadata. For example, after adding the column indexes corresponding to attribute 4 and attribute 5 in the target table to the metadata shown in Table 1, the metadata shown in Table 1 can be updated to what is shown in Table 2.
[0082] Table 2
[0083] Serial Number Event Properties Column Index 1 Attribute 1 1 2 Attribute 2 2 3 Attribute 3 3 4 Attribute 4 4 5 Attribute 5 5
[0084] In another example, if the data processing service does not store the metadata corresponding to the software product containing the event data to be stored, then in this case, the data processing service can generate column indices in the target table for each of the at least one event attributes, starting from a preset index and incrementing the index value sequentially. For example, assuming the event data to be stored includes attribute 1, attribute 2, and attribute 3, the data processing service can generate column index 1, column index 2, and column index 3, and determine column index 1 as the column index corresponding to attribute 1, column index 2 as the column index corresponding to attribute 2, and column index 3 as the column index corresponding to attribute 3. Accordingly, the data processing service can also generate the metadata corresponding to the software product containing the event data to be stored based on the column indices of each of the at least one event attributes in the target table. In this way, when the data processing service subsequently receives event data generated by the application, it can determine the column information corresponding to the event attributes in the target table in the subsequently received event data based on the generated metadata.
[0085] Regarding column indexes, it's important to understand that they are used to index a specific column in a target table. There's a specific correspondence between the column index value and the column number in the target table; a column index uniquely identifies a column in the target table. For example, column index 1 indexes the first column in the target table, column index 2 indexes the second column, and so on. Similarly, when storing events, if the first column in the target table stores the sequence number, the second column stores the software product identifier of the software product that generated the event data, the third column stores the event identifier corresponding to the event data, and the fourth column stores event attributes, then column index 1 can index the fourth column in the target table, column index 2 can index the fifth column, and so on.
[0086] Furthermore, the metadata is not limited to the format shown in Tables 1 and 2. In one example, in addition to the content shown in Tables 1 and 2, the metadata may also include column names, for example, the column name could be a slot. In this case, the metadata can be shown in Table 3 below:
[0087] Table 3
[0088] Serial Number Event Properties Column Name Column Index 1 Attribute 1 slot 1 2 Attribute 2 slot 2 3 Attribute 3 slot 3 4 Attribute 4 slot 4 5 Attribute 5 slot 5
[0089] After executing S102 to obtain the column information of each event attribute in the target table, S103 can be further executed to realize the storage of the event data to be stored.
[0090] S103: Based on the column information of each event attribute in the target table, store the event data to be stored in the target table.
[0091] When storing the event to be stored, the blank row with the smallest number of rows in the target table can be determined first, and this blank row can be determined as the target row for storing the event data. Further, based on the target row and the column information of each event attribute in the target table, the cell for storing each event attribute can be determined, and each event attribute can be stored in the corresponding cell, thereby realizing the storage of the event data to be stored.
[0092] As can be seen from the above description, in this embodiment of the application, the columns in the target table are no longer strongly associated with a certain event attribute. For the target column, different cells can carry different event attributes, thereby reducing the number of columns used to store event data and correspondingly improving the performance provided by the event data analysis system.
[0093] In this embodiment, the data processing service can not only store event data but also support querying of event data. The data query method performed by the data processing service will be described below.
[0094] See Figure 3 The figure is a flowchart illustrating a data query method for software products provided in an embodiment of this application. Figure 3 The method shown may include the following steps S201-S204.
[0095] S201: Receive a first query statement, the first query statement being used to query the target event attribute corresponding to the software product that generated the event data to be stored.
[0096] In one example, the first query statement may be a query statement entered by the user in the corresponding query statement input interface. The first query statement may include the software product identifier of the software product that generates the event data to be stored and the identifier of the target event attribute.
[0097] This application does not specifically limit the first query statement; the first query statement may be a Structured Query Language (SQL) statement.
[0098] S202: Based on the metadata, determine the target column information of the target event attribute in the target table.
[0099] After receiving the first query statement, the data processing service can use the software product identifier included in the first query statement as an index to retrieve the metadata corresponding to the software product identifier. Further, based on the metadata, the target column information of the target event attribute in the target table is determined. Regarding the metadata, please refer to the relevant description above; it will not be repeated here. The target column information may, for example, be the column index of the cell storing the target event attribute.
[0100] S203: Based on the target column information, process the first query statement to obtain a second query statement that includes the target column information.
[0101] S204: Query the target event attributes based on the second query statement.
[0102] After determining the target column information, the first query statement can be processed based on the target column information. For example, the target event attribute in the first query statement can be replaced with the target column information to obtain the second query statement. Further, the target event attribute is queried based on the second query statement. Using this method, users can input the first query statement in a traditional query statement input manner, and the data processing service will process the first query statement based on metadata to achieve the query of the target event attribute. Users can query the target event attribute without needing to be aware of the metadata.
[0103] The data processing method provided in the embodiments of this application has been described above. Next, the data processing method provided in the embodiments of this application will be described in conjunction with specific scenarios.
[0104] See Figure 4 This figure is a schematic diagram illustrating a data storage method for a software product provided in an embodiment of this application. Figure 4 As shown:
[0105] The event data receiving service can receive event data 1 sent by software product 1. Event data 1 includes: the software product identifier of software product 1, the identifier of event 1, attribute 1, attribute 2, and attribute 3. The event data receiving service sends event data 1 to the data processing service through a message broker. The data processing service stores event data 1 in a target table based on the metadata shown in query table 1. The event data receiving service, message broker, and data processing service can all be functional modules included in the event data analysis service.
[0106] Similarly, the event data analysis service can receive event data 2 sent by software product 2. Event data 2 includes: the software product identifier of software product 2, the identifier of event 2, attribute 4, attribute 5, and attribute 6. The event data analysis service sends event data 2 to the data processing service through a message broker. The data processing service queries the metadata corresponding to application 2 (as shown in Table 4 below) and stores event data 2 in the target table in the database.
[0107] Table 4
[0108] Serial Number Event Properties Column Name Column Index 1 Attribute 4 slot 1 2 Attribute 5 slot 2 3 Attribute 6 slot 3
[0109] like Figure 4 It can be seen that slot1 of the target table can store attribute 1 of event data 1 and attribute 4 of event data 2, slot2 of the target table can store attribute 2 of event data 1 and attribute 5 of event data 2, and slot3 of the target table can store attribute 3 of event data 1 and attribute 6 of event data 2.
[0110] The target table has three columns (slot1, slot2, and slot3) for storing event attributes, which can store event data 1 and event data 2. However, using traditional techniques, six columns would be needed to store attributes 1 through 6 (e.g., ...). Figure 1 As shown in the figure, this solution can effectively save the number of columns in the target table.
[0111] In addition, the event data analysis service may also include a query service, which can be used to obtain a second query statement based on metadata and a first query statement input by the user, and then query the database based on the second query statement. The query service can be understood as a functional module included in the event data analysis service.
[0112] Figure 4 The database mentioned may be, for example, a columnar storage database, which will not be described in detail here.
[0113] Exemplary device
[0114] Based on the methods provided in the above embodiments, this application also provides an apparatus, which will be described below with reference to the accompanying drawings.
[0115] See Figure 5 This figure is a schematic diagram of the structure of a data processing device for a software product provided in an embodiment of this application. The device 500 may specifically include, for example, an acquisition unit 501, a first determination unit 502, and a storage unit 503.
[0116] The acquisition unit 501 is used to acquire event data to be stored. The event data to be stored includes: a software product identifier, an event identifier, and at least one event attribute. The software product identifier is used to identify the software product that generates the event data to be stored. The event identifier is used to identify the event corresponding to the event data to be stored. The event attribute is an attribute of the event.
[0117] The first determining unit 502 is used to determine the column information of each event attribute in the target table, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes.
[0118] Storage unit 503 is used to store the event data to be stored in the target table based on the column information of each event attribute in the target table.
[0119] Optionally, the first determining unit 502 is used to:
[0120] Obtain the metadata corresponding to the software product, the metadata including the column information of each event attribute in the target table among several event attributes corresponding to the software product;
[0121] Based on the metadata, determine the column information corresponding to each of the at least one event attribute in the target table.
[0122] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0123] If the metadata includes column information corresponding to each of the at least one event attribute in the target table, then the column information corresponding to each event attribute in the target table is obtained from the metadata.
[0124] Optionally, determining the column information corresponding to each event attribute in the target table based on the metadata includes:
[0125] If the metadata does not include column information corresponding to some or all of the event attributes in the target table, then column information corresponding to each of the event attributes in the target table is generated based on the metadata.
[0126] Optionally, the device further includes:
[0127] The metadata update unit is used to add the column information corresponding to each event attribute in the target table in some or all of the event attributes to the metadata.
[0128] Optionally, the device further includes:
[0129] A receiving unit is configured to receive a first query statement, wherein the first query statement is used to query a target event attribute corresponding to the software product.
[0130] The second determining unit is used to determine the target column information of the target event attribute in the target table based on the metadata;
[0131] The third determining unit is used to process the first query statement based on the target column information to obtain a second query statement including the target column information;
[0132] The query unit is used to query the target event attributes based on the second query statement.
[0133] Since the device 500 is a device corresponding to the data processing method for software products provided in the above method embodiments, the specific implementation of each unit of the device 500 is based on the same concept as in the above method embodiments. Therefore, the specific implementation of each unit of the device 500 can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.
[0134] This application also provides an electronic device, which includes a processor and a memory;
[0135] The processor is used to execute instructions stored in the memory so that the device performs the data processing method for software products provided in the above method embodiments.
[0136] This application provides a computer-readable storage medium including instructions that instruct a device to perform the data processing method for a software product provided in the above method embodiments.
[0137] This application also provides a computer program product that, when run on a computer, causes the computer to execute the data processing method for the software product provided in the above method embodiments.
[0138] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0139] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
[0140] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data processing method for software products, characterized in that, The method includes: Obtain event data to be stored, the event data to be stored includes: a software product identifier, an event identifier, and at least one event attribute, the software product identifier is used to identify the software product that generated the event data to be stored, the event identifier is used to identify the event corresponding to the event data to be stored, and the event attribute is an attribute of the event; Based on the metadata of the software product, determine the column information of each event attribute in the target table in the at least one event attribute, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes, and the metadata includes the column information of each event attribute in the target table in the several event attributes corresponding to the software product; Identify the blank row with the smallest number of rows in the target table, and determine the blank row as the target row for storing the event data to be stored; Based on the target row and the column information of each event attribute in the target table, the event data to be stored is stored in the target table.
2. The method according to claim 1, characterized in that, Determining the column information of each event attribute in the target table for the at least one event attribute includes: Obtain the metadata corresponding to the software product, and based on the metadata, determine the column information corresponding to each event attribute in the target table.
3. The method according to claim 2, characterized in that, The step of determining the column information corresponding to each event attribute in the target table based on the metadata includes: If the metadata includes column information corresponding to each of the at least one event attribute in the target table, then the column information corresponding to each event attribute in the target table is obtained from the metadata.
4. The method according to claim 2, characterized in that, The step of determining the column information corresponding to each event attribute in the target table based on the metadata includes: If the metadata does not include column information corresponding to some or all of the event attributes in the target table, then column information corresponding to each of the event attributes in the target table is generated based on the metadata.
5. The method according to claim 4, characterized in that, The method further includes: Add the column information corresponding to each event attribute in the target table from some or all of the event attributes to the metadata.
6. The method according to claim 2, characterized in that, The method further includes: Receive a first query statement, which is used to query the target event attribute corresponding to the software product; Based on the metadata, determine the target column information of the target event attribute in the target table; Based on the target column information, the first query statement is processed to obtain a second query statement that includes the target column information; The target event attributes are queried based on the second query statement.
7. A data processing device for software products, characterized in that, The device includes: An acquisition unit is used to acquire event data to be stored, the event data to be stored including: a software product identifier, an event identifier, and at least one event attribute, the software product identifier is used to identify the software product that generated the event data to be stored, the event identifier is used to identify the event corresponding to the event data to be stored, and the event attribute is an attribute of the event; The first determining unit is configured to determine, based on the metadata of the software product, the column information of each event attribute in the at least one event attribute in a target table, wherein the target table includes multiple columns, at least one of the multiple columns is a target column, and at least two cells in the target column carry different event attributes, and the metadata includes the column information of each event attribute in the target table corresponding to a plurality of event attributes of the software product. A storage unit is used to determine the blank row with the smallest number of rows in the target table, and to determine the blank row as the target row for storing the event data to be stored. Based on the target row and the column information of each event attribute in the target table, the event data to be stored is stored in the target table.
8. The apparatus according to claim 7, characterized in that, The first determining unit is configured to: Obtain the metadata corresponding to the software product, the metadata including the column information of each event attribute in the target table among several event attributes corresponding to the software product; Based on the metadata, determine the column information corresponding to each of the at least one event attribute in the target table.
9. An electronic device, characterized in that, The device includes a processor and a memory; The processor is configured to execute instructions stored in the memory to cause the device to perform the method described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, Includes instructions that instruct the device to perform the method described in any one of claims 1-6.
Citation Information
Patent Citations
Method and system for uploading variable-length header data to same mysql table
CN115934720A