WO2023041052A1 - Data operation method and apparatus, and server and storage medium - Google Patents

Data operation method and apparatus, and server and storage medium Download PDF

Info

Publication number
WO2023041052A1
WO2023041052A1 PCT/CN2022/119385 CN2022119385W WO2023041052A1 WO 2023041052 A1 WO2023041052 A1 WO 2023041052A1 CN 2022119385 W CN2022119385 W CN 2022119385W WO 2023041052 A1 WO2023041052 A1 WO 2023041052A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target database
operation request
verified
database
Prior art date
Application number
PCT/CN2022/119385
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2023041052A1 publication Critical patent/WO2023041052A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the embodiments of the present application relate to the field of information processing, and in particular, to a data operation method, device, server, and storage medium.
  • the network management protocol defines the configuration database as a candidate database and a running database.
  • Candidate is the candidate database
  • running is the current running database. Modifying the candidate database does not affect the running database.
  • the user can first write the configuration data into the candidate database (the data written into the candidate database is called alternative data), and after confirming that it is correct, the data in the candidate database can be submitted to the running database through the commit operation, so that the running database and the candidate database If the candidate data is not needed, the candidate data can be discarded through the discard-change operation, so that the candidate database can be restored to a state consistent with the running database. Users can also write data directly to the running database.
  • the network management protocol defines the edit-config operation, which is used to write configuration data into the database.
  • the test-option parameter of this operation is set to test-then-set, the data will be checked when it is written into the database. If passed, writing is prohibited.
  • this operation mode is recorded as edit-config ⁇ test-then-set> operation.
  • the test-option parameter of the edit-config operation is set to set, the data can be written directly without checking when it is written to the database.
  • this operation mode is recorded as edit-config ⁇ set> operation.
  • the network management protocol defines the validate operation, which can be used to check the configuration data and verify the data written by the edit-config ⁇ set> operation in the alternative database. Data that fails the verification cannot take effect.
  • the method of sending reverse configuration data can achieve the purpose of retaining the verified candidate data, the operation is very cumbersome when there is a lot of configuration data.
  • the method of discarding the checked candidate data together is simple but cannot retain the checked candidate data. Therefore, both methods face the problem of complex procedures and a large amount of configuration when configuring data for the configuration database, that is, the configuration data operation process is cumbersome, takes a long time, and the workload is heavy, which affects the user's experience of configuring data for the configuration database.
  • the main purpose of the embodiments of the present application is to provide a data operation method, device, server, and storage medium.
  • reduce the workload of data configuration reduce the difficulty of data configuration, thereby improving the user's data configuration experience.
  • an embodiment of the present application provides a data operation method, including: receiving a first operation request for canceling unverified data; wherein, the input parameters of the first operation request include the name of the target database ; Analyzing the input parameters of the operation request to obtain the name of the target database; discarding the unverified data in the target database according to the name of the target database, and retaining the verified data in the target database.
  • an embodiment of the present application provides a data operation device, including: a receiving module configured to receive a first operation request, the first operation request is used to cancel unverified data, and the first The input parameters of the operation request include the name of the target database; the parsing module is configured to parse the input parameters of the operation request to obtain the name of the target database; the processing module is configured to discard the name of the target database according to the name of the target database The verified data retains the verified data in the target database.
  • an embodiment of the present application further provides a server, including: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores information that can be used by the at least one processor An instruction executed by a processor, the instruction is executed by the at least one processor, so that the at least one processor can execute the above data manipulation method.
  • the embodiment of the present application further provides a computer-readable storage medium storing a computer program, and implementing the above data operation method when the computer program is executed by a processor.
  • the input parameters of the operation request are analyzed, the name of the target database is obtained, and according to the The name of the target database discards the unverified data in the target database, and at the same time retains the verified data in the target database. If the verified data is valid or useful data, avoid discarding too much useful data.
  • the data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
  • FIG. 1 is a flowchart of a data manipulation method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a data manipulation method provided in an embodiment of the present disclosure
  • Fig. 3 is a flowchart of a data manipulation method according to another embodiment of the present disclosure.
  • Fig. 4 is a schematic diagram of a data operation device according to another embodiment of the present disclosure.
  • Fig. 5 is a schematic structural diagram of a server according to another embodiment of the present disclosure.
  • One embodiment of the present disclosure relates to a data manipulation method.
  • the method includes: receiving a first operation request for abolishing unverified data rows; wherein, the input parameters of the first operation request include the name of the target database; analyzing the input parameters of the operation request to obtain the target database name; according to the name of the target database, the unverified data in the target database is discarded, and the verified data in the target database is retained. If the unverified data is useless, the verified data is valid or useful Data, avoiding the problem of cumbersome configuration and a large amount of configuration when writing configuration data to the configuration database due to the discarding of too much useful data.
  • the data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
  • Step 101 receiving a first operation request for canceling unverified data.
  • the first operation request is a data operation request sent to the server by a client or other management agent, wherein the input parameters of the first operation request include the name of the target database; the data may be a network management protocol
  • the NETCONF data may also be other protocol operations, and the target database may include a candidate database or a running database or other forms of databases.
  • the first operation request includes a custom operation request; before receiving the first operation request for invalidating unverified data, it further includes: defining an operation response for the custom operation request in advance.
  • the first operation request includes a custom operation request
  • the first operation request may be a custom discard-set operation request
  • the input parameters of the discard-set operation request include the name of the target database, so
  • the target database name mentioned above can be the candidate database candidate or the running database running, and the discard-set operation request is used to discard unverified data in the target database.
  • the first operation request is a custom operation request
  • define the input parameters and operation response for a custom discard-set operation request include: the database name parameter, which is used to specify the name of the configuration database; the operation response of the discard-set operation is an operation containing ⁇ ⁇ rpc-reply> response for ok>.
  • the NETCONF server when the NETCONF server receives an operation request from the NETCONF client, it analyzes the received operation request through the network protocol stack, and if the operation request is resolved, it is a discard-set operation request, the discard-set operation request is sent to the discard-set operation processing module for processing. After the discard-set operation processing module executes the discard-set operation, the NETCONF server returns an operation response to the NETCONF client, and the returned operation response is an ⁇ rpc-reply> response containing ⁇ ok>.
  • Step 102 analyzing the input parameters of the operation request to obtain the name of the target database.
  • the discard-set operation processing module processes the discard-set operation request
  • the input parameters are parsed, and the obtained target database name is the candidate database.
  • Step 103 according to the name of the target database, the unverified data in the target database is discarded, and the verified data in the target database is retained.
  • each data in the target database is identified according to a data mark of each data in the target database; wherein, the mark is used to indicate whether the data has been verified.
  • the identified unverified data in the target database is discarded, and the identified verified data in the target database is retained.
  • the data flag is set in the following manner: after receiving the second operation request for writing data into the database, it is detected whether the data to be written needs to be verified according to the parameters of the second operation request ; If the data to be written needs to be verified, the data mark indicating that the data has been verified is set for the data to be written; if the data to be written does not need to be verified, the The data to be written sets the data flag indicating that the data has not been verified.
  • the second operation may be to process the data written by the edit-config operation, and when the data is written, mark the verified data and the unverified data respectively, for example, when the edit-config operation
  • the test-option parameter is set to test-then-set
  • the data needs to be verified when it is written to the database.
  • This operation is called the edit-config ⁇ test-then-set> operation
  • the edit-config ⁇ test-then -set > The data written in the operation sets the data flag indicating that the data is verified.
  • the edit-config ⁇ set> operation When the test-option parameter of the edit-config operation is set to set, the data will not be verified when it is written to the database.
  • This operation is called the edit-config ⁇ set> operation
  • the edit-config ⁇ set> operation The entered data sets the data flag indicating that the data has not been verified.
  • the data written in the edit-config ⁇ test-then-set> operation has been set to indicate that the data has been verified
  • the data written in the edit-config ⁇ set> operation has been set to indicate that the data has not been verified. Therefore, in this step, according to the data marks of each data in the target database, it can be identified whether the data has been verified, and then the unverified data in the target database is discarded, and the data in the target database is retained. Validated data.
  • step 103 can also discard the unverified data in the target database and keep the The verified data in the target database.
  • the backup data file is a backup of the main data file, the main data file is used to write verified data, and the backup data file is used to write unverified data.
  • the purpose of such backup is to obtain the name of the target database according to the input parameters of the operation request after receiving the first operation request for abolishing unverified data, and only discard the data in the backup data file in the target database.
  • the main data files in the database are still retained, so as to avoid discarding the useful data after verification in too many main data files, which leads to the problem of cumbersome configuration and a large amount of configuration when writing configuration data to the configuration database.
  • the first operation request received in step 101 for canceling unverified data may be a user-defined operation request or a verification operation request;
  • the input parameters of the verification operation request include An indication parameter indicating whether to discard data after the verification fails; after analyzing the input parameters of the operation request and obtaining the name of the target database, it also includes: if the indication parameter indicates that the data is discarded after the verification fails, Then perform the step of discarding the unverified data in the target database according to the name of the target database, and retaining the verified data in the target database.
  • the first operation request includes a verification operation request
  • a discard-set-option input parameter is included in the validate verification operation request
  • the discard-set-option input parameter is used to indicate whether to discard data after verification fails. If the input parameter of discard-set-option is indicated as enable, when the validation fails, the unvalidated data in the target database will be discarded according to the name of the target database; In case of failure, the data that has not been successfully verified will not be discarded.
  • the existing verification operation request By extending the existing verification operation request, not only the input parameters of the user-defined operation request are analyzed to obtain the target database name, but also the unverified data in the target database is discarded according to the target database name. You can also analyze the input parameters of the validate verification operation request to obtain the target database name.
  • the validate verification fails, discard the unverified data according to the target database name to avoid discarding all data and writing configuration data to the configuration database.
  • the time configuration is cumbersome and the configuration volume is large.
  • the data operation method of discarding unverified data can be flexibly implemented, which saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves the user's data configuration experience.
  • Another embodiment of the present disclosure relates to a data manipulation method.
  • the implementation details of the data operation method of the present disclosure are described in detail below, and the following content is only the implementation details provided for the convenience of understanding, and is not necessary for implementing the present solution.
  • the configuration database is candidate and running, and the data operation is discard-set operation.
  • the NETCONF client creates another 100 interfaces in the candidate database through the edit-config ⁇ test-then-set> operation, and configures the parameters of the interfaces, and then NETCONF The client creates another 10 interfaces in the candidate database through the edit-config ⁇ set> operation, and configures the parameters of these interfaces.
  • the 10 interfaces and their parameters created by using the edit-config ⁇ set> operation are unverified data, and the unverified data is abolished.
  • the schematic diagram of the network device structure is shown in Figure 2, and the specific data operation process is shown in Figure 2. 3.
  • step 301 the NETCONF client sends a discard-set operation.
  • the first operation request is a discard-set operation request sent by the NETCONF client to the NETCONF server.
  • Step 302 the NETCONF server receives the discard-set operation request, parses the input parameters of the operation request, and obtains the database name as candidate.
  • the network protocol stack sends the discard-set operation request to the discard-set operation processing module, and the discard-set operation processing module determines the input parameters of the discard-set operation request After parsing, the obtained target database name is the candidate database.
  • step 303 the NETCONF server discards unverified data in the candidate database.
  • the unverified data in the candidate database is discarded, and the 10 interfaces and their parameters created through the edit-config ⁇ set> operation are the unverified data in the target database.
  • the candidate database is restored to only 200 state of an interface. That is to say, the retained data is the data in the initial candidate database and the data created in the candidate database through the edit-config ⁇ test-then-set> operation.
  • step 304 the NETCONF server returns a response, and the NETCONF server returns an ⁇ rpc-reply> response containing ⁇ ok> to the NETCONF client.
  • the operation response of this step is defined before the discard-set operation request.
  • the NETCONF server After the NETCONF server receives the discard-set operation request from the NETCONF client and executes the discard-set operation to discard the unverified data, The NETCONF server will return an operation response to the NETCONF client, and the returned operation response is an ⁇ rpc-reply> response containing ⁇ ok>.
  • the first operation request in this embodiment is a discard-set operation request, and the input parameters of the operation request are parsed to obtain the name of the target database, and the obtained name of the target database is candidate; according to the name of the target database, the The unverified data in the target database, in this embodiment, the 10 interfaces and their parameters created by the edit-config ⁇ set> operation are the unverified data in the target database, and the candidate database in the target database is retained
  • the data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
  • this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in cooperation with the above method embodiment.
  • the relevant technical details and technical effects mentioned in the foregoing embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition.
  • the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
  • FIG. 4 Another embodiment of the present disclosure relates to a data operation device, as shown in FIG. 4 , including: a receiving module 401 configured to receive a first operation request, the first operation request is used to abolish unverified data,
  • the input parameters of the first operation request include a target database name;
  • the parsing module 402 is configured to parse the input parameters of the operation request to obtain the target database name;
  • the processing module 403 is configured to discard the target database name according to the target database name;
  • the unchecked data in the target database retains the checked data in the target database.
  • the processing module 403 is configured to identify each data in the target database according to a data mark of each data in the target database; wherein, the data mark is used to indicate whether the data has been verified; The identified unverified data in the target database is discarded, and the identified verified data in the target database is retained.
  • the processing module 403 further includes a verification module (not shown in the figure) for detecting the pending operation according to the parameters of the second operation request after receiving the second operation request for Whether the written data needs to be verified; if the data to be written needs to be verified, the data mark indicating that the data has been verified is set for the data to be written; if the data to be written does not need performing verification, setting the data flag indicating that the data has not been verified for the data to be written.
  • a verification module (not shown in the figure) for detecting the pending operation according to the parameters of the second operation request after receiving the second operation request for Whether the written data needs to be verified; if the data to be written needs to be verified, the data mark indicating that the data has been verified is set for the data to be written; if the data to be written does not need performing verification, setting the data flag indicating that the data has not been verified for the data to be written.
  • the processing module 403 is configured to discard the backup data file in the target database and retain the main data file in the target database, wherein the backup data file is a backup of the main data file, and the The primary data file is used for writing verified data, and the backup data file is used for writing unverified data.
  • the processing module 403 is set to, after the verification operation request, the input parameters of the verification operation request include an indication parameter for indicating whether to discard data after the verification fails, and detect whether the indication parameter indicates the verification After the verification fails, the data is discarded; if the indication parameter indicates that the data is discarded after the verification fails, then execute the step of discarding the unverified data in the target database according to the name of the target database, and retain the data in the target database. Validated data.
  • modules involved in this embodiment are logical modules.
  • a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units.
  • units that are not closely related to solving the technical problems raised by the present disclosure are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
  • FIG. 5 Another embodiment of the present disclosure relates to a server, as shown in FIG. 5 , including: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501; Instructions executed by the at least one processor 501, the instructions are executed by the at least one processor 501, so that the at least one processor 501 can execute the data operation methods in the foregoing embodiments.
  • the memory and the processor are connected by a bus
  • the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory can be used to store data that the processor uses when performing operations.
  • Another embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program.
  • the above method embodiments are implemented when the computer program is executed by the processor.
  • a storage medium includes several instructions to make a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data operation method and apparatus, and a server and a storage medium. The data operation method comprises: receiving a first operation request for discarding unvalidated data, wherein an input parameter of the first operation request comprises the name of a target database; parsing the input parameter of the first operation request, so as to acquire the name of the target database; and according to the name of the target database, discarding the unvalidated data from the target database, and retaining validated data in the target database.

Description

数据操作方法、装置、服务器以及存储介质Data operation method, device, server and storage medium
相关申请的交叉引用Cross References to Related Applications
本公开基于2021年09月16日提交的发明名称为“数据操作方法、装置、服务器以及存储介质”的中国专利申请CN202111087119.3,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本公开。This disclosure is based on the Chinese patent application CN202111087119.3 filed on September 16, 2021 with the title of "data operation method, device, server and storage medium", and claims the priority of this patent application, which is disclosed by reference The content is incorporated in this disclosure in its entirety.
技术领域technical field
本申请实施例涉及信息处理领域,特别涉及一种数据操作方法、装置、服务器以及存储介质。The embodiments of the present application relate to the field of information processing, and in particular, to a data operation method, device, server, and storage medium.
背景技术Background technique
网络管理协议定义配置数据库有candidate数据库和running数据库,candidate为备选数据库,running为当前运行数据库,修改candidate数据库不影响runnig数据库。用户可以将配置数据先写入candidate数据库(写入candidate数据库的这些数据称为备选数据),确认无误后,可通过commit操作将candidate数据库中的数据提交到running数据库,使running数据库和candiate数据库的数据达到一致,如果不需要备选数据可以通过discard-change操作废弃备选数据,使candidate数据库恢复到和running数据库一致的状态。用户也可以将数据直接写入running数据库。The network management protocol defines the configuration database as a candidate database and a running database. Candidate is the candidate database, and running is the current running database. Modifying the candidate database does not affect the running database. The user can first write the configuration data into the candidate database (the data written into the candidate database is called alternative data), and after confirming that it is correct, the data in the candidate database can be submitted to the running database through the commit operation, so that the running database and the candidate database If the candidate data is not needed, the candidate data can be discarded through the discard-change operation, so that the candidate database can be restored to a state consistent with the running database. Users can also write data directly to the running database.
网络管理协议定义了edit-config操作,该操作用于将配置数据写入数据库,该操作的test-option参数设置为test-then-set时,数据在写入数据库时就进行检查,如果检查不通过,则禁止写入,为描述方便,将这种操作方式记为edit-config<test-then-set>操作。edit-config操作的test-option参数设置为set时,数据在写入数据库时不进行检查,可直接写入,为描述方便,将这种操作方式记为edit-config<set>操作。网络管理协议定义了validate操作,可用于检查配置数据,校验备选数据库中用edit-config<set>操作写入的数据。校验不通过的数据不能生效。通过validate操作对数据进行检查,如果检查不通过,需继续修改后再次执行validate操作,直到检查通过。因此,当数据库需要废弃校验未通过的备选配置选数据时,需要通过下发逆向配置数据的方式,或者连同已校验备选数据一起废弃。The network management protocol defines the edit-config operation, which is used to write configuration data into the database. When the test-option parameter of this operation is set to test-then-set, the data will be checked when it is written into the database. If passed, writing is prohibited. For the convenience of description, this operation mode is recorded as edit-config<test-then-set> operation. When the test-option parameter of the edit-config operation is set to set, the data can be written directly without checking when it is written to the database. For the convenience of description, this operation mode is recorded as edit-config<set> operation. The network management protocol defines the validate operation, which can be used to check the configuration data and verify the data written by the edit-config<set> operation in the alternative database. Data that fails the verification cannot take effect. Check the data through the validate operation. If the check fails, you need to continue to modify and execute the validate operation again until the check passes. Therefore, when the database needs to discard the candidate configuration data that fails the verification, it needs to send the reverse configuration data, or discard it together with the verified candidate data.
然而,下发逆向配置数据的方式虽然可以达到保留已校验备选数据的目的,但在配置数据较多的情况下操作非常繁琐。而连同已校验备选数据一起废弃的方法虽然简单但无法保留已校验备选数据。因此,两种方式均面临给配置数据库配置数据时手续复杂、配置量较大的问题时,即配置数据操作过程繁琐,时间长、工作量大,影响用户给配置数据库配置数据的体验。However, although the method of sending reverse configuration data can achieve the purpose of retaining the verified candidate data, the operation is very cumbersome when there is a lot of configuration data. The method of discarding the checked candidate data together is simple but cannot retain the checked candidate data. Therefore, both methods face the problem of complex procedures and a large amount of configuration when configuring data for the configuration database, that is, the configuration data operation process is cumbersome, takes a long time, and the workload is heavy, which affects the user's experience of configuring data for the configuration database.
发明内容Contents of the invention
本申请实施例的主要目的在于提出一种数据操作方法,装置、服务器以及存储介质。以节省数据配置时间、减少数据配置工作量、降低数据配置难度,从而提升用户的数据配置体验。The main purpose of the embodiments of the present application is to provide a data operation method, device, server, and storage medium. In order to save data configuration time, reduce the workload of data configuration, reduce the difficulty of data configuration, thereby improving the user's data configuration experience.
为实现上述目的,本申请实施例提供了一种数据操作方法,包括:接收用于对未校验数据进行废除的第一操作请求;其中,所述第一操作请求的输入参数包括目标数据库名称;解 析所述操作请求的输入参数,获取到所述目标数据库名称;根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。In order to achieve the above purpose, an embodiment of the present application provides a data operation method, including: receiving a first operation request for canceling unverified data; wherein, the input parameters of the first operation request include the name of the target database ; Analyzing the input parameters of the operation request to obtain the name of the target database; discarding the unverified data in the target database according to the name of the target database, and retaining the verified data in the target database.
为实现上述目的,本申请实施例提供了一种数据操作装置,包括:接收模块,设置为接收第一操作请求,所述第一操作请求用于对未校验数据进行废除,所述第一操作请求的输入参数包括目标数据库名称;解析模块,设置为解析所述操作请求的输入参数,获取到所述目标数据库名称;处理模块,设置为根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。To achieve the above purpose, an embodiment of the present application provides a data operation device, including: a receiving module configured to receive a first operation request, the first operation request is used to cancel unverified data, and the first The input parameters of the operation request include the name of the target database; the parsing module is configured to parse the input parameters of the operation request to obtain the name of the target database; the processing module is configured to discard the name of the target database according to the name of the target database The verified data retains the verified data in the target database.
为实现上述目的,本申请实施例还提供了一种服务器,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述数据操作方法。To achieve the above purpose, an embodiment of the present application further provides a server, including: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores information that can be used by the at least one processor An instruction executed by a processor, the instruction is executed by the at least one processor, so that the at least one processor can execute the above data manipulation method.
为实现上述目的,本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述数据操作方法。In order to achieve the above purpose, the embodiment of the present application further provides a computer-readable storage medium storing a computer program, and implementing the above data operation method when the computer program is executed by a processor.
本公开的实施例提出的一种数据操作方法,在接收用于对未校验数据进行废除的第一操作请求后,解析所述操作请求的输入参数,获取到所述目标数据库名称,根据所述目标数据库名称废弃所述目标数据库中未校验的数据,同时保留所述目标数据库中已校验的数据,若已校验的数据为有效或有用的数据,就避免废弃过多有用数据而导致在给配置数据库写配置数据时面临配置繁琐,配置量大的问题。本申请的数据操作方法,节省了数据配置时间、减少数据配置工作量、降低数据配置难度,提升了用户的数据配置体验。In the data operation method proposed by the embodiments of the present disclosure, after receiving the first operation request for canceling unverified data, the input parameters of the operation request are analyzed, the name of the target database is obtained, and according to the The name of the target database discards the unverified data in the target database, and at the same time retains the verified data in the target database. If the verified data is valid or useful data, avoid discarding too much useful data. As a result, when writing configuration data to the configuration database, it faces the problem of cumbersome configuration and a large amount of configuration. The data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
附图说明Description of drawings
图1是根据本公开一个实施例的一种数据操作方法的流程图;FIG. 1 is a flowchart of a data manipulation method according to an embodiment of the present disclosure;
图2是根据本公开一个实施例中提供的一种数据操作方法的示意图;FIG. 2 is a schematic diagram of a data manipulation method provided in an embodiment of the present disclosure;
图3是根据本公开另一个实施例的一种数据操作方法的流程图;Fig. 3 is a flowchart of a data manipulation method according to another embodiment of the present disclosure;
图4是根据本公开另一个实施例的一种数据操作装置示意图;Fig. 4 is a schematic diagram of a data operation device according to another embodiment of the present disclosure;
图5是根据本公开另一个实施例的服务器的结构示意图。Fig. 5 is a schematic structural diagram of a server according to another embodiment of the present disclosure.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施例进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the application, many technical details are provided for readers to better understand the application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can also be realized. The division of the following embodiments is for the convenience of description, and should not constitute any limitation to the specific implementation of the present application, and the embodiments can be combined and referred to each other on the premise of no contradiction.
本公开的一个实施例涉及一种数据操作方法。方法包括:接收用于对未校验数据行废除的第一操作请求;其中,所述第一操作请求的输入参数包括目标数据库名称;解析所述操作请求的输入参数,获取到所述目标数据库名称;根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据,若未校验的数据无用,已校验的数据为有效或有用的数据,避免了废弃过多有用数据而导致在给配置数据库写配置数据时配 置繁琐,配置量大的问题。本申请的数据操作方法,节省了数据配置时间、减少数据配置工作量、降低数据配置难度,提升了用户的数据配置体验。One embodiment of the present disclosure relates to a data manipulation method. The method includes: receiving a first operation request for abolishing unverified data rows; wherein, the input parameters of the first operation request include the name of the target database; analyzing the input parameters of the operation request to obtain the target database name; according to the name of the target database, the unverified data in the target database is discarded, and the verified data in the target database is retained. If the unverified data is useless, the verified data is valid or useful Data, avoiding the problem of cumbersome configuration and a large amount of configuration when writing configuration data to the configuration database due to the discarding of too much useful data. The data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
下面对本实施例的数据操作的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The implementation details of the data operation in this embodiment are described in detail below, and the following content is only the implementation details provided for the convenience of understanding, and is not necessary for the implementation of this solution.
本实施例的数据操作方法的具体流程可以如图1所示,The specific flow of the data operation method of this embodiment can be shown in Figure 1,
步骤101,接收用于对未校验数据进行废除的第一操作请求。 Step 101, receiving a first operation request for canceling unverified data.
具体而言,所述第一操作请求是由客户端或其他管理代理发送给服务器的数据操作请求,其中,所述第一操作请求的输入参数包括目标数据库名称;所述数据可以为网络管理协议NETCONF数据,也可以是其他协议操作,所述目标数据库可以包括备选数据库或运行数据库或其他形式的数据库。Specifically, the first operation request is a data operation request sent to the server by a client or other management agent, wherein the input parameters of the first operation request include the name of the target database; the data may be a network management protocol The NETCONF data may also be other protocol operations, and the target database may include a candidate database or a running database or other forms of databases.
另外,所述第一操作请求包括自定义操作请求;在所述接收用于对未校验数据进行废除的第一操作请求之前,还包括:预先为所述自定义操作请求定义操作响应。In addition, the first operation request includes a custom operation request; before receiving the first operation request for invalidating unverified data, it further includes: defining an operation response for the custom operation request in advance.
在一个例子中,第一操作请求包括自定义操作请求,例如,所述第一操作请求可以是自定义的discard-set操作请求,其中,discard-set操作请求的输入参数包括目标数据库名称,所述目标数据库名称可以是备选数据库candidate或运行数据库running,discard-set操作请求用于对目标数据库中未校验数据进行废除。当第一操作请求为自定义操作请求时,还需要预先为自定义操作请求定义操作响应。例如,为自定义的discard-set操作请求定义输入参数和操作响应,discard-set操作请求的输入参数包括:数据库名称参数,用于指定配置数据库名称;discard-set操作的操作响应为一个包含<ok>的<rpc-reply>响应。In an example, the first operation request includes a custom operation request, for example, the first operation request may be a custom discard-set operation request, where the input parameters of the discard-set operation request include the name of the target database, so The target database name mentioned above can be the candidate database candidate or the running database running, and the discard-set operation request is used to discard unverified data in the target database. When the first operation request is a custom operation request, it is also necessary to define an operation response for the custom operation request in advance. For example, define the input parameters and operation response for a custom discard-set operation request. The input parameters of the discard-set operation request include: the database name parameter, which is used to specify the name of the configuration database; the operation response of the discard-set operation is an operation containing < <rpc-reply> response for ok>.
以NETCONF协议数据为例,如图2所示,当NETCONF服务器接收到NETCONF客户端下发操作请求,通过网络协议栈对接收到的操作请求进行解析,若解析到该操作请求为discard-set操作请求,则将该discard-set操作请求发送给discard-set操作处理模块进行处理。在discard-set操作处理模块执行discard-set操作后,NETCONF服务器会给NETCONF客户端返回操作响应,所返回的操作响应为一个包含<ok>的<rpc-reply>响应。Taking the NETCONF protocol data as an example, as shown in Figure 2, when the NETCONF server receives an operation request from the NETCONF client, it analyzes the received operation request through the network protocol stack, and if the operation request is resolved, it is a discard-set operation request, the discard-set operation request is sent to the discard-set operation processing module for processing. After the discard-set operation processing module executes the discard-set operation, the NETCONF server returns an operation response to the NETCONF client, and the returned operation response is an <rpc-reply> response containing <ok>.
步骤102,解析所述操作请求的输入参数,获取到所述目标数据库名称。 Step 102, analyzing the input parameters of the operation request to obtain the name of the target database.
针对上述案例,当第一操作请求为discard-set操作请求,网络协议栈将该discard-set操作请求发送给discard-set操作处理模块后,由discard-set操作处理模块对discard-set操作请求的输入参数进行解析,获取到的目标数据库名称为candidate数据库。For the above case, when the first operation request is a discard-set operation request, after the network protocol stack sends the discard-set operation request to the discard-set operation processing module, the discard-set operation processing module processes the discard-set operation request The input parameters are parsed, and the obtained target database name is the candidate database.
步骤103,根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。 Step 103, according to the name of the target database, the unverified data in the target database is discarded, and the verified data in the target database is retained.
在一个例子中,根据所述目标数据库中各数据的数据标记,对所述目标数据库中各数据进行识别;其中,所述标记用于指数据示所述数据是否经过校验。废弃识别到的所述目标数据库中未校验的数据,保留识别到的所述目标数据库中已校验的数据。In an example, each data in the target database is identified according to a data mark of each data in the target database; wherein, the mark is used to indicate whether the data has been verified. The identified unverified data in the target database is discarded, and the identified verified data in the target database is retained.
在一个例子中,所述数据标记通过以下方式设置:在接收到用于将数据写入数据库的第二操作请求后,根据所述第二操作请求的参数检测待写入数据是否需要进行校验;若所述待写入数据需要进行校验,则为所述待写入数据设置指示数据经过校验的所述数据标记;若所述待写入数据不需要进行校验,则为所述待写入数据设置指示数据未经过校验的所述数据标记。In an example, the data flag is set in the following manner: after receiving the second operation request for writing data into the database, it is detected whether the data to be written needs to be verified according to the parameters of the second operation request ; If the data to be written needs to be verified, the data mark indicating that the data has been verified is set for the data to be written; if the data to be written does not need to be verified, the The data to be written sets the data flag indicating that the data has not been verified.
其中,第二操作可以是对edit-config操作写入的数据进行处理,在数据写入时,对已校 验的数据和未校验的数据分别进行标记,比如说,当edit-config操作的test-option参数设置为test-then-set时,数据在写入数据库时需要校验,将这种操作称为edit-config<test-then-set>操作,则对edit-config<test-then-set>操作中写入的数据设置指示数据经过校验的数据标记。当edit-config操作的test-option参数设置为set时,数据在写入数据库时不进行校验,将这种操作称为edit-config<set>操作,则对edit-config<set>操作写入的数据设置指示数据未经过校验的数据标记。Wherein, the second operation may be to process the data written by the edit-config operation, and when the data is written, mark the verified data and the unverified data respectively, for example, when the edit-config operation When the test-option parameter is set to test-then-set, the data needs to be verified when it is written to the database. This operation is called the edit-config<test-then-set> operation, and the edit-config<test-then -set > The data written in the operation sets the data flag indicating that the data is verified. When the test-option parameter of the edit-config operation is set to set, the data will not be verified when it is written to the database. This operation is called the edit-config<set> operation, and the edit-config<set> operation The entered data sets the data flag indicating that the data has not been verified.
由于在对edit-config<test-then-set>操作中写入的数据已经设置了指示数据经过校验的数据标记,对edit-config<set>操作写入的数据设置了指示数据未经过校验的数据标记,因此,在本步骤中,可以根据目标数据库中各数据的数据标记,识别该数据是否经过校验,进而废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。即灵活多变的实现对未校验数据进行废弃的数据操作方法废弃了目标数据库中edit-config<set>操作写入的数据,保留了目标数据库中edit-config<test-then-set>操作写入的数据,灵活多变的实现对未校验数据进行废弃的数据操作方法。Since the data written in the edit-config<test-then-set> operation has been set to indicate that the data has been verified, the data written in the edit-config<set> operation has been set to indicate that the data has not been verified. Therefore, in this step, according to the data marks of each data in the target database, it can be identified whether the data has been verified, and then the unverified data in the target database is discarded, and the data in the target database is retained. Validated data. That is to say, it is flexible and changeable to realize the data operation method of discarding unverified data, discarding the data written by the edit-config<set> operation in the target database, and retaining the edit-config<test-then-set> operation in the target database The written data is flexible and changeable to realize the data operation method of discarding unverified data.
在另一个例子中,步骤103还可以通过废弃所述目标数据库中的备份数据文件,保留所述目标数据库中的主数据文件的方式,废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。其中,所述备份数据文件为所述主数据文件的备份,所述主数据文件用于写入经校验的数据,所述备份数据文件用于写入未校验数据。这样备份的目的在于当接收到用于对未校验数据进行废除的第一操作请求后,根据所述操作请求的输入参数得到目标数据库名称,只废弃目标数据库中备份数据文件中的数据,目标数据库中的主数据文件依然保留,从而避免废弃过多主数据文件中经校验后有用的数据,导致在给配置数据库写配置数据时配置繁琐,配置量大的问题。In another example, step 103 can also discard the unverified data in the target database and keep the The verified data in the target database. Wherein, the backup data file is a backup of the main data file, the main data file is used to write verified data, and the backup data file is used to write unverified data. The purpose of such backup is to obtain the name of the target database according to the input parameters of the operation request after receiving the first operation request for abolishing unverified data, and only discard the data in the backup data file in the target database. The main data files in the database are still retained, so as to avoid discarding the useful data after verification in too many main data files, which leads to the problem of cumbersome configuration and a large amount of configuration when writing configuration data to the configuration database.
另外,步骤101中接收到的用于对未校验数据进行废除的第一操作请求,可以是自定义操作请求,也可以是校验操作请求;所述校验操作请求的输入参数包括用于指示校验失败后是否进行数据废弃的指示参数;所述解析所述操作请求的输入参数,获取到所述目标数据库名称后,还包括:若所述指示参数指示校验失败后进行数据废弃,则再执行所述根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。In addition, the first operation request received in step 101 for canceling unverified data may be a user-defined operation request or a verification operation request; the input parameters of the verification operation request include An indication parameter indicating whether to discard data after the verification fails; after analyzing the input parameters of the operation request and obtaining the name of the target database, it also includes: if the indication parameter indicates that the data is discarded after the verification fails, Then perform the step of discarding the unverified data in the target database according to the name of the target database, and retaining the verified data in the target database.
在具体实现中,所述第一操作请求包括校验操作请求,在接收到对数据进行validate校验的操作请求后,在validate校验操作请求中包含一个discard-set-option输入参数,所述discard-set-option输入参数用于指示校验失败后是否进行数据废弃。若discard-set-option输入参数指示为enable,在validate校验失败时,根据目标数据库名称废弃目标数据库中未校验的数据,若discard-set-option输入参数为指示为disable,在validate校验失败时,不废弃未校验成功的数据。In a specific implementation, the first operation request includes a verification operation request, and after receiving the operation request for validating data, a discard-set-option input parameter is included in the validate verification operation request, and the The discard-set-option input parameter is used to indicate whether to discard data after verification fails. If the input parameter of discard-set-option is indicated as enable, when the validation fails, the unvalidated data in the target database will be discarded according to the name of the target database; In case of failure, the data that has not been successfully verified will not be discarded.
通过对现有的校验操作请求的扩展,不仅对自定义的操作请求的输入参数进行解析获取目标数据库名称,根据目标数据库名称废弃所述目标数据库中未校验的数据。还可以对validate校验操作请求的输入参数进行解析获取目标数据库名称,当validate校验未通过时候,再根据目标数据库名称废弃未校验的数据,避免废弃全部数据导致在给配置数据库写配置数据时配置繁琐,配置量大的问题。而且,可以灵活多变的实现对未校验数据进行废弃的数据操作方法,节省了数据配置时间、减少数据配置工作量、降低数据配置难度,提升了用户的数据配置体验。By extending the existing verification operation request, not only the input parameters of the user-defined operation request are analyzed to obtain the target database name, but also the unverified data in the target database is discarded according to the target database name. You can also analyze the input parameters of the validate verification operation request to obtain the target database name. When the validate verification fails, discard the unverified data according to the target database name to avoid discarding all data and writing configuration data to the configuration database. The time configuration is cumbersome and the configuration volume is large. Moreover, the data operation method of discarding unverified data can be flexibly implemented, which saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves the user's data configuration experience.
本公开的另一个实施例涉及一种数据操作方法。下面对本公开的数据操作方法实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。以在网络设备中进行NETCONF协议数据操作为例,配置数据库为candidtate和running、数据操作为discard-set操作。若初始candidate数据库和running数据库一致,都有100个接口,NETCONF客户端通过edit-config<test-then-set>操作在candidate数据库又创建了100个接口,并配置所述接口的参数,之后NETCONF客户端通过edit-config<set>操作在candidate数据库又创建了10个接口,并配置这些接口的参数。使用edit-config<set>操作创建的10个接口及其参数即为未校验的数据,对未校验的数据进行废除操作,网络设备结构示意图如图2所示,具体数据操作流程如图3所示。Another embodiment of the present disclosure relates to a data manipulation method. The implementation details of the data operation method of the present disclosure are described in detail below, and the following content is only the implementation details provided for the convenience of understanding, and is not necessary for implementing the present solution. Taking the NETCONF protocol data operation in the network device as an example, the configuration database is candidate and running, and the data operation is discard-set operation. If the initial candidate database is consistent with the running database, and both have 100 interfaces, the NETCONF client creates another 100 interfaces in the candidate database through the edit-config<test-then-set> operation, and configures the parameters of the interfaces, and then NETCONF The client creates another 10 interfaces in the candidate database through the edit-config<set> operation, and configures the parameters of these interfaces. The 10 interfaces and their parameters created by using the edit-config <set> operation are unverified data, and the unverified data is abolished. The schematic diagram of the network device structure is shown in Figure 2, and the specific data operation process is shown in Figure 2. 3.
步骤301,NETCONF客户端发送discard-set操作。In step 301, the NETCONF client sends a discard-set operation.
具体而言,第一操作请求是由NETCONF客户端发送给NETCONF服务器discard-set操作请求。Specifically, the first operation request is a discard-set operation request sent by the NETCONF client to the NETCONF server.
步骤302,NETCONF服务器收到discard-set操作请求,解析所述操作请求的输入参数,获取到数据库名称为candidate。 Step 302, the NETCONF server receives the discard-set operation request, parses the input parameters of the operation request, and obtains the database name as candidate.
具体而言,NETCONF服务器收到discard-set操作请求后,网络协议栈将该discard-set操作请求发送给discard-set操作处理模块,由discard-set操作处理模块对discard-set操作请求的输入参数进行解析,获取到的目标数据库名称为candidate数据库。Specifically, after the NETCONF server receives the discard-set operation request, the network protocol stack sends the discard-set operation request to the discard-set operation processing module, and the discard-set operation processing module determines the input parameters of the discard-set operation request After parsing, the obtained target database name is the candidate database.
步骤303,NETCONF服务器将candidate数据库中的未校验的数据废弃。In step 303, the NETCONF server discards unverified data in the candidate database.
具体而言,废弃candidate数据库中未校验的数据,通过edit-config<set>操作创建的10个接口及其参数即为目标数据库中未校验的数据,那么废弃后candidate数据库恢复到只有200个接口的状态。也就是说,保留的数据为初始candidate数据库中的数据,以及通过edit-config<test-then-set>操作在candidate数据库创建的数据。Specifically, the unverified data in the candidate database is discarded, and the 10 interfaces and their parameters created through the edit-config <set> operation are the unverified data in the target database. After discarding, the candidate database is restored to only 200 state of an interface. That is to say, the retained data is the data in the initial candidate database and the data created in the candidate database through the edit-config<test-then-set> operation.
步骤304,NETCONF服务器返回响应,NETCONF服务器返回包含<ok>的<rpc-reply>响应给NETCONF客户端。In step 304, the NETCONF server returns a response, and the NETCONF server returns an <rpc-reply> response containing <ok> to the NETCONF client.
具体而言,本步骤的操作响应是预先在discard-set操作请求之前定义,在NETCONF服务器接收到NETCONF客户端下发discard-set操作请求,执行discard-set操作将未校验的数据废弃后,NETCONF服务器会给NETCONF客户端返回操作响应,所返回的操作响应为一个包含<ok>的<rpc-reply>响应。Specifically, the operation response of this step is defined before the discard-set operation request. After the NETCONF server receives the discard-set operation request from the NETCONF client and executes the discard-set operation to discard the unverified data, The NETCONF server will return an operation response to the NETCONF client, and the returned operation response is an <rpc-reply> response containing <ok>.
本实施例的第一操作请求为discard-set操作请求,解析所述操作请求的输入参数,获取到所述目标数据库名称,所获取的目标数据库名称为candidate;根据所述目标数据库名称废弃所述目标数据库中未校验的数据,在本实施例中通过edit-config<set>操作创建的10个接口及其参数即为目标数据库中未校验的数据,同时保留所述目标数据库中candidate数据库与running数据库一致的数据和通过edit-config<test-then-set>操作在candidate数据库创建的数据。避免了废弃过多已校验的数据而导致在给配置数据库写配置数据面临的配置繁琐,配置量大的问题。本申请的数据操作方法,节省了数据配置时间、减少数据配置工作量、降低数据配置难度,提升了用户的数据配置体验。The first operation request in this embodiment is a discard-set operation request, and the input parameters of the operation request are parsed to obtain the name of the target database, and the obtained name of the target database is candidate; according to the name of the target database, the The unverified data in the target database, in this embodiment, the 10 interfaces and their parameters created by the edit-config <set> operation are the unverified data in the target database, and the candidate database in the target database is retained The data consistent with the running database and the data created in the candidate database through the edit-config<test-then-set> operation. It avoids the problem of cumbersome configuration and large amount of configuration when writing configuration data to the configuration database due to discarding too much verified data. The data operation method of the present application saves data configuration time, reduces data configuration workload, reduces data configuration difficulty, and improves user's data configuration experience.
不难发现,本实施例为与上述方法实施例对应的系统实施例,本实施例可以与上述方法实施例互相配合实施。上述实施例中提到的相关技术细节和技术效果在本实施例中依然有效, 为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在上述实施例中。It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in cooperation with the above method embodiment. The relevant technical details and technical effects mentioned in the foregoing embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
本公开的另一个实施例涉及一种数据操作装置,如图4所示,包括:接收模块401,设置为接收第一操作请求,所述第一操作请求用于对未校验数据进行废除,所述第一操作请求的输入参数包括目标数据库名称;解析模块402,设置为解析所述操作请求的输入参数,获取到所述目标数据库名称;处理模块403,设置为根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。Another embodiment of the present disclosure relates to a data operation device, as shown in FIG. 4 , including: a receiving module 401 configured to receive a first operation request, the first operation request is used to abolish unverified data, The input parameters of the first operation request include a target database name; the parsing module 402 is configured to parse the input parameters of the operation request to obtain the target database name; the processing module 403 is configured to discard the target database name according to the target database name; The unchecked data in the target database retains the checked data in the target database.
在一个例子中,处理模块403设置为根据所述目标数据库中各数据的数据标记,对所述目标数据库中各数据进行识别;其中,所述数据标记用于指示所述数据是否经过校验;废弃识别到的所述目标数据库中未校验的数据,保留识别到的所述目标数据库中已校验的数据。In one example, the processing module 403 is configured to identify each data in the target database according to a data mark of each data in the target database; wherein, the data mark is used to indicate whether the data has been verified; The identified unverified data in the target database is discarded, and the identified verified data in the target database is retained.
在一个例子中,处理模块403还包括校验模块(图中未画出)用于在接收到用于将数据写入数据库的第二操作请求后,根据所述第二操作请求的参数检测待写入数据是否需要进行校验;若所述待写入数据需要进行校验,则为所述待写入数据设置指示数据经过校验的所述数据标记;若所述待写入数据不需要进行校验,则为所述待写入数据设置指示数据未经过校验的所述数据标记。In an example, the processing module 403 further includes a verification module (not shown in the figure) for detecting the pending operation according to the parameters of the second operation request after receiving the second operation request for Whether the written data needs to be verified; if the data to be written needs to be verified, the data mark indicating that the data has been verified is set for the data to be written; if the data to be written does not need performing verification, setting the data flag indicating that the data has not been verified for the data to be written.
在一个例子中,处理模块403设置为废弃所述目标数据库中的备份数据文件,保留所述目标数据库中的主数据文件,其中,所述备份数据文件为所述主数据文件的备份,所述主数据文件用于写入经校验的数据,所述备份数据文件用于写入未校验数据。In one example, the processing module 403 is configured to discard the backup data file in the target database and retain the main data file in the target database, wherein the backup data file is a backup of the main data file, and the The primary data file is used for writing verified data, and the backup data file is used for writing unverified data.
在一个例子中,处理模块403设置为在校验操作请求后,所述校验操作请求的输入参数包括用于指示校验失败后是否进行数据废弃的指示参数,检测所述指示参数是否指示校验失败后进行数据废弃;若所述指示参数指示校验失败后进行数据废弃,则再执行所述根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。In one example, the processing module 403 is set to, after the verification operation request, the input parameters of the verification operation request include an indication parameter for indicating whether to discard data after the verification fails, and detect whether the indication parameter indicates the verification After the verification fails, the data is discarded; if the indication parameter indicates that the data is discarded after the verification fails, then execute the step of discarding the unverified data in the target database according to the name of the target database, and retain the data in the target database. Validated data.
值得一提的是,本实施例中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本公开的创新部分,本实施例中并没有将与解决本公开所提出的技术问题关系不太密切的单元引入,但这并不表明本实施例中不存在其它的单元。It is worth mentioning that all the modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units. In addition, in order to highlight the innovative part of the present disclosure, units that are not closely related to solving the technical problems raised by the present disclosure are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
本公开另一个实施例涉及一种服务器,如图5所示,包括:至少一个处理器501;以及,与所述至少一个处理器501通信连接的存储器502;其中,所述存储器502存储有可被所述至少一个处理器501执行的指令,所述指令被所述至少一个处理器501执行,以使所述至少一个处理器501能够执行上述各实施例中的数据操作方法。Another embodiment of the present disclosure relates to a server, as shown in FIG. 5 , including: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501; Instructions executed by the at least one processor 501, the instructions are executed by the at least one processor 501, so that the at least one processor 501 can execute the data operation methods in the foregoing embodiments.
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。Wherein, the memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory together. The bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein. The bus interface provides an interface between the bus and the transceivers. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, further, the antenna also receives the data and transmits the data to the processor.
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory can be used to store data that the processor uses when performing operations.
本公开另一个实施例涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。Another embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program, the program is stored in a storage medium, and includes several instructions to make a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
本领域的普通技术人员可以理解,上述各实施方式是实现本公开的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本公开的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present disclosure, and in practical applications, various changes can be made in form and details without departing from the spirit and spirit of the present disclosure. scope.

Claims (10)

  1. 一种数据操作方法,包括:A data manipulation method comprising:
    接收用于对未校验数据进行废除的第一操作请求;其中,所述第一操作请求的输入参数包括目标数据库名称;Receiving a first operation request for revoking unverified data; wherein, the input parameters of the first operation request include a target database name;
    解析所述操作请求的输入参数,获取到所述目标数据库名称;Analyzing the input parameters of the operation request to obtain the name of the target database;
    根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。According to the name of the target database, unverified data in the target database is discarded, and verified data in the target database is retained.
  2. 根据权利要求1所述的数据操作方法,其中,所述根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据,包括:The data operation method according to claim 1, wherein the discarding the unverified data in the target database according to the name of the target database and retaining the verified data in the target database includes:
    根据所述目标数据库中各数据的数据标记,对所述目标数据库中各数据进行识别;其中,所述数据标记用于指示所述数据是否经过校验;Identify each data in the target database according to the data mark of each data in the target database; wherein, the data mark is used to indicate whether the data has been verified;
    废弃识别到的所述目标数据库中未校验的数据,保留识别到的所述目标数据库中已校验的数据。The identified unverified data in the target database is discarded, and the identified verified data in the target database is retained.
  3. 根据权利要求2所述的数据操作方法,其中,所述数据标记通过以下方式设置:The data manipulation method according to claim 2, wherein the data flag is set in the following manner:
    在接收到用于将数据写入数据库的第二操作请求后,根据所述第二操作请求的参数检测待写入数据是否需要进行校验;After receiving the second operation request for writing data into the database, detecting whether the data to be written needs to be verified according to the parameters of the second operation request;
    若所述待写入数据需要进行校验,则为所述待写入数据设置指示数据经过校验的所述数据标记;If the data to be written needs to be verified, setting the data mark indicating that the data has been verified for the data to be written;
    若所述待写入数据不需要进行校验,则为所述待写入数据设置指示数据未经过校验的所述数据标记。If the data to be written does not need to be verified, the data flag indicating that the data has not been verified is set for the data to be written.
  4. 根据权利要求1所述的数据操作方法,其中,所述根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据,包括:The data operation method according to claim 1, wherein the discarding the unverified data in the target database according to the name of the target database and retaining the verified data in the target database includes:
    废弃所述目标数据库中的备份数据文件,保留所述目标数据库中的主数据文件,其中,所述备份数据文件为所述主数据文件的备份,所述主数据文件用于写入经校验的数据,所述备份数据文件用于写入未校验数据。discarding the backup data file in the target database, and retaining the main data file in the target database, wherein the backup data file is a backup of the main data file, and the main data file is used to write the verified data, the backup data file is used to write unverified data.
  5. 根据权利要求1至4中任一项所述的数据操作方法,其中,所述第一操作请求包括自定义操作请求;The data operation method according to any one of claims 1 to 4, wherein the first operation request includes a custom operation request;
    在所述接收用于对未校验数据进行废除的第一操作请求之前,还包括:Before said receiving the first operation request for revoking unverified data, it also includes:
    预先为所述自定义操作请求定义操作响应。An operation response is defined in advance for the custom operation request.
  6. 根据权利要求1至4中任一项所述的数据操作方法,其中,所述第一操作请求包括校验操作请求;The data operation method according to any one of claims 1 to 4, wherein the first operation request includes a verification operation request;
    所述校验操作请求的输入参数包括用于指示校验失败后是否进行数据废弃的指示参数;The input parameters of the verification operation request include an indication parameter for indicating whether to discard data after the verification fails;
    所述解析所述操作请求的输入参数,获取到所述目标数据库名称后,还包括:The analyzing the input parameters of the operation request, after obtaining the name of the target database, further includes:
    检测所述指示参数是否指示校验失败后进行数据废弃;Detecting whether the indication parameter indicates that the verification fails and the data is discarded;
    若所述指示参数指示校验失败后进行数据废弃,则再执行所述根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。If the indication parameter indicates that the data is discarded after the verification fails, then perform the step of discarding the unverified data in the target database according to the name of the target database, and retain the verified data in the target database.
  7. 根据权利要求1所述的数据操作方法,其中,所述数据为网络管理协议NETCONF数据,所述目标数据库包括备选数据库和运行数据库。The data operation method according to claim 1, wherein said data is network management protocol NETCONF data, and said target database includes a candidate database and a running database.
  8. 一种数据操作装置,包括:A data manipulation device, comprising:
    接收模块,设置为接收第一操作请求,所述第一操作请求用于对未校验数据进行废除,所述第一操作请求的输入参数包括目标数据库名称;The receiving module is configured to receive a first operation request, the first operation request is used to abolish unverified data, and the input parameters of the first operation request include the target database name;
    解析模块,设置为解析所述操作请求的输入参数,获取到所述目标数据库名称;The parsing module is configured to parse the input parameters of the operation request to obtain the name of the target database;
    处理模块,设置为根据所述目标数据库名称废弃所述目标数据库中未校验的数据,保留所述目标数据库中已校验的数据。The processing module is configured to discard the unverified data in the target database according to the name of the target database, and retain the verified data in the target database.
  9. 一种服务器,包括:A server comprising:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至7中任一项所述的数据操作方法。The memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor, so that the at least one processor can perform the operation described in any one of claims 1 to 7 The data manipulation method described above.
  10. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的数据操作方法。A computer-readable storage medium storing a computer program, which implements the data manipulation method according to any one of claims 1 to 7 when the computer program is executed by a processor.
PCT/CN2022/119385 2021-09-16 2022-09-16 Data operation method and apparatus, and server and storage medium WO2023041052A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111087119.3A CN115827081A (en) 2021-09-16 2021-09-16 Data operation method, device, server and storage medium
CN202111087119.3 2021-09-16

Publications (1)

Publication Number Publication Date
WO2023041052A1 true WO2023041052A1 (en) 2023-03-23

Family

ID=85515045

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/119385 WO2023041052A1 (en) 2021-09-16 2022-09-16 Data operation method and apparatus, and server and storage medium

Country Status (2)

Country Link
CN (1) CN115827081A (en)
WO (1) WO2023041052A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110178990A1 (en) * 2010-01-20 2011-07-21 International Business Machines Corporation Information processor, information processing system, data archiving method, and data deletion method
CN104866242A (en) * 2015-05-29 2015-08-26 北京京东尚科信息技术有限公司 Data deleting system, data deleting method and data deleting denter
CN111198868A (en) * 2019-12-12 2020-05-26 北京淇瑀信息科技有限公司 Intelligent sub-database real-time data migration method and device
CN111309707A (en) * 2020-01-23 2020-06-19 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer readable storage medium
US10963435B1 (en) * 2017-07-10 2021-03-30 Amazon Technologies, Inc. Data validation of data migrated from a source database to a target database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110178990A1 (en) * 2010-01-20 2011-07-21 International Business Machines Corporation Information processor, information processing system, data archiving method, and data deletion method
CN104866242A (en) * 2015-05-29 2015-08-26 北京京东尚科信息技术有限公司 Data deleting system, data deleting method and data deleting denter
US10963435B1 (en) * 2017-07-10 2021-03-30 Amazon Technologies, Inc. Data validation of data migrated from a source database to a target database
CN111198868A (en) * 2019-12-12 2020-05-26 北京淇瑀信息科技有限公司 Intelligent sub-database real-time data migration method and device
CN111309707A (en) * 2020-01-23 2020-06-19 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN115827081A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
WO2019200701A1 (en) Configuration management method and apparatus, terminal device and storage medium
US7376719B1 (en) Automatic generation of configuration data using implementation-specific configuration policies
US20170279691A1 (en) System and Method for Validating Documentation of Representational State Transfer (Rest) Services
US8166140B1 (en) Automatic application of implementation-specific configuration policies
CN110069941A (en) A kind of interface access authentication method, apparatus and computer-readable medium
WO2020000725A1 (en) Electronic apparatus, data migration method, and storage medium
US8713368B2 (en) Methods for testing OData services
EP2769304B1 (en) Telemetry file hash and conflict detection
EP2799995A1 (en) Information interaction test device and method based on automatic generation of associated test cases
US10521407B2 (en) Grouping of database objects
KR20210027400A (en) Implementation of compliance settings by mobile devices to comply with configuration scenarios
JP6614756B2 (en) Transaction system error detection method, apparatus, storage medium, and computer device
US9367298B1 (en) Batch configuration mode for configuring network devices
CN112613993B (en) Transaction data processing method and device, computer equipment and storage medium
WO2021249356A1 (en) Form data verification method, system, server, and user terminal
WO2019144548A1 (en) Security test method, apparatus, computer device and storage medium
WO2020094045A1 (en) Method for enhancing status communications in a sdn-based communication system
CN107102908A (en) Data verification method, data fault tolerance method and device
KR20160048806A (en) Automatically generating certification documents
WO2023056727A1 (en) Access control method and apparatus, and device and readable storage medium
CN116308344A (en) Transaction data authentication consensus method and system based on blockchain
WO2023041052A1 (en) Data operation method and apparatus, and server and storage medium
US10216590B2 (en) Communication control determination of storing state based on a requested data operation and a schema of a table that stores therein data to be operated by the data operation
US10164990B2 (en) Security test tool
US10979287B2 (en) Method and apparatus for receiving a solution when configuration function verification fails in a terminal

Legal Events

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

Ref document number: 22869418

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE