WO2012159404A1 - 提高网管自动发现业务效率的方法及装置 - Google Patents

提高网管自动发现业务效率的方法及装置 Download PDF

Info

Publication number
WO2012159404A1
WO2012159404A1 PCT/CN2011/080586 CN2011080586W WO2012159404A1 WO 2012159404 A1 WO2012159404 A1 WO 2012159404A1 CN 2011080586 W CN2011080586 W CN 2011080586W WO 2012159404 A1 WO2012159404 A1 WO 2012159404A1
Authority
WO
WIPO (PCT)
Prior art keywords
statement
inbound
update
insert
bcp
Prior art date
Application number
PCT/CN2011/080586
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 中兴通讯股份有限公司
Publication of WO2012159404A1 publication Critical patent/WO2012159404A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and apparatus for improving the efficiency of a network management automatic discovery service. Background technique
  • the main purpose of the present invention is to provide a method and device for improving the efficiency of the network management automatic discovery service, which aims to improve the efficiency of the network management automatic discovery service.
  • the present invention provides a method for improving the efficiency of the network management automatic discovery service, including the following steps:
  • the first BCP inbound class and the second BCP inbound class are integrated into the auto-discovery service code, and the first inbound interface and the second inbound interface are invoked to replace the INSERT INTO statement and the UPDATE statement on the operation of the database.
  • the field updated by using the UPDATE statement is separated from the source table having a dependency relationship with other data tables to form a new table, and the second BCP inbound class and the second inbound library are set for the new table.
  • the interface includes:
  • the removed field is combined with the selected foreign key to form a new table, and the properties of the new table are set.
  • the setting the first BCP inbound class and the first inbound interface for the data table involved in the INSERT INTO statement includes:
  • the data table related to the inbound operation INSERT INTO statement and the update operation UPDATE statement in the analysis auto-discovery service includes:
  • the data table associated with the INSERT INTO statement includes a path information table; the data table associated with the UPDATE statement includes a time slot cross table.
  • the invention also provides an apparatus for improving the efficiency of the network management automatic discovery service, comprising: an analyzing unit, configured to analyze a data table related to the inbound operation INSERT INTO statement and the update operation UPDATE statement in the automatic discovery service, and list each data table.
  • the first existence unit is configured to set a first BCP inbound class and a first inbound interface for the data table involved in the INSERT INTO statement;
  • a second setting unit configured to separate a field updated by using an UPDATE statement from a source table having a dependency relationship with other data tables, form a new table, and set a second BCP inbound class and a second for the new table Inbound interface
  • the execution unit is configured to integrate the set first BCP inbound class and the second BCP inbound class into the auto-discovery business code, and call the first inbound interface and the second inbound interface to replace the INSERT INTO statement and the UPDATE statement.
  • the operation of the database is configured to integrate the set first BCP inbound class and the second BCP inbound class into the auto-discovery business code, and call the first inbound interface and the second inbound interface to replace the INSERT INTO statement and the UPDATE statement.
  • the second setting unit comprises:
  • the UPDATE statement analysis module is used to analyze the UPDATE statement, delete the field that needs to be updated from the source table, and select a primary key as the foreign key of the new table;
  • a new table shaping module is used to form a new table with the removed fields together with the selected foreign key, and set the properties of the new table.
  • the first setting unit is specifically configured to:
  • the analyzing unit comprises:
  • the judgment module determines whether the INSERT INTO statement and the update operation UPDATE statement cause an efficiency bottleneck. If not, the process ends.
  • the method or device provided by the invention for improving the efficiency of the network management automatic discovery service replaces the INSERT INTO statement, and replaces the INSERT INTO with the BCP storage method, thereby solving the efficiency loss caused by the INSERT INTO; first analyzing the UPDATE statement Form relationship, separate the fields that need to be updated to form a new table, use foreign keys to associate the relationship between the new table and the source table that has dependencies on other data tables, and then convert the updated data into inserts by BCP inbound.
  • the data solves the efficiency bottleneck problem brought by the UPDATE statement, and greatly improves the efficiency of the network management automatic discovery service; and, the invention eliminates redundant data and transmission dependencies of the data table, so that the requirements of the third paradigm are met between the tables. Also makes the relationship between the tables more For clarity.
  • FIG. 1 is a flow chart of a method for improving the efficiency of automatically discovering a network management service according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a path information table, a time slot cross table, and a new table according to the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for improving the efficiency of automatic network management service discovery in an apparatus mode according to an embodiment of the present invention
  • FIG. 4 is a workflow diagram of an apparatus for improving the efficiency of automatic network management service discovery according to an embodiment of the present invention. detailed description
  • FIG. 1 shows a method flow for improving the efficiency of the network management automatic discovery service in an embodiment of the present invention.
  • the process includes the following steps:
  • Step S10 analyzing a data table related to the inbound operation INSERT INTO statement and the update operation UPDATE statement in the automatic discovery service, and listing the dependencies existing between the data tables; for example, referring to FIG. 2, the path for storing the path information
  • the information table SubnetworkConnection requires a large number of INSERT INTO statements to insert path information; the time slot cross table for storing cross information CrossPath's own path field Trai_Value depends on the Name_value field of the path information table, and this field of the time slot cross table CrossConnection needs to use UPDATE
  • the statement is updated. When a large amount of data is used, this UPDATE statement that has a dependency on the path information table will cause efficiency problems.
  • Step S20 setting a first BCP inbound class and a first inbound interface for the data table involved in the INSERT INTO statement; storing the data in the database by using the INSERT INTO statement
  • the first is the overhead of parsing the statement.
  • the database needs to understand the purpose of this SQL (Structured Query Language) statement and analyze the data and constraints it carries.
  • the second is that Perform batch operations. If you insert data into the database and parse the statement, analyze the data and constraints each time, the speed can be imagined, the overhead is naturally large, and the efficiency problem is outstanding.
  • the invention adopts the BCP (Batch Communication Program) warehousing method, utilizes the memory caching mechanism, first puts the data that needs to be put into the database and caches it in the database, and then writes the data into the database in batches, so that Greatly improved the efficiency of storage.
  • Most modern relational database products provide an application programming interface (API) for operating the database, which can encapsulate these underlying operations and implement BCP storage.
  • API application programming interface
  • abstract a special class for the path information table SubnetworkConnection, such as CBcpSnc call the function of the memory cache bulk storage provided by the low-level API of the database product, and encapsulate the fields used in the INSERT INTO statement. Inbound interface.
  • the BCP storage method allocates a data buffer space in the memory. Each time a record is submitted, a corresponding data is added to the buffer. Until the buffer is full, the memory data is written to the disk in a batch, so as to improve the storage speed. And there is no load from parsing SQL statements.
  • Step S30 separating the field updated by using the UPDATE statement from the source table having a dependency relationship with other data tables, forming a new table, and setting a second BCP storage for the new table.
  • the SQL statement is as follows: UPDATE CrossConnection
  • This update statement updates the three fields. Then, these three fields can be removed from the time slot cross-table CrossConnection to form a new table CroConnTrailRela.
  • the new table is linked with the source table by the primary key Crossld.
  • the foreign key of the new table CroConnTrailRela is used.
  • For the setting of the second inbound interface refer to the setting method of the first inbound interface.
  • CroConnTrailRela can be set to Set_Id(), SetCrossId(), Set_TrailName(), and Set_TrailValue() as the inbound interface.
  • the present invention forms a new table CroConnTrailRela from the field separated by the time slot cross table, and uses the foreign key Crossld to associate the time slot intersection, thus converting the update of TraiLvalue into the insertion operation of the new table CroConnTrailRela, and the speed is greatly improved. It also makes the relationship between the tables clear, eliminating the redundant data and delivery dependencies of the data table.
  • Step S40 integrating the set first BCP inbound class and the second BCP inbound class into the auto-discovery business code, invoking the first inbound interface and the second inbound interface, instead of the INSERT INTO statement and the UPDATE statement on the database Operation.
  • the invention utilizes the BCP storage method to replace the INSERT INTO statement, greatly improves the efficiency of the storage, and solves the bottleneck effect brought by the INSERT INTO statement; and the efficiency problem caused by the UPDATE statement, the UPDATE statement is converted into the BCP storage mode update. Data, from a very time-consuming operation to a high-speed database operation, greatly improves the efficiency of the network management automatic discovery service.
  • the invention also provides a device for improving the efficiency of the network management automatic discovery service, which is used to implement the above method.
  • the apparatus includes: The analyzing unit 10 is configured to analyze a data table related to the inbound operation INSERT INTO statement and the update operation UPDATE statement in the automatic discovery service, and list the dependencies existing between the data tables; for example, referring to FIG. 2, the storage path is used.
  • the information path information table SubnetworkConnection requires a large number of INSERT INTO statements to insert path information; the time slot cross table that stores the cross information CrossConnection's path field Trai_Value depends on the Name_value field of the path table, and this field of the time slot cross table CrossConnection needs Update with the UPDATE statement.
  • the analysis unit 10 is configured to analyze the dependencies existing between the path information table SubnetworkConnection and the time slot cross table CrossConnection.
  • the first setting unit 20 is configured to set a first BCP inbound class and a first inbound interface for the data table involved in the INSERT INTO statement; the second setting unit 20 may invoke a low-level API to encapsulate the field used in the INSERT INTO statement. , and design the inbound interface. For details, refer to the setting method of step S20 in the foregoing method.
  • the second setting unit 30 configured to separate a field updated by using an UPDATE statement from a source table having a dependency relationship with other data tables, form a new table, and set a second BCP inbound class and a first table for the new table.
  • the second setting unit 30 includes:
  • the UPDATE statement analysis module 31 is configured to analyze the UPDATE statement, and the field to be updated is deleted from the source table, and a primary key is selected as the foreign key of the new table;
  • the new table forming module 32 is configured to form a new table together with the selected foreign key, and set the attributes of the new table.
  • the specific use of the UPDATE statement analysis module 31 and the new table shaping module 32 can be referred to the following embodiments:
  • the automatic discovery service discovery needs to update the time slot cross table CrossConnection after completing a service, which is used to indicate the path to which the cross belongs.
  • the SQL statement is as follows:
  • This update statement updates the three fields. Then, these three fields can be removed from the time slot cross-table CrossConnection to form a new table CroConnTrailRda, new
  • the table is linked to the source table using the primary key Crossld, which is used as a foreign key to the new table CroConnTrailRela.
  • the setting of the second inbound interface refer to the setting method of the first inbound interface.
  • CroConnTrailRela can be set to Set_Id(), SetCrossId(), Set_TrailName(), and Set_TrailValue() as the inbound interface.
  • the execution unit 40 is configured to integrate the set first BCP inbound class and the second BCP inbound class into the auto-discovery business code, and invoke the first inbound interface and the second inbound interface to replace the INSERT INTO statement and the UPDATE The operation of the statement against the database.
  • Execution unit 40 can integrate the first BCP inbound class and the second BCP inbound class into the program to replace the INSERT INTO statement and the UPDATE statement on the operation of the database, thereby improving the efficiency of the automatic discovery service.
  • the first setting unit 20 is specifically configured to:
  • the analysis unit 10 includes:
  • the judging module 11 judges whether the INSERT INTO statement and the update operation UPDATE statement cause an efficiency bottleneck, and if not, ends the process.
  • FIG. 4 is a detailed working flow chart of the apparatus for improving the efficiency of the network management automatic discovery service according to the present invention. The process includes:
  • Step S101 determining whether the INSERT INTO statement and the UPDATE statement in the program form an efficiency bottleneck; if yes, executing step S102; if not, executing step S103;
  • Step S102 setting a first BCP inbound class for the table involved in the INSERT INTO statement, and calling the underlying API provided by the database to write the corresponding first inbound interface;
  • Step S103 ending the process, without processing
  • Step S104 analyzing the UPDATE statement, deleting the field that needs to be updated from the source table, and selecting a primary key to be used as a foreign key of the new table;
  • Step S105 forming a new table together with the selected foreign key, and setting a new table Attribute
  • Step S106 designing a second BCP inbound class for the new table, and setting a corresponding second inbound interface
  • Step S107 integrating the set first BCP inbound class and the second BCP inbound class into the program to replace the INSERT
  • the operation of the INTO statement and the UPDATE statement on the database is included in the scope of patent protection of the present invention.
  • the invention solves the efficiency bottleneck problem brought by the UPDATE statement, greatly improves the efficiency of the network management automatic discovery service; eliminates the redundant data and the transmission dependency of the data table, so that the requirements of the third paradigm are satisfied between the tables, and the table is also The relationship is more clear.

