CN117472906A - Data processing method, electronic device and readable storage medium - Google Patents

Data processing method, electronic device and readable storage medium Download PDF

Info

Publication number
CN117472906A
CN117472906A CN202311442282.6A CN202311442282A CN117472906A CN 117472906 A CN117472906 A CN 117472906A CN 202311442282 A CN202311442282 A CN 202311442282A CN 117472906 A CN117472906 A CN 117472906A
Authority
CN
China
Prior art keywords
data table
preset
target
time
changed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311442282.6A
Other languages
Chinese (zh)
Inventor
孙鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seashell Housing Beijing Technology Co Ltd
Original Assignee
Seashell Housing Beijing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seashell Housing Beijing Technology Co Ltd filed Critical Seashell Housing Beijing Technology Co Ltd
Priority to CN202311442282.6A priority Critical patent/CN117472906A/en
Publication of CN117472906A publication Critical patent/CN117472906A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides a data processing method, including: receiving a change request for a preset database, wherein the change request comprises a change type, a target effective starting time and a target serial number of a data table to be changed, the preset database comprises a plurality of preset data tables, and the preset data tables comprise a preset effective starting time, a preset effective ending time, a preset serial number and a preset maximum version mark; determining a target data table according to the target effective starting time, the target sequence number and the change type; performing simultaneous multi-version judgment on the data table to be changed and the target data table according to the target effective starting time; and changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed according to the change type, the determination condition of the target data table and the judgment result of the multiple versions. The present disclosure also provides an electronic device and a readable storage medium.

Description

