Data processing method, electronic device, and readable storage medium
Patent Information
- Application Number
- CN202311442282.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-11-01
AI Technical Summary
由于每天生成的数据表之间相互独立,在对某一数据表中的生效数据进行数据变更时,如果不对应变更其他数据表,将会导致数据混乱,不利于后续数据追溯;如果变更其他数据表,则需要手动一一变更众多数据表中的对应数据,工作量较大,效率低下
[0018]本公开提供的数据处理方法、装置、电子设备、可读存储介质及产品,在预设数据表中增加预设生效开始时间字段、预设生效结束时间字段、预设序号字段和预设最大版本标志字段,其中,增加预设序号字段和预设最大版本标志字段使得同时间多版本数据表能够被有效存储,增加预设生效开始时间字段和预设生效结束时间字段使得多个预设数据表之间具有时间连续性,进而在对预设数据库进行数据变更时,能够自动根据变更类型、目标数据表的确定情况和同时间多版本的判断结果对目标数据表的预设生效结束时间、目标数据表的预设最大版本标志和待变更数据表中的一种或多种进行变更,提升了数据处理效率。
Smart Images

Figure CN117472906B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data processing method, electronic device, and readable storage medium. Background Technology
[0002] With the continuous development of computer technology, various data sources are constantly being generated, and data storage methods are becoming increasingly diverse.
[0003] In related technologies, a data table is generated daily, recording the effective data for each day, and the data table is stored in a database. Because the data tables generated each day are independent of each other, when data changes are made to the effective data in one data table, if other data tables are not correspondingly updated, it will lead to data chaos and hinder subsequent data traceability; if other data tables are changed, the corresponding data in numerous data tables needs to be manually updated one by one, which is labor-intensive and inefficient.
[0004] In other words, there is a problem with the data storage method in the relevant technology, which leads to low data processing efficiency. Summary of the Invention
[0005] To address at least one of the aforementioned technical problems, this disclosure provides a data processing method, apparatus, electronic device, readable storage medium, and product.
[0006] The first aspect of this disclosure provides a data processing method, comprising: receiving a change request for a preset database, the change request including a change type, a target effective start time and a target sequence number of a data table to be changed, the preset database including multiple preset data tables, each preset data table including a preset effective start time, a preset effective end time, a preset sequence number and a preset maximum version flag, the preset effective start time and the preset sequence number being used to characterize the actual effective start time of the preset data table; determining a target data table based on the target effective start time, the target sequence number and the change type, the target data table being a priori data table. According to one or more of the following tables, the preceding data table is a preset data table whose actual effective start time is earlier than the data table to be changed, and the following data table is a preset data table whose actual effective start time is later than the data table to be changed; the data table to be changed and the target data table are judged to be multiple versions simultaneously based on the target effective start time; the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data tables to be changed are changed according to the change type, the determination of the target data table, and the judgment result of the multiple versions simultaneously.
[0007] In some implementations, determining the target data table based on the target effective start time, the target sequence number, and the change type includes: arranging multiple preset data tables in reverse order of preset effective start time and preset sequence number; and determining the target data table from the arranged multiple preset data tables based on the target effective start time, the target sequence number, and the change type.
[0008] In some implementations, the step of determining whether the data table to be modified and the target data table are multiple versions at the same time based on the target effective start time includes: determining that the data table to be modified and the target data table are multiple versions at the same time if the preset effective start time of the target data table is the same as the target effective start time of the data table to be modified; and determining that the data table to be modified and the target data table are multiple versions at different times if the preset effective start time of the target data table is different from the target effective start time of the data table to be modified.
[0009] In some implementations, the step of changing one or more of the following based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time, includes: in response to the change type being a new data table, the prior data table being determined, and the prior data table and the target data table being multiple versions at the same time, updating the preset effective end time of the prior data table to the target effective start time, and updating the preset maximum version flag of the prior data table to a preset non-maximum version. Status value; In response to the change type being the newly added data table, and the prior data table being determined, and the prior data table and the target data table being multiple versions not occurring at the same time, the preset effective end time of the prior data table is updated to the time preceding the target effective start time, while keeping the preset maximum version flag of the prior data table unchanged; In response to the change type being the newly added data table, and the subsequent data table not being determined, the preset latest time is used as the target effective end time of the data table to be changed, and the preset maximum version status value is used as the target maximum version flag of the data table to be changed, and the target effective time is determined accordingly. The start time, the target effective end time, the target sequence number, and the target maximum version flag are used to add the data table to be modified to the preset database. In response to the change type being the newly added data table, and the subsequent data table being identified, and the subsequent data table and the target data table being multiple versions at the same time, the preset effective start time of the subsequent data table is used as the target effective end time of the data table to be modified, and the preset non-maximum version status value is used as the target maximum version flag of the data table to be modified. Furthermore, based on the target effective start time, the target effective end time, the target sequence number, and the target maximum version flag, the data table is modified accordingly. A major version flag is added to the preset database to add the data table to be changed; in response to the change type being the newly added data table, and the subsequent data table being determined, and the subsequent data table and the target data table being multiple versions at different times, the time preceding the preset effective start time of the subsequent data table is taken as the target effective end time of the data table to be changed, and the preset maximum version status value is taken as the target maximum version flag of the data table to be changed, and the data table to be changed is added to the preset database according to the target effective start time, the target effective end time, the target sequence number, and the target maximum version flag.
[0010] In some implementations, the step of changing one or more of the following based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time: directly deleting the data table to be changed if the change type is a data table deletion and the prior data table has not been determined; or changing the prior data table's version number in response to the change type being a data table deletion, the determination of the prior data table, and the determination result of multiple versions at the same time. The preset effective end time is updated to the target effective end time of the data table to be changed, and the preset maximum version flag of the prior data table is updated to the target maximum version flag of the data table to be changed, and the data table to be changed is deleted; in response to the change type being a deleted data table, and the prior data table being identified, and the prior data table and the target data table being multiple versions at different times, the preset effective end time of the prior data table is updated to the target effective end time of the data table to be changed, while keeping the preset maximum version flag of the prior data table unchanged, and the data table to be changed is deleted.
[0011] In some implementations, after receiving the change request for the preset database, the method further includes: in response to the change type being a modification of the preset effective start time, first deleting the data table to be changed in the preset database, and then adding a new data table according to the target effective start time and the deleted data table to be changed.
[0012] In some implementations, after changing one or more of the following based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time: the preset effective end time of the target data table, the preset maximum version flag of the target data table, and the data table to be changed, the method further includes: updating a preset real-time data table based on the data table to be changed if the data in the data table to be changed is currently effective data; and keeping the preset real-time data table unchanged if the data in the data table to be changed is not currently effective data.
[0013] In some implementations, the method further includes: receiving a query request to the preset database, the query request including query data type and query conditions, the query conditions including query identifier and query time, the preset data table further including preset identifier and various preset basic data; filtering out a data table to be displayed according to the query conditions, the data table to be displayed being a preset data table in the preset database where the preset identifier is the same as the query identifier, the preset effective start time is earlier than or equal to the query time, the preset effective end time is later than or equal to the query time, and the preset maximum version flag is a preset maximum version status value; and displaying the content of the basic data to be displayed in the data table to be displayed, the basic data to be displayed being preset basic data of the same type as the query data.
[0014] A second aspect of this disclosure provides a data processing apparatus, comprising: a receiving module, configured to receive a change request for a preset database, the change request including a change type, a target effective start time and a target sequence number of the data table to be changed, the preset database including multiple preset data tables, each preset data table including a preset effective start time, a preset effective end time, a preset sequence number and a preset maximum version flag, the preset effective start time and the preset sequence number being used to characterize the actual effective start time of the preset data table; and a determining module, configured to determine a target data table based on the target effective start time, the target sequence number and the change type, the target data table being a priori data table. The preceding data table is a preset data table whose actual effective start time is earlier than the data table to be changed, and the following data table is a preset data table whose actual effective start time is later than the data table to be changed; the judgment module is used to perform simultaneous multi-version judgment on the data table to be changed and the target data table according to the target effective start time; the change module is used to change the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data table to be changed according to the change type, the determination of the target data table, and the judgment result of simultaneous multi-version;
[0015] A third aspect of this disclosure provides an electronic device, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform a data processing method according to any embodiment of this disclosure.
[0016] A fourth aspect of this disclosure provides a readable storage medium storing executable instructions, which, when executed by a processor, are used to implement the data processing method described in any embodiment of this disclosure.
[0017] The fifth aspect of this disclosure provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the data processing method described in any embodiment of this disclosure.
[0018] The data processing method, apparatus, electronic device, readable storage medium, and product disclosed herein add a preset effective start time field, a preset effective end time field, a preset sequence number field, and a preset maximum version flag field to a preset data table. The addition of the preset sequence number field and the preset maximum version flag field enables the effective storage of multiple versions of the data table simultaneously. The addition of the preset effective start time field and the preset effective end time field ensures temporal continuity among the multiple preset data tables. Therefore, when data changes are made to the preset database, the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data tables to be changed can be automatically modified based on the change type, the determination of the target data table, and the judgment result of multiple versions simultaneously, thereby improving data processing efficiency. Attached Figure Description
[0019] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0020] Figure 1 This is a flowchart illustrating some embodiments of the data processing method disclosed herein.
[0021] Figure 2 This is another schematic diagram of the data processing method according to some embodiments of this disclosure.
[0022] Figure 3 This is yet another flowchart illustrating a data processing method according to some embodiments of this disclosure.
[0023] Figure 4 These are visual examples of preset data tables 1, 2, and 3 for some embodiments of this disclosure.
[0024] Figure 5 This is a visual example diagram of preset data table 1, preset data table 2, preset data table 3 and the data table to be added after adding a new data table 1 to a preset database according to some embodiments of this disclosure.
[0025] Figure 6 This is a visual example of some embodiments of the present disclosure, showing the pre-defined data table 1, pre-defined data table 2, pre-defined data table 3, and the data table to be added after adding the data table to be added 2 to the pre-defined database.
[0026] Figure 7 This is a visual example of some embodiments of the present disclosure, showing the pre-defined data table 1, pre-defined data table 2, pre-defined data table 3 and the data table to be added after adding the data table to be added 3 to the pre-defined database.
[0027] Figure 8 This is a visual example of some embodiments of the present disclosure, showing the pre-defined data table 1, pre-defined data table 2, pre-defined data table 3 and the data table to be added 4 after adding the data table to be added 4 to the pre-defined database.
[0028] Figure 9 This is a visual example of some embodiments of the present disclosure, showing the pre-defined data table 1, pre-defined data table 2, pre-defined data table 3 and the data table to be added 5 after adding the data table to be added 5 to the pre-defined database.
[0029] Figure 10 This is a visual example of some embodiments of the present disclosure, showing the pre-defined data table 1, pre-defined data table 2, pre-defined data table 3 and the data table to be added 6 after adding the data table to be added 6 to the pre-defined database.
[0030] Figure 11 This is a schematic block diagram of a data processing apparatus that employs a hardware implementation of a processing system, according to one embodiment of the present disclosure. Detailed Implementation
[0031] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0032] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0033] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.
[0034] The use of crosshairs and / or shading in the accompanying drawings is generally used to clarify the boundaries between adjacent components. Thus, unless otherwise stated, the presence or absence of crosshairs or shading does not convey or indicate any preference or requirement for the specific material, material properties, dimensions, proportions, commonalities between the illustrated components, or any other characteristics, properties, etc., of the components. Furthermore, in the accompanying drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.
[0035] When a component is referred to as being "on" or "above" another component, "connected to," or "joined to" another component, the component may be directly on, directly connected to, or directly joined to the other component, or there may be intermediate components. However, when a component is referred to as being "directly on" another component, "directly connected to," or "directly joined to" another component, there are no intermediate components. Therefore, the term "connection" can refer to a physical connection, an electrical connection, etc., and may or may not have intermediate components.
[0036] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values that would be recognized by one of ordinary skill in the art.
[0037] The following text combines Figures 1 to 11 The data processing methods and data processing apparatus disclosed herein are described in detail.
[0038] Figure 1 This is a flowchart illustrating some embodiments of the data processing methods disclosed herein. Please refer to... Figure 1 The data processing method S100 provided in this disclosure includes:
[0039] S110: Receive a change request for the preset database. The change request includes the change type, the target effective start time and target sequence number of the data table to be changed. The preset database includes multiple preset data tables. Each preset data table includes a preset effective start time, a preset effective end time, a preset sequence number and a preset maximum version flag. The preset effective start time and preset sequence number are used to characterize the actual effective start time of the preset data table.
[0040] S120: Determine the target data table based on the target effective start time, target number, and change type. The target data table is one or more of the prior data table and the subsequent data table. The prior data table is a preset data table whose actual effective start time is earlier than the data table to be changed, and the subsequent data table is a preset data table whose actual effective start time is later than the data table to be changed.
[0041] S130: Perform simultaneous multi-version judgment on the data table to be changed and the target data table based on the effective start time of the target.
[0042] S140: Based on the change type, the determination of the target data table, and the judgment results of multiple versions at the same time, change one or more of the following: the preset effective end time of the target data table, the preset maximum version flag of the target data table, and the data table to be changed.
[0043] The data processing method disclosed herein adds a preset effective start time field, a preset effective end time field, a preset sequence number field, and a preset maximum version flag field to a preset data table. The addition of the preset sequence number field and the preset maximum version flag field allows for the effective storage of multiple versions of the data table simultaneously. The addition of the preset effective start time field and the preset effective end time field ensures temporal continuity among the multiple preset data tables. Therefore, when data changes are made to the preset database, the method can automatically modify one or more of the preset effective end time, the preset maximum version flag of the target data table, and the data table to be modified based on the change type, the determination of the target data table, and the judgment result of multiple versions simultaneously, thereby improving data processing efficiency.
[0044] Understandably, if a data table is generated every day and the effective data for each day is recorded in the data table, it will not be conducive to subsequent data changes, and it will consume a lot of storage resources. For example, backing up the previous day's effective data (such as employee position data) in the HR system every morning at midnight and generating a snapshot table by recording the data date can effectively record the effective data in the HR system every day, and historical effective data can be queried through the snapshot table. However, if the effective data in the HR system is recorded incorrectly due to human error, such as mistakenly recording an employee's position as position B instead of position A at the beginning of the year, and the employee's position has not actually changed from the beginning to the end of the year, then when the error is discovered at the end of the year, it is necessary to manually correct the position B recorded as position A in hundreds of snapshot tables stored throughout the year, which is a huge workload and inefficient. At the same time, as time accumulates, a large number of snapshot tables will consume a lot of storage resources. In addition, when processing business with high time requirements (such as onboarding, transfer, and resignation), real-time data is often required. Since the snapshot table is obtained from backups, the data recorded in it is not real-time data. Therefore, the snapshot table is not suitable for processing business with high time requirements, and its use cases are limited.
[0045] However, in the data processing method provided in this disclosure, the preset data table includes a preset effective start time, a preset effective end time, a preset sequence number, and a preset maximum version flag. This means that only one preset data table needs to be stored during the data's effective period. Therefore, if a data record is incorrect, it can be modified only in its corresponding preset data table, which is highly efficient. At the same time, since only one preset data table needs to be stored during the data's effective period, a significant amount of storage resources can be saved. Furthermore, since the preset data table includes a preset effective end time, it can represent real-time data, making it suitable for handling businesses with high timeliness requirements and applicable to a wider range of scenarios.
[0046] Specifically, the preset data table can be understood as a data table in the preset database. The preset data table stores preset basic data. The preset effective start time can be understood as the effective start time of the preset basic data in the preset data table. The preset effective end time can be understood as the effective end time of the preset basic data in the preset data table. The preset sequence number can be understood as the sequence number of the preset data table. The preset maximum version flag can be understood as the maximum version flag of the preset data table.
[0047] For example, in a data management scenario of a human resources system, a corresponding preset data table is generated for each employee, and all preset data tables are stored in a preset database. The preset basic data in these preset data tables constitutes the employee's personnel data. Furthermore, the preset data tables store the employee's personnel data, the effective start time of the personnel data, the effective end time of the personnel data, a preset sequence number, and a preset maximum version flag. The personnel data includes one or more of the following: organizational information, job title, employee basic information, and position information. Thus, the preset data tables can record each employee's historically effective personnel data, currently effective personnel data, and future effective personnel data. To facilitate understanding of the data processing method disclosed herein, the following will use a data management scenario of a human resources system as an example to provide a detailed explanation of the data processing method of this disclosure.
[0048] Furthermore, the change type includes one or more of the following: adding a data table, deleting a data table, and modifying the preset effective start time. Correspondingly, when the change type is adding a data table, the data table to be changed can be understood as the data table to be added; when the change type is deleting a data table, the data table to be changed can be understood as the data table to be deleted; when the change type is modifying the preset effective start time, the data table to be changed can be understood as the data table to be modified. Here, the data table to be added is the data table that will be stored in the preset database, while the data tables to be deleted and modified are data tables that are already stored in the preset database. The data table to be changed stores the basic data to be changed. The target effective start time can be understood as the effective start time of the basic data to be changed, the target effective end time can be understood as the effective end time of the basic data to be changed, the target sequence number can be understood as the sequence number of the data table to be changed, and the target maximum version flag can be understood as the maximum version flag of the data table to be changed.
[0049] For example, the effective start time includes year, month, and day, and the effective end time includes year, month, and day. When the effective start time is the same in multiple data tables for a certain employee, it indicates that the employee's personnel data has changed multiple times within one day. That is, the specific content of the personnel data in the multiple data tables for that employee within one day is different. Multiple data tables corresponding to the same employee within the same effective start time are considered multiple versions at the same time. The relationship between multiple versions at the same time is distinguished by a sequence number and a maximum version flag. The sequence numbers of the multiple data tables corresponding to the same employee within the same effective start time are all different. The maximum version flag of the data table with the latest actual effective start time among the multiple data tables corresponding to the same employee within the same effective start time is different from the maximum version flag of other data tables among the multiple data tables corresponding to the same employee within the same effective start time. The preset start time, preset end time, and preset sequence number of any two preset data tables for the same employee are different. The preset start time and preset end time can be used to display the preset basic data of the same employee and the same type for different effective periods in a timeline manner, thus ensuring the continuity of the data in time. The preset start time and preset sequence number can represent the actual effective start time of the preset basic data in the preset data table, thus supporting the existence of multiple data tables with the same preset start time (such as the same day) but different preset basic data content of the same type, without destroying the temporal continuity and data facts between the data. Here, data facts refer to the actual order of occurrence of the business represented by the preset basic data in terms of time.
[0050] For example, within the same effective start time, the serial numbers of multiple data tables corresponding to the same employee are sequentially increased in ascending order of their actual effective start time. That is, the larger the serial number, the later the actual effective start time. For instance, the serial number of the data table that actually takes effect at 10:00 AM is 0, the serial number of the data table that actually takes effect at 1:00 PM is 10, the serial number of the data table that actually takes effect at 6:00 PM is 20, and so on, increasing sequentially in increments of 10. Thus, for multiple versions of preset data tables operating simultaneously, the actual effective start time of the preset data tables can be effectively distinguished by combining the preset serial numbers of the preset data tables; for multiple versions of preset data tables operating at different times, the actual effective start time of the preset data tables can be effectively distinguished directly by using the preset effective start time of the preset data tables.
[0051] For example, the maximum version flag may include a preset maximum version status value or a preset non-maximum version status value. Within the same effective start time, the maximum version flag of the data table with the latest actual effective start time among multiple data tables belonging to the same employee is set to the preset maximum version status value (e.g., 1). The maximum version flag of the data tables other than the data table with the latest actual effective start time among multiple data tables belonging to the same employee within the same effective start time is set to the preset non-maximum version status value (e.g., 0). For instance, if a single employee has three data tables that are actually effective within a day, the maximum version flags of the first data table that is actually effective (serial number 0) and the second data table that is actually effective (serial number 10) are both 0, while the maximum version flag of the third data table that is actually effective (serial number 20) is 1. Thus, for multiple versions of preset data tables at the same time, the data table with the latest actual effective start time among the multiple preset data tables can be quickly and directly determined using the preset maximum version flag of the preset data tables.
[0052] Optionally, in step S140, based on the change type, the determination of the target data table, and the judgment result of multiple versions simultaneously, it is first determined whether to change only the data table to be changed, or to change both the data table to be changed and the preset effective end time of the target data table, or to change the preset effective end time of the target data table, the preset maximum version flag of the target data table, and the data table to be changed, and then perform the corresponding change. The determination of the target data table may include whether the target data table has been determined or not. The judgment result of multiple versions simultaneously may include whether the data table to be changed and the target data table are multiple versions simultaneously or multiple versions of the data table to be changed and the target data table are multiple versions of different times.
[0053] Optionally, the target data table can also be specified manually. For example, the change request may also include the target data table. Then, after step S110, step S120 can be skipped and steps S130 and S140 can be executed directly, thereby further improving data processing efficiency.
[0054] It should be noted that while refining the preset effective start time to the second or millisecond level allows for accurate differentiation of preset data tables that have changed multiple times within a day without adding a preset sequence number field or a preset maximum version flag field, it is difficult to allow users to input a specific preset effective start time down to the second or millisecond when querying the preset data table. However, it is relatively easy to allow users to input a specific preset effective start time down to the day. Therefore, in this disclosure, the preset effective start time is refined to the day and combined with the preset sequence number field and the preset maximum version flag field to differentiate preset data tables that have changed multiple times within a day.
[0055] Furthermore, while a preset sequence number field can distinguish multiple preset data tables with different versions at the same time, with only the preset sequence number field, if a user wants to query the preset data table with the latest actual effective start time among multiple preset data tables with different versions at the same time, the backend needs to compare the preset sequence numbers of multiple preset data tables with different versions at the same time multiple times until the maximum sequence number is determined. Then, the preset data table corresponding to the maximum sequence number is returned to the user as the preset data table with the latest actual effective start time. This involves a large amount of computation and low query efficiency. Therefore, in this disclosure, a preset maximum version flag field is added to the preset data table. In this way, when a user wants to query the preset data table with the latest actual effective start time among multiple preset data tables with different versions at the same time, the backend no longer needs to compare the preset sequence numbers of multiple preset data tables with different versions at the same time. It can directly return the preset data table with the preset maximum version flag set to the preset maximum version status value as the preset data table with the latest actual effective start time to the user, which reduces the amount of computation and improves query efficiency.
[0056] In some implementations, the preset effective start time, preset effective end time, target effective start time, and target effective end time are all in the form of timestamps. This can effectively ensure the accuracy of time and prevent the time continuity between preset data tables from being disrupted due to time differences in different regions.
[0057] Please see Figure 2 In some implementations, step S120 includes:
[0058] S121: Arrange multiple preset data tables in reverse order of preset effective start time and preset serial number.
[0059] S122: Determine the target data table from multiple pre-arranged data tables based on the target effective start time, target number, and change type.
[0060] In this way, the target data table can be quickly identified from multiple preset data tables, improving data processing efficiency.
[0061] Optionally, in step S121, multiple preset data tables are first arranged in reverse order of preset effective start time, and then multiple preset data tables with the same preset effective start time in the first arrangement are arranged in reverse order of preset sequence number.
[0062] Optionally, in step S122, the type of target data table to be determined is first determined according to the change type, that is, it is determined according to the change type whether the prior data table is determined as the target data table, the subsequent data table is determined as the target data table, or both the prior and subsequent data tables are determined as target data tables; then, the target data table corresponding to the type is determined from the preset database according to the target effective start time and the target sequence number.
[0063] Further, the step of determining the prior data table from the preset data table based on the target effective start time and the target sequence number includes: in the preset data table with the same preset effective start time and target effective start time, if there is a preset data table with a preset sequence number less than the target sequence number, then the preset data table with the smallest absolute value of the difference between the preset sequence number and the target sequence number in the preset data table with the preset sequence number less than the target sequence number can be determined as the prior data table, and the determination of the prior data table is determined as "a prior data table has been determined"; if there is no preset data table with a preset sequence number less than the target sequence number, then it is further determined whether there is a preset data table in the preset database with a preset effective start time earlier than the target effective start time. If there is, then the preset data table with the smallest absolute value of the difference between the preset effective start time and the target effective start time in the preset data table with the preset effective start time earlier than the target effective start time can be determined as the prior data table, and the determination of the prior data table is determined as "a prior data table has been determined"; otherwise, the determination of the prior data table is determined as "a prior data table has not been determined".
[0064] Similarly, the steps for determining the subsequent data table from the preset data table based on the target effective start time and the target sequence number include: In the preset data tables where the preset effective start time is the same as the target effective start time, if there exists a preset data table with a preset sequence number greater than the target sequence number, then the preset data table with the smallest absolute value of the difference between the preset sequence number and the target sequence number among the preset data tables with preset sequence numbers greater than the target sequence number is determined as the subsequent data table, and the determination of the subsequent data table is considered as "determined as a subsequent data table"; if there is no preset data table with a preset sequence number greater than the target sequence number, then it is further determined whether there exists a preset data table in the preset database with a preset effective start time later than the target effective start time. If so, then the preset data table with the smallest absolute value of the difference between the preset effective start time and the target effective start time among the preset data tables with preset effective start times later than the target effective start time is determined as the subsequent data table, and the determination of the subsequent data table is considered as "determined as a subsequent data table"; otherwise, the determination of the subsequent data table is considered as "not determined as a subsequent data table".
[0065] Please see Figure 3 In some implementations, step S130 includes:
[0066] S131: In response to the fact that the preset effective start time of the target data table is the same as the target effective start time of the data table to be changed, it is determined that the data table to be changed and the target data table are multiple versions at the same time.
[0067] S132: In response to the fact that the preset effective start time of the target data table is different from the target effective start time of the data table to be changed, it is determined that the data table to be changed and the target data table are multiple versions that are not at the same time.
[0068] In this way, the relationship between the target data table and the data table to be changed can be determined more accurately based on the preset effective start time and the target effective start time.
[0069] Specifically, if the preset effective start time of the prior data table is the same as the target effective start time of the data table to be changed, then the prior data table and the data table to be changed are determined to be multiple versions released simultaneously. If the preset effective start time of the prior data table is different from the target effective start time of the data table to be changed, then the prior data table and the data table to be changed are determined to be multiple versions released at different times. Similarly, if the preset effective start time of the subsequent data table is the same as the target effective start time of the data table to be changed, then the subsequent data table and the data table to be changed are determined to be multiple versions released simultaneously. If the preset effective start time of the subsequent data table is different from the target effective start time of the data table to be changed, then the subsequent data table and the data table to be changed are determined to be multiple versions released at different times.
[0070] In some implementations, step S140 includes:
[0071] S141: In response to a change type of adding a data table, and a prior data table is identified, and the prior data table and the target data table are multiple versions at the same time, the preset effective end time of the prior data table is updated to the effective start time of the target, and the preset maximum version flag of the prior data table is updated to the preset non-maximum version status value.
[0072] S142: In response to a change type of adding a data table, and a prior data table is identified, and the prior data table and the target data table are not multiple versions at the same time, the preset effective end time of the prior data table is updated to the time before the effective start time of the target data table, and the preset maximum version flag of the prior data table remains unchanged.
[0073] S143: In response to a change type of adding a new data table and not being determined as a subsequent data table, the latest preset time is used as the target effective end time of the data table to be changed, and the preset maximum version status value is used as the target maximum version flag of the data table to be changed. The data table to be changed is added in the preset database according to the target effective start time, target effective end time, target sequence number and target maximum version flag.
[0074] S144: In response to a change type of adding a data table, and a subsequent data table being determined, and the subsequent data table and the target data table being multiple versions at the same time, the preset effective start time of the subsequent data table is used as the target effective end time of the data table to be changed, and the preset non-maximum version status value is used as the target maximum version flag of the data table to be changed, and a new data table to be changed is added in the preset database according to the target effective start time, target effective end time, target sequence number and target maximum version flag.
[0075] S145: In response to a change type of adding a data table, and a subsequent data table being determined, and the subsequent data table and the target data table being multiple versions at different times, the time preceding the preset effective start time of the subsequent data table is taken as the target effective end time of the data table to be changed, and the preset maximum version status value is taken as the target maximum version flag of the data table to be changed, and a new data table to be changed is added in the preset database according to the target effective start time, target effective end time, target sequence number and target maximum version flag.
[0076] Thus, when the change type is adding a new data table, it can automatically change one or more of the following based on the determination of the prior and subsequent data tables and the judgment results of multiple versions at the same time: the preset effective end time of the prior data table, the preset maximum version flag of the prior data table, and the data table to be changed. This ensures that the data table to be changed is correctly added to the preset database, and that the correct time continuity is maintained among the preset data tables in the preset database after the data table to be changed is added.
[0077] For example, the preset non-maximum version status value is 0, the preset maximum version status value is 1, and the preset latest time is 2999.12.31. Assume the preset database includes preset data table 1, preset data table 2, and preset data table 3. Figure 4 As shown, the preset effective start time (effDate) of preset data table 1 is 2023.05.01, the preset effective end time (effEndDate) is 2023.05.09, the preset sequence number (seq) is 0, and the preset maximum version flag (maxVersion) is 1. The preset effective start time of preset data table 2 is 2023.05.10, the preset effective end time is 2023.05.09, the preset sequence number is 0, and the preset maximum version flag is 0; the preset effective end time is 2023.05.09, the preset sequence number is 0, and the preset maximum version flag is 1. The preset effective start time of preset data table 3 is 2023.05.10, the preset effective end time is 2999.12.31, the preset sequence number is 10, and the preset maximum version flag is 1. It should be noted that, to avoid redundancy, in... Figure 4In the example, the preset basic data of each preset data table is not shown. However, in actual applications, each preset data table also includes preset basic data.
[0078] Please combine Figure 5 If the target effective start time of the data table to be added 1 is 2023.05.10 and the target sequence number is 20, then it can be determined that the preset data table 3 is the prior data table, and the prior data table and the data table to be added 1 are multiple versions at the same time, and the subsequent data table has not been determined. Then, the preset effective end time of the preset data table 3 is updated to 2023.05.10 and the preset maximum version flag is updated to 0. The target effective end time of the data table to be added 1 is determined to be 2999.12.31 and the target maximum version flag is 1. Then, the data table to be added 1 is added to the preset database.
[0079] Please combine Figure 6 If the target effective start time of the data table to be added 2 is 2023.05.10 and the target sequence number is 5, then it can be determined that the preset data table 2 is the prior data table, and the prior data table and the data table to be added 2 are multiple versions at the same time. Furthermore, the preset data table 3 is the subsequent data table, and the subsequent data table and the data table to be added 2 are multiple versions at the same time. Then, the preset effective end time of the preset data table 2 is updated to 2023.05.10, the target effective end time of the data table to be added 2 is determined to be 2023.05.10, the target maximum version flag is 0, and the data table to be added 2 is added to the preset database.
[0080] Please combine Figure 7 If the target effective start time of the newly added data table 3 is 2023.05.01 and the target sequence number is 10, then it can be determined that the preset data table 1 is the prior data table, and the prior data table and the newly added data table 3 are multiple versions at the same time, and the preset data table 2 is the subsequent data table, and the subsequent data table and the newly added data table 3 are multiple versions at different times. Then, the preset effective end time of the preset data table 1 is updated to 2023.05.01 and the preset maximum version flag is updated to 0. The target effective end time of the newly added data table 3 is determined to be 2023.05.09 (i.e., the day before 2023.05.10) and the target maximum version flag is 1. Then, the newly added data table 3 is added to the preset database.
[0081] Please combine Figure 8If the target effective start time of the data table to be added 4 is 2023.04.26 and the target sequence number is 0, then it can be determined that the prior data table has not been determined, the preset data table 1 is the subsequent data table, and the subsequent data table and the data table to be added 4 are multiple versions that are not at the same time. Therefore, the target effective end time of the data table to be added 4 is determined to be 2023.04.30 (i.e. the day before 2023.05.01), the target maximum version flag is 1, and the data table to be added 4 is added to the preset database.
[0082] Please combine Figure 9 If the target effective start time of the newly added data table 5 is 2023.05.08 and the target sequence number is 0, then it can be determined that the preset data table 1 is the prior data table, and the prior data table and the newly added data table 5 are multiple versions at different times. Furthermore, the preset data table 2 is the subsequent data table, and the subsequent data table and the newly added data table 5 are multiple versions at different times. Therefore, the preset effective end time of the prior data table is updated to 2023.05.07 (i.e., the day before 2023.05.08), the preset maximum version flag of the prior data table remains unchanged at 1, and the target effective end time of the newly added data table 5 is determined to be 2023.05.09 (i.e., the day before 2023.05.10), the target maximum version flag is 1, and the newly added data table 5 is added to the preset database.
[0083] Please combine Figure 10 If the target effective start time of the newly added data table 6 is 2023.05.12 and the target sequence number is 0, then it can be determined that the preset data table 3 is the prior data table, and the prior data table and the newly added data table 6 are multiple versions that are not at the same time, and the subsequent data table has not been determined. Therefore, the preset effective end time of the prior data table will be updated to 2023.05.11 (i.e., the day before 2023.05.12), the preset maximum version flag of the prior data table will remain unchanged at 1, and the target effective end time of the newly added data table 6 will be determined to be 2999.12.31, the target maximum version flag will be 1, and the newly added data table 6 will be added to the preset database.
[0084] In some implementations, step S140 includes:
[0085] S146: In response to a change type of delete table and no prior table has been identified, delete the table to be changed directly.
[0086] S147: In response to a change type of deleting a data table, and a prior data table is identified, and the prior data table and the target data table are multiple versions at the same time, the preset effective end time of the prior data table is updated to the target effective end time of the data table to be changed, the preset maximum version flag of the prior data table is updated to the target maximum version flag of the data table to be changed, and the data table to be changed is deleted.
[0087] S148: In response to a change type of deleting a data table, and a prior data table is identified, and the prior data table and the target data table are not multiple versions at the same time, the preset effective end time of the prior data table is updated to the target effective end time of the data table to be changed, while keeping the preset maximum version flag of the prior data table unchanged, and the data table to be changed is deleted.
[0088] Thus, when the change type is to delete a data table, it can automatically change one or more of the following based on the determination of the prior data table and the judgment results of multiple versions at the same time: the preset effective end time of the prior data table, the preset maximum version flag of the prior data table, and the data table to be changed. This ensures that the data table to be changed in the preset database is correctly deleted, and that the correct time continuity between the preset data tables in the preset database is maintained after the data table to be changed is deleted.
[0089] In some implementations, preset basic data types that are allowed to be deleted are pre-configured. The change request also includes the type of preset basic data in the data table to be deleted. Therefore, before executing step S120, the method further includes: in response to the change type being "delete data table", determining whether the type of the preset basic data in the data table to be deleted is a preset basic data type that is allowed to be deleted; if yes, then executing step S120; if no, then terminating the change and issuing an illegal change prompt. In this way, the data security of the preset database is ensured, and the deletion of important data is prevented.
[0090] In some implementations, after step S110, the following steps are further included:
[0091] In response to a change type of modifying the preset effective start time, first delete the data table to be changed in the preset database, and then add a new data table based on the target effective start time and the deleted data table to be changed.
[0092] Thus, when the change type is to modify the preset effective start time, by first deleting the data table and then adding the data table, the preset effective start time of the preset data table in the preset database can be correctly modified, and the correct time continuity between the preset data tables in the preset database can be maintained after the preset effective start time of the preset data table is modified.
[0093] For example, when the preset effective start time of a preset data table in a preset database needs to be modified, the preset data table is identified as the data table to be modified, and the preset effective start time and preset sequence number in the preset data table are identified as the initial data of the data table to be modified. The user can manually input a change request with the change type being "modify preset effective start time". This change request includes the initial data of the data table to be modified, the target effective start time, and the target sequence number. Then, based on the initial data of the data table to be modified, the corresponding preset data table in the preset database can be determined. Next, the change type is determined to be "delete data table", and the corresponding preset data table in the preset database is identified as the data table to be deleted. The target data table is determined from the preset database based on the preset effective start time, preset sequence number, and change type of the data table to be deleted. Simultaneous multi-version judgment is performed on the data table to be deleted and the target data table based on the preset effective start time of the data table to be deleted. Finally, the determination of the change type and the target data table is considered. Based on the results of simultaneous multi-version checks, the preset effective end time of the existing data table, the preset maximum version flag of the existing data table, and one or more of the data tables to be deleted are modified. Next, the change type is determined to be a new data table, and the target effective start time and target sequence number of the data table to be modified in the change request are determined as the target effective start time and target sequence number of the new data table. Then, based on the target effective start time, target sequence number, and change type of the new data table, the target data table is determined from the preset database after deleting the aforementioned data tables. Simultaneous multi-version checks are performed on the new data table and the target data table based on the target effective start time of the new data table. Based on the change type, the determination of the target data table, and the results of simultaneous multi-version checks, the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data tables to be added are modified. Thus, the modification of the preset effective start time is completed.
[0094] In some implementations, after step S140, the following steps are also included:
[0095] S150: In response to the data in the data table to be changed being the currently effective data, update the preset real-time data table according to the data table to be changed.
[0096] S160: In response to the fact that the data in the data table to be changed is not currently effective data, the preset real-time data table remains unchanged.
[0097] In this way, when the currently effective data changes, the latest effective data can be synchronized to the preset real-time data table in a timely manner so that relevant personnel can view it.
[0098] Optionally, the preset database also includes a preset real-time data table, which stores currently active data in real time. The preset database provides a preset real-time data table query interface and a preset data table query interface. The preset real-time data table query interface is used to query the preset real-time data table, and the preset data table query interface is used to query the preset data table. Since there is only one preset real-time data table for a given user, while a user typically has more than one preset data table, the query efficiency for the preset real-time data table is higher than that for the preset data table. Because the preset real-time data table cannot store historical active data, and the data stored therein lacks temporal continuity, the preset real-time data table query interface is suitable for querying data for which historical active data is not relevant. Users can choose the appropriate query interface based on their actual query needs.
[0099] Furthermore, the absolute value of the difference between the target effective start time and the current time of the data table to be changed can be used to determine whether the data in the data table to be changed is currently effective data. For example, if the absolute value of the difference between the target effective start time and the current time of any preset data table is less than the absolute value of the difference between the target effective start time and the current time of the data table to be changed, then the data in the data table to be changed is determined to be non-currently effective data; otherwise, the data in the data table to be changed is determined to be currently effective data.
[0100] For example, when the data table to be changed is a data table to be added, if the data in the data table to be added is currently effective, then after adding the data table to the preset database, the data in the data table to be added is directly synchronized to the preset real-time data table, thereby overwriting the original data in the preset real-time data table. When the data table to be changed is a data table to be deleted, if the data in the data table to be deleted is currently effective, then the prior data table of the data table to be deleted is determined, and after deleting the data table to be deleted in the preset database, the data in the prior data table of the data table to be deleted is directly synchronized to the preset real-time data table, thereby overwriting the original data in the preset real-time data table. When the data table to be changed is a data table to be modified, if the data in the data table to be modified is currently effective, then after modifying the data table to be modified in the preset database, the data in the modified data table is directly synchronized to the preset real-time data table, thereby overwriting the original data in the preset real-time data table.
[0101] In some embodiments, the data processing method S100 further includes:
[0102] S170: Receive a query request to a preset database. The query request includes the type of data to be queried and the query conditions. The query conditions include the query identifier and the query time. The preset data table also includes a preset identifier and various preset basic data.
[0103] S180: Filter the data table to be displayed according to the query conditions. The data table to be displayed is a preset data table in the preset database with the same preset identifier as the query identifier, the preset effective start time is earlier than or equal to the query time, the preset effective end time is later than or equal to the query time, and the preset maximum version flag is the preset maximum version status value.
[0104] S190: Display the content of the basic data to be displayed in the data table to be displayed. The basic data to be displayed is the same type of preset basic data as the data to be queried.
[0105] In this way, when a user queries data in the preset database, a data point that matches the query time and has the latest actual start time can be quickly output, improving query efficiency.
[0106] Optionally, the types of preset basic data may include one or more of the following: start date, job ID, organization code, organization name, sequence group, job change type, and job change name. The query identifier and preset identifier can be employee identifiers. The preset database can store multiple preset data tables corresponding to different employees. Each employee has a different employee identifier. After determining the query identifier, the preset data table corresponding to the preset identifier with the same query identifier in the preset database can be uniquely identified.
[0107] For example, the data types to be queried include start date, job ID, organization code, and organization name. After receiving a query request to the preset database, the system first filters out preset data tables in the preset database that have the same preset identifier as the query identifier, a preset effective start time earlier than or equal to the query time, a preset effective end time later than or equal to the query time, and a preset maximum version flag that is the preset maximum version status value. The filtered preset data tables are then used as the data tables to be displayed. Next, the preset basic data in the data tables to be displayed, which are of the types of start date, job ID, organization code, and organization name, are displayed. Specifically, the data content of the start date, the data content of the job ID, the data content of the organization code, and the data content of the organization name are displayed.
[0108] In one example, an employee's employee ID is 30009290. In the preset database, there are three preset data tables corresponding to this employee ID: Preset Data Table 4, Preset Data Table 5, and Preset Data Table 6. In Preset Data Table 4, the organization name data content is "SaaS HR R&D Group," the preset effective start time is "2023.06.01," and the preset effective end time is "2999.12.31." In Preset Data Table 5, the organization name data content is "HR R&D Group," and the preset effective end time is... The effective start time is "2023.05.30" and the preset effective end time is "2023.05.31". In the preset data table 6, the data content of the organization name is "SaaS HR R&D Group", the preset effective start time is "2023.01.09" and the preset effective end time is "2023.05.29". It can be seen that the employee's organization name changed from "SaaS HR R&D Group" to "HR R&D Group" on 2023.05.30 and changed from "HR R&D Group" to "SaaS HR R&D Group" on 2023.06.01. Furthermore, if the query time is 2023.07.03 and the query data type is organization name, then it can be found that the organization name in which the employee was actually employed on 2023.07.03 is "SaaS Human Resources R&D Group"; if the query time is 2023.05.30 and the query data type is organization name, then it can be found that the organization name in which the employee was actually employed on 2023.05.30 is "Human Resources R&D Group".
[0109] Please see Figure 11 This disclosure also provides a data processing device 1000, which includes a receiving module 1002, a determining module 1004, a judging module 1006, and a changing module 1008.
[0110] The receiving module 1002 receives change requests to a preset database. The change request includes the change type, the target effective start time and target sequence number of the data table to be changed, and the preset database includes multiple preset data tables. Each preset data table includes a preset effective start time, a preset effective end time, a preset sequence number, and a preset maximum version flag. The preset effective start time and preset sequence number represent the actual effective start time of the preset data table. The determining module 1004 determines the target data table based on the target effective start time, target sequence number, and change type. The target data table can be one or more of a prior data table and a subsequent data table. The prior data table is a preset data table whose actual effective start time is earlier than the data table to be changed, and the subsequent data table is a preset data table whose actual effective start time is later than the data table to be changed. The judging module 1006 performs simultaneous multi-version judgment on the data table to be changed and the target data table based on the target effective start time. The change module 1008 is used to change one or more of the following based on the change type, the determination of the target data table, and the judgment results of multiple versions at the same time: the preset effective end time of the target data table, the preset maximum version flag of the target data table, and the data table to be changed.
[0111] In some implementations, the determining module 1004 is specifically used to: arrange multiple preset data tables in reverse order of preset effective start time and preset sequence number; and determine the target data table from the arranged multiple preset data tables according to the target effective start time, target sequence number and change type.
[0112] In some implementations, the determination module 1006 is specifically used to: determine that the data table to be changed and the target data table are multiple versions at the same time, in response to the preset effective start time of the target data table being the same as the target effective start time of the data table to be changed; and determine that the data table to be changed and the target data table are multiple versions at different times, in response to the preset effective start time of the target data table being different from the target effective start time of the data table to be changed.
[0113] In some implementations, the change module 1008 is specifically configured to: in response to a change type of adding a data table, and a prior data table being identified, and the prior data table and the target data table being multiple versions at the same time, update the preset effective end time of the prior data table to the target effective start time, and update the preset maximum version flag of the prior data table to a preset non-maximum version status value; in response to a change type of adding a data table, and a prior data table being identified, and the prior data table and the target data table being multiple versions at different times, update the preset effective end time of the prior data table to the time preceding the target effective start time, and keep the preset maximum version flag of the prior data table unchanged; in response to a change type of adding a data table, and no subsequent data table being identified, use the preset latest time as the target effective end time of the data table to be changed, and use the preset maximum version status value as the target maximum version flag of the data table to be changed, and, based on the target effective start time, target effective end time, target sequence number, and target maximum version flag, [further details to be added]. A new data table to be modified is added to the preset database. In response to a change type of "new data table," where the subsequent data table is identified and both the subsequent and target data tables are multiple versions released simultaneously, the preset effective start time of the subsequent data table is used as the target effective end time of the data table to be modified. A preset non-maximum version status value is used as the target maximum version flag of the data table to be modified. The new data table to be modified is then added to the preset database based on the target effective start time, target effective end time, target sequence number, and target maximum version flag. Similarly, in response to a change type of "new data table," where the subsequent data table is identified and both the subsequent and target data tables are multiple versions released simultaneously, the time preceding the preset effective start time of the subsequent data table is used as the target effective end time of the data table to be modified. A preset maximum version status value is used as the target maximum version flag of the data table to be modified. The new data table to be modified is then added to the preset database based on the target effective start time, target effective end time, target sequence number, and target maximum version flag.
[0114] In some implementations, the change module 1008 is specifically used for: directly deleting the data table to be changed in response to a change type of deleting a data table and no prior data table being identified; in response to a change type of deleting a data table, a prior data table being identified, and the prior data table and the target data table being multiple versions at the same time, updating the preset effective end time of the prior data table to the target effective end time of the data table to be changed, updating the preset maximum version flag of the prior data table to the target maximum version flag of the data table to be changed, and deleting the data table to be changed; in response to a change type of deleting a data table, a prior data table being identified, and the prior data table and the target data table being multiple versions at different times, updating the preset effective end time of the prior data table to the target effective end time of the data table to be changed, keeping the preset maximum version flag of the prior data table unchanged, and deleting the data table to be changed.
[0115] In some embodiments, the data processing apparatus 1000 further includes a modification module. This modification module is configured to, in response to a change type of modifying a preset effective start time, first delete a data table from a preset database containing data tables to be changed, and then add a new data table based on the target effective start time and the deleted data tables.
[0116] In some embodiments, the data processing apparatus 1000 further includes an update module. Specifically, the update module is used to: update a preset real-time data table according to the data table to be changed if the data in the data table to be changed is currently effective data; and keep the preset real-time data table unchanged if the data in the data table to be changed is not currently effective data.
[0117] In some embodiments, the data processing device 1000 further includes a query module, a filtering module, and a display module. The query module receives query requests to a preset database. The query request includes the type of data to be queried and query conditions. The query conditions include a query identifier and a query time. The preset data table also includes a preset identifier and various preset basic data. The filtering module filters out data tables to be displayed based on the query conditions. These data tables are preset data tables in the preset database whose preset identifier is the same as the query identifier, whose preset effective start time is earlier than or equal to the query time, whose preset effective end time is later than or equal to the query time, and whose preset maximum version flag is the preset maximum version status value. The display module displays the basic data to be displayed in the data tables. The basic data to be displayed is preset basic data of the same type as the query data.
[0118] Figure 11 This is a schematic block diagram of a data processing apparatus that employs a hardware implementation of a processing system, according to one embodiment of the present disclosure.
[0119] The apparatus may include corresponding modules that perform one or more steps in the flowchart above. Therefore, each or more steps in the flowchart above can be performed by a corresponding module, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform a corresponding step, or implemented by a processor configured to perform a corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented through some combination thereof.
[0120] This hardware architecture can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0121] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.
[0122] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).
[0123] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0124] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.
[0125] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0126] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware. The program can be stored in a readable storage medium, and when executed, the program includes one or a combination of the steps of the method implementation.
[0127] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0128] This disclosure also provides an electronic device, including: a memory storing execution instructions; and a processor or other hardware module executing the execution instructions stored in the memory, causing the processor or other hardware module to perform the above-described data processing method.
[0129] This disclosure also provides a readable storage medium storing executable instructions, which, when executed by a processor, are used to implement the data processing method described above.
[0130] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the data processing method described above.
[0131] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0132] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0133] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A data processing method, characterized in that, include: Receive a change request for a preset database. The change request includes the change type, the target effective start time and the target sequence number of the data table to be changed. The preset database includes multiple preset data tables. The preset data table includes a preset effective start time, a preset effective end time, a preset sequence number and a preset maximum version flag. The preset effective start time and the preset sequence number are used to characterize the actual effective start time of the preset data table. The target data table is determined based on the target effective start time, the target sequence number, and the change type. The target data table is one or more of a prior data table and a subsequent data table. The prior data table is a preset data table whose actual effective start time is earlier than the data table to be changed, and the subsequent data table is a preset data table whose actual effective start time is later than the data table to be changed. Based on the effective start time of the target, perform simultaneous multi-version judgment on the data table to be changed and the target data table; Based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time, the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data tables to be changed are modified.
2. The data processing method according to claim 1, characterized in that, The step of determining the target data table based on the target effective start time, the target sequence number, and the change type includes: The preset data tables are arranged in reverse order of preset effective start time and preset serial number; The target data table is determined from a plurality of pre-defined data tables arranged according to the target effective start time, the target sequence number, and the change type.
3. The data processing method according to claim 1, characterized in that, The step of performing simultaneous multi-version judgment on the data table to be changed and the target data table based on the effective start time of the target includes: In response to the fact that the preset effective start time of the target data table is the same as the target effective start time of the data table to be changed, it is determined that the data table to be changed and the target data table are multiple versions at the same time; In response to the fact that the preset effective start time of the target data table is different from the target effective start time of the data table to be changed, it is determined that the data table to be changed and the target data table are multiple versions that are not released at the same time.
4. The data processing method according to claim 3, characterized in that, The step of changing one or more of the following based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time, includes: In response to the change type being a new data table, and the prior data table being identified, and the prior data table and the target data table being multiple versions at the same time, the preset effective end time of the prior data table is updated to the effective start time of the target data table, and the preset maximum version flag of the prior data table is updated to a preset non-maximum version status value. In response to the change type being the new data table, and the prior data table being identified, and the prior data table and the target data table being multiple versions not at the same time, the preset effective end time of the prior data table is updated to the time before the effective start time of the target data table, while keeping the preset maximum version flag of the prior data table unchanged. In response to the change type being the newly added data table and the subsequent data table not being determined, a preset latest time is set as the target effective end time of the data table to be changed, and a preset maximum version status value is set as the target maximum version flag of the data table to be changed. The data table to be changed is then added to the preset database according to the target effective start time, the target effective end time, the target sequence number, and the target maximum version flag. In response to the change type being the newly added data table, and the subsequent data table being determined, and the subsequent data table and the target data table being multiple versions at the same time, the preset effective start time of the subsequent data table is used as the target effective end time of the data table to be changed, and the preset non-maximum version status value is used as the target maximum version flag of the data table to be changed. The data table to be changed is added to the preset database according to the target effective start time, the target effective end time, the target sequence number, and the target maximum version flag. In response to the change type being the newly added data table, and the subsequent data table being determined, and the subsequent data table and the target data table being multiple versions at different times, the time preceding the preset effective start time of the subsequent data table is taken as the target effective end time of the data table to be changed, and the preset maximum version status value is taken as the target maximum version flag of the data table to be changed. Furthermore, the data table to be changed is added to the preset database according to the target effective start time, the target effective end time, the target sequence number, and the target maximum version flag.
5. The data processing method according to claim 3, characterized in that, The step of changing one or more of the following based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time, includes: In response to the change type being a deletion of a data table, and the prior data table not being identified, the data table to be changed is directly deleted; In response to the change type being a deleted data table, and the prior data table being identified, and the prior data table and the target data table being multiple versions at the same time, the preset effective end time of the prior data table is updated to the target effective end time of the data table to be changed, the preset maximum version flag of the prior data table is updated to the target maximum version flag of the data table to be changed, and the data table to be changed is deleted. In response to the change type being a deleted data table, and the prior data table being identified, and the prior data table and the target data table being multiple versions not occurring at the same time, the preset effective end time of the prior data table is updated to the target effective end time of the data table to be changed, while keeping the preset maximum version flag of the prior data table unchanged, and the data table to be changed is deleted.
6. The data processing method according to claim 1, characterized in that, After receiving the request to change the preset database, the method further includes: In response to the change type being a modification of the preset effective start time, the data table to be changed in the preset database is first deleted, and then a new data table is created based on the target effective start time and the deleted data table.
7. The data processing method according to any one of claims 1 to 6, characterized in that, After modifying the preset effective end time of the target data table, the preset maximum version flag of the target data table, and one or more of the data tables to be modified based on the change type, the determination of the target data table, and the judgment result of multiple versions at the same time, the method further includes: In response to the fact that the data in the data table to be changed is currently effective data, the preset real-time data table is updated according to the data table to be changed. If the data in the data table to be changed is not currently effective, the preset real-time data table remains unchanged.
8. The data processing method according to any one of claims 1 to 6, characterized in that, Also includes: Receive a query request to the preset database. The query request includes the type of data to be queried and the query conditions. The query conditions include a query identifier and a query time. The preset data table also includes a preset identifier and various preset basic data. The data table to be displayed is selected based on the query conditions. The data table to be displayed is a preset data table in the preset database where the preset identifier is the same as the query identifier, the preset effective start time is earlier than or equal to the query time, the preset effective end time is later than or equal to the query time, and the preset maximum version flag is the preset maximum version status value. The basic data to be displayed in the data table to be displayed is a preset basic data of the same type as the query data.
9. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes execution instructions stored in the memory, causing the processor to perform the data processing method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that, The readable storage medium stores execution instructions, which, when executed by a processor, are used to implement the data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for storing and managing historical data
CN105095457A
Database version control
US8719226B1