Data processing method and device, monitoring equipment, computer readable storage medium and intelligent operation and maintenance management system

By creating data queues and threads in the user state and processing SNMP request data, the problem of low data processing efficiency in traditional network management methods is solved, efficient data processing is achieved and kernel-state storage occupation is reduced.

CN119652723APending Publication Date: 2025-03-18KEHUA DATA CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411728626.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional network management methods are difficult to deal with large-scale and high-complex network management needs, resulting in user mode being unable to process large amounts of SNMP request data in a timely manner, and frequent switching between user mode and kernel mode, resulting in low data processing efficiency.

Method used

Create data queues and threads in the user state, obtain SNMP request data from the kernel state data queue through threads, and parse and process them in the user state, avoiding frequent switching between user state and kernel state.

Benefits of technology

By copying the requested data to the user state, the use of kernel state storage space is reduced, frequent switching between user state and kernel state is avoided, data processing efficiency is improved, and different threads are able to process different types of requested data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652723A_ABST
    Figure CN119652723A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, monitoring equipment, a computer readable storage medium and an intelligent operation and maintenance management system. The method comprises the following steps: creating a first data queue in a user mode, and creating a first thread in the user mode; calling a first thread, acquiring the request data from a second data queue in a kernel mode, and adding the request data into the first data queue; calling a first thread, analyzing the request data in the first data queue to obtain a data analysis result, and representing the request data type of the request data by the data analysis result; and calling a second thread corresponding to the request data type in the user mode, and processing the request data. According to the invention, the data processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, monitoring equipment, computer-readable storage medium, and intelligent operation and maintenance management system. Background Art

[0002] With the rapid development of network technology, the types and number of network devices are increasing, and the complexity of network management is also increasing. Traditional network management methods can no longer meet the needs of large-scale and highly complex network management. Therefore, it is particularly important to study how to efficiently and securely process Simple Network Management Protocol (SNMP) request data in user mode and kernel mode.

[0003] In the related art, when processing request data, the user state cannot process a large amount of request data in a short time, and the ability to process request data is limited, resulting in the inability to update device parameter information in a timely manner. At the same time, the user state obtains request data one by one from the kernel state receiving queue, resulting in frequent switching between the user state and the kernel state, which leads to low data processing efficiency. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, monitoring equipment, computer-readable storage medium and intelligent operation and maintenance management system, which can improve the efficiency of data processing.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides a data processing method, the method comprising:

[0007] Create a first data queue in a user state, and create a first thread in the user state;

[0008] Calling the first thread, obtaining request data from the second data queue in the kernel state, and adding the request data to the first data queue, wherein the request data is simple network management protocol request data;

[0009] Calling the first thread to parse the request data in the first data queue to obtain a data parsing result, wherein the data parsing result represents the request data type of the request data;

[0010] The second thread corresponding to the requested data type in the user state is called to process the requested data.

[0011] The present application provides a data processing device, including:

[0012] A first creation module, used to create a first data queue in a user state, and to create a first thread in the user state;

[0013] A data acquisition module, used for calling the first thread, acquiring request data from the second data queue in the kernel state, and adding the request data to the first data queue, wherein the request data is a simple network management protocol request data;

[0014] a data parsing module, configured to call the first thread to parse the request data in the first data queue to obtain a data parsing result, wherein the data parsing result represents a request data type of the request data;

[0015] The second creation module is used to call the second thread corresponding to the request data type in the user state to process the request data.

[0016] The present application provides a monitoring device, the monitoring device comprising:

[0017] A memory for storing computer executable instructions or computer programs;

[0018] The processor is used to implement the data processing method provided in the embodiment of the present application when executing the computer executable instructions or computer programs stored in the memory.

[0019] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for implementing the data processing method provided in the embodiment of the present application when executed by a processor.

[0020] An embodiment of the present application provides a computer program product, including computer executable instructions or a computer program. When the computer executable instructions or the computer program are executed by a processor, the data processing method provided by the embodiment of the present application is implemented.

[0021] An embodiment of the present application provides an intelligent operation and maintenance management system, including a monitoring device and a terminal device, wherein the terminal device is used to send its own status data to the monitoring device, and the monitoring device is used to process the status data using the data processing method provided in the embodiment of the present application.

[0022] The embodiments of the present application have the following beneficial effects:

[0023] By using the embodiment of the present application, a first data queue is created in the user state, and a first thread is created in the user state, and then the first thread is called to obtain request data from the second data queue in the kernel state, and the request data is added to the first data queue, where the request data is the simple network management protocol request data. In this way, the request data stored in the kernel state is copied to the user state, which can not only reduce the occupation of the kernel state storage space by the request data, but also avoid frequent switching between the user state and the kernel state, and improve the data processing efficiency. After that, the first thread in the user state is called to parse the request data in the first data queue to obtain the data parsing result, which represents the request data type of the request data, and then the second thread corresponding to the request data type in the user state is called to process the request data. In this way, by calling the thread corresponding to the request data type in the user state to process the request data, different threads are implemented to process different types of request data, which can further improve the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a monitoring relationship topology diagram provided in the related art;

[0025] Figure 2 It is a schematic diagram of the kernel receiving queue capacity reaching the upper limit provided in the related art;

[0026] Figure 3 It is a schematic diagram of a data processing flow provided in the related art;

[0027] Figure 4 It is a schematic diagram of an application mode of the data processing method provided in an embodiment of the present application;

[0028] Figure 5 is a schematic diagram of the structure of a monitoring device provided in an embodiment of the present application;

[0029] Fig. 6A It is a first flow chart of the data processing method provided in the embodiment of the present application;

[0030] Figure 6B is a second flow chart of the data processing method provided in an embodiment of the present application;

[0031] Figure 6C is a third flow chart of the data processing method provided in the embodiment of the present application;

[0032] Fig.6D is a fourth flow chart of the data processing method provided in an embodiment of the present application;

[0033] Figure 7 It is a schematic diagram of the data processing structure provided in an embodiment of the present application.

[0034] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of superiority or inferiority of the solutions or the priority in the implementation process. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0036] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0037] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0038] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.

[0039] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0040] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0041] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0042] 1) Simple Network Management Protocol (SNMP): It is a widely used network management protocol for managing devices on the network, such as computers, routers, switches, printers, servers, etc. It allows network administrators to monitor the operating status, configuration information, performance indicators and other information of network devices.

[0043] 2) User state: refers to a privilege level of the operating system, which is the state when the operating system executes user programs. In user state, the process cannot directly access memory resources.

[0044] 3) Kernel state: refers to a privilege level of the operating system, which is the state when the operating system executes the core code. In kernel state, the process has the highest privilege and can directly access memory resources.

[0045] 4) Management Information Base (MIB): It is a database that contains a series of predefined management objects, including the status, configuration and performance information of network devices.

[0046] 5) Management information database write lock: refers to a mechanism for writing to the management information database, ensuring that only one process or thread can modify the management information database at a given time.

[0047] In order to better understand the data processing method provided in the embodiment of the present application, the data processing method applied to the monitoring field in the related art and the existing shortcomings are first explained.

[0048] refer to Figure 1 , Figure 1 It is a schematic diagram of monitoring relationship topology provided in the related art. The monitoring relationship topology includes monitoring device 101, monitoring network 102, control device 103, and terminal device 104. The terminal device collects device status data such as parameter sets and parameters, and uploads the device status data to the control device 103. The control device 103 receives the device status data and uploads the device status data to the monitoring device 101 through the monitoring network 102.

[0049] As the monitoring topology continues to expand and the monitoring levels continue to overlap, the device parameters that need to be monitored grow exponentially, resulting in the loss of SNMP request packets. Specifically, the SNMP request packet arrives at the kernel state first. Since the kernel receive queue (Recv-Q) has an upper limit on its capacity, if the user-state SNMP program cannot remove data from the kernel receive queue in a timely manner, when new request data arrives at the kernel state, the kernel state will discard the old request data. The SNMP program processes SNMP request packets in serial mode, that is, after processing one SNMP request packet, it reads the next new request data from the kernel state for processing. For an example, refer to Figure 2 , Figure 2 It is a schematic diagram of the kernel receiving queue capacity reaching the upper limit provided in the related art. Area 201 shows that the current data volume of the receiving queue is 217280 request data, the current data volume of the sending queue is 0 request data, the local address is 0.0.0.0, and the port number is 161.

[0050] User mode usually uses the net-SNMP protocol stack to concurrently process SNMP request packets. For request data from multiple host computers, different sessions are created to process the request data. For an example, refer to Figure 3 , Figure 3 It is a schematic diagram of the data processing flow provided in the related technology.

[0051] In step 301, a data packet is read.

[0052] On the user side, the SNMP request data packet is read from the kernel receive queue (Recv-Q) in kernel mode.

[0053] In step 302, a read completion flag is set.

[0054] In step 303, the data is parsed.

[0055] In step 304, the mib database is queried.

[0056] Query parameter information from the MIB database (management information database) and process the request data based on the parameter information.

[0057] In step 305, a reply is sent.

[0058] Send the processing result of the request data.

[0059] In step 306, it is determined whether the session connection traversal is completed.

[0060] If the session connection traversal is completed, the process proceeds to step 307 to process the timing event; if the session connection traversal is not completed, the process proceeds to step 301 to read the data packet.

[0061] In step 308, wait for judgment.

[0062] On the application side, determine the processing result of the timed event.

[0063] In step 309, the data is read again.

[0064] On the application side, read the request data from the processing result of the timed event.

[0065] In step 310, it is determined whether it is a new connection request.

[0066] On the user state side, determine whether the read request data is a new connection request. If the read request data is a new connection request, go to step 311 to create a new session connection. If the read request data is not a new connection request, go to step 306 to determine whether the session connection traversal is completed.

[0067] Related technologies have the following problems in the process of SNMP request data processing:

[0068] The user-mode SNMP program cannot process a large amount of SNMP request data from a single host computer in a short period of time, resulting in the inability to update device parameter information in a timely manner. Due to the performance bottleneck of mi b database operation during the SNMP request data processing process, the SNMP program's ability to process request data is limited, resulting in the discarding of new request data and low data processing efficiency.

[0069] The embodiments of the present application provide a data processing method, device, monitoring equipment, computer-readable storage medium and intelligent operation and maintenance management system, which can improve the efficiency of data processing.

[0070] The following describes an exemplary application of the monitoring device provided in the embodiment of the present application. The monitoring device provided in the embodiment of the present application can be implemented as a monitoring device applied in the field of industrial monitoring, for example, it can be various types of terminals such as a laptop computer, a tablet computer, a desktop computer, a smart phone, etc. The following describes an exemplary application when the device is implemented as a terminal.

[0071] See also Figure 4 , Figure 4 This is a schematic diagram of an application mode of the data processing method provided in the embodiment of the present application, for example, Figure 4The user and terminal 400 are involved. In the data processing process, the terminal 400 obtains a data processing instruction triggered by the user. The terminal 400 responds to the data processing instruction of the user, creates a first data queue in the user state of the operating system, and creates a first thread in the user state, calls the first thread, obtains request data from the second data queue in the kernel state of the operating system, and adds the request data to the first data queue. The request data is a simple network management protocol request data. The first thread is called to parse the request data in the first data queue to obtain a data parsing result. The data parsing result represents the request data type of the request data, and the second thread corresponding to the request data type in the user state is called to process the request data. In this way, the request data stored in the kernel state is copied to the user state, which can not only reduce the occupation of the kernel state storage space by the request data, but also avoid frequent switching between the user state and the kernel state. By calling the thread corresponding to the request data type in the user state to process the request data, different threads are implemented to process different types of request data, thereby improving data processing efficiency.

[0072] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a monitoring device provided in an embodiment of the present application, the monitoring device may be a terminal, Figure 5 The monitoring device 500 shown includes: at least one processor 410, a memory 450, and at least one network interface 420. The various components in the monitoring device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 5 Various buses are labeled as bus system 440 .

[0073] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0074] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0075] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0076] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0077] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic businesses and process hardware-based tasks.

[0078] The network communication module 452 is used to reach other monitoring devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB).

[0079] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 5 A data processing device 455 stored in a memory 450 is shown, which may be software in the form of a program or plug-in, including the following software modules: a first creation module 4551, a data acquisition module 4552, a data analysis module 4553, and a second creation module 4554. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0080] In some embodiments, the terminal can implement the data processing method provided in the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be microprogram-level commands, machine instructions or software instructions. The computer program can be a native program or software module in the operating system; it can be a native (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a cloud computing APP or an instant messaging APP; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

[0081] The data processing method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the terminal device provided in the embodiment of the present application.

[0082] The following describes the data processing method provided by the embodiment of the present application. As mentioned above, the monitoring device that implements the data processing method of the embodiment of the present application can be a monitoring terminal applied to various fields, such as an industrial camera, an industrial computer, etc. in the field of industrial monitoring. Next, the data processing method provided by the embodiment of the present application is described by taking the monitoring device as an example. Fig. 6A , Fig. 6A is a first flow chart of the data processing method provided in the embodiment of the present application, which will be combined with Fig. 6A The steps shown are explained.

[0083] In step 601, a first data queue is created in a user state, and a first thread is created in the user state.

[0084] Here, user state is a permission level of the operating system, and is the state of the operating system when executing a user program. The first data queue is a data queue for receiving data in the user state, and the first thread is a thread for parsing the data in the first data queue. The data structure of the first data queue is defined using data structures such as arrays, lists, and linked lists, and the size of the first data queue is set as needed. The first thread is created through the thread library function in the user state program.

[0085] In step 602, the first thread is called to obtain the request data from the second data queue in the kernel state, and the request data is added to the first data queue.

[0086] Here, the request data is the simple network management protocol request data (ie, SNMP request data). Kernel state refers to a privilege level of the operating system, which is the state when the operating system executes the core code. Kernel state is responsible for allocating and managing memory resources. The second data queue is a data queue in kernel state for receiving request data.

[0087] In some embodiments, see Figure 6B , Figure 6B It is a second flow chart of the data processing method provided in an embodiment of the present application. Fig. 6A Step 602 shown may be performed by Figure 6B Steps 6021 to 6023 are implemented as described in detail below.

[0088] In step 6021, a first quantity of requested data in a second data queue in kernel mode is obtained, and a data mapping quantity is determined based on the first quantity.

[0089] Here, the first quantity is the total number of requested data in the second data queue, and the data mapping quantity is the number of requested data added to the first data queue through one memory mapping. The data mapping quantity is determined based on the first quantity, and the first quantity can be directly determined as the data mapping quantity, that is, through one memory mapping, all the requested data in the second data queue of the kernel state are added to the first data queue. Or one-half of the first quantity is determined as the data mapping quantity, and at this time, all the requested data in the second data queue of the kernel state are added to the first data queue through two memory mappings. Or one-third of the first quantity is determined as the data mapping quantity, and at this time, all the requested data in the second data queue of the kernel state are added to the first data queue through three memory mappings.

[0090] For example, the first number of requested data is 90, and the first number is directly determined as the data mapping number, that is, the data mapping number is 90. Through one memory mapping, all the requested data in the second data queue of the kernel state can be added to the first data queue. Alternatively, one-half of the first number is determined as the data mapping number, that is, the data mapping number is 45. Through two memory mappings, all the requested data in the second data queue of the kernel state can be added to the first data queue. Alternatively, one-third of the first number is determined as the data mapping number, that is, the data mapping number is 30. Through three memory mappings, all the requested data in the second data queue of the kernel state can be added to the first data queue.

[0091] In step 6022, a mapping start address between the first data queue and the second data queue is determined.

[0092] Here, the mapping start address is the start address for requesting data mapping between the first data queue and the second data queue. A first memory area corresponding to the second data queue in kernel mode is determined, and a memory address is pre-selected in the first memory area as the mapping start address according to actual scenario requirements.

[0093] In step 6023, the first thread is called to obtain the requested data from the second data queue based on the data mapping quantity and the mapping start address, and the requested data is added to the first data queue.

[0094] Through the memory address acquisition function in the user state program, the second memory area corresponding to the first data queue in the user state is determined, the first thread is called, the data mapping quantity and the mapping start address are used as input data of the system call function in the user state program, and the data mapping relationship between the first memory area of ​​the second data queue and the second memory area of ​​the first data queue is obtained. According to the data mapping relationship, the request data is obtained from the first memory area of ​​the second data queue, and the request data is added to the second memory area of ​​the first data queue.

[0095] In an embodiment of the present application, the first thread is called to obtain request data in batches from the second data queue based on the number of data mappings and the mapping start address. This can not only improve the data transmission efficiency, but also clear the request data in the kernel state data queue in time, and add the batch-obtained request data to the first data queue, thereby avoiding frequent switching between user state and kernel state.

[0096] In some embodiments, the request data is obtained from the second data queue in the kernel state by direct memory access. Specifically, the first thread is called to initiate a direct memory access request to the kernel state, and the kernel state responds to the direct memory access request and configures a direct memory access controller, which includes the source address of the second data queue, the amount of requested data to be transmitted, etc. The request data is obtained from the second data queue in the kernel state by the direct memory access controller, and the request data is added to the first data queue.

[0097] In some embodiments, request data is obtained from the second data queue in the kernel state by means of a Unix domain socket. A Unix domain socket is a type of socket used for communication between a user state and a kernel state. Specifically, a first Unix domain socket is created in the user state, and the first Unix domain socket is connected to a second Unix domain socket in the kernel state. The first thread is called, and a data transmission request is initiated to the kernel state through the first Unix domain socket. The kernel state responds to the data transmission request and transmits the request data of the second data queue to the first data queue, thereby realizing the one-time addition of the request data of the second data queue to the first data queue.

[0098] Continue to refer Fig. 6A In step 603, the first thread is called to parse the request data in the first data queue to obtain a data parsing result, which represents the request data type of the request data.

[0099] Here, the request data includes a protocol data unit type, and the protocol data unit type is used to indicate the type of the request data. Based on the simple network management protocol, the request data in the first data queue is parsed to obtain a parsing result of the protocol data unit type. The request data type includes a parameter acquisition request data type, a new connection request data type, a parameter setting request data type, etc.

[0100] In step 604, a second thread corresponding to the requested data type in the user state is called to process the requested data.

[0101] Here, the second thread is a thread for processing request data corresponding to the request data type.

[0102] In some embodiments, see Figure 6C , Figure 6C This is a third flow chart of the data processing method provided in the embodiment of the present application. Fig. 6A Step 604 shown may be performed by Figure 6C Steps 6041A to 6042A are implemented as described in detail below.

[0103] In step 6041A, when the request data type is a parameter acquisition request data type, a second thread corresponding to the parameter acquisition request data type is created in the user state.

[0104] Here, the second thread is a thread for processing parameter acquisition request data. When the parsing result of the request data is the parameter acquisition request data type, a second thread corresponding to the parameter acquisition request data type is created through the thread library function in the user state program.

[0105] In step 6042A, the second thread is called to process the request data and read parameter information from the management information database.

[0106] Here, the management information database is a database containing a series of predefined management objects, and the predefined management objects include the status, configuration and performance information of the network device. The second thread is called to process the parameter acquisition request data, and the management object targeted is parsed from the parameter acquisition request data using regular expressions, string operations or other parsing techniques, and the parameter information of the corresponding management object is read from the management information database.

[0107] In an embodiment of the present application, when the request data type is a parameter acquisition request data type, a second thread corresponding to the parameter acquisition request data type is created in user mode, and the second thread is called to process the parameter acquisition request data, thereby realizing targeted processing of the parameter acquisition request data by the thread and improving the processing efficiency of the parameter acquisition request data.

[0108] In some embodiments, see Fig.6D , Fig.6D This is a fourth flow chart of the data processing method provided in an embodiment of the present application. Fig. 6A Step 604 shown may be performed by Fig.6D Steps 6041B to 6042B are implemented as described in detail below.

[0109] In step 6041B, when the request data type is a new connection request data type, the main thread in the user state is determined as the second thread corresponding to the new connection request data type in the user state.

[0110] Here, the second thread is a thread for processing new connection request data. When the parsing result of the request data is a new connection request data type, the main thread in the user state is directly determined as the second thread.

[0111] In step 6042B, the second thread is called to process the request data and establish a data communication connection between the network device and the host computer.

[0112] Here, the network device is the monitored device, and the host computer is a machine used to monitor the network device. The second thread is called to process new connection request data, and the second thread can establish a new child thread based on each new connection request data, and the child thread is used to perform data communication between the network device and the host computer.

[0113] In an embodiment of the present application, when the request data type is a new connection request data type, the main thread in the user state is determined as the second thread corresponding to the new connection request data type in the user state, and the second thread is called to process the new connection request data, thereby realizing targeted processing of the new connection request data by the thread and improving the processing efficiency of the new connection request data.

[0114] In some embodiments, the second thread corresponding to the request data type in the user state can also be called to process the request data by executing the following steps: calling the main thread in the user state to set a write lock for the management information database; when the request data type is a parameter setting request data type, creating a second thread corresponding to the parameter setting request data type in the user state; when the second thread obtains the write lock, calling the second thread to process the request data and modify the parameter information of the management information database.

[0115] Here, the second thread is a thread for processing parameter setting request data. Write lock refers to a mechanism for writing to the management information database, ensuring that only one thread can modify the management information database at a certain time. When the parsing result of the request data is the parameter setting request data type, a second thread corresponding to the parameter setting request data type is created through the thread library function in the user state program.

[0116] When the second thread obtains the write lock, the second thread is called to process the parameter setting request data, and regular expressions, string operations or other parsing techniques are used to parse the parameter information required to set the management object from the parameter setting request data, and modify the parameter information of the corresponding management object in the management information database.

[0117] In some embodiments, if the second thread fails to obtain the write lock, the second thread enters a waiting state. If the write lock is released by other threads, the second thread requests to obtain the write lock again. If the second thread obtains the write lock, the second thread is called to process the parameter setting request data and modify the parameter information of the management information database.

[0118] In an embodiment of the present application, when the request data type is a parameter setting request data type, a second thread corresponding to the parameter setting request data type is created in user mode. When the second thread obtains a write lock, the second thread is called to process the parameter setting request data, thereby realizing targeted processing of the parameter setting request data by the thread and improving the processing efficiency of the parameter setting request data.

[0119] In some embodiments, the following steps can also be performed: when the first thread is in an abnormal state, obtain the restart count of the first thread; when the restart count is less than a preset number threshold, restart the first thread and update the restart count; when the updated restart count reaches the number threshold and the first thread is still in an abnormal state after restarting, restart the main thread.

[0120] Here, the abnormal state refers to the situation where the first thread crashes or gets stuck. When the first thread is in an abnormal state, the first thread is restarted to restore the normal operation state. It should be noted that the restart count of the first thread is first obtained. When the restart count is less than the preset number threshold, the first thread is restarted and the restart count is updated at the same time. Updating the restart count can be adding one to the restart count to obtain the updated restart count. When the updated restart count reaches the number threshold and the first thread is still in an abnormal state after restarting, the main thread is restarted.

[0121] For example, the preset number threshold may be three times, the number of restarts of the first thread is obtained, and when the number of restarts is less than three times, the first thread is restarted and the number of restarts is updated. When the updated number of restarts reaches three times and the first thread is still in an abnormal state after restart, the main thread is restarted.

[0122] In some embodiments, the intelligent operation and maintenance management system provided by the embodiments of the present application includes a monitoring device and a terminal device. The terminal device sends its own temperature, voltage, current and other status data to the monitoring device, and the monitoring device processes the status data using the data processing method provided by the embodiments of the present application, and monitors whether the status of the terminal device is abnormal based on the status data. Optionally, the intelligent operation and maintenance management system provided by the embodiments of the present application includes a monitoring device, a control device and a terminal device. The control device is used to control the status data collection process of the terminal device, and the terminal device sends its own temperature, voltage, current and other status data to the control device, and the control device receives the status data and uploads the status data to the monitoring device through the monitoring network. The monitoring device processes the status data using the data processing method provided by the embodiments of the present application, and monitors whether the status of the terminal device is abnormal based on the status data.

[0123] In an embodiment of the present application, when the first thread is in an abnormal state, the restart count of the first thread is obtained. When the restart count is less than a preset number threshold, the first thread is restarted and the restart count is updated. When the updated restart count reaches the number threshold and the first thread is still in an abnormal state after restarting, the main thread is restarted, so that the running state of the thread parsing request data can be adjusted in time, thereby improving data processing efficiency.

[0124] In some embodiments, the data processing method provided by the embodiment of the present application can be applied in the field of industrial monitoring. In the operating system of the monitoring device, a first data queue is created in the user state, and a first thread is created in the user state, and then the first thread is called to obtain request data from the second data queue in the kernel state in the operating system of the monitoring device, and the request data is added to the first data queue. The request data is the simple network management protocol request data. In this way, the request data stored in the kernel state is copied to the user state, which can not only reduce the occupation of the kernel state storage space by the request data, but also avoid frequent switching between the user state and the kernel state, and improve the data processing efficiency. After that, the first thread in the user state is called to parse the request data in the first data queue to obtain the data parsing result, and the data parsing result represents the request data type of the request data, and then the second thread corresponding to the request data type in the user state is called to process the request data. In this way, by calling the thread corresponding to the request data type in the user state to process the request data, different threads are realized to process different types of request data, which can further improve the data processing efficiency of the monitoring device.

[0125] The following describes an exemplary application of the data processing method provided in an embodiment of the present application in an industrial monitoring scenario.

[0126] The SNMP protocol is used in the industrial monitoring field to monitor and set device parameters. Device parameters are a series of status data on the terminal devices under the control device, such as temperature, voltage, current, etc. These device parameters reflect the health status of the terminal device and need to be monitored in a timely manner on the monitoring device side. With the continuous expansion of monitoring topology and the continuous superposition of monitoring levels, the device parameters that need to be monitored by a host computer or cloud have increased exponentially, even reaching more than 10,000. At the same time, with the continuous improvement of industrial safety and other requirements, the monitored device parameters need to be updated in a timely manner, that is, the update time interval is very short.

[0127] In view of the problems existing in the related art, the present application embodiment proposes a data processing method, which includes the following improvements compared with the related art:

[0128] (1) Create a data queue in the user state to store the SNMP request data in the kernel state receiving queue, batch-acquire the data in the kernel state receiving queue (second data queue) to the user state data queue (first data queue), and clear the kernel state receiving queue data in time to avoid frequent switching between the user state and the kernel state.

[0129] (2) Create multiple threads corresponding to the request data types and call each thread to process different types of SNMP request data, thereby improving data processing efficiency and achieving timely update of large-scale monitoring parameters.

[0130] Example, reference Figure 7 , Figure 7 Schematic diagram of the data processing structure provided in the embodiment of the present application. Figure 7 The request data processing structure in the embodiment of the present application is used to explain the data processing method provided in the embodiment of the present application.

[0131] The user state 701 includes an SNMP library 703 and an application 704, and the kernel state 702 includes a kernel receive queue 705. The SNMP program creates a data queue 706 in the user state 701, and the data queue 706 is used to store the SNMP request data in the kernel receive queue 705. The SNMP program creates a data queue parsing thread 707 in the user state 701, and the data queue parsing thread 707 copies the data in the kernel receive queue 705 to the data queue 706 in batches, and can be copied in batches by mapping the kernel memory and other methods. The data queue parsing thread 707 is also used to cyclically read the request data in the data queue 706 and parse the request data. The main thread 710 is used to process northbound commands and connection establishment and other transactions, and a new mib database write lock is added. The main thread 710 can also interact with user requests 711 for data.

[0132] The parsing result of the request data is a request data type, which mainly includes a new connection request data type, a parameter acquisition request data type, and a parameter setting request data type. When the parsing result of the request data is a new connection request data type, the main thread 710 is called to process the new connection request data, and a data communication connection between the monitoring device and the host computer is established. When the parsing result of the request data is a parameter acquisition request data type, a parameter acquisition request thread 708 is created, and the parameter acquisition request thread 708 is called to process the parameter acquisition request data, including reading parameter information from the mib database, etc. When the parsing result of the request data is a parameter setting request data type, a parameter setting request thread 709 is created, and the parameter setting request thread 709 is called to process the parameter setting request data. After obtaining the mib database write lock, the parameter setting request thread 709 modifies the mib database parameters and executes device parameter modification, etc.

[0133] The main thread 710 is also used to detect or control the data queue parsing thread 707. If it is detected that the data queue parsing thread 707 is abnormal (thread exit or stuck), the data queue parsing thread 707 is restarted to resume normal operation. If the restart times exceed three times and the data queue parsing thread 707 is still in an abnormal state, the main thread 710 is restarted.

[0134] The implementation of the SNMP protocol is based on the Transmission Control Protocol / Internet Protocol (TCP / IP) and the communication mechanism of the socket. The SNMP protocol has object identifiers and other identifiers. In the data processing method provided in the embodiment of the present application, the multithreading does not process the SNMP request data packets in a concurrent order (such as the data packets received later are processed and sent out first), which does not affect the use of the SNMP protocol.

[0135] In the above industrial monitoring application scenario, by creating a data queue in user state, the kernel state receiving queue data is batched to the user state data queue, which replaces the method of obtaining data one by one, so that the kernel state receiving queue data can be cleared in time and frequent switching between user state and kernel state can be avoided. By creating and calling multiple threads to concurrently process different types of request data, the data processing efficiency is improved.

[0136] The following is a description of an exemplary structure of the data processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 5As shown, the software modules stored in the data processing device 455 of the memory 450 may include: a first creation module 4551, used to create a first data queue in the user state, and create a first thread in the user state; a data acquisition module 4552, used to call the first thread, obtain request data from the second data queue in the kernel state, and add the request data to the first data queue, the request data is a simple network management protocol request data; a data parsing module 4553, used to call the first thread, parse the request data in the first data queue, and obtain a data parsing result, the data parsing result represents the request data type of the request data; a second creation module 4554, used to call the second thread corresponding to the request data type in the user state to process the request data.

[0137] In some embodiments, the data acquisition module 4552 is also used to obtain a first quantity of requested data in the second data queue in the kernel state, and determine a data mapping quantity based on the first quantity; determine a mapping start address between the first data queue and the second data queue; call the first thread, based on the data mapping quantity and the mapping start address, obtain the requested data from the second data queue, and add the requested data to the first data queue.

[0138] In some embodiments, the second creation module 4554 is also used to create a second thread corresponding to the parameter acquisition request data type in the user state when the request data type is a parameter acquisition request data type; call the second thread to process the request data and read parameter information from the management information database.

[0139] In some embodiments, the second creation module 4554 is also used to determine the main thread in the user state as the second thread corresponding to the new connection request data type in the user state when the request data type is a new connection request data type; call the second thread to process the request data and establish a data communication connection between the network device and the host computer.

[0140] In some embodiments, the second creation module 4554 is also used to call the main thread in the user state to set a write lock for the management information database; when the request data type is a parameter setting request data type, a second thread corresponding to the parameter setting request data type is created in the user state; when the second thread obtains the write lock, the second thread is called to process the request data and modify the parameter information of the management information database.

[0141] In some embodiments, the second creation module 4554 is also used to obtain the restart count of the first thread when the first thread is in an abnormal state; restart the first thread and update the restart count when the restart count is less than a preset threshold; restart the main thread when the updated restart count reaches the threshold and the first thread is still in an abnormal state after restart.

[0142] The embodiment of the present application provides a computer program product, which includes computer executable instructions or computer programs, and the computer executable instructions or computer programs are stored in a computer-readable storage medium. The processor of the monitoring device reads the computer executable instructions or computer programs from the computer-readable storage medium, and the processor executes the computer executable instructions or computer programs, so that the monitoring device performs the data processing method described above in the embodiment of the present application.

[0143] The present application embodiment provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the method provided by the present application embodiment, for example, Fig. 6A The data processing method is shown.

[0144] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0145] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0146] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0147] As an example, computer executable instructions may be deployed to be executed on one monitoring device, or on multiple monitoring devices located at one site, or on multiple monitoring devices distributed at multiple sites and interconnected by a communication network.

[0148] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Create a first data queue in a user state, and create a first thread in the user state; Calling the first thread, obtaining request data from the second data queue in the kernel state, and adding the request data to the first data queue, wherein the request data is simple network management protocol request data; Calling the first thread to parse the request data in the first data queue to obtain a data parsing result, wherein the data parsing result represents the request data type of the request data; The second thread corresponding to the requested data type in the user state is called to process the requested data.

2. The method according to claim 1, characterized in that The calling of the first thread, obtaining the request data from the second data queue in the kernel state, and adding the request data to the first data queue includes: Acquire a first quantity of requested data in a second data queue in kernel mode, and determine a data mapping quantity based on the first quantity; Determine a mapping start address between the first data queue and the second data queue; The first thread is called to obtain request data from the second data queue based on the data mapping quantity and the mapping start address, and the request data is added to the first data queue.

3. The method according to claim 1, characterized in that The calling of the second thread corresponding to the request data type in the user state to process the request data includes: In a case where the request data type is a parameter acquisition request data type, creating a second thread corresponding to the parameter acquisition request data type in the user state; The second thread is called to process the request data and read parameter information from a management information database.

4. The method according to claim 1, characterized in that The calling of the second thread corresponding to the request data type in the user state to process the request data includes: In a case where the request data type is a new connection request data type, determining the main thread in the user state as a second thread corresponding to the new connection request data type in the user state; The second thread is called to process the request data and establish a data communication connection between the network device and the host computer.

5. The method according to claim 1, characterized in that The method further comprises: Calling the main thread in the user state to set a write lock for the management information database; The calling of the second thread corresponding to the request data type in the user state to process the request data includes: In a case where the request data type is a parameter setting request data type, creating a second thread corresponding to the parameter setting request data type in the user state; When the second thread obtains the write lock, the second thread is called to process the request data and modify the parameter information of the management information database.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the first thread is in an abnormal state, obtaining the number of restarts of the first thread; When the restart times are less than a preset times threshold, restart the first thread and update the restart times; When the updated restart times reaches the times threshold and the first thread is still in an abnormal state after restarting, restart the main thread.

7. A data processing device, characterized in that: The device comprises: A first creation module, used to create a first data queue in a user state, and to create a first thread in the user state; A data acquisition module, used for calling the first thread, acquiring request data from the second data queue in the kernel state, and adding the request data to the first data queue, wherein the request data is a simple network management protocol request data; a data parsing module, configured to call the first thread to parse the request data in the first data queue to obtain a data parsing result, wherein the data parsing result represents a request data type of the request data; The second creation module is used to call the second thread corresponding to the request data type in the user state to process the request data.

8. A monitoring device, characterized in that: The monitoring device comprises: A memory for storing computer executable instructions or computer programs; A processor, used to implement the data processing method according to any one of claims 1 to 6 when executing the computer executable instructions or computer programs stored in the memory.

9. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the data processing method according to any one of claims 1 to 6 is implemented.

10. An intelligent operation and maintenance management system, comprising monitoring equipment and terminal equipment, characterized in that: The terminal device is used to send its own status data to the monitoring device, and the monitoring device is used to process the status data using the data processing method described in any one of claims 1 to 6.

Citation Information

Cited By

  • Remote desktop protocol data transmission method and device, equipment and storage medium

    CN120602478A

  • Data interaction method and device, storage medium and electronic equipment

    CN120669908A