Data processing method, electronic device and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method, an electronic device, and a readable storage medium.
Background
With the continuous development of computer technology, various data are continuously generated, and the data storage modes are various.
In the related art, a data table is generated one day, validation data of each day is recorded in the data table, and the data table is stored in a database. Because the data tables generated every day are mutually independent, when effective data in one data table is changed, if other data tables are not correspondingly changed, data confusion can be caused, and follow-up data tracing is not facilitated; if other data tables are changed, corresponding data in a plurality of data tables need to be manually changed one by one, so that the workload is high and the efficiency is low.
That is, the related art has a problem that the data processing efficiency is low due to an unreasonable data storage manner.
Disclosure of Invention
To solve at least one of the above technical problems, the present disclosure provides a data processing method, apparatus, electronic device, readable storage medium, and product.
The first aspect of the present disclosure provides a data processing method, including: receiving a change request for a preset database, wherein the change request comprises a change type, a target effective starting time and a target serial number of a data table to be changed, the preset database comprises a plurality of preset data tables, the preset data tables comprise preset effective starting time, preset effective ending time, preset serial number and preset maximum version marks, and the preset effective starting time and the preset serial number are used for representing the actual effective starting time of the preset data tables; determining a target data table according to the target effective starting time, the target sequence number and the change type, wherein the target data table is one or more of a previous data table and a subsequent data table, the previous data table is a preset data table with the actual effective starting time earlier than the data table to be changed, and the subsequent data table is a preset data table with the actual effective starting time later than the data table to be changed; performing simultaneous multi-version judgment on the data table to be changed and the target data table according to the target effective starting time; and changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed according to the change type, the determination condition of the target data table and the judgment result of the multiple versions at the same time.
In some embodiments, the determining a target data table based on the target validation start time, the target sequence number, and the change type includes: arranging a plurality of preset data tables according to a mode of reverse order of preset effective starting time and reverse order of preset sequence numbers; and determining a target data table from the arranged plurality of preset data tables according to the target effective starting time, the target sequence number and the change type.
In some embodiments, the performing the simultaneous multi-version determination on the to-be-changed data table and the target data table according to the target validation start time includes: determining that the data table to be changed and the target data table are in the same time multi-version in response to the fact that the preset effective starting time of the target data table is the same as the target effective starting time of the data table to be changed; and determining that the data table to be changed and the target data table are in non-time multi-version in response to the fact that the preset effective starting time of the target data table is different from the target effective starting time of the data table to be changed.
In some embodiments, the changing one or more of the preset valid ending time of the target data table, the preset maximum version flag of the target data table and the data table to be changed according to the changing type, the determining condition of the target data table and the judging result of the multiple versions at the same time includes: in response to the change type being a new added data table, determining the previous data table and the target data table being the simultaneous multi-version, updating a preset effective ending time of the previous data table to the target effective starting time, and updating a preset maximum version mark of the previous data table to a preset non-maximum version state value; responding to the change type as the newly added data table, determining the previous data table and the target data table as the non-time multi-version, updating the preset effective ending time of the previous data table to the time before the target effective starting time, and keeping the preset maximum version mark of the previous data table unchanged; responding to the change type as the newly added data table, and not determining the later data table, taking a preset latest time as a target effective ending time of the data table to be changed, taking a preset maximum version state value as a target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target sequence number and the target maximum version mark; responding to the change type as the newly added data table, determining the later data table and the target data table as the simultaneous multi-version, taking the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking the preset non-maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target sequence number and the target maximum version mark; and responding to the change type as the newly added data table, determining the later data table and the target data table as the non-time multi-version, taking the time before the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking a preset maximum version state value as a target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
In some embodiments, the changing one or more of the preset valid ending time of the target data table, the preset maximum version flag of the target data table and the data table to be changed according to the changing type, the determining condition of the target data table and the judging result of the multiple versions at the same time includes: directly deleting the data table to be changed in response to the change type being a deleted data table and the prior data table not being determined; in response to the change type being a delete data table and determining that the prior data table and the target data table are the simultaneous multi-version, updating a preset effective ending time of the prior data table to a target effective ending time of the data table to be changed, updating a preset maximum version flag of the prior data table to a target maximum version flag of the data table to be changed, and deleting the data table to be changed; and in response to the change type being a deletion data table, determining that the previous data table and the target data table are the non-time multi-version, updating the preset effective ending time of the previous data table to the target effective ending time of the data table to be changed, keeping the preset maximum version mark of the previous data table unchanged, and deleting the data table to be changed.
In some embodiments, after receiving the change request to the preset database, the method further includes: and in response to the change type being the modification preset effective starting time, firstly, deleting the data table of the data table to be changed in the preset database, and then, executing a new data table according to the target effective starting time and the deleted data table to be changed.
In some embodiments, after the changing one or more of the preset valid ending time of the target data table, the preset maximum version flag of the target data table and the data table to be changed according to the changing type, the determining condition of the target data table and the judging result of the multiple versions at the same time, the method further includes: responding to the data in the data table to be changed as the current effective data, and updating a preset real-time data table according to the data table to be changed; and responding to the data in the data table to be changed as non-current effective data, and keeping the preset real-time data table unchanged.
In some embodiments, further comprising: receiving a query request for the preset database, wherein the query request comprises a query data type and a query condition, the query condition comprises a query identifier and a query time, and the preset data table further comprises a preset identifier and various preset basic data; screening a data table to be displayed according to the query condition, wherein the data table to be displayed is a preset data table in which the preset identification is the same as the query identification in the preset database, the preset effective starting time is longer than or equal to the query time, the preset effective ending time is longer than or equal to the query time, and the preset maximum version mark is a preset maximum version state value; and carrying out content display on the basic data to be displayed in the data table to be displayed, wherein the basic data to be displayed is preset basic data with the same type as the query data.
A second aspect of the present disclosure provides a data processing apparatus comprising: the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a change request of a preset database, the change request comprises a change type, a target effective starting time and a target serial number of a data table to be changed, the preset database comprises a plurality of preset data tables, the preset data tables comprise a preset effective starting time, a preset effective ending time, a preset serial number and a preset maximum version mark, and the preset effective starting time and the preset serial number are used for representing the actual effective starting time of the preset data tables; the determining module is used for determining a target data table according to the target effective starting time, the target sequence number and the change type, wherein the target data table is one or more of a previous data table and a later data table, the previous data table is a preset data table with the actual effective starting time earlier than the data table to be changed, and the later data table is a preset data table with the actual effective starting time later than the data table to be changed; the judging module is used for judging the to-be-changed data table and the target data table in the same time and multiple versions according to the target effective starting time; and the change module is used for changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed according to the change type, the determination condition of the target data table and the judgment result of the simultaneous multi-version.
A third aspect of the present disclosure provides an electronic device, comprising: a memory storing execution instructions; and the processor executes the execution instructions stored in the memory, so that the processor executes the data processing method according to any embodiment of the disclosure.
A fourth aspect of the present disclosure provides a readable storage medium having stored therein execution instructions which, when executed by a processor, are to implement a data processing method according to any embodiment of the present disclosure.
A fifth aspect of the present disclosure provides a computer program product comprising computer programs/instructions which when executed by a processor implement a data processing method according to any of the embodiments of the present disclosure.
According to the data processing method, the device, the electronic equipment, the readable storage medium and the product, the preset effective starting time field, the preset effective ending time field, the preset sequence number field and the preset maximum version mark field are added in the preset data table, the preset sequence number field and the preset maximum version mark field are added to enable the multi-version data table to be effectively stored, the preset effective starting time field and the preset effective ending time field are added to enable time continuity among the plurality of preset data tables, and further when the preset database is subjected to data change, one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed can be automatically changed according to the change type, the determination condition of the target data table and the judgment result of the multiple versions in time, so that the data processing efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the disclosure and together with the description serve to explain the principles of the disclosure.
Fig. 1 is a flow diagram of a data processing method of some embodiments of the present disclosure.
Fig. 2 is another flow diagram of a data processing method of some embodiments of the present disclosure.
Fig. 3 is yet another flow diagram of a data processing method of some embodiments of the present disclosure.
Fig. 4 is a visual example diagram of preset data table 1, preset data table 2, and preset data table 3 of some embodiments of the present disclosure.
Fig. 5 is a visual example diagram of a preset data table 1, a preset data table 2, a preset data table 3, and a data table 1 to be newly added to a preset database according to some embodiments of the present disclosure.
Fig. 6 is a visual example diagram of a preset data table 1, a preset data table 2, a preset data table 3, and a data table 2 to be newly added after a new data table 2 is newly added to a preset database according to some embodiments of the present disclosure.
Fig. 7 is a visual illustration of preset data table 1, preset data table 2, preset data table 3, and to-be-added data table 3 after a new to-be-added data table 3 is newly added to a preset database according to some embodiments of the present disclosure.
Fig. 8 is a visual illustration of preset data table 1, preset data table 2, preset data table 3, and preset data table 4 after a new data table 4 is added to a preset database according to some embodiments of the present disclosure.
Fig. 9 is a diagram of a visual example of a preset data table 1, a preset data table 2, a preset data table 3, and a data table 5 to be newly added to a preset database according to some embodiments of the present disclosure.
Fig. 10 is a diagram of a visual example of a preset data table 1, a preset data table 2, a preset data table 3, and a data table 6 to be newly added to a preset database according to some embodiments of the present disclosure.
FIG. 11 is a block diagram of a data processing apparatus employing a hardware implementation of a processing system according to one embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and the embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant content and not limiting of the present disclosure. It should be further noted that, for convenience of description, only a portion relevant to the present disclosure is shown in the drawings.
In addition, embodiments of the present disclosure and features of the embodiments may be combined with each other without conflict. The technical aspects of the present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Unless otherwise indicated, the exemplary implementations/embodiments shown are to be understood as providing exemplary features of various details of some ways in which the technical concepts of the present disclosure may be practiced. Thus, unless otherwise indicated, features of the various implementations/embodiments may be additionally combined, separated, interchanged, and/or rearranged without departing from the technical concepts of the present disclosure.
The use of cross-hatching and/or shading in the drawings is typically used to clarify the boundaries between adjacent components. As such, the presence or absence of cross-hatching or shading does not convey or represent any preference or requirement for a particular material, material property, dimension, proportion, commonality between illustrated components, and/or any other characteristic, attribute, property, etc. of a component, unless indicated. In addition, in the drawings, the size and relative sizes of elements may be exaggerated for clarity and/or descriptive purposes. While the exemplary embodiments may be variously implemented, the specific process sequences may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in reverse order from that described. Moreover, like reference numerals designate like parts.
When an element is referred to as being "on" or "over", "connected to" or "coupled to" another element, it can be directly on, connected or coupled to the other element or intervening elements may be present. However, when an element is referred to as being "directly on," "directly connected to," or "directly coupled to" another element, there are no intervening elements present. For this reason, the term "connected" may refer to physical connections, electrical connections, and the like, with or without intermediate components.
The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Furthermore, when the terms "comprises" and/or "comprising," and variations thereof, are used in the present specification, the presence of stated features, integers, steps, operations, elements, components, and/or groups thereof is described, but the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof is not precluded. It is also noted that, as used herein, the terms "substantially," "about," and other similar terms are used as approximation terms and not as degree terms, and as such, are used to explain the inherent deviations of measured, calculated, and/or provided values that would be recognized by one of ordinary skill in the art.
The data processing method and the data processing apparatus of the present disclosure and the like are described in detail below with reference to fig. 1 to 11.
Fig. 1 is a flow diagram of a data processing method of some embodiments of the present disclosure. Referring to fig. 1, a data processing method S100 provided in the present disclosure includes:
s110: receiving a change request for a preset database, wherein the change request comprises a change type, a target effective starting time and a target serial number of a data table to be changed, the preset database comprises a plurality of preset data tables, the preset data tables comprise preset effective starting time, preset effective ending time, preset serial number and preset maximum version marks, and the preset effective starting time and the preset serial number are used for representing the actual effective starting time of the preset data tables.
S120: and determining a target data table according to the target effective starting time, the target sequence number and the change type, wherein the target data table is one or more of a preceding data table and a following data table, the preceding data table is a preset data table of which the actual effective starting time is earlier than the data table to be changed, and the following data table is a preset data table of which the actual effective starting time is later than the data table to be changed.
S130: and carrying out simultaneous multi-version judgment on the data table to be changed and the target data table according to the target effective starting time.
S140: and changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed according to the change type, the determination condition of the target data table and the judgment result of the multiple versions.
According to the data processing method, the preset effective starting time field, the preset effective ending time field, the preset sequence number field and the preset maximum version mark field are added in the preset data table, the preset sequence number field and the preset maximum version mark field are added to enable the multi-version data table to be effectively stored, the preset effective starting time field and the preset effective ending time field are added to enable time continuity among the plurality of preset data tables, and further when the preset database is subjected to data change, one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed can be automatically changed according to the change type, the determination condition of the target data table and the judgment result of the multi-version at the same time, so that the data processing efficiency is improved.
It will be appreciated that if a data table is created on a daily basis, the daily validation data is recorded in the data table, which on the one hand is detrimental to subsequent data changes and on the other hand consumes a significant amount of memory resources. For example, backup a part of effective data (such as employee post data) in a personnel system of the previous day every early morning and record data date to generate a snapshot table, so that although effective data in the personnel system of each day can be effectively recorded and historical effective data can be queried through the snapshot table, if the effective data in the personnel system is recorded as a B post by human negligence, for example, the employee post is wrongly recorded as a B post in the early year, and the employee post is not actually changed from the early year to the end of year, when the employee post is found to be recorded as a wrong by the end of year, the B post recorded in hundreds of snapshot tables stored in the whole year needs to be manually modified as the A post, so that the workload is huge and the efficiency is low; meanwhile, a large number of snapshot tables need to consume a large amount of storage resources as time accumulates; in addition, real-time data is often required when handling services with high timeliness requirements (e.g., job entry, transfer, job departure), and because the snapshot table is obtained by backup, the recorded data is not real-time data, and thus the snapshot table is not suitable for handling services with high timeliness requirements, and the use scenario is limited.
However, in the data processing method provided by the present disclosure, the preset data table includes a preset validation start time, a preset validation end time, a preset sequence number and a preset maximum version flag, so that only one preset data table can be stored during the validation period of data, and if the data is recorded in error, the data can be modified only in the corresponding preset data table, which has higher efficiency; meanwhile, only one preset data table can be stored in the effective period of the data, so that a large amount of storage resources can be saved; in addition, the preset data table comprises the preset effective ending time, so that real-time data can be represented, the method is suitable for handling the service with higher timeliness requirement, and the use scene is more.
Specifically, the preset data table may be understood as a data table in the preset database, the preset data table stores preset basic data, the preset validation start time may be understood as the validation start time of the preset basic data in the preset data table, the preset validation end time may be understood as the validation end time of the preset basic data in the preset data table, the preset sequence number may be understood as the sequence number of the preset data table, and the preset maximum version flag may be understood as the maximum version flag of the preset data table.
In the data management scenario of the personnel system, a corresponding preset data table is generated for each employee respectively, all preset data tables are stored in a preset database, at this time, preset basic data in the preset data table is personnel data of the employee, and further personnel data of the employee, effective starting time of the personnel data, effective ending time of the personnel data, preset serial numbers and preset maximum version marks are stored in the preset data table, wherein the personnel data comprises one or more of organization information, job positions, basic information of the employee and position information. Thus, the personnel data, the currently effective personnel data and the future effective personnel data of each employee can be recorded through the preset data table. In order to facilitate understanding of the data processing method of the present disclosure, a data management scenario of a personnel system will be taken as an example, and the data processing method of the present disclosure will be described in detail below.
Further, the change type includes one or more of adding a data table, deleting a data table, and modifying a preset effective start time. Correspondingly, when the change type is a new data table, the data table to be changed can be understood as the data table to be newly added; when the change type is the deletion data table, the data table to be changed can be understood as the data table to be deleted; when the change type is to modify the preset effective starting time, the data table to be changed can be understood as a data table to be modified, wherein the data table to be newly added is a data table to be stored in a preset database, and the data table to be deleted and the data table to be modified are data tables already stored in the preset database. The to-be-changed data table stores to-be-changed basic data, the target effective starting time can be understood as the effective starting time of the to-be-changed basic data, the target effective ending time can be understood as the effective ending time of the to-be-changed basic data, the target sequence number can be understood as the sequence number of the to-be-changed data table, and the target maximum version mark can be understood as the maximum version mark of the to-be-changed data table.
The effective starting time includes year, month and day, and the effective ending time includes year, month and day, when the effective starting times in the multiple data tables of a certain employee are the same, the personnel data of the employee are changed for multiple times in a day, that is, the specific contents of the personnel data in the multiple data tables of the employee in a day are different, and the multiple data tables corresponding to the same employee in the same effective starting time are in multiple versions in time. And distinguishing the relation between the multiple versions at the same time by adopting the serial numbers and the maximum version marks, wherein the serial numbers of the data tables corresponding to the same staff in the same effective starting time are different, and the maximum version mark of the data table with the latest actual effective starting time in the data tables corresponding to the same staff in the same effective starting time is different from the maximum version marks of other data tables in the data tables corresponding to the same staff in the same effective starting time. The preset effective starting time, the preset effective ending time and the preset serial number of any two preset data tables of the same staff are different, and the preset basic data of different effective periods, the same staff and the same type can be displayed in a time axis mode through the preset effective starting time and the preset effective ending time, so that the data have time continuity; the actual effective starting time of the preset basic data in the preset data table can be represented through the preset effective starting time and the preset serial number, so that a plurality of data tables with the same preset effective starting time but different preset basic data contents of the same type exist in the same preset effective starting time (like one day), and the time continuity and the data facts among the data are not destroyed, wherein the data facts refer to the actual occurrence sequence of the business represented by the preset basic data in terms of time.
Illustratively, the serial numbers of the multiple data tables corresponding to the same employee in the same validation start time are sequentially incremented from early to late in the actual validation start time, that is, the larger the serial number is, the later the actual validation start time is, for example, the serial number of the data table in which the actual 10:00 starts to be validated in the same employee in one day is 0, the serial number of the data table in which the actual 13:00 starts to be validated is 10, the serial number of the data table in which the actual 18:00 starts to be validated is 20, and so on, in a manner of 10 increment step. Thus, for the preset data table with multiple versions at the same time, the actual effective starting time of the preset data table can be effectively distinguished by combining the preset sequence number of the preset data table; for the preset data table with non-time multiple versions, the preset effective starting time of the preset data table can be directly adopted to effectively distinguish the actual effective starting time of the preset data table.
For example, the maximum version flag may include a preset maximum version state value or a preset non-maximum version state value, where the maximum version flag of the data table with the latest actual validation start time among the plurality of data tables corresponding to the same employee in the same validation start time takes the preset maximum version state value (e.g. 1), and the maximum version flag of the data table with the latest actual validation start time among the plurality of data tables corresponding to the same employee in the same validation start time takes the preset non-maximum version state value (e.g. 0). For example, if three actual effective data tables are available in the same employee in one day, the maximum version flag of the first actual effective data table (with the serial number of 0) and the maximum version flag of the second actual effective data table (with the serial number of 10) are both 0, and the maximum version flag of the third actual effective data table (with the serial number of 20) is 1. Therefore, aiming at the preset data tables with multiple versions at the same time, the latest data table of the actual effective starting time in the preset data tables can be rapidly and directly determined through the preset maximum version mark of the preset data table.
Optionally, in step S140, 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 ending time of the target data table, or to change the preset effective ending time of the target data table, the preset maximum version flag of the target data table, and the data table to be changed according to the change type, the determination condition of the target data table, and the determination result of the multiple versions of the time, and then the corresponding change is performed. The determination of the target data table may include determining the target data table or not determining the target data table. The determination result of the same-time multi-version may include that the data table to be changed and the target data table are in a same-time multi-version or that the data table to be changed and the target data table are in different-time multi-version.
Optionally, the target data table may be manually specified, for example, the change request further includes the target data table, and after step S110, step S120 may be skipped, and step S130 and step S140 may be directly performed, so as to further improve data processing efficiency.
It should be noted that if the preset validation start time is accurate to the second level or the millisecond level, although the preset data table that is changed many times in one day can be accurately distinguished only by the preset validation start time without increasing the preset sequence number field and the preset maximum version flag field, when the user inquires the preset data table, it is difficult to implement to let the user input a preset validation start time specific to the second or the millisecond level, and it is relatively easy to implement to let the user input a preset validation start time specific to the day, so in the present disclosure, the preset validation start time is accurate to the day, and the preset data table that is changed many times in one day is distinguished by combining the preset sequence number field and the preset maximum version flag field.
In addition, although the multiple preset data tables of the same time and multiple versions can be distinguished through the preset sequence number field, under the condition that only the preset sequence number field is needed to query the preset data table with the latest actual effective start time in the multiple preset data tables of the same time and multiple versions, the background is not needed to compare the preset sequence numbers of the multiple preset data tables of the same time and multiple versions for many times until the maximum sequence number in the preset sequence numbers of the multiple preset data tables is determined, then the preset data table corresponding to the maximum sequence number is fed back to the user as the preset data table with the latest actual effective start time, so that the calculated amount is larger, the query efficiency is lower, therefore, in the present disclosure, the preset maximum version flag field is added in the preset data table, when the user wants to query the preset data table with the latest actual effective start time in the multiple preset data tables of the same time and multiple versions, the background is not needed to compare the preset sequence numbers of the multiple preset data tables of the same time and multiple versions, the preset maximum version flag is directly taken as the preset data table with the latest actual effective start time, and the preset maximum version flag value in the multiple preset data tables of the same time and multiple versions is directly fed back to the user, so that the actual data can be calculated, and the actual data can be reduced.
In some embodiments, the preset effective starting time, the preset effective ending time, the target effective starting time and the target effective ending time are all in the form of time stamps, so that the accuracy of time can be effectively ensured, and the time continuity between preset data tables is prevented from being damaged due to time differences in different areas.
Referring to fig. 2, in some embodiments, step S120 includes:
s121: and arranging a plurality of preset data tables according to a mode of reverse order of preset effective starting time and reverse order of preset sequence numbers.
S122: and determining a target data table from the arranged plurality of preset data tables according to the target effective starting time, the target sequence number and the change type.
Therefore, the target data table can be determined from a plurality of preset data tables rapidly, and the data processing efficiency is improved.
Optionally, in step S121, a first arrangement is performed on the plurality of preset data tables according to a reverse order of preset valid start times, and then a second arrangement is performed on the plurality of preset data tables with the same preset valid start times in the first arrangement result according to a reverse order of preset sequence numbers.
Optionally, in step S122, the type of the target data table to be determined is determined according to the change type, that is, whether the previous data table is determined as the target data table, the subsequent data table is determined as the target data table, or both the previous data table and the subsequent data table are determined as the target data table is determined according to the change type; and determining a target data table corresponding to the category from a preset database according to the target effective starting time and the target sequence number.
Further, the step of determining the previous data table from the preset data table according to the target effective starting time and the target sequence number comprises the following steps: if the preset data table with the preset serial number smaller than the target serial number exists in the preset data table with the preset effective starting time being the same as the target effective starting time, the preset data table with the smallest absolute value of the difference between the preset serial number and the target serial number in the preset data table with the preset serial number smaller than the target serial number can be determined as the prior data table, and the determination condition of the prior data table is determined as the prior data table; if the preset data table with the preset sequence number smaller than the target sequence number does not exist, further judging whether the preset data table with the preset effective starting time earlier than the target effective starting time exists in the preset database, if so, determining the preset data table with the minimum absolute value of the difference between the preset effective starting time and the target effective starting time in the preset data table with the preset effective starting time earlier than the target effective starting time as a prior data table, determining the determination condition of the prior data table as a determination prior data table, and otherwise, determining the determination condition of the prior data table as an undetermined prior data table.
Similarly, the step of determining the subsequent data table from the preset data table according to the target effective starting time and the target sequence number comprises the following steps: if the preset data table with the preset serial number larger than the target serial number exists in the preset data table with the preset effective starting time being the same as the target effective starting time, the preset data table with the smallest absolute value of the difference between the preset serial number and the target serial number in the preset data table with the preset serial number larger than the target serial number can be determined as the subsequent data table, and the determination condition of the subsequent data table is determined as the subsequent data table; if the preset data table with the preset sequence number being larger than the target sequence number does not exist, further judging whether the preset data table with the preset effective starting time being later than the target effective starting time exists in the preset database, if so, determining the preset data table with the minimum absolute value of the difference between the preset effective starting time and the target effective starting time in the preset data table with the preset effective starting time being later than the target effective starting time as a subsequent data table, determining the determination condition of the subsequent data table as a determination subsequent data table, and otherwise, determining the determination condition of the subsequent data table as a non-determination subsequent data table.
Referring to fig. 3, in some embodiments, step S130 includes:
s131: and determining that the data table to be changed and the target data table are in a multi-version at the same time in response to the fact that the preset effective starting time of the target data table is the same as the target effective starting time of the data table to be changed.
S132: and determining that the data table to be changed and the target data table are in non-time multi-version in response to the preset effective starting time of the target data table being different from the target effective starting time of the data table to be changed.
Therefore, the relation between the target data table and the data table to be changed can be accurately judged based on the preset effective starting time and the target effective starting time.
Specifically, if the preset effective starting time of the previous data table is the same as the target effective starting time of the data table to be changed, determining that the previous data table and the data table to be changed are in multiple versions at the same time; if the preset validation start time of the prior data table is different from the target validation start time of the data table to be changed, the prior data table and the data table to be changed can be determined to be in non-simultaneous multi-version. If the preset effective starting time of the later data table is the same as the target effective starting time of the data table to be changed, determining that the later data table and the data table to be changed are in multiple versions at the same time; if the preset effective starting time of the later data table is different from the target effective starting time of the data table to be changed, determining that the later data table and the data table to be changed are in different time multi-versions
In some embodiments, step S140 includes:
s141: and in response to the change type being the newly added data table, determining the prior data table, and the prior data table and the target data table being the simultaneous multi-version, updating the preset effective ending time of the prior data table to be the target effective starting time, and updating the preset maximum version mark of the prior data table to be the preset non-maximum version state value.
S142: and in response to the change type being the newly added data table, determining that the prior data table is in a non-time multi-version with the target data table, updating the preset effective ending time of the prior data table to the time before the target effective starting time, and keeping the preset maximum version mark of the prior data table unchanged.
S143: and responding to the change type as a new data table, and not determining the subsequent data table, taking the preset latest time as the target effective ending time of the data table to be changed, taking the preset maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in a preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
S144: and in response to the change type being the newly added data table, determining that the later data table and the target data table are in multiple versions at the same time, taking the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking the preset non-maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
S145: and in response to the change type being the newly added data table, determining that the later data table and the target data table are in different time multiple versions, taking the previous time of the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking the preset maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
When the change type is a new data table, one or more of the preset effective ending time of the previous data table, the preset maximum version mark of the previous data table and the data table to be changed can be automatically changed according to the determination condition of the previous data table and the subsequent data table and the judgment result of multiple versions of time, so that the new data table to be changed is correctly added into the preset database, and the correct time continuity among all preset data tables in the preset database after the new data table to be changed is ensured.
For example, the preset non-maximum version state value is 0, the preset maximum version state value is 1, the preset latest time is 2999.12.31, and the preset database includes a preset data table 1, a preset data table 2 and a preset data table 3, as shown in fig. 4, the preset validation start time (english: effDate) of the preset data table 1 is 2023.05.01, the preset validation end time (english: effEndDate) is 2023.05.09, the preset sequence number (english: seq) is 0, the preset maximum version flag (english: maxVersion) is 1, the preset validation start time of the preset data table 2 is 2023.05.10, the preset validation end time is 2023.05.09, the preset sequence number is 0, the preset maximum version flag is 0, the validation end time is 2023.05.09, the preset maximum version flag is 1, the preset validation start time of the preset data table 3 is 2023.05.10, the preset 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, in order to avoid redundancy, in the example of fig. 4, the preset basic data of each preset data table is not shown, and in practical application, each preset data table further includes preset basic data.
Referring to fig. 5, if the target validation start time of the data table 1 to be newly added is 2023.05.10 and the target sequence number is 20, it may be determined that the preset data table 3 is a previous data table, the previous data table and the data table 1 to be newly added are multiple versions at the same time, and the subsequent data table is not determined, further, the preset validation end time of the preset data table 3 is 2023.05.10, the preset maximum version flag is updated to 0, the target validation end time of the data table 1 to be newly added is 2999.12.31, the target maximum version flag is 1, and the data table 1 to be newly added is newly added in the preset database.
Referring to fig. 6, if the target validation start time of the data table 2 to be newly added is 2023.05.10 and the target sequence number is 5, it may be determined that the preset data table 2 is a previous data table, the previous data table and the data table 2 to be newly added are multi-version at the same time, the preset data table 3 is a subsequent data table, the subsequent data table and the data table 2 to be newly added are multi-version at the same time, further the preset validation end time of the preset data table 2 is 2023.05.10, the target validation end time of the data table 2 to be newly added is 2023.05.10, the target maximum version flag is 0, and the data table 2 to be newly added is newly added in the preset database.
Referring to fig. 7, if the target effective start time of the data table 3 to be newly added is 2023.05.01 and the target serial number is 10, it may be determined that the preset data table 1 is a previous data table, the previous data table and the data table 3 to be newly added are multi-version at the same time, the preset data table 2 is a subsequent data table, the subsequent data table and the data table 3 to be newly added are multi-version at different times, further, the preset effective end time of the preset data table 1 is updated to 2023.05.01, the preset maximum version flag is updated to 0, the target effective end time of the data table 3 to be newly added is 2023.05.09 (i.e. the previous day of 2023.05.10), the target maximum version flag is 1, and the data table 3 to be newly added is newly added in the preset database.
Referring to fig. 8, if the target validation start time of the data table 4 to be newly added is 2023.04.26 and the target sequence number is 0, it may be determined that the previous data table is not determined, the preset data table 1 is the subsequent data table, and the subsequent data table and the data table 4 to be newly added are non-time multiple versions, so as to determine that the target validation end time of the data table 4 to be newly added is 2023.04.30 (i.e. the previous day of 2023.05.01), the target maximum version flag is 1, and the data table 4 to be newly added is newly added in the preset database.
Referring to fig. 9, if the target validation start time of the data table 5 to be newly added is 2023.05.08 and the target sequence number is 0, it may be determined that the preset data table 1 is a previous data table, the previous data table and the data table 5 to be newly added are non-time multi-version, the preset data table 2 is a subsequent data table, the subsequent data table and the data table 5 to be newly added are non-time multi-version, further the preset validation end time of the previous data table is updated to 2023.05.07 (i.e. the previous day of 2023.05.08), the preset maximum version flag of the previous data table is kept unchanged, the target validation end time of the data table 5 to be newly added is 2023.05.09 (i.e. the previous day of 2023.05.10), the target maximum version flag is 1, and the data table 5 to be newly added is newly added in the preset database.
Referring to fig. 10, if the target validation start time of the data table 6 to be newly added is 2023.05.12 and the target sequence number is 0, it may be determined that the preset data table 3 is a previous data table, the previous data table and the data table 6 to be newly added are not time-multiple versions, and the subsequent data table is not determined, further, the preset validation end time of the previous data table is updated to 2023.05.11 (i.e. the previous day of 2023.05.12), the preset maximum version flag of the previous data table is kept unchanged, the target validation end time of the data table 6 to be newly added is 2999.12.31, the target maximum version flag is 1, and the data table 6 to be newly added is newly added in the preset database.
In some embodiments, step S140 includes:
s146: and in response to the change type being the deletion data table and the prior data table not being determined, directly deleting the data table to be changed.
S147: in response to the change type being a delete data table and the determination that the prior data table and the target data table are of simultaneous multiple versions, updating a preset effective end time of the prior data table to a target effective end time of the data table to be changed, and updating a preset maximum version flag of the prior data table to a target maximum version flag of the data table to be changed, and deleting the data table to be changed.
S148: and in response to the change type being the deletion data table, determining the prior data table and the target data table are non-simultaneous multi-version, updating the preset effective ending time of the prior data table to the target effective ending time of the data table to be changed, keeping the preset maximum version mark of the prior data table unchanged, and deleting the data table to be changed.
Therefore, when the change type is the deletion data table, one or more of the preset effective ending time of the prior data table, the preset maximum version mark of the prior data table and the data table to be changed can be automatically changed according to the determination condition of the prior data table and the judgment result of multiple versions of the prior data table, so that the data table to be changed in the preset database is correctly deleted, and the correct time continuity among all preset data tables in the preset database after the data table to be changed is deleted is ensured.
In some embodiments, the preset basic data types allowed to be deleted are preconfigured, the change request further includes the type of the preset basic data in the data table to be deleted, and before executing step S120, the method further includes: responding to the change type as the deletion data table, judging whether the type of the preset basic data in the data table to be deleted is the preset basic data type which is allowed to be deleted, if so, executing step S120; if not, the change is terminated and illegal change prompt is carried out. Therefore, the data security in the preset database is ensured, and important data is prevented from being deleted.
In some embodiments, after step S110, further comprising:
and in response to the change type being the modification preset effective starting time, firstly, deleting the data table of the data table to be changed in the preset database, and then, executing the newly added data table according to the target effective starting time and the deleted data table to be changed.
Therefore, when the change type is to modify the preset effective starting time, the preset effective starting time of the preset data table in the preset database is correctly modified by deleting the data table and then adding the data table, and the correct time continuity among all preset data tables in the preset database is ensured to be maintained after the preset effective starting time of the preset data table is modified.
When the preset effective starting time of a certain preset data table in the preset database needs to be modified, determining the preset data table as a data table to be modified, determining the preset effective starting time and the preset serial number in the preset data table as initial data of the data table to be modified, manually inputting a change request with a change type of modifying the preset effective starting time by a user, wherein the change request comprises the initial data, the target effective starting time and the target serial number of the data table to be modified, further determining the corresponding preset data table in the preset database according to the initial data of the data table to be modified, then determining the change type as a deleting data table, determining the corresponding preset data table in the preset database as a data table to be deleted, determining the target data table from the preset database according to the preset effective starting time, the preset serial number and the change type of the data table to be deleted, and performing simultaneous multi-version judgment on the preset data table to be deleted and the target data table according to the preset effective starting time of the data table to be deleted, and the determination result of the target data table and the simultaneous multi-version judgment result; and secondly, determining the change type as a new data table, determining the target effective starting time and the target sequence number of the data table to be modified in the change request as the target effective starting time and the target sequence number of the data table to be newly added, further determining the target data table from the preset database after deleting the data table to be deleted according to the target effective starting time, the target sequence number and the change type of the data table to be newly added, performing simultaneous multi-version judgment on the data table to be newly added and the target data table according to the target effective starting time of the data table to be newly added, and changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be newly added according to the determination condition of the change type, the target data table and the judgment result of the simultaneous multi-version, thereby completing the modification of the preset effective starting time.
In some embodiments, after step S140, further comprising:
s150: and in response to the data in the data table to be changed being the current effective data, updating the preset real-time data table according to the data table to be changed.
S160: and responding to the data in the data table to be changed as non-current effective data, and keeping the preset real-time data table unchanged.
Therefore, when the current effective data is changed, the latest effective data after the change can be synchronized into the preset real-time data table in time so as to be convenient for related personnel to check.
Optionally, the preset database further includes a preset real-time data table, where the preset real-time data table is used to store the current effective data in real time. The preset database can provide 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 for querying the preset real-time data table, and the preset data table query interface is used for querying the preset data table. Because the same user has only one preset real-time data table, and the same user has more than one preset data table, the query efficiency of the preset real-time data table is higher than that of the preset data table; because the preset real-time data table cannot store the historical effective data, and the stored data does not have time continuity, the preset real-time data table query interface is suitable for querying the data which does not concern the historical effective data, and a user can select a corresponding query interface for querying according to the actual query requirement.
Further, whether the data in the data table to be changed is the current effective data can be judged according to the absolute value of the difference between the target effective starting time and the current time of the data table to be changed, for example, if the absolute value of the difference between the target effective starting time and the current time of any preset data table is smaller than the absolute value of the difference between the target effective starting time and the current time of the data table to be changed, the data in the data table to be changed is determined to be the non-current effective data; otherwise, determining the data in the data table to be changed as the current effective data.
In an exemplary embodiment, if the data table to be changed is the new data table to be added, after the new data table to be added is newly added to the preset database, the data in the new data table to be added is directly synchronized to the preset real-time data table, so that the original data in the preset real-time data table is covered. And under the condition that the data table to be changed is the data table to be deleted, if the data in the data table to be deleted is the current effective data, determining the prior data table of the data table to be deleted, and after deleting the data table to be deleted in the preset database, directly synchronizing the data in the prior data table of the data table to be deleted into the preset real-time data table, thereby covering the original data in the preset real-time data table. And under the condition that the data table to be changed is the data table to be modified, if the data in the data table to be modified is the current effective data, after the data table to be modified in the preset database is modified, directly synchronizing the data in the modified data table into the preset real-time data table, so that the original data in the preset real-time data table is covered.
In some embodiments, the data processing method S100 further includes:
s170: receiving a query request for a preset database, wherein the query request comprises a query data type and a query condition, the query condition comprises a query identifier and a query time, and the preset data table also comprises a preset identifier and various preset basic data.
S180: and screening out a data table to be displayed according to the query condition, wherein the data table to be displayed is a preset data table which is preset in a database, has the same preset identifier as the query identifier, has the preset effective starting time which is longer than or equal to the query time, has the preset effective ending time which is longer than or equal to the query time, and has the preset maximum version identifier which is a preset maximum version state value.
S190: and carrying out content display on the basic data to be displayed in the data table to be displayed, wherein the basic data to be displayed is preset basic data with the same type as the query data.
Therefore, when a user queries the data in the preset database, the data which is matched with the query time and has the latest actual effective starting time can be rapidly output, and the query efficiency is improved.
Optionally, the types of the preset basic data may include one or more of a date of job entry, a job ID, an organization code, an organization name, a sequence group, a job change type, and a job change name. The query identifier and the preset identifier may be employee identifiers, the preset database may store preset data tables corresponding to a plurality of employees, the employee identifiers of different employees may be different, and after the query identifier is determined, the preset data table corresponding to the preset identifier identical to the query identifier in the preset database may be uniquely determined.
The query data types include an on-job date, a job ID, an organization code and an organization name, and after receiving a query request to a preset database, the method includes the steps of screening a preset data table in the preset database, wherein a preset identifier is the same as the query identifier, a preset effective start time is equal to or longer than the query time, a preset effective end time is equal to or longer than the query time, a preset maximum version mark is a preset maximum version state value, using the screened preset data table as a data table to be displayed, and then performing content display on preset basic data of the types of the on-job date, the job ID, the organization code and the organization name in the data table to be displayed, namely displaying data content of the on-job date in the data table to be displayed, displaying data content of the job ID in the data table to be displayed, displaying data content of the organization code in the data table to be displayed and displaying data content of the organization name in the data table to be displayed.
In one example, an employee identifier of a certain employee is 30009290, in a preset database, there are 3 preset data tables corresponding to the employee identifier 30009290, which are respectively a preset data table 4, a preset data table 5 and a preset data table 6, wherein in the preset data table 4, the data content of the organization name is "SaaS personnel research and development group", the preset validation start time is "2023.06.01", and the preset validation end time is "2999.12.31"; in the preset data table 5, the data content of the organization name is 'personnel research and development group', the preset effective starting time is '2023.05.30', and the preset effective ending time is '2023.05.31'; in the preset data table 6, the data content of the organization name is "SaaS personnel research and development group", the preset validation start time is "2023.01.09", and the preset validation end time is "2023.05.29", it can be seen that the organization name of the employee is changed from "SaaS personnel research and development group" to "personnel research and development group" at 2023.05.30, and is changed from "personnel research and development group" to "SaaS personnel research and development group" at 2023.06.01. Further, if the query time is 2023.07.03 and the query data type is the organization name, the organization name actually effective by the employee can be found 2023.07.03 as "SaaS personnel research and development group"; if the inquiry time is 2023.05.30 and the inquiry data type is the organization name, the organization name actually effective by the employee can be found 2023.05.30 as a personnel research and development group.
Referring to fig. 11, the present disclosure further provides a data processing apparatus 1000, where the data processing apparatus 1000 includes a receiving module 1002, a determining module 1004, a judging module 1006, and a changing module 1008.
The receiving module 1002 is configured to receive a change request for a preset database, where the change request includes a change type, a target validation start time and a target sequence number of a data table to be changed, the preset database includes a plurality of preset data tables, the preset data tables include a preset validation start time, a preset validation end time, a preset sequence number and a preset maximum version flag, and the preset validation start time and the preset sequence number are used to characterize an actual validation start time of the preset data tables. The determining module 1004 is configured to determine a target data table according to the target validation start time, the target sequence number, and the change type, where the target data table is one or more of a preceding data table and a following data table, the preceding data table is a preset data table with an actual validation start time earlier than the data table to be changed, and the following data table is a preset data table with an actual validation start time later than the data table to be changed. And a judging module 1006, configured to perform simultaneous multi-version judgment on the to-be-changed data table and the target data table according to the target effective start time. And the changing module 1008 is configured to change one or more of a preset effective ending time of the target data table, a preset maximum version flag of the target data table, and a data table to be changed according to the changing type, the determining condition of the target data table, and the determination result of multiple versions of the time.
In some embodiments, the determining module 1004 is specifically configured to: arranging a plurality of preset data tables according to a mode of reverse order of preset effective starting time and reverse order of preset sequence numbers; and determining a target data table from the arranged plurality of preset data tables according to the target effective starting time, the target sequence number and the change type.
In some embodiments, the determining module 1006 is specifically configured to: determining that the data table to be changed and the target data table are in a multi-version at the same time in response to the fact that the preset effective starting time of the target data table is the same as the target effective starting time of the data table to be changed; and determining that the data table to be changed and the target data table are in non-time multi-version in response to the preset effective starting time of the target data table being different from the target effective starting time of the data table to be changed.
In some embodiments, the altering module 1008 is specifically configured to: in response to the change type being a newly added data table, determining that the prior data table and the target data table are of multiple versions at the same time, updating a preset effective ending time of the prior data table to be a target effective starting time, and updating a preset maximum version mark of the prior data table to be a preset non-maximum version state value; in response to the change type being the newly added data table, determining that the prior data table and the target data table are non-simultaneous multi-version, updating the preset effective ending time of the prior data table to the time before the target effective starting time, and keeping the preset maximum version mark of the prior data table unchanged; responding to the change type as a new added data table and not determining a subsequent data table, taking the preset latest time as the target effective ending time of the data table to be changed, taking the preset maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in a preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark; responding to the change type as a new added data table, determining that the following data table and the target data table are in multiple versions at the same time, taking the preset effective starting time of the following data table as the target effective ending time of the data table to be changed, taking the preset non-maximum version state value as the target maximum version mark of the data table to be changed, and adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark; and in response to the change type being the newly added data table, determining that the later data table and the target data table are in different time multiple versions, taking the previous time of the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking the preset maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
In some embodiments, the altering module 1008 is specifically configured to: in response to the change type being the deletion of the data table and the prior data table not being determined, directly deleting the data table to be changed; in response to the change type being a delete data table and determining that the prior data table and the target data table are of simultaneous multiple versions, updating a preset effective ending time of the prior data table to a target effective ending time of the data table to be changed, updating a preset maximum version flag of the prior data table to a target maximum version flag of the data table to be changed, and deleting the data table to be changed; and in response to the change type being the deletion data table, determining the prior data table and the target data table are non-simultaneous multi-version, updating the preset effective ending time of the prior data table to the target effective ending time of the data table to be changed, keeping the preset maximum version mark of the prior data table unchanged, and deleting the data table to be changed.
In some implementations, the data processing apparatus 1000 further includes a modification module. The modification module is used for responding to the modification type as modification of the preset effective starting time, firstly executing the deletion data table on the data table to be modified in the preset database, and then executing the new data table according to the target effective starting time and the deleted data table to be modified.
In some embodiments, the data processing apparatus 1000 further includes an update module. The updating module is specifically configured to: responding to the data in the data table to be changed as the current effective data, and updating a preset real-time data table according to the data table to be changed; and responding to the data in the data table to be changed as non-current effective data, and keeping the preset real-time data table unchanged.
In some embodiments, the data processing apparatus 1000 further includes a query module, a screening module, and a presentation module. The query module is used for receiving a query request for a preset database, wherein the query request comprises a query data type and a query condition, the query condition comprises a query identifier and a query time, and the preset data table also comprises a preset identifier and various preset basic data. The screening module is used for screening the data table to be displayed according to the query condition, wherein the data table to be displayed is a preset data table which is preset in a database, has the same preset identification as the query identification, has the preset effective starting time which is longer than or equal to the query time, has the preset effective ending time which is longer than or equal to the query time, and has the preset maximum version mark which is a preset maximum version state value. The display module is used for displaying the content of the basic data to be displayed in the data table to be displayed, wherein the basic data to be displayed is preset basic data with the same type as the query data.
FIG. 11 is a block diagram of a data processing apparatus employing a hardware implementation of a processing system according to one embodiment of the present disclosure.
The apparatus may include corresponding modules that perform the steps of the flowcharts described above. Thus, each step or several steps in the flowcharts described above may be performed by respective modules, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform the respective steps, or be implemented by a processor configured to perform the respective steps, or be stored within a computer-readable medium for implementation by a processor, or be implemented by some combination.
The hardware architecture may be implemented using a bus architecture. The bus architecture may include any number of interconnecting buses and bridges depending on the specific application of the hardware and the overall design constraints. Bus 1100 connects together various circuits including one or more processors 1200, memory 1300, and/or hardware modules. Bus 1100 may also connect various other circuits 1400, such as peripherals, voltage regulators, power management circuits, external antennas, and the like.
Bus 1100 may be an industry standard architecture (ISA, industry Standard Architecture) bus, a peripheral component interconnect (PCI, peripheral Component) bus, or an extended industry standard architecture (EISA, extended Industry Standard Component) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one connection line is shown in the figure, but not only one bus or one type of bus.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure. The processor performs the various methods and processes described above. For example, method embodiments in the present disclosure may be implemented as a software program tangibly embodied on a machine-readable medium, such as a memory. In some embodiments, part or all of the software program may be loaded and/or installed via memory and/or a communication interface. One or more of the steps of the methods described above may be performed when a software program is loaded into memory and executed by a processor. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above in any other suitable manner (e.g., by means of firmware).
Logic and/or steps represented in the flowcharts or otherwise described herein may be embodied in any readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description, a "readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program can be printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner if necessary, and then stored in a memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or part of the steps implementing the method of the above embodiments may be implemented by a program to instruct related hardware, and the program may be stored in a readable storage medium, where the program when executed includes one or a combination of the steps of the method embodiments.
Furthermore, each functional unit in each embodiment of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. The storage medium may be a read-only memory, a magnetic disk or optical disk, etc.
The present disclosure also provides an electronic device, including: a memory storing execution instructions; and a processor or other hardware module that executes the execution instructions stored in the memory, such that the processor or other hardware module performs the data processing method described above.
The present disclosure also provides a readable storage medium having stored therein execution instructions which, when executed by a processor, are configured to implement the above-described data processing method.
The present disclosure also provides a computer program product comprising a computer program/instruction which, when executed by a processor, implements the data processing method described above.
In the description of the present specification, reference to the terms "one embodiment/mode," "some embodiments/modes," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment/mode or example is included in at least one embodiment/mode or example of the present application. In this specification, the schematic representations of the above terms are not necessarily the same embodiments/modes or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments/modes or examples. Furthermore, the various embodiments/implementations or examples described in this specification and the features of the various embodiments/implementations or examples may be combined and combined by persons skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
It will be appreciated by those skilled in the art that the above-described embodiments are merely for clarity of illustration of the disclosure, and are not intended to limit the scope of the disclosure. Other variations or modifications will be apparent to persons skilled in the art from the foregoing disclosure, and such variations or modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A method of data processing, comprising:
receiving a change request for a preset database, wherein the change request comprises a change type, a target effective starting time and a target serial number of a data table to be changed, the preset database comprises a plurality of preset data tables, the preset data tables comprise preset effective starting time, preset effective ending time, preset serial number and preset maximum version marks, and the preset effective starting time and the preset serial number are used for representing the actual effective starting time of the preset data tables;
Determining a target data table according to the target effective starting time, the target sequence number and the change type, wherein the target data table is one or more of a previous data table and a subsequent data table, the previous data table is a preset data table with the actual effective starting time earlier than the data table to be changed, and the subsequent data table is a preset data table with the actual effective starting time later than the data table to be changed;
performing simultaneous multi-version judgment on the data table to be changed and the target data table according to the target effective starting time;
and changing one or more of the preset effective ending time of the target data table, the preset maximum version mark of the target data table and the data table to be changed according to the change type, the determination condition of the target data table and the judgment result of the multiple versions at the same time.
2. The data processing method of claim 1, wherein said determining a target data table based on said target validation start time, said target sequence number, and said change type comprises:
arranging a plurality of preset data tables according to a mode of reverse order of preset effective starting time and reverse order of preset sequence numbers;
And determining a target data table from the arranged plurality of preset data tables according to the target effective starting time, the target sequence number and the change type.
3. The data processing method according to claim 1, wherein the performing the simultaneous multi-version determination on the to-be-changed data table and the target data table according to the target validation start time includes:
determining that the data table to be changed and the target data table are in the same time multi-version in response to the fact that the preset effective starting time of the target data table is the same as the target effective starting time of the data table to be changed;
and determining that the data table to be changed and the target data table are in non-time multi-version in response to the fact that the preset effective starting time of the target data table is different from the target effective starting time of the data table to be changed.
4. The data processing method according to claim 3, wherein said changing one or more of a preset validation end time of the target data table, a preset maximum version flag of the target data table, and the data table to be changed according to the change type, the determination of the target data table, and the determination of the time multiple versions includes:
In response to the change type being a new added data table, determining the previous data table and the target data table being the simultaneous multi-version, updating a preset effective ending time of the previous data table to the target effective starting time, and updating a preset maximum version mark of the previous data table to a preset non-maximum version state value;
responding to the change type as the newly added data table, determining the previous data table and the target data table as the non-time multi-version, updating the preset effective ending time of the previous data table to the time before the target effective starting time, and keeping the preset maximum version mark of the previous data table unchanged;
responding to the change type as the newly added data table, and not determining the later data table, taking a preset latest time as a target effective ending time of the data table to be changed, taking a preset maximum version state value as a target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target sequence number and the target maximum version mark;
Responding to the change type as the newly added data table, determining the later data table and the target data table as the simultaneous multi-version, taking the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking the preset non-maximum version state value as the target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target sequence number and the target maximum version mark;
and responding to the change type as the newly added data table, determining the later data table and the target data table as the non-time multi-version, taking the time before the preset effective starting time of the later data table as the target effective ending time of the data table to be changed, taking a preset maximum version state value as a target maximum version mark of the data table to be changed, and newly adding the data table to be changed in the preset database according to the target effective starting time, the target effective ending time, the target serial number and the target maximum version mark.
5. The data processing method according to claim 3, wherein said changing one or more of a preset validation end time of the target data table, a preset maximum version flag of the target data table, and the data table to be changed according to the change type, the determination of the target data table, and the determination of the time multiple versions includes:
directly deleting the data table to be changed in response to the change type being a deleted data table and the prior data table not being determined;
in response to the change type being a delete data table and determining that the prior data table and the target data table are the simultaneous multi-version, updating a preset effective ending time of the prior data table to a target effective ending time of the data table to be changed, updating a preset maximum version flag of the prior data table to a target maximum version flag of the data table to be changed, and deleting the data table to be changed;
and in response to the change type being a deletion data table, determining that the previous data table and the target data table are the non-time multi-version, updating the preset effective ending time of the previous data table to the target effective ending time of the data table to be changed, keeping the preset maximum version mark of the previous data table unchanged, and deleting the data table to be changed.
6. The data processing method according to claim 1, further comprising, after said receiving a change request to a preset database:
and in response to the change type being the modification preset effective starting time, firstly, deleting the data table of the data table to be changed in the preset database, and then, executing a new data table according to the target effective starting time and the deleted data table to be changed.
7. The data processing method according to any one of claims 1 to 6, characterized by further comprising, after said changing one or more of a preset validation end time of said target data table, a preset maximum version flag of said target data table, and said data table to be changed according to said changing type, a determination of said target data table, and said time-multiple version determination result:
responding to the data in the data table to be changed as the current effective data, and updating a preset real-time data table according to the data table to be changed;
and responding to the data in the data table to be changed as non-current effective data, and keeping the preset real-time data table unchanged.
8. The data processing method according to any one of claims 1 to 6, characterized by further comprising:
Receiving a query request for the preset database, wherein the query request comprises a query data type and a query condition, the query condition comprises a query identifier and a query time, and the preset data table further comprises a preset identifier and various preset basic data;
screening a data table to be displayed according to the query condition, wherein the data table to be displayed is a preset data table in which the preset identification is the same as the query identification in the preset database, the preset effective starting time is longer than or equal to the query time, the preset effective ending time is longer than or equal to the query time, and the preset maximum version mark is a preset maximum version state value;
and carrying out content display on the basic data to be displayed in the data table to be displayed, wherein the basic data to be displayed is preset basic data with the same type as the query data.
9. 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 the data processing method of any one of claims 1 to 8.
10. A readable storage medium having stored therein execution instructions which, when executed by a processor, are adapted to carry out the data processing method of any one of claims 1 to 8.
CN202311442282.6A 2023-11-01 2023-11-01 Data processing method, electronic device and readable storage medium Pending CN117472906A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311442282.6A CN117472906A (en) 2023-11-01 2023-11-01 Data processing method, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311442282.6A CN117472906A (en) 2023-11-01 2023-11-01 Data processing method, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN117472906A true CN117472906A (en) 2024-01-30

Family

ID=89627002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311442282.6A Pending CN117472906A (en) 2023-11-01 2023-11-01 Data processing method, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN117472906A (en)

Similar Documents

Publication Publication Date Title
US20010027554A1 (en) Version and configuration management method and apparatus and computer readable recording medium for recording therein version and configuration management program
US7698318B2 (en) Automatically determining file replication mechanisms
CN102279749B (en) Method and equipment for merging codes
US7644357B2 (en) Data conversion system
EP0066064A2 (en) Method of storing and recalling setups in a word processing system
CN115391403A (en) Data integration method and data integration device based on rule engine
CN109902078B (en) Method, device, equipment and storage medium for database upgrading compatibility
JP6504237B2 (en) Shared data definition support system, its support device, program
CN113918648A (en) Data synchronization method and device, electronic equipment and storage medium
CN116823464B (en) Data asset management platform, electronic device, and computer-readable storage medium
CN117472906A (en) Data processing method, electronic device and readable storage medium
EP2742443B1 (en) Database record repair
CN116010347A (en) Resource updating method, device, system, electronic equipment and storage medium
CN108170504A (en) A kind of interface Logo method for customizing, system, equipment and computer readable storage medium
JP4738145B2 (en) Engineering database system and its handling method
CN113787977A (en) Vehicle maintenance method, communication device, and storage medium
CN111639057A (en) Log message processing method and device, computer equipment and storage medium
JP2000184595A (en) Display drawing generation management system and storage medium for recording processing program thereof
CN112540970A (en) Metadata blood relationship analysis method and system based on version management
US20210232717A1 (en) Measurement tables including target identification information indicating a measurement target
CN118035114A (en) Test case library maintenance method, electronic device, storage medium and program product
CN117390039A (en) Data synchronization method and electronic equipment
JPH10269065A (en) Library management method
US20220107932A1 (en) Mutable data ingestion and storage
CN116701385A (en) Reminding method, reminding device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination