Data acquisition method and device based on vector packet processing framework
Through the data acquisition method based on the vector package processing framework, the problem of resource waste and redundant operations of smart terminals when processing multiple services is solved, and efficient data acquisition and resource utilization are achieved.
Patent Information
- Application Number
- CN202411782011.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
AI Technical Summary
When existing smart terminals handle multiple services, they need to customize and develop multiple programs to adapt to the communication needs of different services, resulting in waste of resources and redundant operations.
The data acquisition method based on the vector package processing framework is adopted, and data acquisition programs are collected by generating data point tables, acquiring communication protocol configuration information, and migrating data acquisition programs to the vector package processing framework, and running the data acquisition programs in this framework to realize data acquisition of the server.
The unit testing and deployment process caused by program development is reduced, and the processing of each data collection instruction can be achieved through configuration files, improving resource utilization.
Smart Images

Figure CN119652954A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a data acquisition method based on a vector packet processing framework. Background Art
[0002] With the development of technology, there are now a large number of intelligent terminals (such as computers and other intelligent devices) that can be used for data transmission and data analysis, and these intelligent terminals need to be connected to other devices directly or indirectly for data transmission between devices.
[0003] However, since different smart terminals or different devices may use different communication protocols, when a smart terminal communicates with another device, it needs to load the communication protocol corresponding to the device to implement the communication process between the two based on the communication protocol. However, as the number of services increases, when a smart terminal communicates with another device to process services, the communication requirements corresponding to different services may be different. If a smart terminal needs to process multiple services, and the communication requirements corresponding to the multiple services are different, the smart terminal needs to customize and develop multiple programs to process each service separately, which not only consumes a lot of development resources, but also requires frequent and redundant operations such as unit testing and deployment of the implemented programs, resulting in a waste of resources.
[0004] Therefore, an effective method is urgently needed to solve such problems. Summary of the invention
[0005] In view of this, an embodiment of the present specification provides a data collection method based on a vector packet processing framework. One or more embodiments of the present specification also relate to a data collection device based on a vector packet processing framework, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a data collection method based on a vector packet processing framework is provided, comprising:
[0007] In response to a data collection instruction for a target device, generating a data point table according to parameters of the data to be collected carried in the data collection instruction;
[0008] Obtaining configuration information of the communication protocol of the server, and storing the data point table and the configuration information in a configuration file;
[0009] Transplanting a pre-compiled data acquisition program to a vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol;
[0010] By running the data collection program in the vector packet processing framework and collecting data on the server side according to the configuration information and the data point table stored in the configuration file, corresponding data collection results are obtained.
[0011] Optionally, generating a data point table according to the parameters of the data to be collected carried in the data collection instruction includes:
[0012] Determine at least two data types carried in the data collection instruction, and determine the to-be-collected data parameters corresponding to the target data type, wherein the target data type is each of the at least two data types;
[0013] A data point table corresponding to the target data type is generated according to the parameters of the data to be collected.
[0014] Optionally, the configuration information includes: address information and port number of the server and an association relationship between the to-be-collected data parameter and a storage location of a parameter value corresponding to the to-be-collected data parameter on the server;
[0015] Accordingly, the data collection program is run on the vector packet processing framework, and data collection is performed on the server according to the configuration information and the data point table stored in the configuration file, including:
[0016] Loading the configuration file into the memory by running the data acquisition program in the vector packet processing framework;
[0017] Reading the address information, the port number, the association relationship and the data point table stored in the configuration file;
[0018] The server is accessed according to the address information and the port number, and parameter values corresponding to the data parameters to be collected are collected at the storage location of the server according to the data point table and the association relationship.
[0019] Optionally, the step of transplanting the pre-compiled data acquisition program to the vector packet processing framework includes:
[0020] In response to a plug-in extension request for a vector packet processing framework, obtaining a plug-in interface of the vector packet processing framework;
[0021] Determine a plug-in to be added corresponding to the plug-in interface, wherein the plug-in to be added is a pre-compiled data acquisition program;
[0022] The plug-in to be added is added to the plug-in interface to transplant the data acquisition program to the vector packet processing framework.
[0023] Optionally, the data collection method based on the vector packet processing framework further includes:
[0024] Determining protocol parameters and data transmission format of the communication protocol;
[0025] According to the protocol identifier of the communication protocol, the protocol parameters and the data transmission format, a data acquisition program corresponding to the communication protocol is developed and generated.
[0026] Optionally, the data collection method based on the vector packet processing framework further includes:
[0027] By running the data acquisition program in the vector packet processing framework, receiving the data packet sent by the server;
[0028] Parsing the data packet to obtain a parameter adjustment value corresponding to the data parameter to be adjusted;
[0029] The to-be-adjusted data parameter of the target device is adjusted according to the parameter adjustment value.
[0030] Optionally, the communication protocol includes Modbus TCP protocol.
[0031] According to a second aspect of the embodiments of this specification, a data acquisition device based on a vector packet processing framework is provided, comprising:
[0032] A generating module, configured to generate a data point table in response to a data collection instruction for a target device according to parameters of the data to be collected carried in the data collection instruction;
[0033] A storage module is configured to obtain configuration information of the communication protocol of the server, and store the data point table and the configuration information in a configuration file;
[0034] A processing module is configured to transplant a pre-compiled data acquisition program to a vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol;
[0035] The acquisition module is configured to run the data acquisition program in the vector packet processing framework, and to perform data acquisition on the server according to the configuration information and the data point table stored in the configuration file to obtain corresponding data acquisition results.
[0036] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0037] Memory and processor;
[0038] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement any step of the data collection method based on the vector packet processing framework.
[0039] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the data acquisition methods based on the vector packet processing framework are implemented.
[0040] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data acquisition method based on the vector packet processing framework.
[0041] The embodiments of the specification generate a data point table according to the data parameters to be collected carried in the data collection instruction in response to the data collection instruction for the target device; obtain the configuration information of the communication protocol of the server, and store the data point table and the configuration information in the configuration file; transplant the pre-compiled data collection program to the vector packet processing framework, wherein the data collection program is developed and generated based on the communication protocol; and perform data collection on the server according to the configuration information and the data point table stored in the configuration file by running the data collection program in the vector packet processing framework, and obtain the corresponding data collection results. By adding the data parameters to be collected in different data collection instructions to the configuration file, and performing data collection by running the data collection instructions in the vector packet processing framework, the data parameters to be collected corresponding to each data collection instruction are directly read in the configuration file, without the need to customize the development of the data collection program for each data collection instruction, the unit testing and deployment process caused by program development is reduced, and the processing of each data collection instruction can be realized through the configuration file, which is conducive to reducing the consumption of development resources, thereby facilitating the improvement of resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of a data collection method based on a vector packet processing framework provided by an embodiment of this specification;
[0043] Figure 2 is an architectural diagram of a vector packet processing framework provided by an embodiment of this specification;
[0044] Figure 3 It is a structural schematic diagram of a data acquisition device based on a vector packet processing framework provided by an embodiment of this specification;
[0045] Figure 4 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0046] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0047] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0048] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0049] First, the terms involved in one or more embodiments of this specification are explained.
[0050] Vector Packet Processing (VPP): is an open source project that is an extensible framework used to accelerate the processing and routing of network packets.
[0051] Modbus protocol: A serial communication protocol that has become the industry standard for industrial communication protocols and is now a common connection method between industrial electronic devices. Currently, the industry uses Modbus, mainly Modbus RTU, Modbus ASCII and Modbus TCP (Transmission Control Protocol).
[0052] Modbus TCP protocol: is an application layer messaging protocol that works with Ethernet to enable client / server communication between devices connected on different types of networks and to achieve high-speed data exchange between devices using TCP / IP networks.
[0053] There are two traditional Modbus TCP service implementations: one is interface operation; the other is non-interface implementation, usually based on the business layer program implemented in Linux. However, both methods have obvious disadvantages. For example, interface operation, because the system has higher requirements for the rendering of the user interface, the response of the mouse and keyboard, consumes a lot of system resources such as CPU and memory to support this operation mode. For the Modbus TCP acquisition program, there is no requirement for the user interface, but only a large amount of collected data and high-frequency data update. Therefore, the rendering of the user interface and the response of the mouse and keyboard are not very meaningful for data acquisition; the way of implementing the business layer program through Linux reduces the requirements for the rendering of the user interface and the mouse and keyboard, but due to the different businesses, it is necessary to customize the program according to the business, and the implemented program also needs to be frequently redundantly operated such as unit testing and deployment.
[0054] For this reason, the embodiments of this specification propose solutions for the above two situations, that is, data collection based on the Modbus TCP protocol is implemented based on the Linux kernel + VPP plug-in.
[0055] In this specification, a data acquisition method based on a vector packet processing framework is provided. This specification also relates to a data acquisition device based on a vector packet processing framework, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments.
[0056] Figure 1 A flow chart of a data collection method based on a vector packet processing framework provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0057] Step 102: In response to a data collection instruction for a target device, a data point table is generated according to parameters of the data to be collected carried in the data collection instruction.
[0058] The data collection method based on the vector packet processing framework provided in the embodiments of this specification is applied to a client, and the client may be a client of an energy storage power station, and is used to collect device parameters of related devices of the energy storage power station at the server end.
[0059] Specifically, the data collection instruction for the target device is an instruction for collecting parameter values corresponding to device parameters of the target device, and the data collection instruction carries the data parameters to be collected (device parameters to be collected) of the target device.
[0060] After receiving the data collection instruction for the target device, the client can generate a data point table according to the parameters of the data to be collected carried in the data collection instruction. The data point table contains the parameters of the data to be collected.
[0061] In an optional implementation, generating a data point table according to the parameters of the data to be collected carried in the data collection instruction includes:
[0062] Determine at least two data types carried in the data collection instruction, and determine the to-be-collected data parameters corresponding to the target data type, wherein the target data type is each of the at least two data types;
[0063] A data point table corresponding to the target data type is generated according to the parameters of the data to be collected.
[0064] Specifically, the at least two data types in the embodiments of this specification include state quantity, measurement quantity, discrete quantity and cumulative quantity.
[0065] Among them, the state quantity is used to record the state of the target device, and its corresponding data parameters to be collected may include whether the device is running or whether the device is faulty, etc. The parameter value of each data parameter to be collected is usually yes or no. If expressed in numbers, the parameter value of each data parameter to be collected is usually 1 or 0; the measurement quantity is used to record the measurement parameters of the target device, and its corresponding data parameters to be collected may include the temperature, power, voltage and current of the target device, etc.; the discrete quantity can be regarded as an extension of the state quantity. Since the parameter values of each data parameter to be collected corresponding to the state quantity are usually only 1 or 0, in actual applications, in addition to 0 and 1, other discrete values can also be used to represent other states of the target device. For example, a value of 2 can indicate that the target device is in a charging state, and a value of 3 can indicate that the target device is in a discharging state, etc.; the cumulative quantity is used to record the cumulative value of the data parameter to be collected of the target device over a period of time, and its corresponding data parameter to be collected may include the accumulated charge or discharge amount of the target device over a period of time, etc.
[0066] The four data types in the embodiments of this specification correspond to different data parameters to be collected. To facilitate subsequent data collection and data analysis, the embodiments of this specification generate a data point table for each data type to store the data parameters to be collected corresponding to the data type.
[0067] In actual applications, when the client is a client of an energy storage power station, the target device may be a device such as an electric meter or a battery in the energy storage power station.
[0068] Step 104: Obtain configuration information of the communication protocol of the server, and store the data point table and the configuration information into a configuration file.
[0069] Specifically, the configuration information of the communication protocol may include the address information of the server, the port number, and the association relationship between the to-be-collected data parameter and the storage location of the parameter value corresponding to the to-be-collected data parameter at the server.
[0070] After obtaining the address information, port number and the association between the data parameters to be collected and the parameter values corresponding to the data parameters to be collected on the server, the obtained content and the aforementioned data point table can be stored in the configuration file for use in the subsequent data collection process through the data collection program and the configuration file.
[0071] In practical applications, the storage location of the server may be a register. Different parameter values may be stored in different registers, for example, the value corresponding to the current is stored in register 1, and the value corresponding to the voltage is stored in register 2. Therefore, before the client collects data from the server, it is necessary to first obtain the association between the data parameter to be collected and the storage location (i.e., register number) of the parameter value corresponding to the data parameter to be collected on the server, so as to collect data in the register with the corresponding number based on the association.
[0072] In an optional implementation, the communication protocol includes the Modbus TCP protocol.
[0073] Step 106: transplanting the pre-compiled data acquisition program to the vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol.
[0074] In an optional implementation, the step of transplanting the pre-compiled data acquisition program to the vector packet processing framework includes:
[0075] In response to a plug-in extension request for a vector packet processing framework, obtaining a plug-in interface of the vector packet processing framework;
[0076] Determine a plug-in to be added corresponding to the plug-in interface, wherein the plug-in to be added is a pre-compiled data acquisition program;
[0077] The plug-in to be added is added to the plug-in interface to transplant the data acquisition program to the vector packet processing framework.
[0078] Specifically, the Vector Packet Processing framework, or VPP, has the following features: high performance, flexibility, scalability, and programmability. In addition, VPP's modular design allows for flexible functional expansion by adding and removing functional plug-ins, while providing a rich set of interfaces and tools that enable users to programmatically expand its functionality.
[0079] In addition, the plug-in interface is an open application programming interface that can extend the functionality of the software. Through the plug-in interface, developers can develop and add their own plug-ins to achieve free expansion and flexible customization of the required functions.
[0080] In the embodiments of this specification, each function of the VPP can be supported and run by a function plug-in, and each function plug-in can be compatible with the VPP operating environment through its corresponding plug-in interface. Among them, a "function plug-in" can be a functional module including operating data and program instructions, which can realize a certain type of function. The "plug-in interface" is an interface that makes the function plug-in compatible with the VPP operating environment. When a function plug-in matches a plug-in interface, the function plug-in can be run in the VPP.
[0081] In the embodiments of the present specification, the plug-in interface of the VPP may be pre-set by the developer. For example, at least one plug-in interface may be set for each function that the VPP can implement. When there are two plug-in interfaces corresponding to a function, it means that the VPP can implement the function through two different function plug-ins.
[0082] Therefore, when a user needs to extend the plug-in of VPP, he can send a plug-in extension request to the client. When the client receives the plug-in extension request for VPP, it can first obtain the plug-in interface of VPP to determine what types of functional plug-ins VPP allows to load. The plug-in to be added corresponding to the plug-in interface refers to a functional plug-in that can match any plug-in interface of VPP and needs to be loaded into VPP. After determining the plug-in to be added, the plug-in to be added is loaded into the operating environment of VPP through its corresponding plug-in interface to realize the porting of the plug-in to be added to VPP.
[0083] The architecture diagram of a vector packet processing framework provided in the embodiments of this specification is as follows: Figure 2 As shown. VPP manages all modules in a unified manner. Modules that need to be managed are loaded into VPP for management, and modules that do not need to be managed are removed. During the loading and removal process, the normal operation of other modules will not be affected. In addition, the VPP platform is built on the "packet processing graph". This modular approach means that anyone can "insert" new graph nodes. This makes scalability quite simple and means that plug-ins can be customized for specific purposes. Plug-ins can be managed through VPP, and running, shutting down, and even restarting plug-ins do not require restarting the system, ensuring the convenience of the data collection process.
[0084] In an optional implementation, the data acquisition program can be developed and generated in the following manner:
[0085] Determining protocol parameters and data transmission format of the communication protocol;
[0086] According to the protocol identifier of the communication protocol, the protocol parameters and the data transmission format, a data acquisition program corresponding to the communication protocol is developed and generated.
[0087] Specifically, before collecting data from the server, the client may first determine the communication protocol used by the server, and then develop a data collection program based on the communication protocol.
[0088] In addition, since the protocol parameters of different communication protocols and their corresponding data transmission formats may be different, the protocol parameters and data transmission format of the communication protocol can be obtained first, and then the data acquisition program corresponding to the communication protocol can be developed based on the protocol identifier, protocol parameters and data transmission format.
[0089] The protocol parameters include, but are not limited to, communication interface standards, communication formats, and IP addresses.
[0090] Step 108: By running the data collection program in the vector packet processing framework and collecting data on the server side according to the configuration information and the data point table stored in the configuration file, corresponding data collection results are obtained.
[0091] Specifically, based on the aforementioned process of adding the configuration information and the data point table to the configuration file and porting the data collection program to VPP, the data collection program can be run in VPP, and data can be collected on the server side according to the configuration information and the data point table stored in the configuration file to obtain corresponding collection results.
[0092] In an optional implementation manner, the data collection program is run on the vector packet processing framework, and data collection is performed on the server according to the configuration information and the data point table stored in the configuration file, including:
[0093] Loading the configuration file into the memory by running the data acquisition program in the vector packet processing framework;
[0094] Reading the address information, the port number, the association relationship and the data point table stored in the configuration file;
[0095] The server is accessed according to the address information and the port number, and parameter values corresponding to the data parameters to be collected are collected at the storage location of the server according to the data point table and the association relationship.
[0096] Specifically, since the configuration information includes the address information and port number of the server and the association relationship between the data parameters to be collected and the storage location of the parameter values corresponding to the data parameters to be collected on the server, after the data collection program is transplanted to the VPP, the configuration file can be first loaded into the memory by running the data collection program in the VPP, and then the address information and port number of the server stored in the configuration file can be read to access the server through the address information and port number, and then the data point table can be read to determine the data parameters to be collected contained in the data point table, and then the association relationship between the data parameters to be collected stored in the configuration file and the storage location of the parameter values corresponding to the data parameters to be collected on the server is read, and the corresponding parameter value is read from the corresponding storage location of the server according to the association relationship.
[0097] In the embodiments of this specification, the configuration file can be loaded into the memory in JSON format, because JSON is highly versatile and can intuitively show the configuration description, data, etc., and is highly readable.
[0098] After the parameters of the data to be collected are obtained by loading the configuration file, the data is collected based on the Modbus TCP protocol. After the data is collected, it is processed on the business side, or the data center is synchronized, or the database is updated, etc.
[0099] In an optional implementation, the data collection method based on the vector packet processing framework further includes:
[0100] By running the data acquisition program in the vector packet processing framework, receiving the data packet sent by the server;
[0101] Parsing the data packet to obtain a parameter adjustment value corresponding to the data parameter to be adjusted;
[0102] The to-be-adjusted data parameter of the target device is adjusted according to the parameter adjustment value.
[0103] In the embodiments of this specification, in addition to the client collecting data on the server, the server may also actively send data to the client to instruct the client to adjust the parameter values of related device parameters based on the sent data.
[0104] Specifically, the client can run a data acquisition program in the VPP to receive data packets sent by the server, and then parse the data packets to obtain parameter adjustment values corresponding to the data parameters to be adjusted, so as to adjust the data parameters to be adjusted of the target device based on the parameter adjustment values.
[0105] For example, the target device is a battery, the data parameter to be adjusted is power, and the current battery power is 100w. If the battery power needs to be adjusted to 50w so that the battery is charged or discharged at 50w, the power value of 50w can be packaged as a parameter adjustment value and sent to the client.
[0106] After receiving the data packet, the client parses it to obtain the power value, and adjusts the battery power to 50w according to the power value.
[0107] The TCP / IP protocol of the embodiment of this specification implements the Modbus TCP protocol, and loads the point table and related configurations of Modbus TCP by loading the configuration file. After the configuration file is loaded into the memory, the data acquisition program is transplanted to VPP, and the business layer protocol of Modbus TCP is integrated by loading the plug-in through VPP.
[0108] In addition, since VPP is a highly modular and extensible software framework, newly developed functional modules can be easily integrated into VPP without affecting the underlying code framework of VPP. The VPP platform can be used to build any type of data packet processing application, such as load balancing, firewalls, IDS, or the infrastructure of a gradual protocol stack. VPP runs in user space, which means that when making changes to VPP internal modules, there is no need to change the Linux kernel code.
[0109] The embodiments of this specification generate a data point table according to the data parameters to be collected carried in the data collection instruction in response to the data collection instruction for the target device; obtain the configuration information of the communication protocol of the server, and store the data point table and the configuration information in the configuration file; transplant the pre-compiled data collection program to the vector packet processing framework, wherein the data collection program is developed and generated based on the communication protocol; and perform data collection on the server according to the configuration information and the data point table stored in the configuration file by running the data collection program in the vector packet processing framework, and obtain the corresponding data collection results. By adding the data parameters to be collected in different data collection instructions to the configuration file, and by directly reading the data parameters to be collected corresponding to each data collection instruction in the configuration file when running the data collection instruction in the VPP for data collection, without the need to customize the development of the data collection program for each data collection instruction, the unit testing and deployment process caused by program development is reduced, and the processing of each data collection instruction can be realized through the configuration file, which is conducive to reducing the consumption of development resources, thereby facilitating the improvement of resource utilization.
[0110] Corresponding to the above method embodiment, this specification also provides a data acquisition device embodiment based on a vector packet processing framework, Figure 3FIG. 1 is a schematic diagram showing a structure of a data acquisition device based on a vector packet processing framework provided by an embodiment of the present specification. Figure 3 As shown, the device comprises:
[0111] A generating module 302 is configured to generate a data point table in response to a data collection instruction for a target device according to parameters of the data to be collected carried in the data collection instruction;
[0112] The storage module 304 is configured to obtain the configuration information of the communication protocol of the server, and store the data point table and the configuration information into a configuration file;
[0113] The processing module 306 is configured to transplant the pre-compiled data acquisition program to the vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol;
[0114] The collection module 308 is configured to run the data collection program in the vector packet processing framework, and collect data on the server side according to the configuration information and the data point table stored in the configuration file to obtain corresponding data collection results.
[0115] Optionally, the generating module 302 is further configured to:
[0116] Determine at least two data types carried in the data collection instruction, and determine the to-be-collected data parameters corresponding to the target data type, wherein the target data type is each of the at least two data types;
[0117] A data point table corresponding to the target data type is generated according to the parameters of the data to be collected.
[0118] Optionally, the configuration information includes: address information and port number of the server and an association relationship between the to-be-collected data parameter and a storage location of a parameter value corresponding to the to-be-collected data parameter on the server;
[0119] Accordingly, the acquisition module 308 is further configured to:
[0120] Loading the configuration file into the memory by running the data acquisition program in the vector packet processing framework;
[0121] Reading the address information, the port number, the association relationship and the data point table stored in the configuration file;
[0122] The server is accessed according to the address information and the port number, and parameter values corresponding to the data parameters to be collected are collected at the storage location of the server according to the data point table and the association relationship.
[0123] Optionally, the processing module 306 is further configured to:
[0124] In response to a plug-in extension request for a vector packet processing framework, obtaining a plug-in interface of the vector packet processing framework;
[0125] Determine a plug-in to be added corresponding to the plug-in interface, wherein the plug-in to be added is a pre-compiled data acquisition program;
[0126] The plug-in to be added is added to the plug-in interface to transplant the data acquisition program to the vector packet processing framework.
[0127] Optionally, the data acquisition device based on the vector packet processing framework further includes a development module 310 configured to:
[0128] Determining protocol parameters and data transmission format of the communication protocol;
[0129] According to the protocol identifier of the communication protocol, the protocol parameters and the data transmission format, a data acquisition program corresponding to the communication protocol is developed and generated.
[0130] Optionally, the data acquisition device based on the vector packet processing framework further includes an adjustment module 312 configured to:
[0131] By running the data acquisition program in the vector packet processing framework, receiving the data packet sent by the server;
[0132] Parsing the data packet to obtain a parameter adjustment value corresponding to the data parameter to be adjusted;
[0133] The to-be-adjusted data parameter of the target device is adjusted according to the parameter adjustment value.
[0134] Optionally, the communication protocol includes Modbus TCP protocol.
[0135] The above is a schematic scheme of a data acquisition device based on a vector packet processing framework of the present embodiment. It should be noted that the technical scheme of the data acquisition device based on the vector packet processing framework and the technical scheme of the data acquisition method based on the vector packet processing framework are of the same concept, and the details not described in detail in the technical scheme of the data acquisition device based on the vector packet processing framework can be referred to the description of the technical scheme of the data acquisition method based on the vector packet processing framework.
[0136] Figure 4The block diagram of a computing device 400 according to one embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0137] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0138] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0139] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.
[0140] The processor 420 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned data collection method based on the vector packet processing framework.
[0141] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the data acquisition method based on the vector packet processing framework described above belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the data acquisition method based on the vector packet processing framework described above.
[0142] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned data collection method based on the vector packet processing framework.
[0143] The above is a schematic scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the data acquisition method based on the vector packet processing framework described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the data acquisition method based on the vector packet processing framework described above.
[0144] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data acquisition method based on the vector packet processing framework.
[0145] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the data acquisition method based on the vector packet processing framework described above belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the data acquisition method based on the vector packet processing framework described above.
[0146] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0147] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0148] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0150] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data collection method based on a vector packet processing framework, comprising: In response to a data collection instruction for a target device, generating a data point table according to parameters of the data to be collected carried in the data collection instruction; Obtaining configuration information of the communication protocol of the server, and storing the data point table and the configuration information in a configuration file; Transplanting a pre-compiled data acquisition program to a vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol; By running the data collection program in the vector packet processing framework and collecting data on the server side according to the configuration information and the data point table stored in the configuration file, corresponding data collection results are obtained.
2. According to the data collection method based on the vector packet processing framework of claim 1, the step of generating a data point table according to the parameters of the data to be collected carried in the data collection instruction comprises: Determine at least two data types carried in the data collection instruction, and determine the to-be-collected data parameters corresponding to the target data type, wherein the target data type is each of the at least two data types; A data point table corresponding to the target data type is generated according to the parameters of the data to be collected.
3. According to the data collection method based on the vector packet processing framework of claim 1, the configuration information includes: The address information and port number of the server and the association between the parameters of the data to be collected and the storage location of the parameter values corresponding to the parameters of the data to be collected at the server; Accordingly, the data collection program is run on the vector packet processing framework, and data collection is performed on the server according to the configuration information and the data point table stored in the configuration file, including: Loading the configuration file into the memory by running the data acquisition program in the vector packet processing framework; Reading the address information, the port number, the association relationship and the data point table stored in the configuration file; The server is accessed according to the address information and the port number, and parameter values corresponding to the data parameters to be collected are collected at the storage location of the server according to the data point table and the association relationship.
4. The data acquisition method based on the vector packet processing framework according to claim 1, wherein the step of transplanting the pre-compiled data acquisition program to the vector packet processing framework comprises: In response to a plug-in extension request for a vector packet processing framework, obtaining a plug-in interface of the vector packet processing framework; Determine a plug-in to be added corresponding to the plug-in interface, wherein the plug-in to be added is a pre-compiled data acquisition program; The plug-in to be added is added to the plug-in interface to transplant the data acquisition program to the vector packet processing framework.
5. The data acquisition method based on the vector packet processing framework according to claim 1 further comprises: Determining protocol parameters and data transmission format of the communication protocol; According to the protocol identifier of the communication protocol, the protocol parameters and the data transmission format, a data acquisition program corresponding to the communication protocol is developed and generated.
6. The data acquisition method based on the vector packet processing framework according to claim 1 or 5, further comprising: By running the data acquisition program in the vector packet processing framework, receiving the data packet sent by the server; Parsing the data packet to obtain a parameter adjustment value corresponding to the data parameter to be adjusted; The to-be-adjusted data parameter of the target device is adjusted according to the parameter adjustment value.
7. According to the data acquisition method based on the vector packet processing framework according to any one of claims 1 to 5, the communication protocol comprises the Modbus TCP protocol.
8. A data acquisition device based on a vector packet processing framework, comprising: A generating module, configured to generate a data point table in response to a data collection instruction for a target device according to parameters of the data to be collected carried in the data collection instruction; A storage module is configured to obtain configuration information of the communication protocol of the server, and store the data point table and the configuration information in a configuration file; A processing module is configured to transplant a pre-compiled data acquisition program to a vector packet processing framework, wherein the data acquisition program is developed and generated based on the communication protocol; The acquisition module is configured to run the data acquisition program in the vector packet processing framework, and to perform data acquisition on the server according to the configuration information and the data point table stored in the configuration file to obtain corresponding data acquisition results.
9. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the data acquisition method based on the vector packet processing framework described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the data acquisition method based on the vector packet processing framework as claimed in any one of claims 1 to 7.