Disclosure of Invention
In order to solve the technical problem, the application provides a data processing method, a data processing device, an electronic device and a storage medium.
In some embodiments, the present application provides a data processing method, executed on a server side, the method including the steps of:
acquiring data to be reported of at least one equipment node, wherein the data to be reported comprises state updating data and alarm updating data;
writing the state update data and the alarm update data into a data channel;
and sending prompt information to service calling equipment, wherein the prompt information is used for prompting the service calling equipment to acquire the state updating data and the alarm updating data through the data channel.
Optionally, the acquiring the data to be reported of the at least one device node includes:
acquiring state initial data of the at least one equipment node;
and under the condition that the state initial data is inconsistent with preset state data, updating the preset state data according to the state initial data to obtain the state updating data.
Optionally, the data to be reported includes alarm update data, and acquiring the data to be reported of at least one device node includes:
acquiring alarm initial data of the at least one equipment node;
and under the condition that the alarm initial data is inconsistent with preset alarm data, updating the preset alarm data according to the alarm initial data to obtain the alarm update data.
Optionally, the obtaining of the state initial data of the at least one device node includes:
acquiring real-time data of the at least one equipment node;
carrying out protocol analysis on the real-time data to obtain a parameter value of the equipment node;
and determining the state initial data according to the parameter values of the equipment nodes under the condition that the equipment nodes are determined not to be alarm nodes according to the parameter values of the equipment nodes and the polling of all the equipment nodes is finished.
Optionally, obtaining alarm initial data of the at least one device node includes:
determining the alarm initial data according to the parameter value of the equipment node when the equipment node is determined to be an alarm node according to the parameter value of the equipment node and the parameter value of the equipment node is greater than or equal to a preset alarm value;
the method for acquiring the alarm initial data of the at least one equipment node comprises the following steps:
and adding the equipment node into an alarm queue.
In some embodiments, the present application provides a data processing method, executed on a service invocation device side, the method including the following steps:
receiving prompt information sent by a server;
and acquiring data to be reported of at least one equipment node through a data channel according to the prompt information, wherein the data to be reported comprises state update data and alarm update data which are written into the data channel by the server.
In some embodiments, the present application provides a data processing apparatus comprising:
the device comprises a first data acquisition unit, a second data acquisition unit and a processing unit, wherein the first data acquisition unit is used for acquiring data to be reported of at least one equipment node, and the data to be reported comprises state update data and alarm update data;
the data writing unit is used for writing the state updating data and the alarm updating data into a data channel;
and the information sending unit is used for sending prompt information to the service calling equipment, and the prompt information is used for prompting the service calling equipment to acquire the state updating data and the alarm updating data through the data channel.
In some embodiments, the present application provides a data processing apparatus comprising:
the information receiving unit is used for receiving the prompt information sent by the server;
and a second data obtaining unit, configured to obtain, according to the prompt information, data to be reported of at least one device node through a data channel, where the data to be reported includes state update data and alarm update data written into the data channel by the server.
In some embodiments, the present application provides an electronic device comprising: at least one processor, memory, at least one network interface, and a user interface;
the at least one processor, memory, at least one network interface, and user interface are coupled together by a bus system;
the processor is adapted to perform the steps of the data processing method as described above by calling a program or instructions stored by the memory.
In some embodiments, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the data processing method as described above.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the method provided by the embodiment of the application, the state updating data and the alarm updating data of the equipment node are integrated to form the data to be reported, and the data to be reported are written into the data channel, so that the reported and displayed state updating data and the alarm updating data are kept synchronous, the accuracy of the data to be reported of the equipment node is improved, and the probability of misjudgment or misoperation is reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic flow chart of a data processing method according to an embodiment of the present application, where the data processing method is executed on a server side, and the method specifically includes the following steps:
s101, data to be reported of at least one equipment node is obtained, wherein the data to be reported comprises state updating data and alarm updating data.
Optionally, the device node comprises an industrial device.
And S102, writing the state updating data and the alarm updating data into a data channel.
S103, sending prompt information to service calling equipment, wherein the prompt information is used for prompting the service calling equipment to acquire the state updating data and the alarm updating data through the data channel.
Optionally, the servers are deployed on different nodes in a distributed environment, and the clients automatically discover the currently available servers and invoke the servers by means of address registration of the servers. Typically, the addresses of all servers in a distributed environment are registered using a component of a Service Registry (Service Registry). The method comprises the following specific steps:
(1) deploying servers on different nodes in a distributed environment;
(2) registering a server on a service registry component, registering an address of the server;
(3) the service calling equipment automatically discovers the currently available server through the service registry;
(4) the server executes the processing logic of the data to be reported (simultaneously comprising the state updating data and the alarm updating data) of the equipment node;
(5) writing the packaged data to be reported into a data channel through a network, and sending prompt information to corresponding service calling equipment;
(6) and the service calling equipment acquires the state updating data and the alarm updating data of the equipment node from the data channel according to the prompt information.
According to the method provided by the embodiment of the application, the state updating data and the alarm updating data of the equipment node are integrated to form the data to be reported, and the data to be reported are written into the data channel, so that the reported and displayed state updating data and the alarm updating data are kept synchronous, the accuracy of the data to be reported of the equipment node is improved, and the probability of misjudgment or misoperation is reduced.
Fig. 2 is a flowchart of another data processing method according to an embodiment of the present application, where the data to be reported includes state update data, and in step S101, the method for acquiring data to be reported of at least one device node includes the following steps:
s201, acquiring state initial data of the at least one equipment node.
S202, under the condition that the state initial data is inconsistent with preset state data, updating the preset state data according to the state initial data to obtain the state updating data.
Optionally, comparing the state initial data with preset state data stored in the memory in advance, and if the comparison result is that the state initial data is inconsistent with the preset state data, updating the preset state data according to the state initial data to obtain the state update data; and if the comparison result shows that the initial state data is consistent with the preset state data, the data is not processed.
Fig. 3 is a schematic flow chart of another data processing method according to an embodiment of the present application, where the data processing method according to the embodiment of the present application is provided, and in step S201, acquiring state initial data of the at least one device node includes:
s301, acquiring real-time data of the at least one equipment node.
S302, carrying out protocol analysis on the real-time data to obtain the parameter value of the equipment node.
Optionally, storing the parameter values of the device nodes in a memory according to a preset format;
s303, determining the state initial data according to the parameter values of the equipment nodes under the condition that the equipment nodes are determined not to be alarm nodes according to the parameter values of the equipment nodes and the polling of all the equipment nodes is finished.
Optionally, whether the device node is an alarm node is judged according to the parameter value of the current device node, if the device node is not an alarm node, whether all the device nodes are processed is continuously judged, if yes, the polling is determined to be finished, and if not, the data of the next device node is continuously processed.
Fig. 4 is a flowchart of another data processing method according to an embodiment of the present application, where the data to be reported includes alarm update data, and in step S101, the data to be reported of at least one device node is obtained, including the following steps:
s401, obtaining alarm initial data of the at least one equipment node.
S402, under the condition that the alarm initial data is inconsistent with preset alarm data, updating the preset alarm data according to the alarm initial data to obtain the alarm updating data.
Optionally, the alarm initial data is compared with preset alarm data stored in a memory in advance, and if the comparison result shows that the alarm initial data is inconsistent with the preset alarm data, the preset alarm data is updated according to the alarm initial data to obtain the alarm update data; and if the comparison result shows that the alarm initial data is consistent with the preset alarm data, the data is not processed.
Optionally, in step S401, acquiring alarm initial data of the at least one device node, where the alarm initial data includes:
determining the alarm initial data according to the parameter value of the equipment node when the equipment node is determined to be an alarm node according to the parameter value of the equipment node and the parameter value of the equipment node is greater than or equal to a preset alarm value;
after acquiring the alarm initial data of the at least one equipment node, the method comprises the following steps:
and adding the equipment node into an alarm queue.
Optionally, the preset alarm values of the preset alarm nodes are pre-stored in the memory, and the preset alarm values of the preset alarm nodes are arranged in the memory according to a sequence, so that the preset alarm values can be sorted from large to small or from small to large. For example, a dichotomy is adopted, the parameter value of the equipment node is compared with the preset alarm value of the preset alarm node, if the parameter value is greater than or equal to the preset alarm value, the parameter value is used as alarm initial data, and the equipment node is added into an alarm queue; and if the parameter value is smaller than the preset alarm value, the data is not processed.
Fig. 5 is a schematic flowchart of another data processing method provided in an embodiment of the present application, where the data processing method provided in the embodiment of the present application is executed on a service invocation device side, and the method includes the following steps:
s501, receiving prompt information sent by a server;
s502, acquiring data to be reported of at least one equipment node through a data channel according to the prompt information, wherein the data to be reported comprises state update data and alarm update data written into the data channel by the server.
Fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application, where the data processing apparatus according to the embodiment of the present application includes:
a first data obtaining unit 61, configured to obtain data to be reported of at least one device node, where the data to be reported includes state update data and alarm update data;
a data writing unit 62, configured to write the status update data and the alarm update data into a data channel;
and an information sending unit 63, configured to send a prompt message to a service invocation device, where the prompt message is used to prompt the service invocation device to obtain the state update data and the alarm update data through the data channel.
Fig. 7 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application, where the data processing apparatus according to the embodiment of the present application includes:
an information receiving unit 71, configured to receive a prompt message sent by a server;
a second data obtaining unit 72, configured to obtain, according to the prompt information, data to be reported of at least one device node through a data channel, where the data to be reported includes state update data and alarm update data written into the data channel by the server.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps as described in the method embodiments, for example, including:
acquiring data to be reported of at least one equipment node, wherein the data to be reported comprises state updating data and alarm updating data;
writing the state update data and the alarm update data into a data channel;
and sending prompt information to service calling equipment, wherein the prompt information is used for prompting the service calling equipment to acquire the state updating data and the alarm updating data through the data channel.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps as described in the method embodiments, for example, including:
receiving prompt information sent by a server;
and acquiring data to be reported of at least one equipment node through a data channel according to the prompt information, wherein the data to be reported comprises state update data and alarm update data which are written into the data channel by the server.
Fig. 8 is a schematic structural diagram of an electronic device according to another embodiment of the present application. The electronic device 800 shown in fig. 8 includes: at least one processor 801, memory 802, at least one network interface 804, and other user interfaces 803. The various components in the electronic device 800 are coupled together by a bus system 805. It is understood that the bus system 805 is used to enable communications among the components connected. The bus system 805 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 805 in fig. 8.
The user interface 803 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It will be appreciated that the memory 802 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM) which functions as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (staticiram, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (syncronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced synchronous SDRAM (ESDRAM), synchronous link SDRAM (SLDRAM), and direct memory bus SDRAM (DRRAM). The memory 802 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 802 stores elements, executable units or data structures, or a subset thereof, or an expanded set thereof as follows: an operating system 8021 and application programs 8022.
The operating system 8021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application 8022 includes various applications, such as a media player (MediaPlayer), a Browser (Browser), and the like, for implementing various application services. A program implementing a method according to an embodiment of the present invention may be included in application program 8022.
In the embodiment of the present invention, the processor 801 is configured to execute the method steps provided by each method embodiment by calling the program or instruction stored in the memory 802, specifically, the program or instruction stored in the application 8022, and for example, includes:
acquiring data to be reported of at least one equipment node, wherein the data to be reported comprises state updating data and alarm updating data;
writing the state update data and the alarm update data into a data channel;
and sending prompt information to service calling equipment, wherein the prompt information is used for prompting the service calling equipment to acquire the state updating data and the alarm updating data through the data channel.
The methods disclosed in the embodiments of the present invention described above may be implemented in the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 801. The processor 801 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in the memory 802, and the processor 801 reads the information in the memory 802, and combines the hardware to complete the steps of the method.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for apparatus or system embodiments, since they are substantially similar to method embodiments, they are described in relative terms, as long as they are described in partial descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.