Landscapes

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

Abstract

提供了一种提高网管自动发现业务效率的方法,包括以下步骤:分析自动发现业务中与入库操作INSERTINTO语句和更新操作UPDATE语句有关的数据表,列出各数据表之间存在的依赖关系;为INSERTINTO语句涉及到的数据表设置第一BCP入库类和第一入库接口;将使用UPDATE语句更新的字段从与其它数据表存在依赖关系的源表中分离出来,形成一个新表,并为新表设置第二BCP入库类和第二入库接口;将设置好入库类集成到自动发现业务代码,调用入库接口,以代替INSERTINTO语句和UPDATE语句对数据库的操作。还提供了一种提高网管自动发现业务效率的装置。所提供的方法或装置,可提升网管自动发现业务的效率。

Description

提高网管自动发现业务效率的方法及装置 技术领域
本发明涉及通信技术领域, 尤其涉及一种提高网管自动发现业务效率 的方法及装置。 背景技术
随着通信技术的迅猛发展, 光网络中管理的业务数量越来越多, 数据 量日趋庞大, 对网管的要求也不断提升。 在对业务的自动发现方面, 不仅 要求网管具有对各种不同速率业务的发现能力, 还要求具有业务的增量发 现能力, 甚至提出了对错误配置的业务应该具有容错能力。 这样一来, 直 接导致网管的业务数据量增大。 数据量一增大, 效率自然成了一个重要的 问题。 因此, 怎样提升网管自动发现业务的效率成了目前亟待解决的问题。 发明内容
本发明的主要目的在于提供一种提高网管自动发现业务效率的方法及 装置, 旨在提高网管自动发现业务的效率。
为了实现发明目的, 本发明提供一种提高网管自动发现业务效率的方 法, 包括以下步驟:
分析自动发现业务中与入库操作 INSERT INTO 语句和更新操作 UPDATE语句有关的数据表, 列出各数据表之间存在的依赖关系;
为 INSERT INTO语句涉及到的数据表设置第一批量通信程序 BCP入 库类和第一入库接口;
将使用 UPDATE语句更新的字段从与其它数据表存在依赖关系的源表 中分离出来, 形成一个新表, 并为所述新表设置第二批量通信程序 BCP入 库类和第二入库接口;
将设置好的第一 BCP入库类和第二 BCP入库类集成到自动发现业务代 码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO 语句和 UPDATE语句对数据库的操作。
优选地, 所述将使用 UPDATE语句更新的字段从与其它数据表存在依 赖关系的源表中分离出来, 形成一个新表, 并为所述新表设置第二 BCP入 库类和第二入库接口包括:
分析 UPDATE语句, 把需要更新的字段从源表中删除, 选择一个主键 作为新表的外键使用;
将移出的字段连同选择的外键形成一个新表, 设置好新表的属性。 优选地, 所述为 INSERT INTO语句涉及到的数据表设置第一 BCP入 库类和第一入库接口包括:
调用低层应用程序编程接口 API对 INSERT INTO语句中使用的字段进 行封装, 并设置好入库接口函数。
优选地, 所述分析自动发现业务中与入库操作 INSERT INTO语句和更 新操作 UPDATE语句有关的数据表包括:
判断 INSERT INTO语句和更新操作 UPDATE语句是否造成效率瓶颈 , 若否, 则结束流程。
优选地, 上述与入库操作 INSERT INTO语句有关的数据表包括路径信 息表; 与 UPDATE语句有关的数据表包括时隙交叉表。
本发明还提供一种提高网管自动发现业务效率的装置, 包括: 分析单元, 用于分析自动发现业务中与入库操作 INSERT INTO语句和 更新操作 UPDATE语句有关的数据表,列出各数据表之间存在的依赖关系; 第一设置单元, 用于为 INSERT INTO语句涉及到的数据表设置第一 BCP入库类和第一入库接口; 第二设置单元, 用于将使用 UPDATE语句更新的字段从与其它数据表 存在依赖关系的源表中分离出来, 形成一个新表, 并为所述新表设置第二 BCP入库类和第二入库接口;
执行单元,用于将设置好的第一 BCP入库类和第二 BCP入库类集成到 自动发现业务代码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO语句和 UPDATE语句对数据库的操作。
优选地, 所述第二设置单元包括:
UPDATE语句分析模块, 用于分析 UPDATE语句, 把需要更新的字段 从源表中删除, 选择一个主键作为新表的外键使用;
新表成形模块, 用于将移出的字段连同选择的外键形成一个新表, 设 置好新表的属性。
优选地, 所述第一设置单元具体用于:
调用低层应用程序编程接口 API对 INSERT INTO语句中使用的字段进 行封装, 并设置好入库接口函数。
优选地, 所述分析单元包括:
判断模块,判断 INSERT INTO语句和更新操作 UPDATE语句是否造成 效率瓶颈, 若否, 则结束流程。
本发明所提供的提高网管自动发现业务效率的方法或装置,对 INSERT INTO语句进行替换, 利用 BCP入库方式来代替 INSERT INTO, 解决了 INSERT INTO 带来的效率上的损失;对于 UPDATE语句首先分析表格关 系, 分离出那些需要更新的字段形成新表, 利用外键来关联新表与与其它 数据表存在依赖关系的源表之间的关系, 然后采用 BCP入库的方式将更新 数据转换为插入数据, 解决了 UPDATE语句带来的效率瓶颈问题, 大大提 升了网管自动发现业务的效率; 并且, 本发明消除了数据表的冗余数据和 传递依赖, 使得表格之间满足第三范式的要求, 也使得表格之间的关系更 为明确。 附图说明
图 1 为本发明一实施方式中提高网管自动发现业务效率的方法的流程 图;
图 2为本发明中路径信息表、 时隙交叉表以及新表的结构示意图; 图 3 为本发明一实施装置方式中提高网管自动发现业务效率的装置的 结构示意图;
图 4为本发明一实施例中提高网管自动发现业务效率的装置的工作流 程图。 具体实施方式
应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于 限定本发明。
图 1 示出了本发明的一个实施方式中提高网管自动发现业务效率的方 法流程。 该流程包括以下步驟:
步驟 S10, 分析自动发现业务中与入库操作 INSERT INTO语句和更新 操作 UPDATE语句有关的数据表, 列出各数据表之间存在的依赖关系; 例 如, 参照图 2, 用来存储路径信息的路径信息表 SubnetworkConnection需要 大量的使用 INSERT INTO语句来插入路径信息; 存储交叉信息的时隙交叉 表 CrossConnection 的所属路径字段 Trai_Value 依赖于路径信息表的 Name_value 字段, 而时隙交叉表 CrossConnection 的这个字段需要采用 UPDATE语句进行更新。 大数据量时, 这个与路径信息表存在依赖关系的 UPDATE语句执行时, 就会带来效率问题。
步驟 S20,为 INSERT INTO语句涉及到的数据表设置第一 BCP入库类 和第一入库接口; 使用 INSERT INTO语句往数据库里面插入数据的时候存 在两个效率瓶颈, 第一就是对语句的解析所作的开销, 数据库需要理解这 条 SQL ( Structured Query Language, 结构化查询语言)语句的目的和分析 其中所携带的数据和约束; 第二就是不能进行批量操作。 如果一条条的往 数据库里面插入数据, 而且每次都要解析语句、 分析数据和约束, 这个速 度可想而知, 开销自然很大, 效率问题突出。 本发明采用 BCP ( Batch Communications Program,批量通信程序 )入库方式, 利用内存的緩存机制, 把需要入库的数据首先放到数据库里面緩存起来, 然后再将数据成批的写 入数据库, 这样就大大提高了入库效率。 现代关系型数据库产品大都提供 了 氐层 API ( Application Programming Interface, 应用程序编程接口 )供操 作数据库, 可以封装这些底层操作, 实现 BCP入库方式。 跟具体的数据库 产品结合起来, 为路径信息表 SubnetworkConnection抽象出专门的类, 例 如 CBcpSnc, 调用数据库产品低层 API提供的内存緩存批量入库的函数, 对 INSERT INTO语句中使用的字段进行封装, 设计好入库接口。 BCP入库 方式会在内存分配一块数据緩沖空间, 每提交一条记录, 緩沖区就增加一 条相应的数据, 直到緩沖区满了才一次性批量的把内存数据写入磁盘, 以 提高入库速度, 而且也无解析 SQL语句带来的负荷。
例如语句:
"INSERT INTO SubnetworkConnection( id, value ) Values ( ... ) " 可以为类 CBcpSnc设置入库各字段的函数接口 Set_Id()、 Set_Value()来 对内存緩沖区进行操作。 这些接口可根据具体的表格和具体的字段来设置。
对于其他的表格只要涉及到 INSERT INTO语句, 都可以为表格设计专 门的 BCP入库类, 用来提高入库的速度。 这样就可以大大提高自动发现业 务的效率。
步驟 S30, 将使用 UPDATE语句更新的字段从与其它数据表存在依赖 关系的源表中分离出来, 形成一个新表, 并为所述新表设置第二 BCP入库 类和第二入库接口; 例如自动发现业务发现完成一条业务后都需要更新时 隙交叉表 CrossConnection表, 用来表示交叉所属的路径。 SQL语句如下: UPDATE CrossConnection
SET Trail_if=l, Trail_Name=,SNC,, Trail_Value='SNC{ 12-2412-231-1 }' WHERE CrossId=1233
这条更新语句对三个字段进行更新操作, 那么, 可以将这三个字段从 时隙交叉表 CrossConnection 中移出, 形成一个新表 CroConnTrailRela, 新 表与源表之间用主键 Crossld联系起来, Crossld作为新表 CroConnTrailRela 的外键使用。 第二入库接口的设置可参照第一入库接口的设置方法, 例如, 对于新表 CroConnTrailRela 可以设置为 Set_Id()、 SetCrossId()、 Set_TrailName()、 Set_TrailValue()作为入库接口。本发明将从时隙交叉表中 分离出来的字段形成新表 CroConnTrailRela, 采用外键 Crossld来关联时隙 交叉, 这样就把对 TraiLvalue的更新转换为对新表 CroConnTrailRela的插 入操作, 速度大大提高。 同时也使得表格之间的关系明确, 消除了数据表 的冗余数据和传递依赖。
步驟 S40,将设置好的第一 BCP入库类和第二 BCP入库类集成到自动 发现业务代码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO 语句和 UPDATE语句对数据库的操作。
本发明利用 BCP入库方式替代 INSERT INTO语句, 大大提高了入库 效率 ,解决了 INSERT INTO语句带来的瓶颈效应; 而针对 UPDATE语句带 来的效率问题, 将 UPDATE语句转换为 BCP入库方式更新数据, 从一个非 常耗时的操作转换为一个高速的数据库操作, 大大提高了网管自动发现业 务的效率。 本发明还提供了一种提高网管自动发现业务效率的装置, 用以实现上 述方法。 参照图 3, 该装置包括: 分析单元 10,用于分析自动发现业务中与入库操作 INSERT INTO语句 和更新操作 UPDATE语句有关的数据表, 列出各数据表之间存在的依赖关 系;例如,参照图 2,用来存储路径信息的路径信息表 SubnetworkConnection 需要大量的使用 INSERT INTO语句来插入路径信息; 存储交叉信息的时隙 交叉表 CrossConnection 的所属路径字段 Trai_Value 依赖于路径表的 Name_value 字段, 而时隙交叉表 CrossConnection 的这个字段需要采用 UPDATE 语句进行更新。 分析单元 10 用 于分析路径信息表 SubnetworkConnection和时隙交叉表 CrossConnection之间存在的依赖关系。
第一设置单元 20,用于为 INSERT INTO语句涉及到的数据表设置第一 BCP入库类和第一入库接口; 第二设置单元 20可调用低层 API对 INSERT INTO语句中使用的字段进行封装, 并设计好入库接口。 具体可参照前述方 法中步驟 S20的设置方法。
第二设置单元 30, 用于将使用 UPDATE语句更新的字段从与其它数据 表存在依赖关系的源表中分离出来, 形成一个新表, 并为所述新表设置第 二 BCP入库类和第二入库接口; 在一实施例中, 第二设置单元 30包括:
UPDATE语句分析模块 31 , 用于分析 UPDATE语句, 4巴需要更新的字 段从源表中删除, 选择一个主键作为新表的外键使用;
新表成形模块 32, 用于将移出的字段连同选择的外键形成一个新表, 设置好新表的属性。 UPDATE语句分析模块 31和新表成形模块 32的具体 用途可参照下述实施例: 例如自动发现业务发现完成一条业务后都需要更 新时隙交叉表 CrossConnection , 用来表示交叉所属的路径。 SQL语句如下:
UPDATE CrossConnection
SET Trail_if=l, Trail_Name=,SNC,, Trail_Value='SNC{ 12-2412-231-1 }' WHERE CrossId=1233
这条更新语句对三个字段进行更新操作, 那么, 可以将这三个字段从 时隙交叉表 CrossConnection 中移出, 形成一个新表 CroConnTrailRda, 新 表与源表之间用主键 Crossld联系起来, Crossld作为新表 CroConnTrailRela 的外键使用。 第二入库接口的设置可参照第一入库接口的设置方法, 例如, 对于新表 CroConnTrailRela 可以设置为 Set_Id()、 SetCrossId()、 Set_TrailName()、 Set_TrailValue()作为入库接口。
执行单元 40, 用于将设置好的第一 BCP入库类和第二 BCP入库类集 成到自动发现业务代码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO语句和 UPDATE语句对数据库的操作。 执行单元 40可将第 一 BCP入库类和第二 BCP入库类集成到程序, 以替代 INSERT INTO语句 和 UPDATE语句对数据库的操作, 从而提高自动发现业务的效率。
在一实施例中, 第一设置单元 20具体用于:
调用低层应用程序编程接口 API对 INSERT INTO语句中使用的字段进 行封装, 并设置好入库接口函数。
分析单元 10包括:
判断模块 11 , 判断 INSERT INTO语句和更新操作 UPDATE语句是否 造成效率瓶颈, 若否, 则结束流程。
图 4是本发明提高网管自动发现业务效率的装置的详细工作流程图。 该流程包括:
步驟 S101 , 判断程序中的 INSERT INTO语句和 UPDATE语句是否形 成效率瓶颈; 如果是, 则执行步驟 S102; 如果否, 则执行步驟 S103;
步驟 S102, 为 INSERT INTO语句涉及到的表设置第一 BCP入库类, 调用数据库提供的底层 API写好对应的第一入库接口;
步驟 S103, 结束流程, 不作处理;
步驟 S104, 分析 UPDATE语句, 把需要更新的字段从源表中删除, 选 择一个主键作为新表的外键使用;
步驟 S105, 把移出的字段连同选择的外键形成一个新表, 设置好新表 的属性;
步驟 S106, 为新表设计第二 BCP入库类, 设置对应的第二入库接口; 步驟 S107, 将设置好的第一 BCP入库类和第二 BCP入库类集成到程 序 , 以替代 INSERT INTO语句和 UPDATE语句对数据库的操作。 以上仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡 是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接 或间接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范围 内。 工业实用性
本发明解决了 UPDATE语句带来的效率瓶颈问题, 大大提升了网管自 动发现业务的效率; 消除了数据表的冗余数据和传递依赖, 使得表格之间 满足第三范式的要求, 也使得表格之间的关系更为明确。

Claims

权利要求书
1、 一种提高网管自动发现业务效率的方法, 其中, 该方法包括: 分析自动发现业务中与入库操作 INSERT INTO 语句和更新操作
UPDATE语句有关的数据表, 列出各数据表之间存在的依赖关系;
为 INSERT INTO语句涉及到的数据表设置第一批量通信程序 BCP入 库类和第一入库接口;
将使用 UPDATE语句更新的字段从与其它数据表存在依赖关系的源表 中分离出来, 形成一个新表, 并为所述新表设置第二批量通信程序 BCP入 库类和第二入库接口;
将设置好的第一 BCP入库类和第二 BCP入库类集成到自动发现业务代 码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO 语句和
UPDATE语句对数据库的操作。
2、 如权利要求 1所述的方法, 其中, 所述将使用 UPDATE语句更新的 字段从与其它数据表存在依赖关系的源表中分离出来, 形成一个新表, 并 为所述新表设置第二 BCP入库类和第二入库接口包括:
分析 UPDATE语句, 把需要更新的字段从源表中删除, 选择一个主键 作为新表的外键使用;
将移出的字段连同选择的外键形成一个新表, 设置好新表的属性。
3、 如权利要求 1或 2所述的方法, 其中, 所述为 INSERT INTO语句 涉及到的数据表设置第一 BCP入库类和第一入库接口包括:
调用低层应用程序编程接口 API对 INSERT INTO语句中使用的字段进 行封装, 并设置好入库接口函数。
4、 如权利要求 3所述的方法, 其中, 所述分析自动发现业务中与入库 操作 INSERT INTO语句和更新操作 UPDATE语句有关的数据表包括: 判断 INSERT INTO语句和更新操作 UPDATE语句是否造成效率瓶颈 , 若未造成效率瓶颈, 则结束流程。
5、 如权利要求 4所述的方法, 其中, 与入库操作 INSERT INTO语句 有关的数据表包括路径信息表; 与 UPDATE语句有关的数据表包括时隙交 叉表。
6、 一种提高网管自动发现业务效率的装置, 该装置包括:
分析单元, 用于分析自动发现业务中与入库操作 INSERT INTO语句和 更新操作 UPDATE语句有关的数据表,列出各数据表之间存在的依赖关系; 第一设置单元, 用于为 INSERT INTO语句涉及到的数据表设置第一 BCP入库类和第一入库接口;
第二设置单元, 用于将使用 UPDATE语句更新的字段从与其它数据表 存在依赖关系的源表中分离出来, 形成一个新表, 并为所述新表设置第二 BCP入库类和第二入库接口;
执行单元,用于将设置好的第一 BCP入库类和第二 BCP入库类集成到 自动发现业务代码, 调用第一入库接口和第二入库接口, 以替代 INSERT INTO语句和 UPDATE语句对数据库的操作。
7、 如权利要求 6所述的装置, 其中, 所述第二设置单元包括:
UPDATE语句分析模块, 用于分析 UPDATE语句, 把需要更新的字段 从源表中删除, 选择一个主键作为新表的外键使用;
新表成形模块, 用于将移出的字段连同选择的外键形成一个新表, 设 置好新表的属性。
8、如权利要求 6或 7所述的装置,其中, 所述第一设置单元具体用于: 调用低层应用程序编程接口 API对 INSERT INTO语句中使用的字段进 行封装, 并设置好入库接口函数。
9、 如权利要求 8所述的装置, 其中, 所述分析单元包括:
判断模块,判断 INSERT INTO语句和更新操作 UPDATE语句是否造成 效率瓶颈, 若未造成效率瓶颈, 则结束流程。
10、 如权利要求 9所述的装置, 其中, 与入库操作 INSERT INTO语句 有关的数据表包括路径信息表; 与 UPDATE语句有关的数据表包括时隙交 叉表。
PCT/CN2011/080586 2011-05-23 2011-10-09 提高网管自动发现业务效率的方法及装置 WO2012159404A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110133974.3 2011-05-23
CN201110133974.3A CN102799582B (zh) 2011-05-23 2011-05-23 提高网管自动发现业务效率的方法及装置

Publications (1)

Publication Number Publication Date
WO2012159404A1 true WO2012159404A1 (zh) 2012-11-29

Family

ID=47198694

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080586 WO2012159404A1 (zh) 2011-05-23 2011-10-09 提高网管自动发现业务效率的方法及装置

Country Status (2)

Country Link
CN (1) CN102799582B (zh)
WO (1) WO2012159404A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930532A (zh) * 2020-07-09 2020-11-13 西北工业大学 航电数据集成方法及装置
US10922206B2 (en) 2019-05-10 2021-02-16 Capital One Services, Llc Systems and methods for determining performance metrics of remote relational databases

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105429794B (zh) * 2015-11-09 2018-10-30 成都广达新网科技股份有限公司 一种提高网管工作站访问网元设备效率的方法及装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039212A (zh) * 2006-03-15 2007-09-19 中兴通讯股份有限公司 一种数据快速入库方法
CN101299750A (zh) * 2007-04-30 2008-11-05 华为技术有限公司 一种实现业务管理的方法和设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110030A (zh) * 2007-08-23 2008-01-23 南京联创科技股份有限公司 基于java的数据库持久层的开发方法
US8572027B2 (en) * 2007-09-21 2013-10-29 International Business Machines Corporation Performing synchronization among relational database tables with minimal contention
CN101814090A (zh) * 2010-03-22 2010-08-25 深圳市芯朗金能源技术有限公司 一种关系数据库的大批量数据插入方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039212A (zh) * 2006-03-15 2007-09-19 中兴通讯股份有限公司 一种数据快速入库方法
CN101299750A (zh) * 2007-04-30 2008-11-05 华为技术有限公司 一种实现业务管理的方法和设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10922206B2 (en) 2019-05-10 2021-02-16 Capital One Services, Llc Systems and methods for determining performance metrics of remote relational databases
CN111930532A (zh) * 2020-07-09 2020-11-13 西北工业大学 航电数据集成方法及装置
CN111930532B (zh) * 2020-07-09 2023-11-17 智盈未来(西安)信息技术有限公司 航电数据集成方法及装置

