WO2013086683A1 - 数据配置及其回退方法和设备 - Google Patents

数据配置及其回退方法和设备 Download PDF

Info

Publication number
WO2013086683A1
WO2013086683A1 PCT/CN2011/083874 CN2011083874W WO2013086683A1 WO 2013086683 A1 WO2013086683 A1 WO 2013086683A1 CN 2011083874 W CN2011083874 W CN 2011083874W WO 2013086683 A1 WO2013086683 A1 WO 2013086683A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
sequence number
request
operation sequence
configuration
Prior art date
Application number
PCT/CN2011/083874
Other languages
English (en)
French (fr)
Inventor
甘嘉栋
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP11877514.7A priority Critical patent/EP2713555B1/en
Priority to PCT/CN2011/083874 priority patent/WO2013086683A1/zh
Priority to CN201180003188.XA priority patent/CN102726002B/zh
Publication of WO2013086683A1 publication Critical patent/WO2013086683A1/zh
Priority to US14/142,332 priority patent/US9734020B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1474Saving, restoring, recovering or retrying in transactions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • 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/21Design, administration or maintenance of databases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0859Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions
    • H04L41/0863Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions by rolling back to previous configuration versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0866Checking the configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events

Definitions

  • the present invention relates to the field of information processing technologies, and in particular, to a data configuration and a fallback method and device thereof. Background technique
  • configuration data can be described in the form of records.
  • a configuration item for example, in a relational database, creates a table for the board to manage the configuration data of the board.
  • the fallback of data configuration is an important function. It is mainly to verify the newly configured data after the data configuration operation is performed. If the newly configured data is found to be incorrect, the data configuration needs to be rolled back. Previously configured data; confirm the implementation of the newly configured data if the newly configured data is correct.
  • An existing data configuration includes: when the configuration operation starts, the current configuration data is backed up to form data of the primary state and the standby state, and after the data of the primary state is configured several times, if the data configuration needs to be rolled back When the configured data and the unconfigured data state are switched, the data of the active state is unconfigured data; if the newly configured data is correct, the unconfigured data is deleted.
  • this method requires backing up the current configuration data, which increases the storage space requirements and makes it difficult to support single-step fallback.
  • the configuration data is not required to be backed up, the storage space requirement is reduced, and the single-step back-off can be supported.
  • the data configuration operation is formed.
  • a reverse operation if you need to perform a reverse operation when the data configuration is rolled back, you can implement the function of rollback. Since some data configuration operations are complicated in the specific data configuration process, the algorithm for generating the reverse operation is complicated; and the data configuration operation is relatively large, and the corresponding reverse operation needs to be performed when performing the rollback, so that The retreat time is longer, that is, the retreat rate is lower.
  • Embodiments of the present invention provide a data configuration and a method and device for backing off, which simplify data configuration and its fallback operation.
  • the embodiment of the invention provides a data configuration method, including:
  • the data configuration operation request including inserting a data request, deleting Data request or update data request;
  • the allocated operation serial number and the data requested by the data configuration operation request are recorded as a correspondence relationship between the creation operation serial number, the deletion operation serial number, and the data.
  • the embodiment of the invention further provides a data configuration device, including:
  • a request receiving unit configured to receive a data configuration operation request, where the data configuration operation request includes an insert data request, a delete data request, or an update data request;
  • a sequence number allocation unit configured to allocate an operation sequence number to the operation request received by the request receiving unit
  • a recording unit configured to allocate, according to the data configuration operation request received by the request receiving unit, the operation serial number and the location assigned by the sequence number allocation unit
  • the data of the operation requested by the data configuration operation request is recorded as the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data.
  • the data configuration process of this embodiment it is required to allocate an operation sequence number for each data configuration operation request, where the data configuration operation request includes an insert data request, a delete data request, or an update data request, and the allocation operation is performed according to the data configuration operation request.
  • the operation sequence number and the data configuration operation request data of the requested operation are recorded as the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data.
  • it is required to generate a reverse operation in each data configuration operation and the operation of allocating, recording the operation sequence number and recording data in the embodiment is relatively simple, thereby simplifying the operation of data configuration.
  • only the correlation relationship between the storage data, the creation operation sequence number, and the deletion operation sequence number is required, and the storage space requirement is not high.
  • the embodiment of the invention provides a method for backing up data configuration, including:
  • the creation operation sequence number is less than or equal to the rollback operation sequence number, and the deletion operation sequence number is greater than the rollback operation sequence number or the deletion operation sequence number is empty.
  • the deletion operation sequence number obtains the creation operation sequence number greater than or equal to the rollback operation sequence number, and the deletion operation sequence number is smaller than the rollback operation sequence number or the deletion operation sequence number is empty. Corresponding data.
  • the embodiment of the invention provides a data configuration device, including: a rollback sequence number obtaining unit, configured to obtain a rollback operation sequence number of the data configuration;
  • a configuration data obtaining unit configured to obtain, according to the corresponding relationship recorded in the storage unit, a recurring operation sequence number obtained by the retrieving sequence number acquiring unit that is smaller than or equal to the retrieving sequence number acquiring unit, and the deletion operation sequence number is greater than the retreating sequence number acquiring unit.
  • the data corresponding to the sequence number of the rollback operation; or the data corresponding to the number of the operation operation being greater than or equal to the number of the rollback operation, and the sequence number of the deletion operation is smaller than the sequence number of the rollback operation or the number of the deletion operation is empty;
  • the storage unit is configured to store the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data. It can be seen that, in the method for backing up the data configuration and the related device in the embodiment of the present invention, after obtaining the rollback operation sequence number configured by the data, obtaining the rollback operation sequence number whose creation operation sequence number is less than or equal to (or greater than or equal to), and deleting the operation The sequence number is greater than (or less than) the data of the rollback operation sequence number or the deletion operation sequence number is empty.
  • the rollback process in the embodiment of the present invention Compared with the implementation of a reverse operation in the prior art to implement the rollback, in the rollback process in the embodiment of the present invention, only the data needs to be searched according to the association relationship, thereby implementing the data configuration rollback, which can be returned to any After performing any data configuration operation at one time, the data configuration rollback operation is simplified and the fallback rate is improved.
  • FIG. 1 is a flowchart of a data configuration method according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a data configuration process according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another data configuration method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a data configuration and a fallback process according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a configuration item table in a data configuration process according to an embodiment of the present invention
  • a schematic structural diagram of a data configuration device
  • FIG. 7 is a schematic structural diagram of another data configuration apparatus according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another data configuration apparatus according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of another data configuration apparatus according to an embodiment of the present invention.
  • Embodiments of the present invention provide a data configuration method and a corresponding data configuration fallback method, which are applied to any field having a data configuration function, wherein for a data configuration method, a functional device having data configuration (ie, data) The configuration device is executed.
  • the flowchart is as shown in FIG. 1 , and includes: Step 101: Receive a data configuration operation request, where the data configuration operation request includes inserting a data request, deleting a data request, or updating a data request.
  • the data configuration operation request is required to trigger the configuration of the related data of the device or the service, and the user may send the data configuration operation request through the service layer, and trigger the operation in this embodiment.
  • the process of data configuration; the process of data configuration can also be triggered by other operations in the system.
  • the data configuration operation request may include information such as requesting the configured data address, identification, and specific operations (such as inserting data, or modifying data, or updating data).
  • Step 102 Assign an operation sequence number to the data configuration operation request.
  • the operation request may be assigned an operation serial number (OSN) in an incremental or degressive manner to uniquely identify a data configuration operation request. If the allocation is made in an incremental (or decremental) manner, the operation sequence number assigned to the currently received operation request is the result of adding (or subtracting) 1 or n on the basis of the operation number assigned for the last acquired operation request.
  • OSN operation serial number
  • Step 103 Record, according to the data configuration operation request, the operation sequence number assigned in step 102 and the data requested by the data configuration operation request as the creation operation serial number (Creation OSN, COSN) of the insertion configuration data, and the deletion operation sequence number of the deletion configuration data. (Deletion OSN, DOSN) and the correspondence between the data.
  • Each type of data recorded in this embodiment is associated with COSN and DOSN.
  • data has two types, that is, data of the device model and data of the date of manufacture of the device, and data of the device model (or data of the date of manufacture of the device) Both are associated with COSN and DOSN.
  • the step of recording the correspondence specifically includes: If the data configuration operation request is an insert data request, if the operation requested by the operation request is an operation of inserting data, the insert data requested by the insert data request is recorded, and the COSN corresponding to the insert data is recorded and allocated in step 102. OSN, and the delete operation sequence number corresponding to the inserted data is empty;
  • the operation requested by the operation request is an operation of deleting data
  • the DOSN corresponding to the deletion data requested by the deletion data request is recorded as the OSN allocated in step 102;
  • the operation requested by the operation request is a configuration operation of deleting the original data and inserting new data, recording the update data requested by the update data request, and recording the update data corresponding to the
  • the COSN is the OSN allocated in step 102, and the DOSN corresponding to the original data requested by the update data request is recorded as the COSN allocated in step 102.
  • a process of performing data configuration that is, a process of operating a data configuration operation request, after performing data configuration several times according to the above steps 101 to 103, each stored in the system
  • the item data (a piece of data including at least one type of data) records the corresponding creation operation sequence number COSN, but not every data record has a corresponding deletion operation serial number DOSN, and the deletion operation sequence number corresponding to some item data is empty. The data was not deleted during the data configuration process.
  • an operation sequence number needs to be allocated for each data configuration operation request, where the data configuration operation request includes an insert data request, a delete data request, or an update data request, and the operation request is configured according to the data.
  • the assigned operation sequence number and the data requested by the data configuration operation request are recorded as the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data.
  • an effective operation sequence number may be preset to indicate that the data configured in the system is valid after being configured in the above steps 101 to 103. Data so that the data configuration device can display the valid data based on the ASON. Specifically, if the operation sequence number is allocated in an incremental manner when the foregoing step 102 is performed, the operation sequence number whose creation operation sequence number is less than or equal to the effective operation sequence number is displayed, and the deletion operation sequence number is greater than the effective operation sequence number or the deletion operation sequence number is empty.
  • the data requested to be deleted in the operation request in this embodiment is stored in the bottom layer of the configuration device, but is not displayed in the service layer, so that the user seems to delete the data, and the deleted data is for the user. It is transparent.
  • the data configuration device can validate the data of the configuration after each data configuration operation, and the ASON configured in the data configuration device needs to be updated according to the changed operation sequence number. Specifically, the operation sequence number assigned to the operation request of the current data configuration is updated.
  • the data configuration device does not need to be validated for each configuration. After several times of data configuration, if the configuration is correct, the configuration will take effect several times. If the configuration is incorrect, This configuration does not take effect several times, which simplifies the process of data configuration.
  • a current operation sequence number (Present OSN, POSN) needs to be preset in the data configuration device, and the AOSN can be a preset operation sequence number. After the operation of configuring the data, the AOSN is fixed. The POSN needs to be updated as the assigned operation sequence number changes, specifically updating the operation sequence number assigned to the operation request of the current data configuration.
  • the data configuration device may not need to display the data valid according to the AOSN, but display the data that has been recorded according to steps 101 to 103 but is not valid according to the PSON, so that the user can continue to configure according to the displayed data.
  • the configuration data is displayed according to the PSON, if the operation sequence number is allocated in an incremental manner when performing the above step 102, the display creation operation sequence number is less than or equal to PSON, and the deletion operation sequence number is greater than PSON or the deletion operation sequence number is empty.
  • step 101 in order to ensure the correctness of the data configuration operation, after the data configuration device performs the above step 101, that is, after receiving the operation request, it is also required to determine whether the data configuration operation requested by the operation request received in step 101 is Valid, if yes, go to step 102, if not, end the process.
  • the data configuration device may determine, according to a certain preset policy, whether the service logic corresponding to the operation request is correct according to a certain preset policy.
  • the operation request is an attribute of the board, such as a rack number and a frame number.
  • the rack number and frame number must be stored in the device.
  • the data configuration device performs data configuration of several times (for example, B and C operations) according to the above steps 101 to 103, it is necessary to verify the newly configured data, and if the configuration is correct, it is confirmed that the new configuration is implemented.
  • the data corresponding to the OSN that is less than or equal to an effective operation sequence number (AOSN) may be deleted, and the specific value of the AOSN may be configured by the user through the service layer, or may be allocated for the operation request configured for the current data. If the configuration is incorrect, you need to perform data configuration rollback. You can return to the operation of any data configuration, such as A or B operation.
  • AOSN effective operation sequence number
  • the fallback method for the data configuration may be performed by a functional device (that is, a data configuration device) configured with data.
  • a functional device that is, a data configuration device configured with data.
  • the flowchart is as shown in FIG. 3, and includes:
  • Step 201 Obtain a rollback operation sequence number of the data configuration.
  • sequence number of the rollback operation may be regarded as the operation sequence number that is allocated when the data configuration operation request is executed in the data configuration process, and the rollback method in this embodiment may be triggered by the user sending a rollback request through the service layer.
  • the back-off operation sequence number may be included in the refund request.
  • Step 202 According to the record creation sequence number, the deletion operation sequence number, and the data correspondence relationship, the creation operation sequence number of the insertion configuration data is less than or equal to the rollback operation sequence number, and the deletion operation sequence number of deleting the configuration data is greater than the rollback operation sequence number or deleted.
  • the data corresponding to the operation sequence number is empty.
  • the number of the creation operation of the insertion configuration data is greater than or equal to the number of the retraction operation, and the deletion operation sequence number of the deletion configuration data is smaller than the data corresponding to the retraction operation sequence number or the deletion operation sequence number being empty. If the deletion operation sequence number is empty, it indicates that the data corresponding to the deletion operation sequence number is not deleted during the data configuration process.
  • the corresponding creation operation sequence number must be smaller than the deletion operation sequence number, and the creation operation sequence number is less than or equal to the rollback operation sequence number, and If the deletion operation sequence number is greater than the data of the rollback operation sequence number or the deletion operation sequence number is empty, the data configuration is rolled back, that is, the data state after returning to the operation request corresponding to the sequence number of the rollback operation is performed, specifically The state before the delete operation of the acquired data is not performed.
  • the corresponding creation operation sequence number must be greater than the deletion operation sequence number, and the creation operation sequence number is greater than or equal to the rollback operation sequence number, and If the deletion operation sequence number is smaller than the data of the rollback operation sequence number or the deletion operation sequence number is empty, the data configuration is rolled back, that is, the data state after the data configuration operation request corresponding to the rollback operation sequence number is returned. Specifically, the state before the deletion operation of the acquired data is not performed.
  • the rollback of the data configuration is implemented. Specifically, after obtaining the rollback operation sequence number of the data configuration, obtaining the rollback operation sequence number whose creation operation sequence number is less than or equal to (or greater than or equal to), And delete the operation sequence number is greater than (or less than) the rollback operation sequence number or delete the data corresponding to the operation sequence number is empty. It can be seen that, in the backoff process in the embodiment of the present invention, only the data is searched according to the corresponding relationship, thereby implementing the data configuration rollback, which can be returned, compared to the prior art performing a reverse operation to implement the rollback. After performing any data configuration operation, the data configuration rollback operation is simplified and the rollback rate is provided.
  • creation operation sequence number corresponds to each other, and the mutual correspondence between the three may be stored by any form of medium, such as by using a disk or a memory or a flash memory. Wait for storage; you can also enter the logical structure in any form Row storage, such as through relational tables, or databases, or tree or linked lists. And the corresponding relationship can be represented by the following methods:
  • the third configuration item table and the fourth configuration item table are associated by using at least one type of data stored in the fourth configuration item table as an association item.
  • Step 301 The user sends a data configuration operation request to the configuration function module of the data configuration device by using the service layer, and the sequence number assignment sub-module in the configuration function module allocates an OSN for the operation request, which is allocated in this embodiment.
  • the OSN is unidirectionally incremental, and in other embodiments the assigned OSN may be unidirectionally decreasing.
  • Step 302 The validity judgment sub-module in the configuration function module determines whether the operation request is valid, mainly analyzes the business logic of the operation request, analyzes the validity of the data requested by the operation request, and stores the data in the system. Consistency judgment, etc. If the judgment is valid, the data configuration operation conversion sub-module in the configuration function module performs step 303, and if it is invalid, the process ends.
  • the The operation request is valid. For example, if the rack attribute of the board is stored in the database, the rack number of the board stored in the database needs to be the same as the rack number requested in the operation request. Only effective.
  • Step 303 The data configuration operation conversion submodule in the configuration function module can convert the operation request according to a preset conversion rule, and convert to the actual operation performed on the database in the data configuration device.
  • the data configuration operation conversion sub-module may perform conversion according to the conversion rule 1: the conversion rule 1 is: inserting data into the configuration item table of the database, and the configuration item table The corresponding COSN of the inserted data is set to the OSN corresponding to the operation request, and the DOSN is set to be empty;
  • the data configuration operation conversion sub-module may perform conversion according to the conversion rule 2, and the conversion rule 2 is: setting the DOSN corresponding to the data to be deleted in the configuration item table as the OSN of the operation request. In this case, it is not necessary to delete the data in the configuration item table, but the data to be deleted is not displayed to the user;
  • the data configuration operation conversion sub-module may perform conversion according to the conversion rule 3, and the conversion rule 3 is: setting the DOSN corresponding to the original data to be deleted in the configuration item table as the operation request. OSN, and insert new data into the configuration item table, set the corresponding COSN of the inserted data to the OSN of the operation request and the DOSN is set to be empty. In this case, it is not necessary to delete the original data from the configuration item table. Instead, the original data that needs to be deleted is not displayed to the user.
  • Table 1 below shows the operations after converting the three operation requests.
  • Step 304 The data configuration operation sub-module in the configuration function module performs corresponding operations on the database according to the actual operation of the conversion.
  • the ASON is preset.
  • the data configuration device takes effect each configured data, and the AOSN follows the operation sequence number assigned to the operation request.
  • the update is updated, and the update becomes the operation sequence number assigned by the current operation request, and the data configuration device displays the configuration data that is valid according to the AOSN.
  • the rollback may be performed according to the following step 306, and the query may be performed according to the following step 305.
  • the data of the configuration may be implemented. If it is determined that the data configuration is not required to be rolled back, the data for confirming the new configuration may be implemented. Specifically, the data corresponding to the DOSN less than or equal to the AOSN may be deleted from the configuration item table, or the COSN and the COSN may be The DOSN is deleted, and the specific value of the AOSN is the operation sequence number assigned to the operation request configured for the current data, and may also be configured by the user through the service layer.
  • Step 305 For the query of the data, the query process may be triggered by the user to send a query operation request, and the query operation request may include specific information that needs to be queried, and the query operation request may further include the configured AOSN.
  • the AOSN acquisition sub-module obtains the AOSN configured in the AOSN or the query operation request preset in the data configuration device, and the data is passed.
  • the configuration operation conversion sub-module converts the query operation request into an actual operation performed on the database according to the obtained AOSN, and performs corresponding operations on the database by the data configuration operation sub-module.
  • the user can configure multiple AOSNs, and the query request operation is included in the issued query operation request.
  • AOSN such that the data configuration operation conversion sub-module converts the query operation request into multiple actual operations on the database according to the multiple AOSNs, and the data configuration operation sub-module performs corresponding operations on the database to obtain a plurality of data, so that It is possible to compare the difference in data after two data configuration operations.
  • Step 306 For the rollback of the data configuration, the user may send a rollback operation request through the service layer to trigger the rollback process, and the rollback operation request needs to include the rollback operation sequence number, when configuring the query in the function module.
  • the AOSN acquisition sub-module After the fallback operation sub-module receives the rollback operation request, the AOSN acquisition sub-module will take the rollback operation sequence number as the value of the AOSN, and the AOSN obtained by the AOSSN acquisition sub-module will be rolled back through the data configuration operation conversion sub-module.
  • the operation request is converted into the actual operation of the database, and the data configuration operation sub-module performs corresponding operations on the database.
  • the user can set the rollback operation sequence number to any integer between 100 and 103 to trigger the rollback process.
  • the data configuration device searches the database for the cosn in the configuration item table.
  • the data corresponding to the rollback operation sequence number is less than or equal to the rollback operation sequence number, and the data corresponding to the rollback operation sequence number or dosn is empty, including a and b values, so that the state of any configuration data between 100 and 103 can be rolled back. Step back or achieve full rollback.
  • the specific data configuration and the fallback process are similar to the corresponding embodiment of FIG. 4, except that when the cosn and dosn corresponding to the data a and b are recorded, they are recorded in the two configuration item tables respectively; When performing data rollback, you need to combine the two configuration item tables and then look up. Specifically, when the two configuration item tables are combined, when the data a and b in the configuration item table 1 are consistent with the data a and b in the configuration item table 2, the consistent data a and b correspond to the configuration item table 1 The cosn and the dosn corresponding to the configuration item table 2 serve as cosn and dosn corresponding to the consistent data a and b.
  • two types of data are stored in the database, and the relationship between the creation operation sequence number, the deletion operation sequence number, and the data is represented by the method (3), and the configuration item table of this embodiment is used.
  • the specific data configuration and the fallback process are similar to the corresponding embodiment of FIG. 4, except that when the data a and b and the corresponding cosn and dosn are recorded, they are respectively recorded in the two configuration item tables, and the data is searched ( Or the data configuration rollback is performed, the two configuration item tables need to be jointly searched.
  • the cosn is found in the configuration item table 4 to be greater than or equal to the AOSN (or the rollback operation sequence number), and Dosn is smaller than the data b corresponding to the AOSN (or the rollback operation sequence number) or the dosn is empty, and the corresponding data a is found in the configuration item table 3 according to the data b.
  • the data b as an association item can be uniquely associated with the data a and the corresponding cosn and dosn.
  • the configuration function in the data configuration device The module performs data configuration and its fallback, and the data configuration operation conversion sub-module may not be independent, that is, the step of converting according to the conversion rule may be omitted, but the database is directly operated according to the conversion rule.
  • the data configuration operation conversion module can be implemented by borrowing a database, for example, creating a trigger and a view for the configuration item table stored in the database, and when the validity judgment sub-module determines that the operation request of the data configuration is valid. Triggering the trigger to directly operate on the database according to a certain rule, wherein the rule for the trigger operation is consistent with the conversion rule used by the data configuration operation conversion module to convert the data configuration operation request; when the query/return operation subroutine
  • the module receives the query or the rollback operation request, and the view obtains the corresponding data in the database according to the AOSN obtained by the AOS, and the certain rule, and the corresponding data is displayed in the database for display, and the view performs the parameter search and data configuration operation conversion sub-module conversion.
  • the rules used to query or roll back the operation request are the same and will not be described here.
  • the data configuration device when a user tries to configure data through certain functions of the service layer, the data configuration device does not take effect of each configured data, but needs to preset POSN and AOSN in the database. Configure the device to perform multiple data configurations as shown in Figure 1. In this process, the POSN is updated with the change of the operation sequence number assigned to the operation request configured for the data, and the preset AOSN in the database is fixed, and the data configuration device displays the corresponding recorded according to the PSON. Data not in effect.
  • the data of the multiple configurations can be validated, that is, the value of the AOSN is set to PSON; after some functions are tried, the data in the database needs to be returned to the state before the data configuration, then the data
  • the configuration device can read the AOSN stored in the database, and store the DOSN stored in the database is greater than (or less than) the read AOSN or DOSN is empty, and the COSN is less than or equal to (or greater than or equal to) the read AOSN corresponding to The configuration items are displayed.
  • An embodiment of the present invention provides another data configuration device, which is shown in FIG. 6.
  • the request receiving unit 20 is configured to receive a data configuration operation request, where the data configuration operation request includes inserting a data request and deleting a data request. Or update the data request;
  • a sequence number allocating unit 21 configured to allocate an operation sequence number to the operation request received by the request receiving unit 20
  • the recording unit 22 is configured to record, according to the data configuration operation request received by the request receiving unit 20, the operation sequence number assigned by the sequence number assignment unit 21 and the data requested by the data configuration operation request into a creation operation sequence number, and delete The correspondence between the operation number and the data.
  • the corresponding relationship between the creation operation sequence number, the deletion operation sequence number, and the data may be a creation operation sequence number, a deletion operation sequence number, and a data correspondence relationship stored in a configuration item table; or, a creation operation sequence stored in the first configuration item table.
  • Correspondence between the number and the data, and the correspondence between the sequence number of the deletion operation stored in the second configuration item table and the data; or, the plurality of types of data stored in the third configuration item table, and the fourth configuration item table The stored creation operation serial number, the deletion operation serial number, and the correspondence relationship of at least one type of the plurality of types of data.
  • the recording unit 22 specifically records the insertion requested by the insertion data request if the operation request received by the request receiving unit 20 is an insertion data request, and the operation requested by the operation request is an operation of inserting data.
  • the data is recorded, and the operation sequence number corresponding to the insertion data is the operation sequence number assigned by the sequence number allocation unit 21, and the deletion operation sequence number corresponding to the insertion data is empty; if the operation request received by the request receiving unit 20 is the deletion data request, the operation request is If the requested operation is an operation of deleting data, the deletion operation sequence number corresponding to the deletion data requested by the record deletion data request is the operation sequence number assigned by the sequence number assignment unit 21; if the operation request received by the request receiving unit 20 is an update data request Then, the operation requested by the operation request includes the operation of inserting the update data and deleting the original data, recording the update data requested by the update data request, and recording the operation sequence number assigned by the sequence number assignment unit 21 corresponding to the creation operation sequence number corresponding to the update data, Record update number
  • the data configuration operation request when the request receiving unit 20 receives the operation request of the data configuration, the data configuration operation request includes an insert data request, a delete data request, or an update data request, and the sequence number assigning unit 21 is The data configuration operation requests the assignment operation sequence number, and the recording unit 22 records the assigned operation sequence number and the data requested by the data configuration operation request as the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data.
  • the sequence number assigning unit 21 is The data configuration operation requests the assignment operation sequence number
  • the recording unit 22 records the assigned operation sequence number and the data requested by the data configuration operation request as the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data.
  • the data configuration device may include, in addition to the structure shown in FIG. 6, a validity determining unit 23, a display unit 24, and a configuration deleting unit 25, where:
  • the validity determining unit 23 is configured to determine whether the data configuration operation requested by the operation request is valid.
  • the recorded data includes the operation operation sequence number is less than or equal to a preset operation sequence number, and the deletion operation sequence number is greater than the preset operation sequence number or the Deleting the data corresponding to the operation sequence number is empty; or, the recorded data includes the operation operation sequence number greater than or equal to the preset operation sequence number, and the deletion operation sequence number is smaller than the preset operation sequence number or deletion operation
  • the data corresponding to the empty number is empty;
  • the preset operation sequence number includes: an operation sequence number assigned to the current data configuration operation request or a preset effective operation sequence number AOSN.
  • the configuration deletion unit 25 is configured to delete the data corresponding to the deletion operation sequence number less than or equal to an effective operation sequence number, where the effective operation sequence number is the operation sequence number allocated for the current data configuration operation request.
  • the validity determining unit 23 may first perform the validity determination. If it is valid, the sequence number assigning unit 21 allocates the operation sequence number, and is performed by the recording unit 22. recording.
  • the request receiving unit 20, the sequence number assigning unit 21, the recording unit 22, and the validity determining unit 23 in the data configuration apparatus of the present embodiment can display the data recorded by the recording unit 22 by the display unit 24 after the data configuration is performed, if If the configuration is correct, the data for implementing the configuration is confirmed.
  • the configuration deletion unit 25 deletes the data record corresponding to the record whose operation number is less than or equal to an effective operation number.
  • the embodiment of the present invention further provides a data configuration device, and the structure of the device is as shown in FIG. 8 , and includes: a rollback sequence number obtaining unit 10, configured to acquire a sequence number of the rollback operation of the data configuration;
  • the configuration data obtaining unit 11 is configured to obtain, according to the correspondence recorded in the storage unit 12, a recurring operation sequence number obtained by the retrieving sequence number obtaining unit 10 that is smaller than or equal to the revocation operation sequence number, and the deletion operation sequence number is greater than the retreat sequence number.
  • the data of the rollback operation sequence number or the deletion operation sequence number obtained by the obtaining unit 10 is empty;
  • the configuration data obtaining unit 11 is configured to obtain the creation operation sequence number greater than or equal to the fallback operation.
  • the serial number, and the deletion operation sequence number is smaller than the data corresponding to the rollback operation sequence number or the deletion operation sequence number is empty;
  • the storage unit 12 is configured to store the correspondence between the creation operation sequence number, the deletion operation sequence number, and the at least one data.
  • the storage unit 12 may store the correspondence between the creation operation sequence number, the deletion operation sequence number, and the data by using a configuration item table; or, the storage unit 12 stores the correspondence between the creation operation sequence number and the data by using the first configuration item table. And storing, by using the second configuration item table, a correspondence between the sequence number of the deletion operation and the data; or, the storage unit 12 stores the plurality of types of data by using the third configuration item table, and storing the creation operation sequence number and the deletion operation by using the second configuration item table A serial number and a correspondence between at least one type of data of the plurality of types of data.
  • the configuration data acquiring unit 11 obtains, according to the corresponding relationship stored by the storage unit 12, that the creation operation sequence number is less than or equal to (or greater than or equal to )
  • the operation sequence number is retracted, and the data whose sequence number is greater than (or less than) the rollback operation sequence number or the deletion operation sequence number is empty.
  • the data configuration device includes, in addition to the structure shown in FIG. 8, an operation request receiving unit 13, an operation number assigning unit 14, a configuration recording unit 15, and a judgment.
  • Unit 16 wherein:
  • An operation request receiving unit 13 is configured to receive an operation request of a data configuration, where the data configuration operation request includes an insert data request, a delete data request, or an update data request;
  • the determining unit 16 is configured to determine whether the data configuration operation requested by the operation request is valid, and if valid, the operation sequence number assigning unit 14 assigns an operation sequence number;
  • the operation sequence number assigning unit 14 is configured to allocate an operation sequence number to the operation request acquired by the operation request receiving unit 13;
  • a configuration recording unit 15 configured to record, according to the data configuration operation request, the allocated operation serial number and the data requested by the data configuration operation request into a creation operation sequence number, and a deletion operation The correspondence between the serial number and the data is stored in the storage unit 12.
  • the configuration recording unit 15 is configured to record the insertion data requested by the insertion data request, and record the creation operation sequence corresponding to the insertion data as The assigned operation sequence number, the deletion operation sequence number corresponding to the insertion data is empty; if the data configuration operation request received by the operation request receiving unit 13 is a deletion data request, the configuration recording unit 15 is configured to record the request for deleting the data request The deletion operation sequence number corresponding to the deletion data is the assigned operation sequence number; if the data configuration operation request received by the operation request receiving unit 13 is an update data request, the configuration record unit 15 is configured to record the update data requested by the update data request. And recording the operation operation sequence number corresponding to the update data as the assigned operation sequence number, and deleting the operation operation sequence number corresponding to the original data requested by the update data request is the allocated operation sequence number.
  • the configuration data in the storage unit 12 can be configured by the operation request receiving unit 13, the operation number assigning unit 14, the configuration recording unit 15, and the judging unit 16.
  • the operation request receiving unit 13 the operation number assigning unit 14
  • the configuration recording unit 15 the configuration recording unit 15
  • the judging unit 16 the configuration data in the storage unit 12 can be configured by the operation request receiving unit 13, the operation number assigning unit 14, the configuration recording unit 15, and the judging unit 16.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: ROM, RAM, disk or CD, etc.

Abstract

一种数据配置及其回退方法和设备,应用于信息处理技术领域。一种数据配置方法包括:接收数据配置操作请求,数据配置操作请求包括插入数据请求、删除数据请求或更新数据请求;为数据配置操作请求分配操作序号;根据数据配置操作请求,将分配的操作序号和数据配置操作请求所请求操作的数据记录成创建操作序号、删除操作序号和数据的对应关系。一种数据配置的回退方法包括:获取数据配置的回退操作序号;根据记录的创建操作序号、删除操作序号和数据的对应关系,获取创建操作序号小于或等于(或大于或等于)回退操作序号,且删除操作序号大于(或小于)回退操作序号或删除操作序号为空所对应的数据。实现了数据的配置操作和数据配置的回退。

Description

数据配置及其回退方法和设备
技术领域
本发明涉及信息处理技术领域, 特别涉及数据配置及其回退方法和设备。 背景技术
在信息处理技术领域,对设备或业务进行管理时, 都需要进行一定的数据 配置, 比如对物理设施、 逻辑结构和业务等信息的配置, 具体地, 可以将配置 数据以记录的形式来描述现实中的一个配置项, 例如, 在关系型数据库中, 对 设备单板创建一个表来管理单板的配置数据。
数据配置的回退是比较重要的功能, 主要是在执行完数据的配置操作后, 对新配置的数据进行验证,如果发现新配置的数据有误, 就需要进行数据配置 的回退, 退回到之前配置的数据; 如果新配置的数据无误就确认实施新配置的 数据。
现有一种数据配置包括: 当配置操作开始时,将当前的配置数据进行备份 形成主用状态和备用状态的数据,对主用状态的数据进行若干次的配置后,如 果需要数据配置的回退时,将配置的数据和未配置的数据状态进行切换, 则主 用状态的数据即为未配置的数据; 如果新配置的数据无误, 则删除未配置的数 据。 但是这种方法需要备份当前的配置数据, 使得对存储空间的要求增加, 且 难以支持单步回退。
而另一种数据配置的方法中, 不需要备份配置数据, 减低了对存储空间的 要求, 且可以支持单步回退, 具体地, 在执行每个数据配置操作时, 为该数据 配置操作形成一个反向操作,如果需要进行数据配置的回退时执行反向操作即 可实现回退的功能。 由于在具体的数据配置过程中,有些数据配置的操作比较 复杂, 则生成反向操作的算法复杂; 且数据配置的操作比较多, 在进行回退时 都需要执行相应的反向操作, 使得回退的时间较长即回退率比较低。
发明内容
本发明实施例提供数据配置及其回退方法和设备,简化数据配置及其回退 操作。
本发明实施例提供一种数据配置方法, 包括:
接收数据配置操作请求, 所述数据配置操作请求包括插入数据请求、删除 数据请求或更新数据请求;
为所述数据配置操作请求分配操作序号;
根据所述数据配置操作请求,将所述分配的操作序号和所述数据配置操作 请求所请求操作的数据记录成创建操作序号、 删除操作序号和数据的对应关 系。
本发明实施例还提供一种数据配置设备, 包括:
请求接收单元, 用于接收数据配置操作请求, 所述数据配置操作请求包括 插入数据请求、 删除数据请求或更新数据请求;
序号分配单元, 用于为所述请求接收单元接收的操作请求分配操作序号; 记录单元, 用于根据所述请求接收单元接收的数据配置操作请求,将所述 序号分配单元分配的操作序号和所述数据配置操作请求所请求操作的数据记 录成创建操作序号、 删除操作序号和数据的对应关系。
在本实施例的数据配置过程中,需要为每个数据配置操作请求分配操作序 号,其中数据配置操作请求包括插入数据请求、删除数据请求或更新数据请求, 且根据数据配置操作请求,将分配的操作序号和数据配置操作请求所请求操作 的数据记录成创建操作序号、删除操作序号和数据的对应关系。 这样与现有技 术中需要在进行每一次数据配置操作时, 需要生成一个反向操作相比, 本实施 例中的分配、记录操作序号和记录数据的操作比较简单,从而简化了数据配置 的操作; 且本实施例中只需要储存数据、创建操作序号和删除操作序号的相互 关联关系, 对存储空间的要求不高。
本发明实施例提供一种数据配置的回退方法, 包括:
获取数据配置的回退操作序号;
根据记录的创建操作序号、删除操作序号和数据的对应关系, 获取创建操 作序号小于或等于所述回退操作序号,且删除操作序号大于所述回退操作序号 或删除操作序号为空所对应的数据;
或, 根据记录的创建操作序号、 删除操作序号和数据的对应关系, 获取创 建操作序号大于或等于所述回退操作序号,且删除操作序号小于所述回退操作 序号或删除操作序号为空所对应的数据。
本发明实施例提供一种数据配置设备, 包括: 回退序号获取单元, 用于获取数据配置的回退操作序号;
配置数据获取单元, 用于根据储存单元中记录的对应关系, 获取创建操作 序号小于或等于所述回退序号获取单元获取的回退操作序号,且删除操作序号 大于所述回退序号获取单元获取的回退操作序号所对应的数据;或用于获取创 建操作序号大于或等于所述回退操作序号,且删除操作序号小于所述回退操作 序号或删除操作序号为空所对应的数据;
储存单元,用于储存所述创建操作序号、删除操作序号和数据的对应关系。 可见本发明实施例的数据配置的回退方法和相关设备中,通过获取数据配 置的回退操作序号后, 获取到创建操作序号小于或等于(或大于或等于)回退 操作序号, 且删除操作序号大于(或小于)回退操作序号或删除操作序号为空 所对应的数据。相对于现有技术中执行一个反向操作来实现回退相比, 本发明 实施例中的回退过程中, 只需要根据关联关系查找数据,从而实现了数据配置 的回退, 可以退回到任一次执行任一次数据配置的操作后, 简化了数据配置的 回退操作, 且提高了回退率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的一种数据配置方法的流程图;
图 2是本发明实施例提供的数据配置过程的流程图;
图 3是本发明实施例提供的另一种数据配置方法的流程图;
图 4是本发明实施例提供的数据配置及其回退过程的结构示意图; 图 5是本发明实施例中在数据配置的过程中配置项表的结构示意图; 图 6是本发明实施例提供的一种数据配置设备的结构示意图;
图 7是本发明实施例提供的另一种数据配置设备的结构示意图;
图 8是本发明实施例提供的另一种数据配置设备的结构示意图;
图 9是本发明实施例提供的另一种数据配置设备的结构示意图。
具体实施方式 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明实施例提供一种数据配置方法及相应的数据配置的回退方法,应用 于任一个具有数据配置功能的领域, 其中对于数据配置方法来说,是由具有数 据配置的功能设备(即数据配置设备) 来执行, 流程图如图 1所示, 包括: 步骤 101 , 接收数据配置操作请求, 所述数据配置操作请求包括插入 ( Insert )数据请求、 删除(delete )数据请求或更新数据请求。
可以理解, 在对设备或业务等进行管理时, 需要通过数据配置操作请求来 触发对设备或业务等相关数据的配置,具体可以由用户通过业务层发送数据配 置操作请求, 并触发本实施例中数据配置的过程; 也可以由系统中的其它操作 来触发数据配置的过程。
其中在数据配置操作请求中可以包括请求配置的数据地址、标识和具体操 作 (比如插入数据, 或修改数据, 或更新数据)等信息。
步骤 102, 为所述数据配置操作请求分配操作序号。
当数据配置设备接收到数据配置操作请求后,可以以递增或递减的方式为 该操作请求分配操作序号 (Operation Serial Number, OSN ), 用来唯一标识一 个数据配置操作请求。 如果以递增(或递减)的方式进行分配, 则为当前接收 的操作请求分配的操作序号是在为上次获取的操作请求分配的操作序号的基 础上加(或减) 1或 n的结果。
步骤 103 , 根据数据配置操作请求, 将步骤 102中分配的操作序号和数据 配置操作请求所请求操作的数据记录成插入配置数据的创建操作序号 ( Creation OSN, COSN )、 删除配置数据的删除操作序号 ( Deletion OSN, DOSN )和数据的对应关系。
本实施例中记录的每种类型的数据都与 COSN和 DOSN相互关联, 比如 数据有两种类型即设备型号的数据和设备出厂日期的数据,其中设备型号的数 据(或设备出厂日期的数据 )都与 COSN和 DOSN相互关联。
具体地, 记录对应关系的步骤具体包括: 若所述数据配置操作请求为插入数据请求,则该操作请求所请求的操作为 插入数据的操作, 则记录插入数据请求所请求的插入数据, 并记录该插入数据 对应的 COSN为步骤 102中分配的 OSN, 而插入数据对应的删除操作序号为 空;
若所述数据配置操作请求为删除数据请求,则该操作请求所请求的操作为 删除数据的操作, 则记录该删除数据请求所请求的删除数据对应的 DOSN为 步骤 102中分配的 OSN;
若所述数据配置操作请求为更新数据请求,则该操作请求所请求的操作为 删除原始数据并插入新数据的配置操作,则记录更新数据请求所请求的更新数 据, 并记录该更新数据对应的 COSN为步骤 102中分配的 OSN, 记录该更新 数据请求所请求的原始数据对应的 DOSN为步骤 102中分配的 COSN。
需要说明的是,上述步骤 101到 103是进行一次数据配置的操作过程即对 一个数据配置操作请求进行操作的过程,按照上述步骤 101到 103进行若干次 的数据配置后, 则系统中储存的每项数据(一项数据包括至少一种类型数据) 都记录了对应的创建操作序号 COSN,但是并不是每项数据都记录有对应的删 除操作序号 DOSN,有些项数据对应的删除操作序号为空,说明在数据配置过 程中没有删除该项数据。
可见,在本实施例的数据配置过程中, 需要为每个数据配置操作请求分配 操作序号, 其中该数据配置操作请求包括插入数据请求、删除数据请求或更新 数据请求, 且根据数据配置操作请求, 将分配的操作序号和数据配置操作请求 所请求操作的数据记录成创建操作序号、删除操作序号和数据的对应关系。这 样与现有技术中需要在进行每一次数据配置操作时,需要生成一个反向操作相 比, 本实施例中的分配、 记录操作序号和记录配置数据的操作比较简单, 从而 简化了数据配置的操作; 且本实施例中只需要储存数据、创建操作序号和删除 操作序号的相互对应关联关系, 对存储空间的要求不高。
需要说明的是, 在数据配置设备中还可以预置一个生效的操作序号 ( Active OSN, AOSN ), 用来指示经过上述步骤 101到 103的数据配置后, 在系统中已记录的数据中生效的数据,这样数据配置设备就可以根据该 ASON 来显示生效的数据。 具体地,如果在执行上述步骤 102时按照递增的方式来分配操作序号, 则 显示创建操作序号小于或等于生效的操作序号,且删除操作序号大于生效的操 作序号或删除操作序号为空所对应的数据;如果在执行上述步骤 102时按照递 减的方式来分配操作序号, 则显示创建操作序号大于或等于 ASON, 且删除操 作序号小于 AOSN或删除操作序号为空对应的数据。 特别地, 本实施例中对 于操作请求中请求删除的数据是储存在配置设备的底层,但是并不显示在业务 层,这样在用户看来则相当于删除了数据,删除的数据对于用户来说是透明的。
( 1 )在一种场景下:
进行数据配置的过程中,数据配置设备可以在进行每一次数据配置的操作 后, 都会生效该次配置的数据, 则在数据配置设备中配置的 ASON需要随着 分配的操作序号的变化而更新,具体地更新成为当前数据配置的操作请求分配 的操作序号。
( 2 )在另一种场景下:
在进行数据配置的过程中, 数据配置设备并不需要生效每一次配置的数 据, 而可以在进行若干次数据配置的操作后, 如果配置无误, 才生效这若干次 的配置, 如果配置有误, 则不生效这若干次的配置, 简化了数据配置的过程。 在这种情况下, 还需要在数据配置设备中预置一个当前的操作序号 (Present OSN, POSN ), 而 AOSN可以为一个预置的操作序号, 在开始配置数据的操 作后, AOSN固定不变, 而 POSN需要随着分配的操作序号的变化而更新, 具 体地更新成为当前数据配置的操作请求分配的操作序号。
且在数据配置的过程中, 数据配置设备可以不需要根据 AOSN显示生效 的数据,而是根据 PSON显示已按照步骤 101到 103进行记录但是未生效的数 据, 这样用户才能根据显示的数据继续配置。 具体地, 在根据 PSON显示配置 数据时,如果在执行上述步骤 102时按照递增的方式来分配操作序号, 则显示 创建操作序号小于或等于 PSON,且删除操作序号大于 PSON或删除操作序号 为空所对应的数据;如果在执行上述步骤 102时按照递减的方式来分配操作序 号, 则显示创建操作序号大于或等于 PSON, 且删除操作序号小于 PSON或删 除操作序号为空对应的数据。
在若干次数据配置后, 如果配置无误, 在生效这若干次数据配置时, 可以 将预置的 ASON值置为 PSON的值, 如果配置有误, 则不生效这若干次数据 配置。
在另外一些具体的实施例中, 为了确保数据配置操作的正确性, 在数据配 置设备执行上述步骤 101即接收到操作请求之后,还需要判断步骤 101中接收 的操作请求所请求的数据配置操作是否有效, 如果是, 才执行步骤 102, 如果 不是, 则结束流程。
具体地,在进行有效性的判断时,数据配置设备可以根据一定的预置策略 判断该操作请求对应的业务逻辑是否正确, 例如, 该操作请求是对单板的属性 如机架号和框号等数据的配置, 则需要在设备中已储存有该机架号和框号等。
参考图 2所示,数据配置设备在按照上述 101到 103的步骤进行若干次(比 如 、 B和 C操作)的数据配置后, 需要对新配置的数据进行验证, 如果配置 无误则确认实施新配置的数据, 具体地, 可以将 DOSN小于或等于一个生效 的操作序号(AOSN )对应的数据删除, 且 AOSN的具体值可以由用户通过业 务层进行配置,也可以是为当前数据配置的操作请求分配的操作序号; 如果配 置有误则需要进行数据配置的回退,可以退回到执行任一次数据配置的操作后 比如 A或 B操作。
在本发明实施例中对于数据配置的回退方法来说,可以由具有数据配置的 功能设备(即数据配置设备) 来执行, 流程图如图 3所示, 包括:
步骤 201 , 获取数据配置的回退操作序号。
这里回退操作序号可以认为是在数据配置过程中,执行某一个数据配置操 作请求时分配的操作序号,且本实施例的回退方法可以由用户通过业务层发送 回退请求来触发, 在回退请求中可以包括该回退操作序号。
步骤 202, 根据记录的创建操作序号、 删除操作序号和数据的对应关系, 获取插入配置数据的创建操作序号小于或等于回退操作序号,且删除配置数据 的删除操作序号大于回退操作序号或删除操作序号为空所对应的数据。
或是, 获取插入配置数据的创建操作序号大于或等于回退操作序号,且删 除配置数据的删除操作序号小于回退操作序号或删除操作序号为空所对应的 数据。其中删除操作序号为空则说明在数据配置的过程中, 并没有删除该删除 操作序号对应的数据。 如果为数据配置操作请求分配的操作序号是递增的,则对于同一个数据来 说, 其对应的创建操作序号必定会小于删除操作序号, 则获取到创建操作序号 小于或等于回退操作序号,且删除操作序号大于回退操作序号或删除操作序号 为空所对应的数据, 就实现了数据配置的回退, 即退回到执行完该回退操作序 号所对应的操作请求之后的数据状态,具体是在未执行获取到的数据的删除操 作之前的状态。
例如, 对于两种类型的数据 a和 b来说, 在获取到操作序号为 102所对应 的数据配置操作请求时, 插入配置数据 a=2和 b=3 , 在获取到操作序号为 103 所对应的数据配置操作请求为删除配置数据 a=2和 b=3的请求时,系统中会储 存配置数据 a=2和 b=3 , COSN=102及 DOSN=103的对应关系,且此时显示给 用户的就没有 a=2和 b=3这一项数据。在进行数据配置的回退时,如果当前接 收到的回退操作序号为 102 , 则获取到 DOSN大于 102, 且 COSN小于或等于 102所对应的数据, 即 a=2和 b=3。
如果为数据配置操作请求分配的操作序号是递减的,则对于同一个数据来 说, 其对应的创建操作序号必定会大于删除操作序号, 则获取到创建操作序号 大于或等于回退操作序号,且删除操作序号小于回退操作序号或删除操作序号 为空所对应的数据, 就实现了数据配置的回退, 即退回到执行完该回退操作序 号所对应的数据配置操作请求之后的数据状态 ,具体是在未执行获取到的数据 的删除操作之前的状态。
可见, 通过上述步骤 201到 202, 实现了数据配置的回退, 具体地, 通过 获取数据配置的回退操作序号后, 获取到创建操作序号小于或等于(或大于或 等于)回退操作序号, 且删除操作序号大于(或小于)回退操作序号或删除操 作序号为空所对应的数据。可见,相对于现有技术中执行一个反向操作来实现 回退相比, 本发明实施例中的回退过程中, 只需要根据对应关系查找数据, 从 而实现了数据配置的回退, 可以退回到执行任一次数据配置的操作后, 简化了 数据配置的回退操作, 且提供了回退率。
需要说明的是, 上述实施例中所述的创建操作序号、删除操作序号和数据 相互对应, 且它们三个之间的相互对应关系可以通过任意形式的介质进行存 储, 比如通过磁盘或内存或闪存等进行储存; 还可以以任意形式的逻辑结构进 行存储, 比如通过关系表, 或数据库, 或树形或链表等形式进行存储。 且该相 互对应的关联关系可以用如下几种方法来表示:
( 1 )用一个配置项表存储的创建操作序号、 删除操作序号和数据的对应 关系来表示;
( 2 )用两个配置项表存储的对应关系, 具体地, 用第一配置项表储存的 创建操作序列号与数据的对应关系,及, 用第二配置项表储存的删除操作序列 号与数据的对应关系来表示; 在这种情况下,是通过第一配置项表和第二配置 项表中相同的一种类型数据将两个配置项表进行关联起来;
( 3 )用两个配置项表存储的对应关系, 具体地, 主要针对存储有多种类 型数据的情况来说, 用第三配置项表储存多种类型数据, 及, 用第四配置项表 储存创建操作序号、删除操作序号及第三配置型表的多种类型数据中至少一种 数据的对应关系来表示。在这种情况下,是通过将第四配置项表中储存的至少 一种类型数据作为关联项, 将第三配置项表和第四配置项表关联起来的。
以下以具体的例子说明本实施例的数据配置及其回退方法:
具体应用例一、
在本实施例中在数据库存储有两种类型数据即 a和 b, 且通过第 ( 1 )种 方法来表示创建操作序号、删除操作序号和数据的相互关联关系, 则本实施例 的配置项表为 tbl ( a, b, cosn, dosn ), 具体进行数据配置及其回退过程的结 构示意图如图 4所示, 包括:
步骤 301 , 用户通过业务层下发数据配置操作请求到数据配置设备的配置 功能模块,则该配置功能模块中的序号分配子模块就会为该操作请求分配一个 OSN, 在本实施例中分配的 OSN是单向递增的, 在其它实施例中分配的 OSN 可以是单向递减的。
步骤 302 , 配置功能模块中的有效性判断子模块判断该操作请求是否有 效, 主要是对操作请求进行业务逻辑的分析, 分析操作请求所请求操作的数据 的有效性, 与系统中已储存数据的一致性判断等。 如果判断有效, 则由配置功 能模块中的数据配置操作转换子模块执行步骤 303 , 如果无效, 则结束流程。
例如,在操作请求中请求对机架号为 X ,框号为 y的单板的属性进行配置, 则在数据配置设备的数据库中需要储存有这些该单板的机架号 X和框号 y , 该 操作请求才有效; 又例如, 在数据库中还储存有该单板的机架属性, 则在数据 库中储存的该单板的机架号需要与操作请求中请求的机架号一致,该操作请求 才有效等。
步骤 303 , 配置功能模块中的数据配置操作转换子模块可以按照预置的转 换规则对该操作请求进行转换,转换为对数据配置设备中数据库进行的实际操 作。
例如, 当操作请求为插入数据的请求, 则数据配置操作转换子模块可以按 照转换规则 1进行转换, 该转换规则 1为: 将数据插入数据库的配置项表中, 并将该配置项表中所插入的数据对应的 COSN置为该操作请求对应的 OSN, DOSN置为空;
当操作请求为删除数据的请求,则数据配置操作转换子模块可以按照转换 规则 2进行转换, 该转换规则 2为: 将该配置项表中需要删除的数据对应的 DOSN置为该操作请求的 OSN, 这种情况下, 并不需要将配置项表中的数据 进行删除, 而是不将该需要删除的数据显示给用户;
当操作请求为更新数据的请求,则数据配置操作转换子模块可以按照转换 规则 3进行转换, 该转换规则 3为: 将该配置项表中需要删除的原始数据对应 的 DOSN置为该操作请求的 OSN, 且插入新数据到配置项表中, 将插入的数 据对应的 COSN置为该操作请求的 OSN而 DOSN置为空, 在这种情况下, 并 不需要从配置项表中删除原始数据,而是不将该需要删除的原始数据显示给用 户。
如下表 1所示为对三个操作请求进行转换后的操作。
操作请求的 OSN 转换前 转换后 插入 a=l , b=l 在配置项表中插入 a=l , b=l , 且置对应的
100
的配置数据 cosn为 100 , dosn为空 删除 a=l的配
101 更新配置项表中 a= 1对应的 dosn为 101 置数据
102 当 a=l时置 b 将 a=l , b=2插入配置项表中, 并置对应的 为 2 cosn为 102, dosn为空; 再更新配置项表中 原来 a=l对应的 dosn为 102 表 1
步骤 304, 配置功能模块中的数据配置操作子模块按照转换的实际操作, 对数据库进行相应的操作。
可以理解, 在数据配置设备中预置有 ASON, 在执行上述步骤 301到 304 的数据配置过程中, 数据配置设备会生效每一次配置的数据, 则该 AOSN随 着为操作请求分配的操作序号的变化而更新,更新成为当前操作请求分配的操 作序号, 且数据配置设备根据该 AOSN显示生效的配置数据。
在完成数据的配置后,如果在对新配置的数据进行验证的过程中,确定需 要进行数据配置的回退, 则可以按照下述步骤 306进行回退,且可以按照下述 步骤 305来查询之前配置的数据; 如果确定不需要进行数据配置的回退, 则可 以实施确认新配置的数据, 具体地, 可以将 DOSN小于或等于 AOSN对应的 数据从配置项表中删除, 也可以将该 COSN和 DOSN删除, 且 AOSN的具体 值是为当前数据配置的操作请求分配的操作序号,也可以由用户通过业务层进 行配置。
步骤 305, 对于数据的查询, 可以由用户通过业务层下发查询操作请求来 触发查询的过程, 在查询操作请求中可以包括需要查询的具体信息,且在查询 操作请求中还可以包括配置的 AOSN等, 当配置功能模块中的查询 /回退操作 子模块接收到查询操作请求后; 则 AOSN获取子模块会获取到在数据配置设 备中预置的 AOSN或查询操作请求中配置的 AOSN, 通过数据配置操作转换 子模块按照获取的 AOSN将查询操作请求转换为对数据库进行的实际操作, 并由数据配置操作子模块对数据库进行相应的操作。
例如, 查询 /回退操作子模块接收到的查询操作请求中包括查询的信息为 在配置项表中查询当 a=l 的配置数据, 则 AOSN获取子模块查找到当前的 AOSN为 101 , 且数据配置操作转换子模块转换的实际操作为: 在配置项表中 查询当 a=l , 且对应的 dosn不为空, 且 cosn<=101<dosn的配置数据。
可以理解, 用户可以配置多个 AOSN, 则在下发的查询操作请求中包括多 个 AOSN, 这样数据配置操作转换子模块会分别根据多个 AOSN将查询操作 请求转换为对数据库进行的多个实际操作,并由数据配置操作子模块对数据库 进行相应的操作得到多项数据,这样就可以对比两次数据配置操作后的数据的 差异。
步骤 306, 对于数据配置的回退, 可以由用户通过业务层下发回退操作请 求来触发回退的过程,且在回退操作请求中需要包括回退操作序号, 当配置功 能模块中的查询 /回退操作子模块接收到回退操作请求后; 则 AOSN获取子模 块会将该回退操作序号作为 AOSN的值, 并通过数据配置操作转换子模块按 照 AOSN获取子模块获取的 AOSN将回退操作请求转换为对数据库进行的实 际操作, 并由数据配置操作子模块对数据库进行相应的操作。
例如,接收到的回退操作请求中包括的回退操作序号为 101 , 则 AOSN获 取子模块将 101作为 AOSN的值, 且数据配置操作转换子模块转换的实际操 作为: 查找配置项表中 cosn<=101<dosn对应的数据。
以下以 3个数据配置的过程进行具体说明,在数据配置设备的数据库中储 存着一个配置项表, 且表中可以包括两种类型数据 a和 b (表中一列为一种类 型数据, 在其他实施例中可以是一行为一种类型数据 )及对应的 cosn和 dosn: 参考图 5所示, 在未进行数据配置的操作时, OSN的初始值为 100 , 在数 据库中已经储存有 a=l和 b=l的数据, 这时 a=l和 b=l对应的 cosn不可用, 且 dosn为空;
在接收到数据配置的操作请求为插入 a=2和 b=2的请求,则数据配置设备 为该操作请求分配 OSN为 101 , 且将 a=2和 b=2插入配置项表中, 并将对应 的 cosn置为 101 , dosn仍为空;
在接收到数据配置的操作请求为当 a=2时修改 b为 3的请求,则数据配置 设备为该操作请求分配 OSN为 102, 且将 a=2和 b=3插入配置项表中, 并将 需要删除的一项原始数据(表中一行为一项数据, 在其它实施例中可以是一列 为一项数据 ) a=2和 b=2对应的 dosn置为 102, 且将插入的一项新数据 a=2和 b=3对应的 cosn置为 102, 这种情况下, 在数据库中储存的 a=2和 b=2对于用 户是透明的;
在接收到数据配置的操作请求为删除 a=2和 b=3的请求,则数据配置设备 为该操作请求分配 OSN为 103 , 且将需要删除的 a=2和 b=3对应的 dosn置为 103 , 这种情况下, 在数据库中储存的 a=2和 b=3对于用户是透明的。
当需要数据配置的回退时, 用户可以通过业务层设置回退操作序号为 100 到 103之间的任一整数, 触发回退的流程, 则数据配置设备会在数据库中查找 配置项表中 cosn小于或等于该回退操作序号, 且 dosn大于该回退操作序号或 dosn为空所对应的数据包括 a和 b值,这样可以回退到 100到 103之间任一项 配置数据的状态, 实现单步回退或实现全部回退。
具体应用例二、
在本实施例中在数据库中存储有两种类型数据即 a和 b, 通过第 (2 )种 方法来表示创建操作序号、删除操作序号和数据的相互关联关系, 则本实施例 的配置项表为 tbll ( a, b, cosn )和 tbl2 ( a, b, dosn ):
具体进行数据配置及其回退过程与图 4对应实施例类似, 所不同的是,在 记录数据 a和 b对应的 cosn和 dosn时, 分别记录在两个配置项表中; 在查找 数据(或进行数据配置的回退)时, 就需要先将两个配置项表联合起来, 然后 在进行查找。 具体在联合两个配置项表时, 当配置项表 1中数据 a和 b, 与配 置项表 2中的数据 a和 b—致时,将该一致的数据 a和 b在配置项表 1对应的 cosn和在配置项表 2对应的 dosn,作为该一致的数据 a和 b对应的 cosn和 dosn。
具体应用例三、
在本实施例中在数据库存储有两种类型数据即 a和 b, 且通过第 (3 )种 方法来表示创建操作序号、删除操作序号和数据的相互关联关系, 则本实施例 的配置项表为 tbl3 ( a, b )和 tbl4 ( b, cosn, dosn )。
具体进行数据配置及其回退过程与图 4对应实施例类似, 所不同的是,在 记录数据 a和 b与对应的 cosn和 dosn时, 分别记录在两个配置项表中, 在查 找数据(或进行数据配置的回退)时, 就需要将两个配置项表联合起来进行查 找, 具体地, 可以先在配置项表 4中查找到 cosn大于或等于 AOSN (或回退 操作序号), 且 dosn小于 AOSN (或回退操作序号)或 dosn为空所对应的数 据 b, 并根据数据 b在配置项表 3中找到对应的数据 a。 其中数据 b作为关联 项, 是可以唯一能关联到数据 a与对应的 cosn和 dosn的。
需要说明的是,在上述的三个具体应用例中,数据配置设备中的配置功能 模块进行数据配置及其回退, 而其中数据配置操作转换子模块可以不独立, 即 可以不用按照转换规则进行转换的步骤,而是直接按照转换规则对数据库进行 实际操作。
且数据配置操作转换模块具体可以借用数据库来实现, 比如, 为数据库中 储存的配置项表创建一个触发器(trigger )和视图(view ), 当有效性判断子模 块判断数据配置的操作请求有效后 ,触发该触发器直接按照一定的规则对数据 库进行操作,其中触发器进行操作的规则与数据配置操作转换模块进行转换数 据配置的操作请求时所用到的转换规则一致; 当查询 /回退操作子模块接收到 查询或回退操作请求, 视图会根据 AOSN获取子模块获取的 AOSN, 及一定 的规则在数据库中查找到相应的数据进行显示,视图进行查找数据的规则与数 据配置操作转换子模块转换查询或回退操作请求时所用的规则一致,在此不进 行赘述。
具体应用例四、
在一个具体的应用场景下,某一用户通过业务层试用某些功能而对数据进 行配置操作时,数据配置设备不会生效每一次配置的数据, 而需要在数据库中 预置 POSN和 AOSN,数据配置设备可以按照图 1所示方法进行多次的数据配 置。 在这个过程中, POSN会随着为数据配置的操作请求分配的操作序号的改 变而更新, 而数据库中预置的 AOSN 固定不变, 且数据配置设备会根据该 PSON进行显示相应的已记录但未生效的数据。 如果这多次的数据配置无误, 则可以生效这多次配置的数据, 即将 AOSN的值置为 PSON; 在试用了某些功 能后,数据库中的数据需要退回到数据配置之前的状态, 则数据配置设备可以 读取数据库中储存的 AOSN, 并将数据库中储存的 DOSN大于 (或小于)该 读取的 AOSN或 DOSN为空, 且 COSN小于或等于 (或大于或等于)该读取 的 AOSN对应的配置项进行显示。
本发明实施例提供另一种数据配置设备,其结构示意图如图 6所示,包括: 请求接收单元 20, 用于接收数据配置操作请求, 所述数据配置操作请求 包括插入数据请求、 删除数据请求或更新数据请求;
序号分配单元 21 , 用于为所述请求接收单元 20接收的操作请求分配操作 序号; 记录单元 22 , 用于根据所述请求接收单元 20接收的数据配置操作请求, 将所述序号分配单元 21分配的操作序号和所述数据配置操作请求所请求操作 的数据记录成创建操作序号、 删除操作序号和数据的对应关系。
这里的创建操作序号、删除操作序号和数据的对应关系具体可以为用一个 配置项表储存的创建操作序号、 删除操作序号和数据的对应关系; 或, 用第一 配置项表储存的创建操作序列号与数据的对应关系,及, 用第二配置项表储存 的删除操作序列号与数据的对应关系; 或, 用第三配置项表储存的多种类型数 据, 及, 用第四配置项表储存的创建操作序号、 删除操作序号及该多种类型数 据中至少一种类型数据的对应关系。
且记录单元 22具体在进行记录的操作时,若请求接收单元 20接收的操作 请求为插入数据请求, 则该操作请求所请求的操作为插入数据的操作, 则记录 该插入数据请求所请求的插入数据,并记录插入数据对应的创建操作序号为序 号分配单元 21分配的操作序号, 置插入数据对应的删除操作序号为空; 若请 求接收单元 20接收的操作请求为删除数据请求, 则该操作请求所请求的操作 为删除数据的操作,则将记录删除数据请求所请求的删除数据对应的删除操作 序号为序号分配单元 21分配的操作序号记录;若请求接收单元 20接收的操作 请求为更新数据请求 ,则该操作请求所请求的操作包括插入更新数据和删除原 始数据的操作, 则记录更新数据请求所请求的更新数据, 并记录更新数据对应 的创建操作序号为序号分配单元 21分配的操作序号, 记录更新数据请求所请 求的原始数据对应的删除操作序号为序号分配单元 21分配的操作序号。
可见, 在本实施例的数据配置设备中, 当请求接收单元 20接收了数据配 置的操作请求, 该所述数据配置操作请求包括插入数据请求、删除数据请求或 更新数据请求, 序号分配单元 21为数据配置操作请求分配操作序号, 且记录 单元 22将分配的操作序号和数据配置操作请求所请求操作的数据记录成创建 操作序号、删除操作序号和数据的对应关系。这样与现有技术中数据配置设备 需要在进行每一次数据配置操作时, 需要生成一个反向操作相比, 本实施例的 数据配置设备中进行分配、记录操作序号和记录数据的操作比较简单,从而简 化了数据配置的操作; 且本实施例中只需要储存数据、创建操作序号和删除操 作序号的相互关联关系, 对存储空间的要求不高。 参考图 Ί 所示, 在一个具体的实施例中, 数据配置设备除了包括如图 6 所示的结构外, 还可以包括: 有效性判断单元 23、 显示单元 24和配置删除单 元 25 , 其中:
有效性判断单元 23 , 用于判断所述操作请求所请求的数据配置操作是否 有效。
显示单元 24, 用于显示已记录的数据; 所述已记录的数据包括所述创建 操作序号小于或等于预置的操作序号,且所述删除操作序号大于所述预置的操 作序号或所述删除操作序号为空所对应的数据; 或, 所述已记录的数据包括所 述创建操作序号大于或等于所述预置的操作序号,且删除操作序号小于所述预 置的操作序号或删除操作序号为空对应的数据;
所述预置的操作序号包括:为当前数据配置操作请求分配的操作序号或预 置的生效的操作序号 AOSN。
配置删除单元 25 , 用于将删除操作序号小于或等于一个生效的操作序号 对应的数据删除,所述生效的操作序号是为当前数据配置操作请求分配的操作 序号。
在本实施例中, 在请求接收单元 20获取了操作请求后, 可以先由有效性 判断单元 23进行有效性的判断, 如果有效, 则序号分配单元 21才分配操作序 号, 并由记录单元 22进行记录。 且本实施例的数据配置设备中的请求接收单 元 20、 序号分配单元 21、 记录单元 22和有效性判断单元 23在进行数据配置 后, 可以由显示单元 24显示记录单元 22已记录的数据, 如果这些配置无误, 则确认实施这些配置的数据,具体可以由配置删除单元 25将记录单元 22记录 的数据中, 删除操作序号小于或等于一个生效的操作序号对应的数据项删除。
本发明实施例还提供一种数据配置设备,其结构示意图如图 8所示,包括: 回退序号获取单元 10 , 用于获取数据配置的回退操作序号;
配置数据获取单元 11 , 用于根据储存单元 12中记录的对应关系, 获取创 建操作序号小于或等于所述回退序号获取单元 10获取的回退操作序号, 且删 除操作序号大于所述回退序号获取单元 10获取的回退操作序号或删除操作序 号为空所对应的数据;
或配置数据获取单元 11用于获取创建操作序号大于或等于所述回退操作 序号,且删除操作序号小于所述回退操作序号或删除操作序号为空所对应的数 据;
储存单元 12, 用于储存所述创建操作序号、 删除操作序号和所述至少一 种数据的对应关系。
储存单元 12在储存对应关系时,可以用一个配置项表储存创建操作序号、 删除操作序号和数据的对应关系; 或, 储存单元 12用第一配置项表储存创建 操作序列号与数据的对应关系 ,及用第二配置项表储存删除操作序列号与数据 的对应关系; 或, 储存单元 12用第三配置项表储存多种类型数据, 及用第二 配置项表储存创建操作序号、删除操作序号及该多种类型数据中至少一种类型 数据的对应关系。
可见, 本实施例中, 回退序号获取单元 10获取数据配置的回退操作序号 后, 配置数据获取单元 11根据储存单元 12储存的对应关系, 获取到创建操作 序号小于或等于(或大于或等于)回退操作序号, 且删除操作序号大于(或小 于)回退操作序号或删除操作序号为空所对应的数据。 可见, 相对于现有技术 中执行一个反向操作来实现回退相比, 本发明实施例中的回退过程中, 只需要 根据相互关联关系查找数据,从而实现了数据配置的回退, 退回到对查找的一 项配置数据进行下一次的数据配置操作之前, 简化了数据配置的回退操作,且 提供了回退率。
参考图 9 所示, 在一个具体的实施例中, 数据配置设备除了包括如图 8 所示的结构外, 还可以包括: 操作请求接收单元 13、 操作序号分配单元 14、 配置记录单元 15和判断单元 16, 其中:
操作请求接收单元 13 , 用于接收数据配置的操作请求, 所述数据配置操 作请求包括插入数据请求、 删除数据请求或更新数据请求;
判断单元 16, 用于判断所述操作请求所请求的数据配置操作是否有效, 如果有效, 则操作序号分配单元 14分配操作序号;
操作序号分配单元 14 , 用于为所述操作请求接收单元 13获取的操作请求 分配操作序号;
配置记录单元 15 , 用于根据所述数据配置操作请求, 将所述分配的操作 序号和所述数据配置操作请求所请求操作的数据记录成创建操作序号、删除操 作序号和数据的对应关系, 并储存到储存单元 12中。
可以理解, 如果操作请求接收单元 13接收的数据配置操作请求为插入数 据请求, 配置记录单元 15用于记录所述插入数据请求所请求的插入数据, 并 记录所述插入数据对应的创建操作序号为所述分配的操作序号,所述插入数据 对应的删除操作序号为空; 如果操作请求接收单元 13接收的数据配置操作请 求为删除数据请求, 配置记录单元 15用于记录所述删除数据请求所请求的删 除数据对应的删除操作序号为所述分配的操作序号; 如果操作请求接收单元 13接收的数据配置操作请求为更新数据请求, 配置记录单元 15用于记录所述 更新数据请求所请求的更新数据 ,并记录所述更新数据对应的创建操作序号为 所述分配的操作序号,记录所述更新数据请求所请求的原始数据对应的删除操 作序号为所述分配的操作序号。
在本实施例中, 可以通过操作请求接收单元 13、 操作序号分配单元 14、 配置记录单元 15和判断单元 16对储存单元 12中的配置数据进行配置。 具体 的配置方法见上述方法实施例所述, 在此不进行赘述。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: ROM、 RAM, 磁盘或光盘等。
以上对本发明实施例所提供的数据配置及其回退方法和设备,进行了详细 施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于本领域 的一般技术人员,依据本发明的思想, 在具体实施方式及应用范围上均会有改 变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种数据配置方法, 其特征在于, 包括:
接收数据配置操作请求, 所述数据配置操作请求包括插入数据请求、删除 数据请求或更新数据请求;
为所述数据配置操作请求分配操作序号;
根据所述数据配置操作请求,将所述分配的操作序号和所述数据配置操作 请求所请求操作的数据记录成创建操作序号、 删除操作序号和数据的对应关 系。
2、 如权利要求 1所述的方法, 其特征在于, 所述根据所述数据配置操作 请求,将所述分配的操作序号和所述数据配置操作请求所请求操作的数据记录 成创建操作序号、 删除操作序号和数据的对应关系包括:
若所述数据配置操作请求为所述插入数据请求 ,则记录所述插入数据请求 所请求的插入数据,并记录所述插入数据对应的创建操作序号为所述分配的操 作序号, 所述插入数据对应的删除操作序号为空;
若所述数据配置操作请求为所述删除数据请求,则记录所述删除数据请求 所请求的删除数据对应的删除操作序号为所述分配的操作序号;
若所述数据配置操作请求为所述更新数据请求 ,则记录所述更新数据请求 所请求的更新数据,并记录所述更新数据对应的创建操作序号为所述分配的操 作序号,记录所述更新数据请求所请求的原始数据对应的删除操作序号为所述 分配的操作序号。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述接收数据配置操作 请求之后, 还包括:
判断所述操作请求所请求的数据配置操作是否有效,如果是, 则为所述操 作请求分配操作序号。
4、 如权利要求 1或 2所述的方法, 其特征在于, 还包括:
显示已记录的数据,所述已记录的数据包括创建操作序号小于或等于预置 的操作序号,且所述删除操作序号大于所述预置的操作序号或所述删除操作序 号为空所对应的数据;
或 ,所述已记录的数据包括所述创建操作序号大于或等于所述预置的操作 序号,且删除操作序号小于所述预置的操作序号或删除操作序号为空对应的数 据;
所述预置的操作序号包括:为当前数据配置操作请求分配的操作序号或预 置的生效的操作序号 AOSN。
5、 如权利要求 1至 4任一项所述的方法, 其特征在于, 还包括: 将删除操作序号小于或等于一个生效的操作序号对应的数据删除,所述生 效的操作序号是为当前数据配置的操作请求分配的操作序号。
6、 如权利要求 1至 5任一项所述的方法, 其特征在于, 所述创建操作序 号、 删除操作序号和数据的对应关系, 具体包括:
用一个配置项表储存的所述创建操作序号、删除操作序号和数据的对应关 系;
或, 用第一配置项表储存的所述创建操作序列号与数据的对应关系, 及, 用第二配置项表储存的所述删除操作序列号与数据的对应关系;
或, 用第三配置项表储存的多种类型数据, 及, 用第四配置项表储存的所 述创建操作序号、删除操作序号及所述多种类型中的至少一种类型数据的对应 关系。
7、 一种数据配置的回退方法, 其特征在于, 包括:
获取数据配置的回退操作序号;
根据记录的创建操作序号、删除操作序号和数据的对应关系, 获取创建操 作序号小于或等于所述回退操作序号,且删除操作序号大于所述回退操作序号 或删除操作序号为空所对应的数据;
或, 根据记录的创建操作序号、 删除操作序号和数据的对应关系, 获取创 建操作序号大于或等于所述回退操作序号,且删除操作序号小于所述回退操作 序号或删除操作序号为空所对应的数据。
8、 如权利要求 7所述的方法, 其特征在于, 所述获取数据配置的回退操 作序号之前还包括:
接收数据配置操作请求, 所述数据配置操作请求包括插入数据请求、删除 数据请求或更新数据请求;
为所述数据配置操作请求分配操作序号; 根据所述数据配置操作请求所请求,将所述分配的操作序号和所述数据配 置操作请求所请求操作的数据记录成创建操作序号、删除操作序号和数据的对 应关系。
9、 如权利要求 8所述的方法, 其特征在于, 所述根据所述数据配置操作 请求所请求,将所述分配的操作序号和所述数据配置操作请求所请求操作的数 据记录成创建操作序号、 删除操作序号和数据的对应关系具体包括:
若所述数据配置操作请求为所述插入数据请求 ,则记录所述插入数据请求 所请求的插入数据,并记录所述插入数据对应的创建操作序号为所述分配的操 作序号, 所述插入数据对应的删除操作序号为空;
若所述数据配置操作请求为所述删除数据请求,则记录所述删除数据请求 所请求的删除数据对应的删除操作序号为所述分配的操作序号;
若所述数据配置操作请求为所述更新数据请求 ,则记录所述更新数据请求 所请求的更新数据,并记录所述更新数据对应的创建操作序号为所述分配的操 作序号,记录所述更新数据请求所请求的原始数据对应的删除操作序号为所述 分配的操作序号。
10、 如权利要求 8或 9所述的方法, 其特征在于, 所述接收到数据配置操 作请求之后, 还包括:
判断所述操作请求所请求的数据配置操作是否有效,如果是, 则为所述操 作请求分配一个操作序号。
11、 如权利要求 7至 10任一项所述的方法, 其特征在于, 所述创建操作 序号、 删除操作序号和数据的对应关系具体包括:
用一个配置项表储存所述创建操作序号、 删除操作序号和数据的对应关 系;
或, 用第一配置项表储存所述创建操作序列号与数据的对应关系,及用第 二配置项表储存所述删除操作序列号与数据的对应关系;
或, 用第三配置项表储存多种类型数据,及用第四配置项表储存所述创建 操作序号、 删除操作序号及所述多种类型中的至少一种类型数据的对应关系。
12、 一种数据配置设备, 其特征在于, 包括:
请求接收单元, 用于接收数据配置操作请求, 所述数据配置操作请求包括 插入数据请求、 删除数据请求或更新数据请求;
序号分配单元, 用于为所述请求接收单元接收的操作请求分配操作序号; 记录单元, 用于根据所述请求接收单元接收的数据配置操作请求,将所述 序号分配单元分配的操作序号和所述数据配置操作请求所请求操作的数据记 录成创建操作序号、 删除操作序号和数据的对应关系。
13、 如权利要求 12所述的数据配置设备, 其特征在于,
当所述请求接收单元接收的数据配置操作请求为所述插入数据请求 ,所述 记录单元用于记录所述插入数据请求所请求的插入数据,并记录所述插入数据 对应的创建操作序号为所述分配的操作序号,所述插入数据对应的删除操作序 号为空;
当所述请求接收单元接收的数据配置操作请求为所述删除数据请求,所述 记录单元用于记录所述删除数据请求所请求的删除数据对应的删除操作序号 为所述分配的操作序号;
当所述请求接收单元接收的数据配置操作请求为所述更新数据请求,所述 记录单元用于记录所述更新数据请求所请求的更新数据,并记录所述更新数据 对应的创建操作序号为所述分配的操作序号,记录所述更新数据请求所请求的 原始数据对应的删除操作序号为所述分配的操作序号。
14、 如权利要求 12或 13所述的数据配置设备, 其特征在于, 还包括: 有效性判断单元, 用于判断所述操作请求所请求的数据配置操作是否有 效;
所述序号分配单元,用于在所述有效性单元判断所述操作请求所请求的数 据配置操作有效时, 分配操作序号。
15、 如权利要求 12至 14任一项所述的数据配置设备, 其特征在于, 还包 括:
显示单元, 用于显示已记录的数据; 所述已记录的数据包括创建操作序号 小于或等于预置的操作序号,且所述删除操作序号大于所述预置的操作序号或 所述删除操作序号为空所对应的数据; 或, 所述已记录的数据包括所述创建操 作序号大于或等于所述预置的操作序号,且删除操作序号小于所述预置的操作 序号或删除操作序号为空对应的数据; 所述预置的操作序号包括:为当前数据配置操作请求分配的操作序号或预 置的生效的操作序号 AOSN。
16、 如权利要求 12至 15任一项所述的数据配置设备, 其特征在于, 还包 括: 配置删除单元, 用于将删除操作序号小于或等于一个生效的操作序号对应 的数据删除, 所述生效的操作序号是为当前数据配置操作请求分配的操作序 号。
17、 一种数据配置设备, 其特征在于, 包括:
回退序号获取单元, 用于获取数据配置的回退操作序号;
配置数据获取单元, 用于根据储存单元中记录的对应关系, 获取创建操作 序号小于或等于所述回退序号获取单元获取的回退操作序号,且删除操作序号 大于所述回退序号获取单元获取的回退操作序号所对应的数据;或用于获取创 建操作序号大于或等于所述回退操作序号,且删除操作序号小于所述回退操作 序号或删除操作序号为空所对应的数据;
储存单元,用于储存所述创建操作序号、删除操作序号和数据的对应关系。
18、 如权利要求 17所述的数据配置设备, 其特征在于, 还包括: 操作请求接收单元, 用于获取数据配置操作请求, 所述数据配置操作请求 包括插入数据请求、 删除数据请求或更新数据请求;
操作序号分配单元,用于为所述操作请求接收单元获取的操作请求分配操 作序号;
配置记录单元, 用于根据所述操作请求接收单元接收的数据配置操作请 求,将所述操作序号分配单元分配的操作序号和所述数据配置操作请求所请求 操作的数据记录成创建操作序号、删除操作序号和数据的对应关系, 并储存到 所述储存单元中。
19、 如权利要求 18所述的数据配置设备, 其特征在于,
当所述操作请求接收单元接收的数据配置操作请求为所述插入数据请求, 所述配置记录单元用于记录所述插入数据请求所请求的插入数据,并记录所述 插入数据对应的创建操作序号为所述分配的操作序号,所述插入数据对应的删 除操作序号为空;
当所述操作请求接收单元接收的数据配置操作请求为所述删除数据请求, 所述配置记录单元用于记录所述删除数据请求所请求的删除数据对应的删除 操作序号为所述分配的操作序号;
当所述操作请求接收单元接收的数据配置操作请求为所述更新数据请求, 所述配置记录单元用于记录所述更新数据请求所请求的更新数据,并记录所述 更新数据对应的创建操作序号为所述分配的操作序号,记录所述更新数据请求 所请求的原始数据对应的删除操作序号为所述分配的操作序号。
PCT/CN2011/083874 2011-12-13 2011-12-13 数据配置及其回退方法和设备 WO2013086683A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP11877514.7A EP2713555B1 (en) 2011-12-13 2011-12-13 Data configuration method and device, and rollback method and device for data configuration
PCT/CN2011/083874 WO2013086683A1 (zh) 2011-12-13 2011-12-13 数据配置及其回退方法和设备
CN201180003188.XA CN102726002B (zh) 2011-12-13 2011-12-13 数据配置及其回退方法和设备
US14/142,332 US9734020B2 (en) 2011-12-13 2013-12-27 Data configuration method and device, and data configuration rollback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/083874 WO2013086683A1 (zh) 2011-12-13 2011-12-13 数据配置及其回退方法和设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/142,332 Continuation US9734020B2 (en) 2011-12-13 2013-12-27 Data configuration method and device, and data configuration rollback method and device

Publications (1)

Publication Number Publication Date
WO2013086683A1 true WO2013086683A1 (zh) 2013-06-20

Family

ID=46950480

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/083874 WO2013086683A1 (zh) 2011-12-13 2011-12-13 数据配置及其回退方法和设备

Country Status (4)

Country Link
US (1) US9734020B2 (zh)
EP (1) EP2713555B1 (zh)
CN (1) CN102726002B (zh)
WO (1) WO2013086683A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064665A (zh) * 2022-01-19 2022-02-18 浙江省人力资源和社会保障信息中心 一种数据回退方法、系统、电子设备及可存储介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015535105A (ja) * 2012-10-31 2015-12-07 ホアウェイ・テクノロジーズ・カンパニー・リミテッド ネットワーク・データ・ロールバック方法およびデバイス
CN103902406A (zh) * 2012-12-31 2014-07-02 杨威锋 高可靠性固态存储设备的映射表信息的保存和恢复技术
CN105939217B (zh) * 2016-03-23 2019-02-19 杭州迪普科技股份有限公司 配置回滚的方法及装置
CN110300009A (zh) * 2018-03-23 2019-10-01 华为技术有限公司 报文的生成方法及相关设备
CN110389860A (zh) * 2019-06-20 2019-10-29 北京奇艺世纪科技有限公司 一种数据处理方法、装置、电子设备及存储介质
CN111478801A (zh) * 2020-03-27 2020-07-31 烽火通信科技股份有限公司 一种通信设备配置管理方法及系统
US11489712B1 (en) * 2020-04-11 2022-11-01 Juniper Networks, Inc. Systems and methods for efficient configuration file management and distribution by network management systems
CN113364629B (zh) * 2021-06-15 2023-05-23 中国建设银行股份有限公司 交换机端口的配置方法及装置、配置信息回退方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678088A (zh) * 2004-03-31 2005-10-05 华为技术有限公司 一种具有交换功能的通信设备
CN101535977A (zh) * 2006-11-09 2009-09-16 微软公司 联盟基础结构内的一致性
CN102215129A (zh) * 2011-06-15 2011-10-12 中兴通讯股份有限公司 业务模块外置方法、装置及系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7779404B2 (en) * 2004-06-10 2010-08-17 Cisco Technology, Inc. Managing network device configuration using versioning and partitioning
US7966298B2 (en) * 2008-04-30 2011-06-21 Unisys Corporation Record-level locking and page-level recovery in a database management system
JP4870190B2 (ja) * 2009-04-27 2012-02-08 株式会社日立製作所 データ処理方法、計算機、及びデータ処理プログラム
US10430298B2 (en) * 2010-10-28 2019-10-01 Microsoft Technology Licensing, Llc Versatile in-memory database recovery using logical log records
US9053153B2 (en) * 2012-06-18 2015-06-09 Sap Se Inter-query parallelization of constraint checking
US9104630B1 (en) * 2012-10-24 2015-08-11 Google Inc. Online account reset, rollback, and backup

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678088A (zh) * 2004-03-31 2005-10-05 华为技术有限公司 一种具有交换功能的通信设备
CN101535977A (zh) * 2006-11-09 2009-09-16 微软公司 联盟基础结构内的一致性
CN102215129A (zh) * 2011-06-15 2011-10-12 中兴通讯股份有限公司 业务模块外置方法、装置及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2713555A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064665A (zh) * 2022-01-19 2022-02-18 浙江省人力资源和社会保障信息中心 一种数据回退方法、系统、电子设备及可存储介质

Also Published As

Publication number Publication date
EP2713555A4 (en) 2014-10-01
EP2713555A1 (en) 2014-04-02
CN102726002B (zh) 2014-04-02
US9734020B2 (en) 2017-08-15
EP2713555B1 (en) 2015-11-04
CN102726002A (zh) 2012-10-10
US20140114914A1 (en) 2014-04-24

Similar Documents

Publication Publication Date Title
WO2013086683A1 (zh) 数据配置及其回退方法和设备
CN110275884B (zh) 数据存储方法及节点
TWI338837B (zh)
US20190340171A1 (en) Data Redistribution Method and Apparatus, and Database Cluster
WO2021027956A1 (zh) 一种基于区块链系统的交易处理方法及装置
US20210243013A1 (en) Updating a state merkle tree
WO2011079787A1 (zh) 磁盘阵列的实现方法和数据读写方法及装置
CN103026355A (zh) 数据库管理系统
WO2014012390A1 (zh) 数据处理方法及装置、共享存储设备
JP2023501436A (ja) IoTデバイス、並びにそのサーバーおよび記憶媒体を管理するための方法および装置
US20160275089A1 (en) Methods for implementing nosql database snapshots and devices thereof
KR101912728B1 (ko) 데이터 처리 방법 및 장치
CN109407975B (zh) 写数据方法与计算节点以及分布式存储系统
US20160275085A1 (en) Methods for facilitating a nosql database with integrated management and devices thereof
CN114185991A (zh) 基于分布式数据库实现数据同步的方法及相关装置
CN103905512A (zh) 一种数据处理方法和设备
CN107239568B (zh) 分布式索引实现方法及装置
US20060004812A1 (en) Method and system for mapping datasources in a metadata model
CN110532243A (zh) 数据处理方法、装置和电子设备
US11500943B2 (en) Method and system for cached early-binding document search
CN107908727B (zh) 存储对象克隆方法、装置、设备及计算机可读存储介质
CN109254870A (zh) 数据备份的方法和装置
JP6172294B2 (ja) トランザクション分散処理装置、方法、システム、および、記憶媒体
CN115391238B (zh) 持久卷的静态制备方法、装置、终端设备与介质
KR100678926B1 (ko) 로그 정보 관리 시스템 및 방법

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180003188.X

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11877514

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011877514

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE