Task processing method and apparatus, electronic device, storage medium, and program product
By defining the target task in the data table and generating task processing results based on historical read records, the problem of high complexity in data table task processing is solved, and a more efficient processing process is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2026-03-26
AI Technical Summary
In existing technologies, the processing of data tables is complex and affects processing efficiency.
By defining the target task of the data table, the data record rows are traversed according to a preset traversal order, the current processing object type is read, and the task processing result is generated based on the historical read records, thereby reducing the complexity of task processing.
It improves the efficiency of task processing, reduces repeated traversal of each data record row, and increases processing speed.
Smart Images

Figure CN2025101268_26032026_PF_FP_ABST
Abstract
Description
Task processing method and device, electronic equipment, storage medium and program product
[0001] Cross-reference to related applications
[0002] The present application claims priority to the Chinese patent application No. 202411311415.0, filed on September 19, 2024, and entitled "Task processing method, device, electronic equipment, storage medium and program product", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present application relates to the technical field of data processing, and in particular to a task processing method, device, electronic equipment, storage medium and program product. BACKGROUND
[0004] In order to facilitate management and maintenance, a large amount of data can be centrally stored together by using a data table.
[0005] However, there are different use requirements for the data of the data table in various application scenarios. The task processing process performed in the prior art to achieve the corresponding use requirements is relatively complex, which seriously affects the efficiency of task processing. SUMMARY
[0006] Therefore, the purpose of the present application is to provide a task processing method, device, electronic equipment, storage medium and program product to solve or partially solve the above technical problems.
[0007] To achieve the above purpose, the first aspect of the present application provides a task processing method, comprising:
[0008] determining a target task for a data table, the data table comprising a plurality of data record rows;
[0009] traversing the plurality of data record rows according to a preset traversal order, and reading a current processing object type corresponding to the target task in a currently traversed data record row during the traversal process;
[0010] obtaining a first historical reading record corresponding to the plurality of data record rows, processing the first historical reading record and the current processing object type based on the target task, and generating a task processing result corresponding to the currently traversed data record row.
[0011] Based on the same inventive concept, the second aspect of the present application provides a task processing device, comprising:
[0012] a task determination module configured to determine a target task for a data table, the data table comprising a plurality of data record rows;
[0013] The traversal reading module is configured to traverse the plurality of data record rows according to a preset traversal order, and read a current processing object type corresponding to the target task in a currently-traversed data record row during the traversal.
[0014] The processing result generation module is configured to obtain a first historical reading record corresponding to the plurality of data record rows, process the first historical reading record and the current processing object type based on the target task, and generate a task processing result corresponding to the currently-traversed data record row.
[0015] Based on the same inventive concept, a third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
[0016] Based on the same inventive concept, a fourth aspect of the present application provides a non-transitory computer-readable storage medium, which stores computer instructions for causing a computer to execute the method of the first aspect.
[0017] Based on the same inventive concept, a fifth aspect of the present application provides a computer program product, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present application or related art, the drawings needed to be used in the embodiments or related art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0019] FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present application;
[0020] FIG. 2 is a flowchart of a task processing method according to an embodiment of the present application;
[0021] FIG. 3A is a first schematic diagram of an exemplary page according to an embodiment of the present application;
[0022] FIG. 3B is a second schematic diagram of an exemplary page according to an embodiment of the present application;
[0023] FIG. 3C is a third schematic diagram of an exemplary page according to an embodiment of the present application;
[0024] FIG. 4 is a structural schematic diagram of a task processing apparatus according to an embodiment of the present application;
[0025] FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] It can be understood that the data involved in the technical solutions of the present application (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0027] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and do not limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0028] It can be understood that before using the technical solutions of various embodiments of the present application, the type of personal information involved, the scope of use, the scenario of use, etc. will be informed to the user in an appropriate manner, and the authorization of the user will be obtained.
[0029] For example, in response to receiving the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require the acquisition and use of personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as electronic device, application program, server or storage medium, etc. that performs the operation of the technical solutions of the present application according to the prompt information.
[0030] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user may, for example, be a pop-up window manner, in which the prompt information can be presented in the form of text. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0031] It can be understood that the above notification and user authorization process is only illustrative, and does not limit the implementation manner of the present application, and other manners that meet the relevant laws and regulations can also be applied to the implementation manner of the present application.
[0032] In the present application, it should be understood that the number of any elements in the drawings is used for illustration only and not for limitation, and any naming is only used for distinction and does not have any limiting meaning.
[0033] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and do not limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0034] Referring to FIG. 1, it is a schematic diagram of an application scenario of a task processing method provided by an embodiment of the present application. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 can be connected through a wired or wireless communication network. The terminal device 101 includes, but is not limited to, a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA), or other electronic devices capable of realizing the above functions, etc. The server 102 and the data storage system 103 can be independent physical servers, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.
[0035] The server 102 determines a target task of a data table displayed in the terminal device 101, the data table including a plurality of data record rows; then the server 102 traverses the plurality of data record rows according to a preset traversal order, and reads a current processing object type corresponding to the target task in a currently traversed data record row in the traversal process; then the server 102 obtains first historical reading records corresponding to the plurality of data record rows from the data storage system 103, processes the first historical reading records and the current processing object type based on the target task, and generates a task processing result corresponding to the currently traversed data record row and sends it to the terminal device 101 for display. The data storage system 103 provides data storage support for the operation of the server 102, for example, for storing program code and related data of the first historical reading records.
[0036] The task processing method according to an exemplary embodiment of the present application will be described below in combination with the application scenario of FIG. 1. It should be noted that the above-mentioned application scenario is only shown for the purpose of facilitating the understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
[0037] An embodiment of the present application provides a task processing method, as shown in FIG. 2, which includes the following steps:
[0038] Step 201, determining a target task for a data table, the data table including a plurality of data record rows.
[0039] In some embodiments, the data table can be a spreadsheet or an online spreadsheet.
[0040] The data table includes multiple data record rows, and data items are stored through the data record rows. The data table is connected by a star connection, and a data table (referred to as a fact table) is at the center, and other data tables (referred to as dimension tables) are surrounded. The data of the multi-dimensional table is integrated according to a specific theme, and a dimensional data cube data model is provided, which is more suitable for complex queries and analysis, especially when a large amount of data is processed, and analysis results can be provided faster.
[0041] Each data record row represents a complete record or a set of associated data items, which can be a simple value or a complex object.
[0042] The data items stored in each data record row in the data table can be organized according to certain rules, such as table splitting, partitioning, indexing, etc., so as to facilitate subsequent addition, query, modification and deletion operations.
[0043] For example, the data table can include a table named "shopping list table" containing shopping data. Each row represents an item, and the column names are "product name", "product category",... Then, the data table can refer to the "shopping list table". In actual applications, the data table in different application scenarios will be different.
[0044] In step 202, the multiple data record rows are traversed according to a preset traversal order, and the current processing object type corresponding to the target task in the current traversed data record row is read in the traversal process.
[0045] In some embodiments, the multiple data record rows in the data table can be traversed according to a preset traversal order. The traversal order here can be random or ordered. If the traversal order is ordered, it is generally sorted according to certain specific standards, such as timestamp, alphabet, ascending order, descending order, etc.
[0046] In the traversal process, each data record row can be read in sequence from the beginning until all records are read. Of course, it can also be traversed in reverse order, that is, read from the tail to the front.
[0047] In the traversal process, the current processing object type corresponding to the target task in the current traversed data record row also needs to be read. Here, the "target task" refers to the purpose or task of this time, that is, which information needs to be extracted from the data table.
[0048] Different tasks may need to focus on different attribute fields, so it is necessary to clarify the target task in advance. For example, the target task is to count the number of goods corresponding to each "product category" in the "shopping list table" table. At this time, the attribute field that needs to be focused on should be the "product category" column, and the "current processing object type" refers to the attribute field corresponding to the "product category" column in the current data record line during traversal.
[0049] In step 203, a first historical reading record corresponding to the plurality of data record lines is obtained, and the first historical reading record and the current processing object type are processed based on the target task to generate a task processing result corresponding to the currently traversed data record line.
[0050] In some embodiments, in order to facilitate subsequent updating of the task processing result, the data traversed this time and / or the task processing result can be recorded in the currently traversed data record line. In this way, the next time the data is traversed again, the previous result can be directly used for subsequent processing, thereby avoiding repeated calculation and improving processing efficiency.
[0051] After traversal is completed, a first historical reading record corresponding to the plurality of data record lines can be obtained. The "first historical reading record" referred to here refers to temporary data generated in the previous traversal process, which is not the final result. During the traversal process, after reading each data record line, it is compared with the previously read data to obtain the current processing object type and other related information. These information are recorded to form the first historical reading record. It should be noted that since the first historical reading record is only temporary data, it should be cleaned up in time after the traversal is completed, and only the final first historical reading record is retained to avoid occupying too much space.
[0052] After traversal is completed, the first historical reading record and the current processing object type can be processed based on the target task to generate a task processing result corresponding to the currently traversed data record line. Based on this, the corresponding processing process is performed on the current object type to generate the corresponding task processing result. Only one traversal process is required according to the preset traversal order to complete the task processing process of the data table, and each data record line does not need to be traversed once, thereby reducing the complexity of the task processing and improving the efficiency of the task processing.
[0053] The "task processing result" here refers to the conclusion or output finally obtained by this time of traversal. It can be statistical data, reports, charts, etc., or other forms of output.
[0054] The specific form of the task processing result depends on the requirements of the target task itself. For example, if the target task is to count the number of products corresponding to each product category in the "shopping list table", the task processing result should be a numerical variable representing the number of products. In another scenario, the task processing result may be a classification label indicating which category the current data belongs to.
[0055] In some embodiments, the target task is to count the number of each processing object type.
[0056] In step 203, the first historical reading record and the current processing object type are processed based on the target task to generate a task processing result corresponding to the currently traversed data record row, including:
[0057] In response to the absence of the first historical processing object type in the first historical reading record, the number of the current processing object type is determined to be 1, and the number of the current processing object type is taken as the task processing result corresponding to the currently traversed data record row.
[0058] In some embodiments, if a data record row is traversed and it is found that the first historical reading record stored in the real-time reading process is empty at this time and does not store any first historical processing object type, it means that this data record row is the first data record row to be traversed, and the number of the current processing object type is recorded as 1 and taken as the task processing result corresponding to the currently traversed data record row.
[0059] For example, as shown in FIG. 3A, in the traversal process, the data record rows are traversed in ascending order of row sequence number, and the target task is to count the number of each gender. The currently traversed data record row is the data record row with row sequence number 1, and the gender of the person with the name A in the data record row with row sequence number 1 is "female" (i.e., the current processing object type). At this time, since the data record row with row sequence number 1 is the first to be traversed, the first historical reading record stored in the real-time reading process is empty at this time and does not store any first historical processing object type. At this time, it is the first time to appear this gender, and the number of the gender "female" is recorded as 1 and taken as the task processing result corresponding to the currently traversed data record row.
[0060] In some embodiments, the target task is to count the number of each processing object type.
[0061] In step 203, the first historical reading record and the current processing object type are processed based on the target task to generate a task processing result corresponding to the currently traversed data record row, including:
[0062] Step A1, in response to the first historical processing object type existing in the first historical read record, searching whether the first target historical processing object type same as the current processing object type exists in the first historical read record, obtaining a first search result.
[0063] Step A2, determining the task processing result corresponding to the current traversed data record row according to the first search result.
[0064] In some embodiments, if a data record row is traversed, and the first historical processing object type is stored in the first historical read record stored in the real-time reading process at this time, it indicates that the current traversed data record row is other than the data record row which is firstly started to be traversed. At this time, it is searched whether the first target historical processing object type same as the current processing object type exists in the first historical read record, obtaining a first search result.
[0065] The first search result is used to indicate whether the processing object type has appeared before. If it exists, it indicates that the processing object type has appeared before. If it does not exist, it indicates that the processing object type has not appeared before.
[0066] Based on the first search result, the task processing result corresponding to the current traversed data record row can be quickly determined.
[0067] In some embodiments, step A2 includes:
[0068] Step A21, in response to the first search result being non-existent, determining that the number of the current processing object types is 1, and taking the number of the current processing object types as 1 as the task processing result corresponding to the current traversed data record row. Or,
[0069] Step A22, in response to the first search result being existent, counting the historical number of the first target historical processing object type, adding 1 to the historical number to obtain a latest number, and taking the latest number as the task processing result corresponding to the current traversed data record row.
[0070] In some embodiments, if the first search result is non-existent, it indicates that the current processing object type has not appeared before. At this time, the number of the current processing object type is counted as 1, and taken as the task processing result corresponding to the current traversed data record row.
[0071] For example, as shown in FIG. 3B, in the traversal process, the data record rows are traversed in ascending order of the row numbers, i.e., the data record row with the row number 1, the data record row with the row number 2, and so on. At this time, the target task is to count the number of each gender, and the currently traversed data record row is the data record row with the row number 3, and the gender of the person with the name C in the data record row with the row number 3 is “female” (i.e., the current processing object type).
[0072] It is found in the first historical reading record stored in the real-time reading process that the gender corresponding to the data record row with the row number 1 is “male”, and the gender corresponding to the data record row with the row number 2 is “male”.
[0073] At this time, the gender same as the gender in the data record row with the row number 3 cannot be found, which indicates that the gender of “female” has never appeared before, and the number of the gender of “female” is counted as 1. The task processing result corresponding to the data record row with the row number 3 is 1.
[0074] Alternatively, if the first finding result is that there exists, which has never appeared before, it indicates that the current processing object type has appeared before, and at this time, the number of the first target historical processing object type same as the processing object type needs to be counted, and 1 is added to obtain the latest number, which is taken as the task processing result corresponding to the currently traversed data record row.
[0075] For example, as shown in FIG. 3C, in the traversal process, the data record rows are traversed in ascending order of the row numbers, i.e., the data record row with the row number 1, the data record row with the row number 2, and so on. At this time, the target task is to count the number of each gender, and the currently traversed data record row is the data record row with the row number 3, and the gender of the person with the name C in the data record row with the row number 3 is “female” (i.e., the current processing object type).
[0076] It is found in the first historical reading record stored in the real-time reading process that the gender corresponding to the data record row with the row number 1 is “female”, and the gender corresponding to the data record row with the row number 2 is “male”.
[0077] At this time, the gender of the data record row with the row number 1 (i.e., the first target historical processing object type) is same as the gender in the data record row with the row number 3, and therefore the gender same as the gender in the data record row with the row number 3 can be found. The gender of the data record row with the row number 1 has appeared once, and 1 is added to obtain the latest number, which is 2. The task processing result corresponding to the data record row with the row number 3 is 2.
[0078] In some embodiments, the first historical reading record includes a plurality of different first historical processing object types.
[0079] In step 203, the first historical read record and the current processing object type are processed based on the target task to generate a task processing result corresponding to the current traversed data record row, including:
[0080] Step B1, find a first target historical processing object type same as the current processing object type from the plurality of different first historical processing object types.
[0081] Step B2, find a target index corresponding to the first target historical processing object type from a plurality of pre-constructed indexes.
[0082] Step B3, determine a task processing result corresponding to the current traversed data record row based on the target index.
[0083] In some embodiments, the index is used to indicate the line number of the occurrence of each different processing object type.
[0084] After finding the first target historical processing object type same as the current processing object type from the first historical read record, the index corresponding to the processing object type is found, and the task processing result corresponding to the current traversed data record row can be quickly determined based on the index.
[0085] In some embodiments, each index is constructed by the following process:
[0086] Step C1, traverse the plurality of data record rows in a preset traversal order, and read the current processing object type corresponding to the target task and the current line identifier corresponding to the current traversed data record row in the traversal process.
[0087] Step C2, obtain a second historical read record corresponding to the plurality of data record rows, and process the current processing object type and the current line identifier based on the second historical read record to obtain an index corresponding to the current processing object type.
[0088] In some embodiments, the indexes of each different processing object type are pre-constructed, and the plurality of data record rows in the data table are traversed in a preset traversal order.
[0089] The traversal order here can be random or ordered. If the traversal order is ordered, it is generally sorted according to a certain specific standard, such as timestamp, alphabet, ascending order, descending order, etc.
[0090] In the process of traversal, each data record row can be read in sequence from the beginning until all records are read. Of course, it can also be traversed in reverse order, that is, read from the tail to the front.
[0091] In the process of traversal, the current processing object type corresponding to the target task in the currently traversed data record row and the current row identifier corresponding to the currently traversed data record row also need to be read. The "target task" here refers to the purpose or task of this traversal, that is, which information needs to be extracted from the data table.
[0092] Different tasks may need to focus on different attribute fields, so it is necessary to clarify the target task in advance. For example, the target task is to count the number of goods corresponding to each "product category" in the "shopping list table". Therefore, the attribute field of the "product category" column needs to be focused on, and the "current processing object type" refers to the attribute field corresponding to the "product category" column in the currently traversed data record row during traversal.
[0093] After traversal, a second historical read record corresponding to multiple data record rows can be obtained. The "second historical read record" here refers to temporary data records generated during the previous traversal process, which is not the final result. In the process of traversal, after reading each data record row, it is compared with the previously read data to obtain the current processing object type and other related information. These information will be recorded to form the second historical read record. It should be noted that since the second historical read record is only temporary data, it should be cleaned up in time after the traversal is completed, and only the final first historical read record is retained to avoid occupying too much space.
[0094] After traversal, the current processing object type and the current row identifier can be processed based on the target task to obtain an index corresponding to the current processing object type, and generate an index corresponding to the currently traversed data record row.
[0095] In some embodiments, in step C2, the processing of the current processing object type and the current row identifier based on the second historical read record to obtain an index corresponding to the current processing object type includes:
[0096] In response to the absence of a second historical processing object type in the second historical read record, the current row identifier is stored in association with the current processing object type to form an index corresponding to the current processing object type.
[0097] In some embodiments, if a data record row is traversed, and it is found that the second historical reading record stored in the real-time reading process is empty at this time and does not store any second historical processing object type, it indicates that the data record row is the first data record row traversed, at this time, it is the first time that this processing object type appears, the current processing object type is stored in association with the corresponding current row identifier, and it is taken as an index corresponding to the current processing object type.
[0098] For example, in the traversal process, the data record rows are traversed in ascending order of row numbers, at this time, the target task is to count the number of each gender, the data record row currently traversed is the data record row with the row number of 1, and the gender in the data record row with the row number of 1 is “female” (i.e., the current processing object type). At this time, since the data record row with the row number of 1 is the first to be traversed, the second historical reading record stored in the real-time reading process is empty at this time and does not store any second historical processing object type, at this time, it is the first time that this gender appears, the gender “female” is stored in association with the data record row with the row number of 1 (i.e., the current row identifier), and it is taken as an index corresponding to the gender “female”.
[0099] In some embodiments, in step C2, the processing of the current processing object type and the current row identifier based on the second historical reading record to obtain an index corresponding to the current processing object type comprises:
[0100] Step D1, in response to the existence of a second historical processing object type in the second historical reading record, searching whether there is a second target historical processing object type identical to the current processing object type in the second historical reading record to obtain a second search result.
[0101] Step D2, determining an index corresponding to the current processing object type according to the second search result.
[0102] In some embodiments, if a data record row is traversed, and the second historical reading record stored in the real-time reading process stores a second historical processing object type at this time, it indicates that the data record row currently traversed is a data record row other than the data record row which is the first to be traversed.
[0103] At this time, it is searched whether there is a second target historical processing object type identical to the current processing object type in the second historical reading record to obtain a second search result.
[0104] The second search result is used to indicate whether this processing object type has appeared before, if it exists, it indicates that this processing object type has appeared before, and if it does not exist, it indicates that this processing object type has not appeared before.
[0105] Based on the second search result, the index corresponding to the current processing object type can be quickly determined.
[0106] In some embodiments, the step D2 comprises:
[0107] The step D21 comprises: in response to the second search result being non-existent, storing the current processing object type and the current row identifier in association, to form an index corresponding to the current processing object type. Alternatively,
[0108] The step D22 comprises: in response to the second search result being existent, obtaining an original index corresponding to the second target historical processing object type, adding the current row identifier to the original index in association, to obtain a latest index, and taking the latest index as the index corresponding to the current processing object type.
[0109] In some embodiments, if the second search result is non-existent, it indicates that the current processing object type has never appeared before. In this case, the current processing object type and the corresponding current row identifier are stored in association, and taken as the index corresponding to the current processing object type.
[0110] For example, in the traversal process, the data record rows are traversed in ascending order of row sequence numbers, i.e., the data record row with the row sequence number 1, the data record row with the row sequence number 2, and so on. In this case, the target task is to count the number of each gender, and the currently traversed data record row is the data record row with the row sequence number 3, and the gender in the data record row with the row sequence number 3 is “female” (i.e., the current processing object type).
[0111] In the real-time reading process, it is found in the stored second historical reading record that the gender corresponding to the data record row with the row sequence number 1 is “male”, and the gender corresponding to the data record row with the row sequence number 2 is “male”.
[0112] At this time, the gender identical to the gender in the data record row with the row sequence number 3 cannot be found, indicating that the gender “female” has never appeared before. In this case, the gender “female” is stored in association with the data record row with the row sequence number 3, to form an index corresponding to the gender “female”.
[0113] Alternatively, if the second search result is existent, it indicates that the current processing object type has appeared before. In this case, the number of the second target historical processing object type identical to the current processing object type needs to be counted, an original index corresponding to the second target historical processing object type is obtained, the current row identifier is added to the original index in association, to obtain a latest index, and the latest index is taken as the index corresponding to the current processing object type.
[0114] For example, in the traversal process, the data record rows are traversed in ascending order of row numbers, i.e., the data record row with row number 1, the data record row with row number 2, and so on. At this time, the target task is to count the number of each gender, and the currently traversed data record row is the data record row with row number 3, and the gender in the data record row with row number 3 is "female" (i.e., the current processing object type).
[0115] In the real-time reading process, it is found in the second historical reading record that the gender corresponding to the data record row with row number 1 is "female", and the gender corresponding to the data record row with row number 2 is "male".
[0116] At this time, the gender of the data record row with row number 1 (i.e., the second target historical processing object type) is the same as the gender in the data record row with row number 3, so the gender that is the same as the gender in the data record row with row number 3 can be found.
[0117] The original index corresponding to the gender "female" is the association relationship between the data record row with row number 1 and the gender "female", and then the data record row with row number 3 is added to the original index, the latest index is the data record row with row number 1, the data record row with row number 3, and the association relationship with the gender "female", and the index corresponding to the gender "female" is formed.
[0118] In some embodiments, step B3 comprises:
[0119] Counting the number of historical data record row identifiers in the target index to obtain a statistical result, and taking the statistical result as the task processing result corresponding to the currently traversed data record row.
[0120] In some embodiments, the row identifier of the data record row recorded in the target index is called, the number of row identifiers is counted to obtain a statistical result, and the statistical result is the task processing result corresponding to the currently traversed data record row.
[0121] For example, the target index is the data record row with row number 1, the data record row with row number 3, and the association relationship with the gender "female". The number of row identifiers of the gender "female" is 2, indicating that the task processing result corresponding to the currently traversed data record row is 2.
[0122] In some embodiments, after step 203, the method further comprises:
[0123] Recording the task processing result in the currently traversed data record row.
[0124] In some embodiments, in the traversal process, the corresponding task processing result is recorded in the currently traversed data record row in real time. In some embodiments, in the traversal process, the corresponding task processing result is recorded in the currently traversed data record row in real time.
[0125] The task processing result recorded in each data record row is updated in real time as the traversal is performed, and remains unchanged until the traversal is completed.
[0126] By recording the task processing result in each data record row, the user can conveniently view the task processing situation in real time.
[0127] According to the above scheme, after determining the target task for the data table, the plurality of data record rows stored in the data table are traversed according to the preset traversal order. When any data record row is traversed in the traversal process, the corresponding current processing object type needs to be read, and then it is determined whether the same processing object type as the current object type has been read before by using the first historical reading record stored in real time in the traversal process. On this basis, the corresponding processing process is performed on the current object type to generate the corresponding task processing result. Only one traversal process according to the preset traversal order is needed to complete the task processing process of the data table, and each data record row does not need to be traversed once. Therefore, the complexity of the task processing can be reduced, and the task processing efficiency is improved.
[0128] It should be noted that the method of the embodiments of the present application can be executed by a single device, such as a computer or a server, etc. The method of the embodiments of the present application can also be applied to a distributed scenario, and completed by multiple devices cooperating with each other. In this distributed scenario, one of the multiple devices can only execute one or more steps in the method of the embodiments of the present application, and the multiple devices can interact with each other to complete the method.
[0129] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than the order described above and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0130] Based on the same inventive concept, the present application also provides a task processing device corresponding to any of the above-mentioned embodiment methods.
[0131] Referring to FIG. 4, the task processing device comprises:
[0132] The task determination module 401 is configured to determine a target task for a data table, and the data table comprises a plurality of data record rows.
[0133] The traversal reading module 402 is configured to traverse the plurality of data record rows in a preset traversal order, and read a current processing object type corresponding to the target task in a currently-traversed data record row during the traversal;
[0134] The processing result generation module 403 is configured to obtain a first historical reading record corresponding to the plurality of data record rows, process the first historical reading record and the current processing object type based on the target task, and generate a task processing result corresponding to the currently-traversed data record row.
[0135] In some embodiments, the target task is to count the number of each processing object type.
[0136] The processing result generation module 403 is specifically configured to:
[0137] In response to the first historical processing object type not existing in the first historical reading record, determine that the number of the current processing object type is 1, and take the number of the current processing object type as 1 as the task processing result corresponding to the currently-traversed data record row.
[0138] In some embodiments, the target task is to count the number of each processing object type.
[0139] The processing result generation module 403 includes:
[0140] The first finding unit is configured to, in response to the first historical processing object type existing in the first historical reading record, find whether a first target historical processing object type same as the current processing object type exists in the first historical reading record, to obtain a first finding result.
[0141] The first determination unit is configured to determine the task processing result corresponding to the currently-traversed data record row according to the first finding result.
[0142] In some embodiments, the first determination unit is specifically configured to:
[0143] In response to the first finding result being non-existent, determine that the number of the current processing object type is 1, and take the number of the current processing object type as 1 as the task processing result corresponding to the currently-traversed data record row; or,
[0144] In response to the first finding result being existent, count a historical number of the first target historical processing object type, add 1 to the historical number to obtain a latest number, and take the latest number as the task processing result corresponding to the currently-traversed data record row.
[0145] In some embodiments, the first historical reading record includes a plurality of different first historical processing object types;
[0146] The processing result generation module 403 includes:
[0147] The second finding unit is configured to find, from the plurality of different first historical processing object types, a first target historical processing object type same as the current processing object type;
[0148] The third finding unit is configured to find, from a plurality of pre-constructed indexes, a target index corresponding to the first target historical processing object type;
[0149] The processing result determination unit is configured to determine a task processing result corresponding to the currently iterated data record row based on the target index.
[0150] In some embodiments, the task processing apparatus further includes an index construction module, and the index construction module includes:
[0151] The iteration reading unit is configured to iterate the plurality of data record rows in a preset iteration order, and read, in the iteration process, a current processing object type corresponding to the target task in the currently iterated data record row and a current row identifier corresponding to the currently iterated data record row;
[0152] The index determination unit is configured to obtain a second historical reading record corresponding to the plurality of data record rows, process the current processing object type and the current row identifier based on the second historical reading record, and obtain an index corresponding to the current processing object type.
[0153] In some embodiments, the index determination unit is specifically configured to:
[0154] In response to the absence of a second historical processing object type in the second historical reading record, the current row identifier is stored in association with the current processing object type to form the index corresponding to the current processing object type.
[0155] In some embodiments, the index determination unit includes:
[0156] The fourth finding unit is configured to, in response to the presence of a second historical processing object type in the second historical reading record, find whether a second target historical processing object type same as the current processing object type exists in the second historical reading record to obtain a second finding result;
[0157] The second determination unit is configured to determine the index corresponding to the current processing object type according to the second finding result.
[0158] In some embodiments, the second determining unit is specifically configured to:
[0159] In response to the second lookup result being non-existent, the current processing object type and the current row identifier are stored in association to form an index corresponding to the current processing object type; or
[0160] In response to the second lookup result being existent, an original index corresponding to the second target historical processing object type is obtained, the current row identifier is added to the original index in association to obtain a latest index, and the latest index is taken as an index corresponding to the current processing object type.
[0161] In some embodiments, the processing result determining unit is specifically configured to:
[0162] The number of historical data record row identifiers in the target index is counted to obtain a counting result, and the counting result is taken as a task processing result corresponding to the currently iterated data record row.
[0163] In some embodiments, the task processing apparatus further includes a recording module, after generating the task processing result corresponding to the currently iterated data record row, the recording module is specifically configured to:
[0164] Record the task processing result in the currently iterated data record row.
[0165] For the convenience of description, the above apparatus is described in various modules in terms of functions. Of course, in the implementation of the present application, the functions of the modules can be implemented in one or more software and / or hardware.
[0166] The apparatuses of the above embodiments are used to implement the corresponding task processing methods in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which are not described here again.
[0167] Based on the same inventive concept, corresponding to any of the above method embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the task processing method of any of the above embodiments when executing the program.
[0168] FIG. 5 shows a more specific hardware structure of an electronic device according to the present embodiment. The device can include a processor 501, a memory 502, an input / output interface 503, a communication interface 504, and a bus 505. The processor 501, the memory 502, the input / output interface 503, and the communication interface 504 are connected to each other through the bus 505 for communication within the device.
[0169] The processor 501 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solutions provided by the embodiments of the present specification.
[0170] The memory 502 can be implemented by a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 502 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the relevant program codes are stored in the memory 502 and called and executed by the processor 501.
[0171] The input / output interface 503 is configured to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input devices can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices can include a display, a speaker, a vibrator, an indicator light, etc.
[0172] The communication interface 504 is configured to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication through a wired manner (such as USB, network cable, etc.) or through a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0173] The bus 505 includes a path for transmitting information between various components (such as the processor 501, the memory 502, the input / output interface 503, and the communication interface 504) of the device.
[0174] It should be noted that although the above device only shows the processor 501, the memory 502, the input / output interface 503, the communication interface 504, and the bus 505, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only include the components necessary to implement the solutions of the embodiments of the present specification, and does not have to include all the components shown in the figure.
[0175] The electronic device of the above embodiments is used to implement the corresponding task processing method in any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here again.
[0176] Based on the same inventive concept, the present application also provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the task processing method according to any of the above embodiments.
[0177] The computer readable medium of the embodiments can include permanent and non-permanent, removable and non-removable media, which can be realized by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0178] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the task processing method according to any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which are not described here.
[0179] Based on the same concept, the present application also provides a computer program product comprising computer program instructions for causing a computer to perform the method according to any of the above embodiments when the computer program instructions are run on the computer, having the beneficial effects of the corresponding method embodiments, which are not described here.
[0180] Those skilled in the art should understand that the above discussion of any of the embodiments is only exemplary and is not intended to imply that the scope of the present application is limited to these examples; the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes of the different aspects of the embodiments of the present application as described above. In order to be brief, they are not provided in detail.
[0181] Additionally, to simplify the description and discussion, and so as not to obscure the embodiments of the application being presented, the well-known functions or constructions of integrated circuit (IC) chips and other components can or can not be shown in the figures and will be omitted as not to unnecessarily obscure the embodiments of the application being presented. Moreover, the devices can be shown in block diagram form in order to avoid obscuring the embodiments of the application, and this also acknowledges the fact that the details in regards to the implementation of such block devices are highly dependent on the platform upon which the embodiments of the application are being implemented (i.e., these details should be well within the purview of one of ordinary skill in the art). Where specific details are set forth in order to describe an illustrative embodiment of the application, it will be apparent to one of ordinary skill in the art that the embodiments of the application can be practiced without, or with variation of, these specific details. Thus, the description is to be considered as illustrative and not restrictive, and the scope of the application should be determined not with reference to the above description, but should be given to the appended claims.
[0182] While the application has been described in connection with specific embodiments thereof, many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) can use the embodiments discussed.
[0183] Embodiments of the application are intended to cover all such alternatives, modifications and variations as falling within the scope of the application. Accordingly, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the application should be included in the scope of protection of the application.
Claims
1. A task processing method, comprising: determining a target task for a data table, the data table comprising a plurality of data record rows; traversing the plurality of data record rows according to a preset traversal order, and reading a current processing object type corresponding to the target task in a currently traversed data record row during the traversal; obtaining a first historical reading record corresponding to the plurality of data record rows, processing the first historical reading record and the current processing object type based on the target task, and generating a task processing result corresponding to the currently traversed data record row.
2. The method of claim 1, wherein, The target task is to count the number of each processing object type. The processing of the first historical reading record and the current processing object type based on the target task to generate a task processing result corresponding to the currently traversed data record row comprises: in response to the first historical reading record not containing a first historical processing object type, determining that the number of the current processing object type is 1, and taking the number of the current processing object type as 1 as the task processing result corresponding to the currently traversed data record row.
3. The method of claim 1, wherein, The target task is to count the number of each processing object type. The processing of the first historical reading record and the current processing object type based on the target task to generate a task processing result corresponding to the currently traversed data record row comprises: in response to the first historical reading record containing a first historical processing object type, searching the first historical reading record for a first target historical processing object type identical to the current processing object type to obtain a first search result; determining the task processing result corresponding to the currently traversed data record row according to the first search result.
4. The method of claim 3, wherein, The determination of the task processing result corresponding to the currently traversed data record row according to the first search result comprises: in response to the first search result being non-existent, determining that the number of the current processing object type is 1, and taking the number of the current processing object type as 1 as the task processing result corresponding to the currently traversed data record row; or in response to the first search result being existent, counting a historical number of the first target historical processing object type, adding 1 to the historical number to obtain a latest number, and taking the latest number as the task processing result corresponding to the currently traversed data record row.
5. The method of claim 1, wherein, The first historical reading record comprises a plurality of different first historical processing object types. The processing of the first historical reading record and the current processing object type based on the target task to generate a task processing result corresponding to the currently traversed data record row comprises: searching the plurality of different first historical processing object types for a first target historical processing object type identical to the current processing object type; searching a plurality of indexes constructed in advance for a target index corresponding to the first target historical processing object type; determining the task processing result corresponding to the currently traversed data record row based on the target index.
6. The method of claim 5, wherein, Each index is constructed by the following process: traverse the plurality of data record rows according to a preset traversal order, and read a current processing object type corresponding to the target task in a currently traversed data record row and a current row identifier corresponding to the currently traversed data record row in the process of traversal; obtain a second historical reading record corresponding to the plurality of data record rows, and process the current processing object type and the current row identifier based on the second historical reading record to obtain an index corresponding to the current processing object type.
7. The method of claim 6, wherein, The processing of the current processing object type and the current row identifier based on the second historical reading record to obtain the index corresponding to the current processing object type includes: in response to the second historical reading record not containing a second historical processing object type, storing the current row identifier and the current processing object type in association to form the index corresponding to the current processing object type.
8. The method of claim 6, wherein, The processing of the current processing object type and the current row identifier based on the second historical reading record to obtain the index corresponding to the current processing object type includes: in response to the second historical reading record containing a second historical processing object type, searching the second historical reading record for a second target historical processing object type identical to the current processing object type to obtain a second search result; determining the index corresponding to the current processing object type according to the second search result.
9. The method of claim 8, wherein, The determination of the index corresponding to the current processing object type according to the second search result includes: in response to the second search result being non-existent, storing the current processing object type and the current row identifier in association to form the index corresponding to the current processing object type; or in response to the second search result being existent, obtaining an original index corresponding to the second target historical processing object type, adding the current row identifier to the original index to obtain a latest index, and taking the latest index as the index corresponding to the current processing object type.
10. The method of claim 5, wherein, The determination of the task processing result corresponding to the currently traversed data record row based on the target index includes: counting a number of historical data record identifiers in the target index to obtain a statistical result, and taking the statistical result as the task processing result corresponding to the currently traversed data record row.
11. The method of claim 1, wherein, After generating the task processing result corresponding to the currently traversed data record row, the method further includes: recording the task processing result in the currently traversed data record row.
12. A task processing apparatus, comprising: a task determination module configured to determine a target task for a data table, the data table including a plurality of data record rows; a traversal reading module configured to traverse the plurality of data record rows according to a preset traversal order, and read a current processing object type corresponding to the target task in a currently traversed data record row in the process of traversal; A processing result generation module is configured to acquire first historical reading records corresponding to the plurality of data record rows, process the first historical reading records and the current processing object type based on the target task, and generate a task processing result corresponding to a currently iterated data record row.
13. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein, The processor implements the method of any one of claims 1-11 when executing the program.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method of any one of claims 1-11.
15. A computer program product comprising computer program instructions, wherein, The computer program instructions, when running on a computer, cause the computer to execute the method of any one of claims 1-11.
Citation Information
Patent Citations
Form processing method, apparatus, system and medium
CN109101641A
Data processing method and device, computer equipment, storage medium and program product
CN114238310A
Multi-database subsetting
US11636086B1