Also Published As

Publication number Publication date
CN102799582B (zh) 2015-06-03
CN102799582A (zh) 2012-11-28

Similar Documents

Publication Publication Date Title
CN109857724B (zh) 基于区块链实现支持多种数据库的方法及设备
EP2477355B1 (en) Method and device for managing association of network resources
CN109614413B (zh) 一种内存流式计算平台系统
CN109829011B (zh) 一种分布式异构数据库的数据同步方法及装置
EP2797013B1 (en) Database update execution according to power management schemes
JP6200384B2 (ja) データをモデリングするためのシステム及び方法
US20080281846A1 (en) High performant row-level data manipulation using a data layer interface
US20090037553A1 (en) Configuring or Reconfiguring a Multi-Master Information Sharing Environment
WO2012034440A1 (zh) 一种数据库升级脚本的生成方法和装置
CN102103642B (zh) 基于oltp的数据删除方法、系统及图形数据库服务器
CN104376017A (zh) 在数据库之间进行数据同步的方法及系统
WO2021184761A1 (zh) 数据访问方法和装置、数据存储方法和装置
US20200364183A1 (en) Device and method for managing ledger data on blockchain
CN111752959A (zh) 一种实时数据库跨库sql交互方法和系统
CN103946794A (zh) 数据特征的滚动升级的系统和方法
WO2024041022A1 (zh) 数据库表变更方法、装置、设备和存储介质
CN107704573A (zh) 一种与业务耦合的智能缓存方法
WO2014056145A1 (zh) 使Web应用获取数据库变化的方法和系统
WO2012159404A1 (zh) 提高网管自动发现业务效率的方法及装置
US20090063433A1 (en) Apparatus, system, and method for command manager support for pluggable data formats
CN105550342B (zh) 一种全透明的分布式数据库的数据处理方法
CN102597995B (zh) 同步数据库和非数据库资源
WO2021109777A1 (zh) 一种数据文件的导入方法及装置
CN103646015B (zh) 发送、接收以及传输xml报文的方法和系统
CN101853278A (zh) 数据存储系统应用方法

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: 11866407

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11866407

Country of ref document: EP

Kind code of ref document: A1