WO2022116846A1 - Method and apparatus for acquiring operation data of virtual network element - Google Patents

Method and apparatus for acquiring operation data of virtual network element Download PDF

Info

Publication number
WO2022116846A1
WO2022116846A1 PCT/CN2021/131443 CN2021131443W WO2022116846A1 WO 2022116846 A1 WO2022116846 A1 WO 2022116846A1 CN 2021131443 W CN2021131443 W CN 2021131443W WO 2022116846 A1 WO2022116846 A1 WO 2022116846A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
network element
virtual network
file
instance
Prior art date
Application number
PCT/CN2021/131443
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 WO2022116846A1 publication Critical patent/WO2022116846A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Definitions

  • the invention relates to the field of communication technologies, and in particular, to a method and device for collecting operation data of a virtual network element.
  • Network Function Virtualization technology is a software processing technology that implements some specific network functions in general-purpose hardware through virtualization technology, aiming to improve the flexibility, scalability and security of the network. Reduce network deployment and operating costs.
  • VNFs Virtualized Network Functions
  • each virtual network element can generate some operation data related to network functions during operation, and the operation status of the network can be fully and clearly understood through the operation data.
  • an embodiment of the present invention provides a method for collecting operation data of a virtual network element, including:
  • the data collection channel includes a database connection instance, a data attribute and a collection period configuration instance, and a trigger collection instance;
  • the database stores operation data of the target virtual network element, and the operation data includes several data attributes and each of the The data attribute value corresponding to the data attribute;
  • the data attribute value corresponding to each of the data attributes of the operating data is collected in the database.
  • the data collection channel further includes a data processing server obtaining instance and a data reporting instance
  • the operation data collection method of the virtual network element further includes:
  • each of the data attributes of the operating data and the corresponding data attribute values are reported to the data processing server corresponding to the address.
  • obtaining a pre-built data collection channel corresponding to the target virtual network element which also includes:
  • Scan a preset shared directory, wherein a folder corresponding to the target virtual network element is stored in the shared directory, and the first file of the target virtual network element is stored in the folder, and the first file of the target virtual network element is stored in the folder.
  • the data collection channel corresponding to the target virtual network element is constructed based on the first file and the second file.
  • obtaining a pre-built data collection channel corresponding to the target virtual network element which also includes:
  • the updated data collection channel is used as the data collection channel corresponding to the target virtual network element.
  • both the first file and the second file are generated when the target virtual network element is started, and the first verification file is obtained after performing MD5 verification on the first file, and the first verification file is obtained after MD5 verification is performed on the first file.
  • the second check file is obtained after performing MD5 check on the second file.
  • updating the data collection channel based on the first file is specifically updating the database connection instance in the data collection channel based on the first file.
  • updating the data collection channel based on the second file specifically includes updating the data attribute and collection cycle configuration instance and the trigger collection instance in the data collection channel based on the second file.
  • an embodiment of the present invention provides an apparatus for collecting operation data of a virtual network element, including:
  • an acquisition module configured to acquire a pre-built data acquisition channel corresponding to the target virtual network element, wherein the data acquisition channel includes a database connection instance, a data attribute and an acquisition cycle configuration instance, and a trigger acquisition instance;
  • a connection module configured to connect to the database corresponding to the target virtual network element based on the database connection instance, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes a data attribute value corresponding to each of the data attributes;
  • a configuration module configured to determine each of the data attributes of the operating data and a collection period corresponding to each of the data attributes based on the data attributes and the collection cycle configuration instance;
  • a collection module configured to collect, in the database, the data attribute value corresponding to each of the data attributes of the operating data according to the collection period corresponding to each of the data attributes based on the trigger collection instance .
  • an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the program as described in the first aspect when the processor executes the program Provided are the steps of the operation data collection method of the virtual network element.
  • an embodiment of the present invention provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, realizes the operation data of the virtual network element provided in the first aspect The steps of the collection method.
  • the method and device for collecting operation data of a virtual network element can obtain data from the corresponding virtual network element from the target virtual network element through a pre-built data collection channel including a database connection instance, a data attribute and a collection period configuration instance, and an instance of triggering collection.
  • the operation data of the target virtual network element is collected in the database, which solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
  • FIG. 1 is a schematic diagram of an application scenario of a method for collecting operation data of a virtual network element according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for collecting operation data of a virtual network element according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for collecting operation data of a virtual network element provided by another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for collecting operation data of a virtual network element according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a physical structure of an electronic device according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of an application scenario of a method for collecting operation data of a virtual network element according to an embodiment of the present invention.
  • the application scenario includes at least one server, such as a filtering server or a deep packet inspection server.
  • the server is deployed with multiple virtual network elements virtualized by the virtualization technology and a virtual collector.
  • virtual network elements are used to implement specific network functions, and virtual network elements can be divided into various types according to the different network functions implemented, such as switch-type virtual network elements, gateway-type virtual network elements, and client devices. class of virtual network elements, etc.
  • the multiple virtual network elements in the server may be of the same type or of different types, and the types are not limited here.
  • the virtual network element generates running data in real time during operation, such as the number of uplink and downlink data packets of the terminal device, and periodically stores the running data in the corresponding database, such as a high-performance key-value database such as redis database.
  • a database such as a high-performance key-value database such as redis database.
  • the virtual collector is used to collect the operation data of the multiple virtual network elements in the server, and specifically collects the operation data of the multiple virtual network elements from the database corresponding to the multiple virtual network elements.
  • FIG. 2 is a flowchart of a method for collecting operation data of a virtual network element provided by an embodiment of the present invention.
  • the execution body of the method is a virtual collector. As shown in FIG. 2 , the method includes:
  • Step 201 Acquire a pre-built data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and a collection period configuration instance, and a trigger collection instance.
  • the virtual collector needs to collect the operation data of multiple virtual network elements. Since the virtual collector has the same method of collecting operation data for each virtual network element, Therefore, the following description mainly takes a method for collecting operation data of a virtual network element as an example.
  • the virtual network element is called a target virtual network element.
  • the virtual collector pre-builds a data collection channel corresponding to the target virtual network element, so as to complete the collection of the operation data of the target virtual network element based on the data collection channel.
  • the data collection channel includes multiple instances, such as database connection instance, data attribute and collection cycle configuration instance, and trigger collection instance.
  • an example refers to a program formed by a software code to realize a specific function.
  • the database connection instance is used to connect the virtual collector to the database corresponding to the target virtual network element
  • the data attribute and collection cycle configuration instance is used to enable the virtual collector to determine several data attributes and each data attribute of the running data of the target virtual network element.
  • a collection period corresponding to a data attribute, and triggering the collection instance is used for the virtual collector to collect the data of the target virtual network element in the database corresponding to the target virtual network element according to the collection period corresponding to each data attribute of the running data of the target virtual network element.
  • the data attribute value corresponding to each data attribute of the running data is used to collect the data of the target virtual network element in the database corresponding to the target virtual network element.
  • Step 202 based on the database connection instance, connect with the database corresponding to the target virtual network element, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and each data attribute. a data attribute value corresponding to the data attribute.
  • the running data when the target virtual network element is running, the running data will be generated in real time, and the running data will be periodically stored in the corresponding database.
  • the running data is stored in the database in the form of key-value pairs.
  • the key is the data attribute
  • the value corresponding to the key is the data attribute value corresponding to the data attribute
  • the running data of the target virtual network element stored in the database includes several data attributes and the data attribute value corresponding to each data attribute.
  • the virtual collector can be connected to the database corresponding to the target virtual network element, so as to collect the operation data of the target virtual network element from the database subsequently.
  • Step 203 based on the data attributes and the collection period configuration instance, determine a plurality of the data attributes of the operation data and a collection period corresponding to each of the data attributes.
  • the virtual collector can be made to determine several data attributes of the running data of the target virtual network element, wherein the determined several data attributes are the same as those stored in the database corresponding to the target virtual network element. Several data attributes of the running data are consistent. Based on the data attributes and the collection cycle configuration instance, the virtual collector can determine several data attributes of the running data of the target virtual network element and the collection cycle corresponding to each data attribute.
  • step 203 may be performed after step 202 , or before step 202 , or may be performed in parallel with step 202 .
  • Step 204 based on the trigger collection instance and according to the collection period corresponding to each data attribute, collect the data attribute value corresponding to each data attribute of the operation data in the database.
  • the virtual collector can determine the collection time according to the collection period corresponding to each data attribute of the operation data of the target virtual network element, and collect the data in the database corresponding to the target virtual network element when the collection time arrives.
  • the data attribute value corresponding to each data attribute of the operation data of the target virtual network element so as to complete the collection of the operation data of the target virtual network element.
  • the method for collecting operation data of a virtual network element can collect data from the database corresponding to the target virtual network element through a pre-built data collection channel including a database connection instance, a data attribute and a collection period configuration instance, and an instance of triggering collection. Collecting the operation data of the target virtual network element solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
  • FIG. 3 is a flowchart of a method for collecting operation data of a virtual network element provided by another embodiment of the present invention.
  • the operation data of the virtual network element is Collection methods also include:
  • Step 301 Obtain an address of a data collection server based on the data processing server obtaining instance.
  • the data processing server obtains an instance and is used to make the virtual collector send a request to the HyperText Transfer Protocol (Hyper Text Transfer Protocol, HTTP) server to request the hypertext transfer protocol server to return the address of the corresponding data processing server to the virtual collector , such as an Internet Protocol (IP) address.
  • HTTP HyperText Transfer Protocol
  • IP Internet Protocol
  • the data collection server is configured to collect the operation data of multiple virtual network elements in the server collected by each virtual collector, perform data analysis, and provide a page for the user to view the analysis result.
  • step 301 may be performed after step 201 , step 202 , step 203 or step 204 , or may be performed in parallel with step 202 , step 203 or step 204 .
  • Step 302 based on the data reporting instance, report each of the data attributes and the corresponding data attribute values of the operating data to the data processing server corresponding to the address.
  • the virtual collector can report the collected operation data of the target virtual network element to the data processing server corresponding to the address based on the data reporting instance.
  • the method for collecting the operation data of the virtual network element further includes:
  • Scan a preset shared directory, wherein a folder corresponding to the target virtual network element is stored in the shared directory, and the first file of the target virtual network element is stored in the folder, and the first file of the target virtual network element is stored in the folder.
  • the container (that is, the virtual collector and the virtual network element) has the function of mapping the file directory to the server, that is, the virtual collector and the virtual network element can share and define the file directory on the server.
  • the shared file directory is referred to as the shared directory, and the location of the shared directory is assumed to be /usr/local/find/.
  • a folder will be created in the shared directory according to its own NE ID.
  • the network element identifier may be generated when the virtual network element is created, and the network element identifiers of different virtual network elements are different from each other. For example, if the NE ID of the target virtual NE is abcdefgh12345678, the target virtual NE will create a folder under the shared directory /usr/local/find/ and name it abcdefgh12345678.
  • the target virtual network element creates several empty files in the folder and performs information writing and verification operations, specifically:
  • the target virtual network element creates a first empty file, and writes the port number of its own corresponding database and its own startup time into the first empty file to form a first file, and the first file can be named run_vnf.conf . It should be noted that, every time the target virtual network element is started, the first empty file will be recreated in the folder, and information will be written to form a new first file, and the original first file will be overwritten.
  • format of the information stored in the first file may be:
  • $redis_port is the port number of the database corresponding to the target virtual network element
  • $systime is the startup time of the target virtual network element
  • *** is some other information, which is not limited here.
  • the target virtual network element After the first file is formed, the target virtual network element performs verification on the first file, such as MD5 verification, so as to obtain the first verification file, and the first verification file may be named run_vnf.md5. It should be noted that each time the target virtual network element is started, the new first file will be verified to obtain a new first verification file. Since the startup time of each startup of the target virtual network element is different, even if the target virtual network The port number of the database corresponding to the network element remains unchanged. Since the startup time of the target virtual network element changes, the new first file will be different from the original first file, and the new first verification file will be different from the original first file. Checksum files are different.
  • the target virtual network element also creates a second empty file, and writes several data attributes of its own operation data and the collection period corresponding to each data attribute into the second empty file to form a second file, and the second file can be named for key.conf. It should be noted that, every time the target virtual network element is started, the second empty file will be re-created, and information will be written to form a new second file, and the original second file will be overwritten.
  • format of the information stored in the second file may be:
  • the key is the data attribute of the running data of the target virtual network element, and the tick is the collection period corresponding to the data attribute. It should be noted that for data attributes with *, regular matching will be performed, and all data attributes that meet the conditions will be read out, thereby realizing batch collection of running data.
  • the target virtual network element After the second file is formed, the target virtual network element performs verification on the second file, such as MD5 verification, so as to obtain the second verification file, and the second verification file may be named key.md5. It should be noted that, every time the target virtual network element is started, the new second file will be verified to obtain a new second verification file.
  • the data collection channel corresponding to the target virtual network element is constructed based on the first file and the second file.
  • the virtual collector determines whether the folder corresponding to the target virtual network element stored in the shared directory appears for the first time.
  • One implementation method is that the virtual collector pre-stores the folders corresponding to several virtual network elements that have collected operation data. The name of the folder, compare the name of the folder corresponding to the target virtual network element with several pre-stored names, if the name of the folder corresponding to the target virtual network element is found in the pre-stored names, Then, it is determined that the folder corresponding to the target virtual network element appears for the first time, and at this time, a data collection channel is constructed based on the first file and the second file of the target virtual network element.
  • the method for collecting the operation data of the virtual network element further includes:
  • the folder does not appear for the first time, the first verification file and the second verification file are acquired.
  • the folder corresponding to the target virtual network element does not appear for the first time, it proves that the target virtual network element has been collected operation data by the virtual collector, and the virtual collector has built a data collection channel corresponding to the target virtual network element. At this time, the first verification file and the second verification file are acquired.
  • the virtual collector determines whether the first verification file is consistent with the first verification file obtained last time. Since the first verification file is obtained by verifying the first file, if the information in the first file changes, Then the first verification file also changes accordingly, that is, the acquired first verification file is inconsistent with the first verification file acquired last time. At this time, the data acquisition channel is updated based on the first file, and specifically, the The database connection instance ensures that the virtual collector can always be connected to the correct database, and avoids errors in the collected operation data.
  • the virtual collector determines whether the second verification file is consistent with the second verification file obtained last time. Since the second verification file is obtained by verifying the second file, if the information in the second file changes, Then the second verification file also changes accordingly, that is, the acquired second verification file is inconsistent with the second verification file acquired last time. At this time, the data acquisition channel is updated based on the second file, and specifically, the The data attribute and collection period configuration instance and trigger collection instance ensure that the virtual collector can always determine the correct data attribute and corresponding collection period for the target virtual network element, so as to avoid errors in the collection time and the collected operation data.
  • the updated data collection channel is used as the data collection channel corresponding to the target virtual network element, thereby enabling the virtual collector to collect the running data of the target virtual network element based on the data collection channel corresponding to the target virtual network element.
  • both the first file and the second file are generated when the target virtual network element is started, and the first verification file is obtained after performing MD5 verification on the first file, and the first verification file is obtained after MD5 verification is performed on the first file.
  • the second check file is obtained after performing MD5 check on the second file.
  • updating the data collection channel based on the first file includes:
  • the database connection instance in the data collection channel is updated based on the first file.
  • updating the data collection channel based on the second file includes:
  • the data attribute and collection cycle configuration instance and the trigger collection instance in the data collection channel are updated based on the second file.
  • the embodiment of the present invention describes the steps performed by the target virtual network element:
  • a folder is created in the shared directory according to its own network element identifier, and the first file, the first verification file, the second file and the second verification file are created in the folder.
  • the first file includes the port number of the database corresponding to the target virtual network element and the startup time of the target virtual network element
  • the first verification file is a file obtained by performing MD5 verification on the first file
  • the second file includes the target virtual network element.
  • the second verification file is a file obtained by performing MD5 verification on the second file.
  • a new first file, a new first verification file, and a new second file are recreated in the corresponding folder under the shared directory according to its own network element identifier. and the new second verification file to respectively cover the original first file, the original first verification file, the original second file and the original second verification file.
  • the embodiment of the present invention describes the steps performed by the virtual collector:
  • the virtual collector scans the shared directory regularly or irregularly, and sequentially determines whether each folder in the shared directory appears for the first time.
  • the data collection channel of the corresponding virtual network element is updated based on the first file in the folder. If the second check file is inconsistent, the data collection channel of the corresponding virtual network element is updated based on the second file in the folder.
  • the virtual collector collects the operation data of each virtual network element based on the data collection channel corresponding to each virtual network element.
  • the data collection channel includes database connection instances, data attributes, and collection cycle configuration instances and trigger collection instances.
  • Any virtual network element is called a target virtual network element, and the specific process of collecting the target virtual network element by the virtual collector is as follows: based on the database connection instance, the database connection corresponding to the target virtual network element, wherein the target virtual network element is stored in the database.
  • the operation data of the meta the operation data includes several data attributes and the data attribute value corresponding to each data attribute.
  • Based on the data attributes and the collection period configuration instance determine several data attributes of the running data and the collection period corresponding to each data attribute.
  • the data attribute value corresponding to each data attribute of the operation data is collected in the database, thereby completing the collection of the operation data of the target virtual network element.
  • the virtual collector reports the running data to the corresponding data processing server for the data processing server to perform data analysis and provides a page for the user to view the analysis results.
  • the data collection channel also includes an instance of data processing server acquisition and an instance of data reporting.
  • the specific process of reporting the running data of the target virtual network element to the corresponding data processing server is: obtaining an instance based on the data processing server, and obtaining the address of the data collection server. Based on the data reporting instance, each data attribute of the running data and the corresponding data attribute value are reported to the data processing server corresponding to the address.
  • FIG. 4 is a schematic structural diagram of an apparatus for collecting operation data of a virtual network element according to an embodiment of the present invention. It should be noted that the apparatus is specifically a virtual collector. As shown in FIG. 4 , the apparatus includes:
  • the acquisition module 401 is used to acquire a pre-built data acquisition channel corresponding to the target virtual network element, wherein the data acquisition channel includes a database connection instance, a data attribute and an acquisition cycle configuration instance and a trigger acquisition instance;
  • the connection module 402 using is connected to the database corresponding to the target virtual network element based on the database connection instance, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and each The data attribute value corresponding to the data attribute;
  • the configuration module 403 is configured to determine a plurality of the data attributes of the operating data and the collection period corresponding to each of the data attributes based on the data attribute and the collection cycle configuration instance;
  • Module 404 configured to collect the data attribute value corresponding to each of the data attributes of the operating data in the database according to the collection period corresponding to each of the data attributes based on the trigger collection instance .
  • the apparatus for collecting operation data of a virtual network element provided in the embodiment of the present invention is configured to execute the steps of the above method for collecting operation data of a virtual network element, which will not be repeated here.
  • the device for collecting the operation data of the virtual network element provided by the embodiment of the present invention can collect data from the database corresponding to the target virtual network element through the pre-built data collection channel including the database connection instance, the data attribute and collection period configuration instance and the trigger collection instance. Collecting the operation data of the target virtual network element solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
  • FIG. 5 is a schematic diagram of an entity structure of an electronic device provided by an embodiment of the present invention.
  • the electronic device may include: a processor (processor) 501, a communications interface (Communications Interface) 502, a memory (memory) 503, and a communication The bus 504, wherein the processor 501, the communication interface 502, and the memory 503 complete the communication with each other through the communication bus 504.
  • the processor 501 may call a computer program stored in the memory 503 and run on the processor 501 to execute the methods provided by the above embodiments, for example, including: acquiring a pre-built data collection channel corresponding to the target virtual network element, Wherein, the data collection channel includes a database connection instance, a data attribute and collection cycle configuration instance, and a trigger collection instance; based on the database connection instance, a database connection corresponding to the target virtual network element, wherein the database stores There is operation data of the target virtual network element, and the operation data includes several data attributes and a data attribute value corresponding to each of the data attributes; The data attributes and the collection period corresponding to each of the data attributes; based on the trigger collection instance, according to the collection period corresponding to each of the data attributes, collect each of the operation data in the database. the data attribute value corresponding to the data attribute.
  • the above-mentioned logic instructions in the memory 503 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
  • the technical solutions of the embodiments of the present invention are essentially, or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
  • Embodiments of the present invention also provide a non-transitory computer-readable storage medium on which a computer program is stored, and the computer program is implemented when executed by a processor to execute the transmission methods provided in the foregoing embodiments, for example, including: obtaining a pre-built The data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and collection cycle configuration instance, and a trigger collection instance; based on the database connection instance, and the target virtual network element A corresponding database connection, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and a data attribute value corresponding to each of the data attributes; based on the data attributes and A collection period configuration instance, determining a number of the data attributes of the operating data and the collection period corresponding to each of the data attributes; based on the trigger collection instance, according to the collection period corresponding to each of the data attributes, in the The data attribute value corresponding to each of the data attributes of the operating data is collected in the database
  • the device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
  • each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware.
  • the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present invention provide a method and apparatus for acquiring operation data of a virtual network element. The method comprises: obtaining a pre-constructed data acquisition channel corresponding to a target virtual network element; connecting, on the basis of a database connection instance, to a database corresponding to the target virtual network element, wherein the database stores operation data of the target virtual network element, and the operation data comprises a plurality of data attributes and a data attribute value corresponding to each data attribute; determining, on the basis of a data attribute and acquisition cycle configuration instance, the plurality of data attributes of the operation data and an acquisition cycle corresponding to each data attribute; and acquiring, on the basis of an acquisition triggering instance, the data attribute value corresponding to each data attribute of the operation data in the database according to the acquisition cycle corresponding to each data attribute. According to the embodiments of the present invention, acquiring the operation data of the target virtual network element by means of the pre-constructed data acquisition channel solves the technical problem in the prior art that there is no method for acquiring operation data of a virtual network element.

Description

虚拟网元的运行数据采集方法及装置Operation data collection method and device for virtual network element 技术领域technical field
本发明涉及通信技术领域,尤其涉及一种虚拟网元的运行数据采集方法及装置。The invention relates to the field of communication technologies, and in particular, to a method and device for collecting operation data of a virtual network element.
背景技术Background technique
网络功能虚拟化(Network Function Virtualization,NFV)技术是一种通过虚拟化技术在通用硬件中实现一些特定的网络功能的软件处理技术,旨在提高网络的灵活性、可扩展性和安全性,并降低网络的部署和运营成本。通过网络功能虚拟化技术可以在通用硬件中虚拟出多个虚拟化网络功能(Virtualized Network Function,VNF)(也即虚拟网元),其中,每一虚拟网元用以承担某个特定的网络功能。Network Function Virtualization (NFV) technology is a software processing technology that implements some specific network functions in general-purpose hardware through virtualization technology, aiming to improve the flexibility, scalability and security of the network. Reduce network deployment and operating costs. Through the network function virtualization technology, multiple virtualized network functions (Virtualized Network Functions, VNFs) (that is, virtual network elements) can be virtualized in general-purpose hardware, wherein each virtual network element is used to undertake a specific network function. .
对于一台通用硬件来说,其中的每一虚拟网元在运行时均能产生一些与网络功能相关的运行数据,通过运行数据可以全面且清楚地了解到网络的运行状态。现阶段暂时还没有针对虚拟网元的运行数据的采集方法,因此亟需提供一种虚拟网元的运行数据采集方法。For a general-purpose hardware, each virtual network element can generate some operation data related to network functions during operation, and the operation status of the network can be fully and clearly understood through the operation data. Currently, there is no method for collecting operation data of virtual network elements, so it is urgent to provide a method for collecting operation data of virtual network elements.
发明内容SUMMARY OF THE INVENTION
因此,有必要提供一种虚拟网元的运行数据采集方法及装置,用以解决现有技术中没有针对虚拟网元的运行数据的采集方法的技术问题。Therefore, it is necessary to provide a method and device for collecting operation data of a virtual network element, so as to solve the technical problem that there is no method for collecting operation data of a virtual network element in the prior art.
第一方面,本发明实施例提供一种虚拟网元的运行数据采集方法,包括:In a first aspect, an embodiment of the present invention provides a method for collecting operation data of a virtual network element, including:
获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;Acquire a pre-built data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and a collection period configuration instance, and a trigger collection instance;
基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;Connect to a database corresponding to the target virtual network element based on the database connection instance, wherein the database stores operation data of the target virtual network element, and the operation data includes several data attributes and each of the The data attribute value corresponding to the data attribute;
基于所述数据属性及采集周期配置实例,确定所述运行数据的每一所述数据属性和每一所述数据属性对应的采集周期;determining each of the data attributes of the operating data and a collection period corresponding to each of the data attributes based on the data attributes and the collection cycle configuration instance;
基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。Based on the triggered collection instance, according to the collection period corresponding to each of the data attributes, the data attribute value corresponding to each of the data attributes of the operating data is collected in the database.
进一步地,所述数据采集通道还包括数据处理服务器获取实例和数据上报实例,所述虚拟网元的运行数据采集方法还包括:Further, the data collection channel further includes a data processing server obtaining instance and a data reporting instance, and the operation data collection method of the virtual network element further includes:
基于所述数据处理服务器获取实例,获取数据采集服务器的地址;Obtain an instance based on the data processing server, and obtain the address of the data collection server;
基于所述数据上报实例,将所述运行数据的每一所述数据属性及对应的所述数据属性值上报给所述地址对应的所述数据处理服务器。Based on the data reporting instance, each of the data attributes of the operating data and the corresponding data attribute values are reported to the data processing server corresponding to the address.
进一步地,获取预先构建的与目标虚拟网元对应的数据采集通道,之前还包括:Further, obtaining a pre-built data collection channel corresponding to the target virtual network element, which also includes:
扫描预置的共享目录,其中,所述共享目录中存储有所述目标虚拟网元对应的文件夹,所述文件夹中存储有所述目标虚拟网元的第一文件、对所述第一文件进行校验得到的第一校验文件、第二文件和对所述第二文件进行校验得到的第二校验文件,所述第一文件包括所述目标虚拟网元对应的数据库的端口号和所述目标虚拟网元的启动时间,所述第二文件包括所述目标虚拟网元的运行数据的若干数据属性和每一所述数据属性对应的采集周期;Scan a preset shared directory, wherein a folder corresponding to the target virtual network element is stored in the shared directory, and the first file of the target virtual network element is stored in the folder, and the first file of the target virtual network element is stored in the folder. A first verification file obtained by verifying the file, a second file obtained by verifying the second file, and a second verification file obtained by verifying the second file, where the first file includes the port of the database corresponding to the target virtual network element number and the startup time of the target virtual network element, and the second file includes several data attributes of the running data of the target virtual network element and a collection period corresponding to each of the data attributes;
判断所述文件夹是否首次出现,若是,则基于所述第一文件和所述第二文件构建所述目标虚拟网元对应的所述数据采集通道。It is judged whether the folder appears for the first time, and if so, the data collection channel corresponding to the target virtual network element is constructed based on the first file and the second file.
进一步地,获取预先构建的与目标虚拟网元对应的数据采集通道,之前还包括:Further, obtaining a pre-built data collection channel corresponding to the target virtual network element, which also includes:
若所述文件夹非首次出现,则获取所述第一校验文件和所述第二校验文件;If the folder does not appear for the first time, obtain the first verification file and the second verification file;
判断所述第一校验文件是否与上一次获取的所述第一校验文件一致,若否,则基于所述第一文件更新所述数据采集通道;Determine whether the first verification file is consistent with the first verification file obtained last time, and if not, update the data acquisition channel based on the first file;
判断所述第二校验文件是否与上一次获取的所述第二校验文件一致,若否,则基于所述第二文件更新所述数据采集通道;Determine whether the second verification file is consistent with the second verification file obtained last time, and if not, update the data acquisition channel based on the second file;
将更新后的所述数据采集通道作为所述目标虚拟网元对应的所述数据采集通道。The updated data collection channel is used as the data collection channel corresponding to the target virtual network element.
进一步地,所述第一文件和所述第二文件均在所述目标虚拟网元启动时生 成,所述第一校验文件为对所述第一文件进行MD5校验后得到,所述第二校验文件为对所述第二文件进行MD5校验后得到。Further, both the first file and the second file are generated when the target virtual network element is started, and the first verification file is obtained after performing MD5 verification on the first file, and the first verification file is obtained after MD5 verification is performed on the first file. The second check file is obtained after performing MD5 check on the second file.
进一步地,基于所述第一文件更新所述数据采集通道,具体为基于所述第一文件更新所述数据采集通道中的所述数据库连接实例。Further, updating the data collection channel based on the first file is specifically updating the database connection instance in the data collection channel based on the first file.
进一步地,基于所述第二文件更新所述数据采集通道,具体为基于所述第二文件更新所述数据采集通道中的所述数据属性及采集周期配置实例和所述触发采集实例。Further, updating the data collection channel based on the second file specifically includes updating the data attribute and collection cycle configuration instance and the trigger collection instance in the data collection channel based on the second file.
第二方面,本发明实施例提供一种虚拟网元的运行数据采集装置,包括:In a second aspect, an embodiment of the present invention provides an apparatus for collecting operation data of a virtual network element, including:
获取模块,用于获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;an acquisition module, configured to acquire a pre-built data acquisition channel corresponding to the target virtual network element, wherein the data acquisition channel includes a database connection instance, a data attribute and an acquisition cycle configuration instance, and a trigger acquisition instance;
连接模块,用于基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;A connection module, configured to connect to the database corresponding to the target virtual network element based on the database connection instance, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes a data attribute value corresponding to each of the data attributes;
配置模块,用于基于所述数据属性及采集周期配置实例,确定所述运行数据的每一所述数据属性和每一所述数据属性对应的采集周期;a configuration module, configured to determine each of the data attributes of the operating data and a collection period corresponding to each of the data attributes based on the data attributes and the collection cycle configuration instance;
采集模块,用于基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。a collection module, configured to collect, in the database, the data attribute value corresponding to each of the data attributes of the operating data according to the collection period corresponding to each of the data attributes based on the trigger collection instance .
第三方面,本发明实施例提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如第一方面所提供的虚拟网元的运行数据采集方法的步骤。In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the program as described in the first aspect when the processor executes the program Provided are the steps of the operation data collection method of the virtual network element.
第四方面,本发明实施例提供一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面所提供的虚拟网元的运行数据采集方法的步骤。In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, realizes the operation data of the virtual network element provided in the first aspect The steps of the collection method.
本发明实施例提供的虚拟网元的运行数据采集方法及装置,通过预先构建的包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例的数据采集通道,能够从目标虚拟网元对应的数据库中采集目标虚拟网元的运行数据,解决了现有技术中没有针对虚拟网元的运行数据的采集方法的技术问题。The method and device for collecting operation data of a virtual network element provided by the embodiment of the present invention can obtain data from the corresponding virtual network element from the target virtual network element through a pre-built data collection channel including a database connection instance, a data attribute and a collection period configuration instance, and an instance of triggering collection. The operation data of the target virtual network element is collected in the database, which solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本发明实施例提供的虚拟网元的运行数据采集方法的应用场景示意图;1 is a schematic diagram of an application scenario of a method for collecting operation data of a virtual network element according to an embodiment of the present invention;
图2为本发明实施例提供的虚拟网元的运行数据采集方法流程图;FIG. 2 is a flowchart of a method for collecting operation data of a virtual network element according to an embodiment of the present invention;
图3为本发明另一实施例提供的虚拟网元的运行数据采集方法流程图;3 is a flowchart of a method for collecting operation data of a virtual network element provided by another embodiment of the present invention;
图4为本发明实施例提供的虚拟网元的运行数据采集装置的结构示意图;4 is a schematic structural diagram of an apparatus for collecting operation data of a virtual network element according to an embodiment of the present invention;
图5为本发明实施例提供的电子设备的实体结构示意图。FIG. 5 is a schematic diagram of a physical structure of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
为了更清楚地对本发明实施例提供的虚拟网元的运行数据采集方法进行说明,首先对该方法的应用场景进行说明。图1为本发明实施例提供的虚拟网元的运行数据采集方法的应用场景示意图,如图1所示,该应用场景中至少包括一台服务器,例如过滤服务器或深度报文检测服务器等,该服务器中部署有通过虚拟化技术虚拟出来的多个虚拟网元和一个虚拟采集器。In order to more clearly describe the method for collecting operation data of a virtual network element provided by the embodiment of the present invention, an application scenario of the method is first described. FIG. 1 is a schematic diagram of an application scenario of a method for collecting operation data of a virtual network element according to an embodiment of the present invention. As shown in FIG. 1 , the application scenario includes at least one server, such as a filtering server or a deep packet inspection server. The server is deployed with multiple virtual network elements virtualized by the virtualization technology and a virtual collector.
其中,虚拟网元用于实现特定的网络功能,根据所实现的网络功能的不同可以将虚拟网元划分为多种类型,例如交换机类的虚拟网元、网关类的虚拟网元和客户端设备类的虚拟网元等。该服务器中的多个虚拟网元可以是同种类型的,也可以是不同种类型的,此处不对其类型进行限定。Among them, virtual network elements are used to implement specific network functions, and virtual network elements can be divided into various types according to the different network functions implemented, such as switch-type virtual network elements, gateway-type virtual network elements, and client devices. class of virtual network elements, etc. The multiple virtual network elements in the server may be of the same type or of different types, and the types are not limited here.
虚拟网元在运行时会实时产生运行数据,例如终端设备的上行和下行数据包的数量,并将运行数据周期性地存储到对应的数据库中,例如redis数据库等 高性能的键值数据库。需要说明的是,每一虚拟网元对应一个数据库,不同的虚拟网元对应的数据库不同。The virtual network element generates running data in real time during operation, such as the number of uplink and downlink data packets of the terminal device, and periodically stores the running data in the corresponding database, such as a high-performance key-value database such as redis database. It should be noted that each virtual network element corresponds to a database, and different virtual network elements correspond to different databases.
虚拟采集器用于采集服务器中的多个虚拟网元的运行数据,具体为从多个虚拟网元对应的数据库中采集多个虚拟网元的运行数据。The virtual collector is used to collect the operation data of the multiple virtual network elements in the server, and specifically collects the operation data of the multiple virtual network elements from the database corresponding to the multiple virtual network elements.
以下结合上述应用场景,对虚拟网元的运行数据采集方法进行具体说明。In the following, a method for collecting operation data of a virtual network element will be described in detail in combination with the above application scenarios.
图2为本发明实施例提供的虚拟网元的运行数据采集方法流程图,该方法的执行主体为虚拟采集器,如图2所示,该方法包括:FIG. 2 is a flowchart of a method for collecting operation data of a virtual network element provided by an embodiment of the present invention. The execution body of the method is a virtual collector. As shown in FIG. 2 , the method includes:
步骤201,获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例。Step 201: Acquire a pre-built data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and a collection period configuration instance, and a trigger collection instance.
具体地,服务器中部署有多个虚拟网元和一个虚拟采集器,虚拟采集器需要采集多个虚拟网元的运行数据,由于虚拟采集器针对每一虚拟网元的运行数据采集方法均相同,因此后文主要以对一个虚拟网元的运行数据采集方法为例进行说明,为了便于描述,将该虚拟网元称为目标虚拟网元。Specifically, multiple virtual network elements and a virtual collector are deployed in the server, and the virtual collector needs to collect the operation data of multiple virtual network elements. Since the virtual collector has the same method of collecting operation data for each virtual network element, Therefore, the following description mainly takes a method for collecting operation data of a virtual network element as an example. For convenience of description, the virtual network element is called a target virtual network element.
虚拟采集器预先构建好与目标虚拟网元对应的数据采集通道,以基于该数据采集通道完成对目标虚拟网元的运行数据的采集。其中,数据采集通道包括多个实例,例如数据库连接实例、数据属性及采集周期配置实例和触发采集实例。The virtual collector pre-builds a data collection channel corresponding to the target virtual network element, so as to complete the collection of the operation data of the target virtual network element based on the data collection channel. The data collection channel includes multiple instances, such as database connection instance, data attribute and collection cycle configuration instance, and trigger collection instance.
需要说明的是,实例指的是通过软件代码形成的用以实现特定功能的程序。具体而言,数据库连接实例用于使虚拟采集器与目标虚拟网元对应的数据库连接,数据属性及采集周期配置实例用于使虚拟采集器确定目标虚拟网元的运行数据的若干数据属性和每一数据属性对应的采集周期,触发采集实例用于使虚拟采集器根据目标虚拟网元的运行数据的每一数据属性对应的采集周期,在目标虚拟网元对应的数据库中采集目标虚拟网元的运行数据的每一数据属性对应的数据属性值。It should be noted that an example refers to a program formed by a software code to realize a specific function. Specifically, the database connection instance is used to connect the virtual collector to the database corresponding to the target virtual network element, and the data attribute and collection cycle configuration instance is used to enable the virtual collector to determine several data attributes and each data attribute of the running data of the target virtual network element. A collection period corresponding to a data attribute, and triggering the collection instance is used for the virtual collector to collect the data of the target virtual network element in the database corresponding to the target virtual network element according to the collection period corresponding to each data attribute of the running data of the target virtual network element. The data attribute value corresponding to each data attribute of the running data.
步骤202,基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值。 Step 202, based on the database connection instance, connect with the database corresponding to the target virtual network element, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and each data attribute. a data attribute value corresponding to the data attribute.
具体地,目标虚拟网元运行时会实时产生运行数据,并将运行数据周期性 地存储到对应的数据库中,需要说明的是,运行数据在数据库中以键值对的形式存储,具体而言,键为数据属性,键对应的值即为数据属性对应的数据属性值,数据库中存储的目标虚拟网元的运行数据包括若干数据属性和每一数据属性对应的数据属性值。Specifically, when the target virtual network element is running, the running data will be generated in real time, and the running data will be periodically stored in the corresponding database. It should be noted that the running data is stored in the database in the form of key-value pairs. , the key is the data attribute, the value corresponding to the key is the data attribute value corresponding to the data attribute, and the running data of the target virtual network element stored in the database includes several data attributes and the data attribute value corresponding to each data attribute.
基于数据库连接实例,能够使虚拟采集器与目标虚拟网元对应的数据库连接,以便于后续从数据库中采集目标虚拟网元的运行数据。Based on the database connection instance, the virtual collector can be connected to the database corresponding to the target virtual network element, so as to collect the operation data of the target virtual network element from the database subsequently.
步骤203,基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和每一所述数据属性对应的采集周期。 Step 203 , based on the data attributes and the collection period configuration instance, determine a plurality of the data attributes of the operation data and a collection period corresponding to each of the data attributes.
具体地,基于数据属性及采集周期配置实例,能够使虚拟采集器确定目标虚拟网元的运行数据的若干数据属性,其中,所确定的若干数据属性与目标虚拟网元对应的数据库中所存储的运行数据的若干数据属性一致,基于数据属性及采集周期配置实例,能够使虚拟采集器确定目标虚拟网元的运行数据的若干数据属性和每一数据属性对应的采集周期。Specifically, based on the data attributes and the collection period configuration example, the virtual collector can be made to determine several data attributes of the running data of the target virtual network element, wherein the determined several data attributes are the same as those stored in the database corresponding to the target virtual network element. Several data attributes of the running data are consistent. Based on the data attributes and the collection cycle configuration instance, the virtual collector can determine several data attributes of the running data of the target virtual network element and the collection cycle corresponding to each data attribute.
需要说明的是,步骤203的执行可以在步骤202之后,也可以在步骤202之前,还可以与步骤202并行执行。It should be noted that, the execution of step 203 may be performed after step 202 , or before step 202 , or may be performed in parallel with step 202 .
步骤204,基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。 Step 204 , based on the trigger collection instance and according to the collection period corresponding to each data attribute, collect the data attribute value corresponding to each data attribute of the operation data in the database.
具体地,基于触发采集实例,能够使虚拟采集器根据目标虚拟网元的运行数据的每一数据属性对应的采集周期确定采集时刻,并在采集时刻到来时在目标虚拟网元对应的数据库中采集目标虚拟网元的运行数据的每一数据属性对应的数据属性值,从而完成目标虚拟网元的运行数据的采集。Specifically, based on the triggered collection instance, the virtual collector can determine the collection time according to the collection period corresponding to each data attribute of the operation data of the target virtual network element, and collect the data in the database corresponding to the target virtual network element when the collection time arrives. The data attribute value corresponding to each data attribute of the operation data of the target virtual network element, so as to complete the collection of the operation data of the target virtual network element.
本发明实施例提供的虚拟网元的运行数据采集方法,通过预先构建的包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例的数据采集通道,能够从目标虚拟网元对应的数据库中采集目标虚拟网元的运行数据,解决了现有技术中没有针对虚拟网元的运行数据的采集方法的技术问题。The method for collecting operation data of a virtual network element provided by the embodiment of the present invention can collect data from the database corresponding to the target virtual network element through a pre-built data collection channel including a database connection instance, a data attribute and a collection period configuration instance, and an instance of triggering collection. Collecting the operation data of the target virtual network element solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
进一步地,所述数据采集通道还包括数据处理服务器获取实例和数据上报实例,图3为本发明另一实施例提供的虚拟网元的运行数据采集方法流程图,所述虚拟网元的运行数据采集方法还包括:Further, the data collection channel further includes a data processing server obtaining instance and a data reporting instance. FIG. 3 is a flowchart of a method for collecting operation data of a virtual network element provided by another embodiment of the present invention. The operation data of the virtual network element is Collection methods also include:
步骤301,基于所述数据处理服务器获取实例,获取数据采集服务器的地址。Step 301: Obtain an address of a data collection server based on the data processing server obtaining instance.
具体地,数据处理服务器获取实例用于使虚拟采集器向超文本传输协议(Hyper Text Transfer Protocol,HTTP)服务器发送请求,以请求超文本传输协议服务器向虚拟采集器返回对应的数据处理服务器的地址,例如互联网协议(Internet Protocol,IP)地址。需要说明的是,数据采集服务器用于收集每一虚拟采集器采集的服务器中的多个虚拟网元的运行数据,进行数据分析并提供页面供用户查看分析结果。Specifically, the data processing server obtains an instance and is used to make the virtual collector send a request to the HyperText Transfer Protocol (Hyper Text Transfer Protocol, HTTP) server to request the hypertext transfer protocol server to return the address of the corresponding data processing server to the virtual collector , such as an Internet Protocol (IP) address. It should be noted that the data collection server is configured to collect the operation data of multiple virtual network elements in the server collected by each virtual collector, perform data analysis, and provide a page for the user to view the analysis result.
需要说明的是,步骤301的执行可以在步骤201、步骤202、步骤203或步骤204之后,也可以与步骤202、步骤203或步骤204并行执行。It should be noted that, the execution of step 301 may be performed after step 201 , step 202 , step 203 or step 204 , or may be performed in parallel with step 202 , step 203 or step 204 .
步骤302,基于所述数据上报实例,将所述运行数据的每一所述数据属性及对应的所述数据属性值上报给所述地址对应的所述数据处理服务器。 Step 302 , based on the data reporting instance, report each of the data attributes and the corresponding data attribute values of the operating data to the data processing server corresponding to the address.
具体地,虚拟采集器得到数据处理服务器的地址后,基于数据上报实例能够将采集到的目标虚拟网元的运行数据上报给该地址对应的数据处理服务器。Specifically, after obtaining the address of the data processing server, the virtual collector can report the collected operation data of the target virtual network element to the data processing server corresponding to the address based on the data reporting instance.
进一步地,本发明实施例提供的虚拟网元的运行数据采集方法在上述步骤201也即获取预先构建的与目标虚拟网元对应的数据采集通道之前,还包括:Further, the method for collecting the operation data of the virtual network element provided by the embodiment of the present invention further includes:
扫描预置的共享目录,其中,所述共享目录中存储有所述目标虚拟网元对应的文件夹,所述文件夹中存储有所述目标虚拟网元的第一文件、对所述第一文件进行校验得到的第一校验文件、第二文件和对所述第二文件进行校验得到的第二校验文件,所述第一文件包括所述目标虚拟网元对应的数据库的端口号和所述目标虚拟网元的启动时间,所述第二文件包括所述目标虚拟网元的运行数据的若干数据属性和每一所述数据属性对应的采集周期。Scan a preset shared directory, wherein a folder corresponding to the target virtual network element is stored in the shared directory, and the first file of the target virtual network element is stored in the folder, and the first file of the target virtual network element is stored in the folder. A first verification file obtained by verifying the file, a second file obtained by verifying the second file, and a second verification file obtained by verifying the second file, where the first file includes the port of the database corresponding to the target virtual network element number and the startup time of the target virtual network element, and the second file includes several data attributes of the running data of the target virtual network element and a collection period corresponding to each of the data attributes.
具体地,容器(也即虚拟采集器和虚拟网元)具有映射文件目录到服务器上的功能特性,即虚拟采集器和虚拟网元可以在服务器上共享文件目录并对其进行定义。为了便于后文描述,将共享的文件目录称为共享目录,并假定共享目录的位置为/usr/local/find/。Specifically, the container (that is, the virtual collector and the virtual network element) has the function of mapping the file directory to the server, that is, the virtual collector and the virtual network element can share and define the file directory on the server. For the convenience of the description below, the shared file directory is referred to as the shared directory, and the location of the shared directory is assumed to be /usr/local/find/.
目标虚拟网元启动后会根据自身的网元标识在共享目录下创建文件夹。需要说明的是,每一虚拟网元都具有一个唯一的网元标识,网元标识可以在创建虚拟网元时生成,不同的虚拟网元的网元标识彼此不同。例如,目标虚拟网元 的网元标识为abcdefgh12345678,则目标虚拟网元在共享目录/usr/local/find/下创建文件夹,并命名为abcdefgh12345678。After the target virtual NE is started, a folder will be created in the shared directory according to its own NE ID. It should be noted that each virtual network element has a unique network element identifier, the network element identifier may be generated when the virtual network element is created, and the network element identifiers of different virtual network elements are different from each other. For example, if the NE ID of the target virtual NE is abcdefgh12345678, the target virtual NE will create a folder under the shared directory /usr/local/find/ and name it abcdefgh12345678.
文件夹创建完成后,目标虚拟网元在该文件夹下创建若干空文件并进行信息写入和校验操作,具体为:After the folder is created, the target virtual network element creates several empty files in the folder and performs information writing and verification operations, specifically:
目标虚拟网元创建第一空文件,并将其自身对应的数据库的端口号和其自身的启动时间写入至该第一空文件中,形成第一文件,第一文件可以命名为run_vnf.conf。需要说明的是,目标虚拟网元每次启动,都会在该文件夹下重新创建第一空文件并进行信息写入形成新的第一文件,并覆盖原有的第一文件。The target virtual network element creates a first empty file, and writes the port number of its own corresponding database and its own startup time into the first empty file to form a first file, and the first file can be named run_vnf.conf . It should be noted that, every time the target virtual network element is started, the first empty file will be recreated in the folder, and information will be written to form a new first file, and the original first file will be overwritten.
需要说明的是,第一文件中存储的信息的格式可以为:It should be noted that the format of the information stored in the first file may be:
$redis_port,***,$systime$redis_port,***,$systime
其中,$redis_port为目标虚拟网元对应的数据库的端口号,$systime为目标虚拟网元的启动时间,***为一些其他信息,此处不对其进行限定。Among them, $redis_port is the port number of the database corresponding to the target virtual network element, $systime is the startup time of the target virtual network element, and *** is some other information, which is not limited here.
形成第一文件后,目标虚拟网元对第一文件进行校验,例如MD5校验,从而得到第一校验文件,第一校验文件可以命名为run_vnf.md5。需要说明的是,目标虚拟网元每次启动,都会对新的第一文件进行校验,得到新的第一校验文件,由于目标虚拟网元每次启动的启动时间均不同,即使目标虚拟网元对应的数据库的端口号不变,由于目标虚拟网元的启动时间改变,都会使得新的第一文件和原有的第一文件不同,新的第一校验文件和原有的第一校验文件不同。After the first file is formed, the target virtual network element performs verification on the first file, such as MD5 verification, so as to obtain the first verification file, and the first verification file may be named run_vnf.md5. It should be noted that each time the target virtual network element is started, the new first file will be verified to obtain a new first verification file. Since the startup time of each startup of the target virtual network element is different, even if the target virtual network The port number of the database corresponding to the network element remains unchanged. Since the startup time of the target virtual network element changes, the new first file will be different from the original first file, and the new first verification file will be different from the original first file. Checksum files are different.
目标虚拟网元还创建第二空文件,并将自身的运行数据的若干数据属性和每一数据属性对应的采集周期写入至该第二空文件中,形成第二文件,第二文件可以命名为key.conf。需要说明的是,目标虚拟网元每次启动,都会重新创建第二空文件并进行信息写入形成新的第二文件,并覆盖原有的第二文件。The target virtual network element also creates a second empty file, and writes several data attributes of its own operation data and the collection period corresponding to each data attribute into the second empty file to form a second file, and the second file can be named for key.conf. It should be noted that, every time the target virtual network element is started, the second empty file will be re-created, and information will be written to form a new second file, and the original second file will be overwritten.
需要说明的是,第二文件中存储的信息的格式可以为:It should be noted that the format of the information stored in the second file may be:
key,tickkey, tick
例如,*-status,10For example, *-status, 10
Sysinfo,20Sysinfo, 20
其中,key为目标虚拟网元的运行数据的数据属性,tick为数据属性对应的采集周期。需要说明的是,对于带*的数据属性,会进行正则匹配,凡满足条件的数据属性均会被读取出来,由此实现运行数据的批量采集。The key is the data attribute of the running data of the target virtual network element, and the tick is the collection period corresponding to the data attribute. It should be noted that for data attributes with *, regular matching will be performed, and all data attributes that meet the conditions will be read out, thereby realizing batch collection of running data.
形成第二文件后,目标虚拟网元对第二文件进行校验,例如MD5校验,从而得到第二校验文件,第二校验文件可以命名为key.md5。需要说明的是,目标虚拟网元每次启动,都会对新的第二文件进行校验,得到新的第二校验文件。After the second file is formed, the target virtual network element performs verification on the second file, such as MD5 verification, so as to obtain the second verification file, and the second verification file may be named key.md5. It should be noted that, every time the target virtual network element is started, the new second file will be verified to obtain a new second verification file.
判断所述文件夹是否首次出现,若是,则基于所述第一文件和所述第二文件构建所述目标虚拟网元对应的所述数据采集通道。It is judged whether the folder appears for the first time, and if so, the data collection channel corresponding to the target virtual network element is constructed based on the first file and the second file.
具体地,虚拟采集器判断共享目录下存储的目标虚拟网元对应的文件夹是否为首次出现,其中一种实现方式是虚拟采集器预先存储有已被采集过运行数据的若干虚拟网元对应的文件夹的名称,将目标虚拟网元对应的文件夹的名称与预先存储的若干名称进行比对,若在预先存储的若干名称中找到与目标虚拟网元对应的文件夹的名称一致的名称,则判断目标虚拟网元对应的文件夹首次出现,此时,基于目标虚拟网元的第一文件和第二文件构建数据采集通道。Specifically, the virtual collector determines whether the folder corresponding to the target virtual network element stored in the shared directory appears for the first time. One implementation method is that the virtual collector pre-stores the folders corresponding to several virtual network elements that have collected operation data. The name of the folder, compare the name of the folder corresponding to the target virtual network element with several pre-stored names, if the name of the folder corresponding to the target virtual network element is found in the pre-stored names, Then, it is determined that the folder corresponding to the target virtual network element appears for the first time, and at this time, a data collection channel is constructed based on the first file and the second file of the target virtual network element.
进一步地,本发明实施例提供的虚拟网元的运行数据采集方法在上述步骤201也即获取预先构建的与目标虚拟网元对应的数据采集通道之前,还包括:Further, the method for collecting the operation data of the virtual network element provided by the embodiment of the present invention further includes:
若所述文件夹非首次出现,则获取所述第一校验文件和所述第二校验文件。If the folder does not appear for the first time, the first verification file and the second verification file are acquired.
具体地,若目标虚拟网元对应的文件夹非首次出现,则证明目标虚拟网元曾被虚拟采集器采集过运行数据,虚拟采集器构建过与目标虚拟网元对应的数据采集通道。此时,获取第一校验文件和第二校验文件。Specifically, if the folder corresponding to the target virtual network element does not appear for the first time, it proves that the target virtual network element has been collected operation data by the virtual collector, and the virtual collector has built a data collection channel corresponding to the target virtual network element. At this time, the first verification file and the second verification file are acquired.
判断所述第一校验文件是否与上一次获取的所述第一校验文件一致,若否,则基于所述第一文件更新所述数据采集通道。It is judged whether the first verification file is consistent with the first verification file obtained last time, and if not, the data acquisition channel is updated based on the first file.
具体地,虚拟采集器判断第一校验文件是否与上一次获取的第一校验文件一致,由于第一校验文件为对第一文件进行校验得到,若第一文件中的信息变化,则第一校验文件也随之变化,即获取的第一校验文件与上一次获取的第一校验文件不一致,此时,基于第一文件更新数据采集通道,具体更新数据采集通道中的数据库连接实例,保证虚拟采集器始终能够与正确的数据库连接,避免采集到的运行数据有误。Specifically, the virtual collector determines whether the first verification file is consistent with the first verification file obtained last time. Since the first verification file is obtained by verifying the first file, if the information in the first file changes, Then the first verification file also changes accordingly, that is, the acquired first verification file is inconsistent with the first verification file acquired last time. At this time, the data acquisition channel is updated based on the first file, and specifically, the The database connection instance ensures that the virtual collector can always be connected to the correct database, and avoids errors in the collected operation data.
判断所述第二校验文件是否与上一次获取的所述第二校验文件一致,若否,则基于所述第二文件更新所述数据采集通道。It is judged whether the second verification file is consistent with the second verification file obtained last time, and if not, the data acquisition channel is updated based on the second file.
具体地,虚拟采集器判断第二校验文件是否与上一次获取的第二校验文件 一致,由于第二校验文件为对第二文件进行校验得到,若第二文件中的信息变化,则第二校验文件也随之变化,即获取的第二校验文件与上一次获取的第二校验文件不一致,此时,基于第二文件更新数据采集通道,具体更新数据采集通道中的数据属性及采集周期配置实例和触发采集实例,保证虚拟采集器始终能够为目标虚拟网元确定正确的数据属性及对应的采集周期,避免采集时间和采集到的运行数据有误。Specifically, the virtual collector determines whether the second verification file is consistent with the second verification file obtained last time. Since the second verification file is obtained by verifying the second file, if the information in the second file changes, Then the second verification file also changes accordingly, that is, the acquired second verification file is inconsistent with the second verification file acquired last time. At this time, the data acquisition channel is updated based on the second file, and specifically, the The data attribute and collection period configuration instance and trigger collection instance ensure that the virtual collector can always determine the correct data attribute and corresponding collection period for the target virtual network element, so as to avoid errors in the collection time and the collected operation data.
将更新后的所述数据采集通道作为所述目标虚拟网元对应的所述数据采集通道,由此使得虚拟采集器基于目标虚拟网元对应的数据采集通道采集目标虚拟网元的运行数据。The updated data collection channel is used as the data collection channel corresponding to the target virtual network element, thereby enabling the virtual collector to collect the running data of the target virtual network element based on the data collection channel corresponding to the target virtual network element.
进一步地,所述第一文件和所述第二文件均在所述目标虚拟网元启动时生成,所述第一校验文件为对所述第一文件进行MD5校验后得到,所述第二校验文件为对所述第二文件进行MD5校验后得到。Further, both the first file and the second file are generated when the target virtual network element is started, and the first verification file is obtained after performing MD5 verification on the first file, and the first verification file is obtained after MD5 verification is performed on the first file. The second check file is obtained after performing MD5 check on the second file.
进一步地,基于所述第一文件更新所述数据采集通道,包括:Further, updating the data collection channel based on the first file includes:
基于所述第一文件更新所述数据采集通道中的所述数据库连接实例。The database connection instance in the data collection channel is updated based on the first file.
进一步地,基于所述第二文件更新所述数据采集通道,包括:Further, updating the data collection channel based on the second file includes:
基于所述第二文件更新所述数据采集通道中的所述数据属性及采集周期配置实例和所述触发采集实例。The data attribute and collection cycle configuration instance and the trigger collection instance in the data collection channel are updated based on the second file.
作为一个优选的实施例,本发明实施例对目标虚拟网元所执行的步骤进行说明:As a preferred embodiment, the embodiment of the present invention describes the steps performed by the target virtual network element:
目标虚拟网元首次启动,根据自身的网元标识在共享目录下创建文件夹,在该文件夹下创建第一文件、第一校验文件、第二文件和第二校验文件。其中,第一文件包括目标虚拟网元对应的数据库的端口号和目标虚拟网元的启动时间,第一校验文件为对第一文件进行MD5校验得到的文件,第二文件包括目标虚拟网元的运行数据的若干数据属性和每一数据属性对应的采集周期,第二校验文件为对第二文件进行MD5校验得到的文件。When the target virtual network element is started for the first time, a folder is created in the shared directory according to its own network element identifier, and the first file, the first verification file, the second file and the second verification file are created in the folder. The first file includes the port number of the database corresponding to the target virtual network element and the startup time of the target virtual network element, the first verification file is a file obtained by performing MD5 verification on the first file, and the second file includes the target virtual network element. Several data attributes of the operating data of the element and a collection period corresponding to each data attribute, and the second verification file is a file obtained by performing MD5 verification on the second file.
需要说明的是,若目标虚拟网元再次启动,则根据自身的网元标识在共享目录下的对应文件夹中重新创建新的第一文件、新的第一校验文件、新的第二文件和新的第二校验文件以分别覆盖原有的第一文件、原有的第一校验文件、原有的第二文件和原有的第二校验文件。It should be noted that if the target virtual network element is restarted, a new first file, a new first verification file, and a new second file are recreated in the corresponding folder under the shared directory according to its own network element identifier. and the new second verification file to respectively cover the original first file, the original first verification file, the original second file and the original second verification file.
作为一个优选的实施例,本发明实施例对虚拟采集器所执行的步骤进行说明:As a preferred embodiment, the embodiment of the present invention describes the steps performed by the virtual collector:
虚拟采集器定时或不定时扫描共享目录,依次判断共享目录下的每一文件夹是否是首次出现。The virtual collector scans the shared directory regularly or irregularly, and sequentially determines whether each folder in the shared directory appears for the first time.
若某一文件夹是首次出现,则记录该文件夹的名称,并基于该文件夹下的第一文件和第二文件为对应的虚拟网元创建数据采集通道。If a certain folder appears for the first time, the name of the folder is recorded, and a data collection channel is created for the corresponding virtual network element based on the first file and the second file under the folder.
若某一文件夹非首次出现,则读取该文件夹下的第一校验文件和第二校验文件,并判断第一校验文件与上一次获取的第一校验文件是否一致,且判断第二校验文件与上一次获取的第二校验文件是否一致。If a folder does not appear for the first time, read the first verification file and the second verification file under the folder, and determine whether the first verification file is consistent with the first verification file obtained last time, and It is judged whether the second verification file is consistent with the second verification file obtained last time.
若第一校验文件与上一次获取的第一校验文件不一致,则基于该文件夹下的第一文件更新对应的虚拟网元的数据采集通道,若第二校验文件与上一次获取的第二校验文件不一致,则基于该文件夹下的第二文件更新对应的虚拟网元的数据采集通道。If the first verification file is inconsistent with the first verification file obtained last time, the data collection channel of the corresponding virtual network element is updated based on the first file in the folder. If the second check file is inconsistent, the data collection channel of the corresponding virtual network element is updated based on the second file in the folder.
虚拟采集器基于与每一虚拟网元对应的数据采集通道,采集每一虚拟网元的运行数据,需要说明的是,数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例。将任意一个虚拟网元称为目标虚拟网元,虚拟采集器采集目标虚拟网元的具体过程为:基于数据库连接实例,与目标虚拟网元对应的数据库连接,其中,数据库中存储有目标虚拟网元的运行数据,运行数据包括若干数据属性和每一数据属性对应的数据属性值。基于数据属性及采集周期配置实例,确定运行数据的若干数据属性和每一数据属性对应的采集周期。基于触发采集实例,根据每一数据属性对应的采集周期,在数据库中采集运行数据的每一数据属性对应的数据属性值,从而完成目标虚拟网元的运行数据的采集。The virtual collector collects the operation data of each virtual network element based on the data collection channel corresponding to each virtual network element. It should be noted that the data collection channel includes database connection instances, data attributes, and collection cycle configuration instances and trigger collection instances. . Any virtual network element is called a target virtual network element, and the specific process of collecting the target virtual network element by the virtual collector is as follows: based on the database connection instance, the database connection corresponding to the target virtual network element, wherein the target virtual network element is stored in the database. The operation data of the meta, the operation data includes several data attributes and the data attribute value corresponding to each data attribute. Based on the data attributes and the collection period configuration instance, determine several data attributes of the running data and the collection period corresponding to each data attribute. Based on the triggered collection instance, according to the collection period corresponding to each data attribute, the data attribute value corresponding to each data attribute of the operation data is collected in the database, thereby completing the collection of the operation data of the target virtual network element.
虚拟采集器将运行数据上报给对应的数据处理服务器以供数据处理服务器进行数据分析提供页面供用户查看分析结果。需要说明的是,数据采集通道还包括数据处理服务器获取实例和数据上报实例。将目标虚拟网元的运行数据上报给对应的数据处理服务器的具体过程为:基于数据处理服务器获取实例,获取数据采集服务器的地址。基于数据上报实例,将运行数据的每一数据属性及对应的数据属性值上报给地址对应的数据处理服务器。The virtual collector reports the running data to the corresponding data processing server for the data processing server to perform data analysis and provides a page for the user to view the analysis results. It should be noted that the data collection channel also includes an instance of data processing server acquisition and an instance of data reporting. The specific process of reporting the running data of the target virtual network element to the corresponding data processing server is: obtaining an instance based on the data processing server, and obtaining the address of the data collection server. Based on the data reporting instance, each data attribute of the running data and the corresponding data attribute value are reported to the data processing server corresponding to the address.
图4为本发明实施例提供的虚拟网元的运行数据采集装置的结构示意图,需要说明的是,该装置具体为虚拟采集器,如图4所示,该装置包括:4 is a schematic structural diagram of an apparatus for collecting operation data of a virtual network element according to an embodiment of the present invention. It should be noted that the apparatus is specifically a virtual collector. As shown in FIG. 4 , the apparatus includes:
获取模块401,用于获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;连接模块402,用于基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;配置模块403,用于基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和每一所述数据属性对应的采集周期;采集模块404,用于基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。The acquisition module 401 is used to acquire a pre-built data acquisition channel corresponding to the target virtual network element, wherein the data acquisition channel includes a database connection instance, a data attribute and an acquisition cycle configuration instance and a trigger acquisition instance; the connection module 402, using is connected to the database corresponding to the target virtual network element based on the database connection instance, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and each The data attribute value corresponding to the data attribute; the configuration module 403 is configured to determine a plurality of the data attributes of the operating data and the collection period corresponding to each of the data attributes based on the data attribute and the collection cycle configuration instance; Module 404, configured to collect the data attribute value corresponding to each of the data attributes of the operating data in the database according to the collection period corresponding to each of the data attributes based on the trigger collection instance .
需要说明的是,本发明实施例提供的虚拟网元的运行数据采集装置用于执行上述虚拟网元的运行数据采集方法的步骤,此处不再进行赘述。本发明实施例提供的虚拟网元的运行数据采集装置,通过预先构建的包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例的数据采集通道,能够从目标虚拟网元对应的数据库中采集目标虚拟网元的运行数据,解决了现有技术中没有针对虚拟网元的运行数据的采集方法的技术问题。It should be noted that the apparatus for collecting operation data of a virtual network element provided in the embodiment of the present invention is configured to execute the steps of the above method for collecting operation data of a virtual network element, which will not be repeated here. The device for collecting the operation data of the virtual network element provided by the embodiment of the present invention can collect data from the database corresponding to the target virtual network element through the pre-built data collection channel including the database connection instance, the data attribute and collection period configuration instance and the trigger collection instance. Collecting the operation data of the target virtual network element solves the technical problem that there is no collection method for the operation data of the virtual network element in the prior art.
图5为本发明实施例提供的电子设备的实体结构示意图,如图5所示,该电子设备可以包括:处理器(processor)501、通信接口(Communications Interface)502、存储器(memory)503和通信总线504,其中,处理器501,通信接口502,存储器503通过通信总线504完成相互间的通信。处理器501可以调用存储在存储器503上并可在处理器501上运行的计算机程序,以执行上述各实施例提供的方法,例如包括:获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和 每一所述数据属性对应的采集周期;基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。FIG. 5 is a schematic diagram of an entity structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 5 , the electronic device may include: a processor (processor) 501, a communications interface (Communications Interface) 502, a memory (memory) 503, and a communication The bus 504, wherein the processor 501, the communication interface 502, and the memory 503 complete the communication with each other through the communication bus 504. The processor 501 may call a computer program stored in the memory 503 and run on the processor 501 to execute the methods provided by the above embodiments, for example, including: acquiring a pre-built data collection channel corresponding to the target virtual network element, Wherein, the data collection channel includes a database connection instance, a data attribute and collection cycle configuration instance, and a trigger collection instance; based on the database connection instance, a database connection corresponding to the target virtual network element, wherein the database stores There is operation data of the target virtual network element, and the operation data includes several data attributes and a data attribute value corresponding to each of the data attributes; The data attributes and the collection period corresponding to each of the data attributes; based on the trigger collection instance, according to the collection period corresponding to each of the data attributes, collect each of the operation data in the database. the data attribute value corresponding to the data attribute.
此外,上述的存储器503中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 503 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solutions of the embodiments of the present invention are essentially, or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的传输方法,例如包括:获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和每一所述数据属性对应的采集周期;基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。Embodiments of the present invention also provide a non-transitory computer-readable storage medium on which a computer program is stored, and the computer program is implemented when executed by a processor to execute the transmission methods provided in the foregoing embodiments, for example, including: obtaining a pre-built The data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and collection cycle configuration instance, and a trigger collection instance; based on the database connection instance, and the target virtual network element A corresponding database connection, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes and a data attribute value corresponding to each of the data attributes; based on the data attributes and A collection period configuration instance, determining a number of the data attributes of the operating data and the collection period corresponding to each of the data attributes; based on the trigger collection instance, according to the collection period corresponding to each of the data attributes, in the The data attribute value corresponding to each of the data attributes of the operating data is collected in the database.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施 方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

  1. 一种虚拟网元的运行数据采集方法,其特征在于,包括:A method for collecting operation data of a virtual network element, comprising:
    获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;Acquire a pre-built data collection channel corresponding to the target virtual network element, wherein the data collection channel includes a database connection instance, a data attribute and a collection period configuration instance, and a trigger collection instance;
    基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;Connect to a database corresponding to the target virtual network element based on the database connection instance, wherein the database stores operation data of the target virtual network element, and the operation data includes several data attributes and each of the The data attribute value corresponding to the data attribute;
    基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和每一所述数据属性对应的采集周期;determining a plurality of the data attributes of the operating data and a collection period corresponding to each of the data attributes based on the data attributes and the collection cycle configuration instance;
    基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所述数据属性值。Based on the triggered collection instance, according to the collection period corresponding to each of the data attributes, the data attribute value corresponding to each of the data attributes of the operating data is collected in the database.
  2. 根据权利要求1所述的虚拟网元的运行数据采集方法,其特征在于,所述数据采集通道还包括数据处理服务器获取实例和数据上报实例,所述虚拟网元的运行数据采集方法还包括:The method for collecting operation data of a virtual network element according to claim 1, wherein the data collection channel further comprises a data processing server obtaining instance and an instance of data reporting, and the method for collecting operation data of the virtual network element further comprises:
    基于所述数据处理服务器获取实例,获取数据采集服务器的地址;Obtain an instance based on the data processing server, and obtain the address of the data collection server;
    基于所述数据上报实例,将所述运行数据的每一所述数据属性及对应的所述数据属性值上报给所述地址对应的所述数据处理服务器。Based on the data reporting instance, each of the data attributes of the operating data and the corresponding data attribute values are reported to the data processing server corresponding to the address.
  3. 根据权利要求1所述的虚拟网元的运行数据采集方法,其特征在于,获取预先构建的与目标虚拟网元对应的数据采集通道,之前还包括:The method for collecting operation data of a virtual network element according to claim 1, wherein the step of obtaining a pre-built data collection channel corresponding to the target virtual network element further comprises:
    扫描预置的共享目录,其中,所述共享目录中存储有所述目标虚拟网元对应的文件夹,所述文件夹中存储有所述目标虚拟网元的第一文件、对所述第一文件进行校验得到的第一校验文件、第二文件和对所述第二文件进行校验得到的第二校验文件,所述第一文件包括所述目标虚拟网元对应的数据库的端口号和所述目标虚拟网元的启动时间,所述第二文件包括所述目标虚拟网元的运行数据的若干数据属性和每一所述数据属性对应的采集周期;Scan a preset shared directory, wherein a folder corresponding to the target virtual network element is stored in the shared directory, and the first file of the target virtual network element is stored in the folder, and the first file of the target virtual network element is stored in the folder. A first verification file obtained by verifying the file, a second file obtained by verifying the second file, and a second verification file obtained by verifying the second file, where the first file includes the port of the database corresponding to the target virtual network element number and the startup time of the target virtual network element, and the second file includes several data attributes of the running data of the target virtual network element and a collection period corresponding to each of the data attributes;
    判断所述文件夹是否首次出现,若是,则基于所述第一文件和所述第二文件构建所述目标虚拟网元对应的所述数据采集通道。It is judged whether the folder appears for the first time, and if so, the data collection channel corresponding to the target virtual network element is constructed based on the first file and the second file.
  4. 根据权利要求3所述的虚拟网元的运行数据采集方法,其特征在于,获取预先构建的与目标虚拟网元对应的数据采集通道,之前还包括:The method for collecting operation data of a virtual network element according to claim 3, wherein the step of obtaining a pre-built data collection channel corresponding to the target virtual network element further comprises:
    若所述文件夹非首次出现,则获取所述第一校验文件和所述第二校验文件;If the folder does not appear for the first time, obtain the first verification file and the second verification file;
    判断所述第一校验文件是否与上一次获取的所述第一校验文件一致,若否,则基于所述第一文件更新所述数据采集通道;Determine whether the first verification file is consistent with the first verification file obtained last time, and if not, update the data acquisition channel based on the first file;
    判断所述第二校验文件是否与上一次获取的所述第二校验文件一致,若否,则基于所述第二文件更新所述数据采集通道;Determine whether the second verification file is consistent with the second verification file obtained last time, and if not, update the data acquisition channel based on the second file;
    将更新后的所述数据采集通道作为所述目标虚拟网元对应的所述数据采集通道。The updated data collection channel is used as the data collection channel corresponding to the target virtual network element.
  5. 根据权利要求3所述的虚拟网元的运行数据采集方法,其特征在于,所述第一文件和所述第二文件均在所述目标虚拟网元启动时生成,所述第一校验文件为对所述第一文件进行MD5校验后得到,所述第二校验文件为对所述第二文件进行MD5校验后得到。The method for collecting operation data of a virtual network element according to claim 3, wherein the first file and the second file are both generated when the target virtual network element is started, and the first verification file is The second verification file is obtained after performing MD5 verification on the first file, and the second verification file is obtained after performing MD5 verification on the second file.
  6. 根据权利要求4所述的虚拟网元的运行数据采集方法,其特征在于,基于所述第一文件更新所述数据采集通道,包括:The method for collecting operation data of a virtual network element according to claim 4, wherein updating the data collection channel based on the first file comprises:
    基于所述第一文件更新所述数据采集通道中的所述数据库连接实例。The database connection instance in the data collection channel is updated based on the first file.
  7. 根据权利要求4所述的虚拟网元的运行数据采集方法,其特征在于,基于所述第二文件更新所述数据采集通道,包括:The method for collecting operation data of a virtual network element according to claim 4, wherein updating the data collection channel based on the second file comprises:
    基于所述第二文件更新所述数据采集通道中的所述数据属性及采集周期配置实例和所述触发采集实例。The data attribute and collection cycle configuration instance and the trigger collection instance in the data collection channel are updated based on the second file.
  8. 一种虚拟网元的运行数据采集装置,其特征在于,包括:A device for collecting operation data of a virtual network element, comprising:
    获取模块,用于获取预先构建的与目标虚拟网元对应的数据采集通道,其中,所述数据采集通道包括数据库连接实例、数据属性及采集周期配置实例和触发采集实例;an acquisition module, configured to acquire a pre-built data acquisition channel corresponding to the target virtual network element, wherein the data acquisition channel includes a database connection instance, a data attribute and an acquisition cycle configuration instance, and a trigger acquisition instance;
    连接模块,用于基于所述数据库连接实例,与所述目标虚拟网元对应的数据库连接,其中,所述数据库中存储有所述目标虚拟网元的运行数据,所述运行数据包括若干数据属性和每一所述数据属性对应的数据属性值;a connection module, configured to connect to the database corresponding to the target virtual network element based on the database connection instance, wherein the database stores the operation data of the target virtual network element, and the operation data includes several data attributes a data attribute value corresponding to each of the data attributes;
    配置模块,用于基于所述数据属性及采集周期配置实例,确定所述运行数据的若干所述数据属性和每一所述数据属性对应的采集周期;a configuration module, configured to determine a plurality of the data attributes of the operating data and a collection period corresponding to each of the data attributes based on the data attributes and the collection cycle configuration instance;
    采集模块,用于基于所述触发采集实例,根据每一所述数据属性对应的所述采集周期,在所述数据库中采集所述运行数据的每一所述数据属性对应的所 述数据属性值。a collection module, configured to collect, in the database, the data attribute value corresponding to each of the data attributes of the operating data according to the collection period corresponding to each of the data attributes based on the trigger collection instance .
  9. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至7中任一项所述虚拟网元的运行数据采集方法的步骤。An electronic device, comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1 to 7 when the processor executes the program The steps of the operation data collection method of the virtual network element.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1至7中任一项所述虚拟网元的运行数据采集方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method for collecting operation data of a virtual network element according to any one of claims 1 to 7 are implemented .
PCT/CN2021/131443 2020-12-01 2021-11-18 Method and apparatus for acquiring operation data of virtual network element WO2022116846A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011381764.1A CN112564957B (en) 2020-12-01 2020-12-01 Method and device for acquiring running data of virtual network element
CN202011381764.1 2020-12-01

Publications (1)

Publication Number Publication Date
WO2022116846A1 true WO2022116846A1 (en) 2022-06-09

Family

ID=75045754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/131443 WO2022116846A1 (en) 2020-12-01 2021-11-18 Method and apparatus for acquiring operation data of virtual network element

Country Status (2)

Country Link
CN (1) CN112564957B (en)
WO (1) WO2022116846A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112564957B (en) * 2020-12-01 2022-05-17 武汉绿色网络信息服务有限责任公司 Method and device for acquiring running data of virtual network element
CN113806176A (en) * 2021-09-22 2021-12-17 中国建设银行股份有限公司 Data object identification method and device based on configuration management

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017041556A1 (en) * 2015-09-11 2017-03-16 中兴通讯股份有限公司 Virtual resource scheduling method
CN107077483A (en) * 2014-09-23 2017-08-18 亚马逊技术股份有限公司 The synchronization of Shared Folders and file
CN108370341A (en) * 2016-03-02 2018-08-03 华为技术有限公司 Resource allocation method, virtual network function manager and Element management system
CN112564957A (en) * 2020-12-01 2021-03-26 武汉绿色网络信息服务有限责任公司 Method and device for acquiring running data of virtual network element

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100554985C (en) * 2007-05-25 2009-10-28 中兴通讯股份有限公司 A kind of method of inspection of north direction interface data integrity
CN100546260C (en) * 2007-06-27 2009-09-30 中国移动通信集团四川有限公司 The inconsistent detection processing method of data
CN101247271A (en) * 2008-03-24 2008-08-20 中兴通讯股份有限公司 Performance data storage method and device
CN102651729A (en) * 2011-02-23 2012-08-29 中国移动通信集团公司 Resource configuration method and device
CN105391601B (en) * 2015-12-09 2018-08-07 瑞斯康达科技发展股份有限公司 A kind of performance test methods and system of Network Management Equipment
CN106936660B (en) * 2015-12-31 2020-02-14 华为软件技术有限公司 Data acquisition method and device
CN107026747A (en) * 2016-02-01 2017-08-08 中兴通讯股份有限公司 The statistical summaries method and device of network management performance data
CN106533838B (en) * 2016-11-30 2019-12-10 国云科技股份有限公司 Service characteristic time sequence data packet acquisition method facing cloud platform
CN107302450B (en) * 2017-06-13 2021-05-11 国网冀北电力有限公司信息通信分公司 Data acquisition task changing method and device
CN110471927A (en) * 2019-08-20 2019-11-19 浙江大搜车软件技术有限公司 Metadata acquisition method, apparatus, computer equipment and storage medium
CN111143031A (en) * 2019-12-20 2020-05-12 中国银联股份有限公司 Method and device for changing capacity of virtual machine
CN111585815B (en) * 2020-05-09 2023-11-03 浙江大华技术股份有限公司 Port data acquisition method and device
CN111625319A (en) * 2020-05-25 2020-09-04 北京金山云网络技术有限公司 Virtual machine monitoring data acquisition method and device and host machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077483A (en) * 2014-09-23 2017-08-18 亚马逊技术股份有限公司 The synchronization of Shared Folders and file
WO2017041556A1 (en) * 2015-09-11 2017-03-16 中兴通讯股份有限公司 Virtual resource scheduling method
CN108370341A (en) * 2016-03-02 2018-08-03 华为技术有限公司 Resource allocation method, virtual network function manager and Element management system
CN112564957A (en) * 2020-12-01 2021-03-26 武汉绿色网络信息服务有限责任公司 Method and device for acquiring running data of virtual network element

Also Published As

Publication number Publication date
CN112564957B (en) 2022-05-17
CN112564957A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US11928029B2 (en) Backup of partitioned database tables
US11036591B2 (en) Restoring partitioned database tables from backup
US11327949B2 (en) Verification of database table partitions during backup
WO2022116846A1 (en) Method and apparatus for acquiring operation data of virtual network element
US10019180B1 (en) Snapshot data operation request processing
US9471610B1 (en) Scale-out of data that supports roll back
CA3068345C (en) Witness blocks in blockchain applications
US10534749B1 (en) Block device emulation for data snapshots
US11099939B2 (en) Snapshot clustering techniques for multipart volumes
WO2022048359A1 (en) Data archiving method and apparatus, and electronic device and storage medium
JP5807594B2 (en) Verification support program, verification support method, and verification support apparatus
CN112104715A (en) Link tracking method and system based on microservice log
US11677826B2 (en) Efficient transfer to and from a deduplicated cloud storage system
US10289493B1 (en) Data snapshot analysis systems and techniques
CN112559525B (en) Data checking system, method, device and server
US20180075054A1 (en) Metering data in distributed storage environments
US8108349B1 (en) Directory services integration and replication system
US11949547B2 (en) Enhanced simple network management protocol (SNMP) connector
CN115878721A (en) Data synchronization method, device, terminal and computer readable storage medium
US11151082B1 (en) File system operation cancellation
CN113031995A (en) Rule updating method and device, storage medium and electronic equipment
US11714799B1 (en) Automated testing of add-on configurations for searching event data using a late-binding schema
US11379440B1 (en) Correction, synchronization, and migration of databases
CN115756549A (en) Method and device for downloading data of big data middlebox and storage medium
US11144504B1 (en) Eliminating redundant file system operations

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

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

Country of ref document: EP

Kind code of ref document: A1