CN110191095B - Data processing method and terminal equipment - Google Patents

Data processing method and terminal equipment Download PDF

Info

Publication number
CN110191095B
CN110191095B CN201910351974.7A CN201910351974A CN110191095B CN 110191095 B CN110191095 B CN 110191095B CN 201910351974 A CN201910351974 A CN 201910351974A CN 110191095 B CN110191095 B CN 110191095B
Authority
CN
China
Prior art keywords
data
message
analyzed
analysis
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910351974.7A
Other languages
Chinese (zh)
Other versions
CN110191095A (en
Inventor
王敬卿
林琛强
陈闽洪
刘军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING KEHUA ZHONGSHENG CLOUD COMPUTING TECHNOLOGY CO.,LTD.
Xiamen kecan Information Technology Co., Ltd
Original Assignee
Xiamen Kecan Information Technology Co ltd
Kehua Data Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Kecan Information Technology Co ltd, Kehua Data Co Ltd filed Critical Xiamen Kecan Information Technology Co ltd
Priority to CN201910351974.7A priority Critical patent/CN110191095B/en
Publication of CN110191095A publication Critical patent/CN110191095A/en
Application granted granted Critical
Publication of CN110191095B publication Critical patent/CN110191095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention is suitable for the technical field of network communication, and provides a data processing method and terminal equipment, wherein the method comprises the following steps: receiving a message; according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data; the data is grouped and stored, and a set of good design of message acquisition, message analysis, data processing and data storage based on the IEC104 protocol is provided, so that the messages, analysis messages and data processing acquired by the IEC104 can be well decoupled, and multiplexing, expansion and maintenance are facilitated.

Description

Data processing method and terminal equipment
Technical Field
The present invention belongs to the technical field of network communication, and in particular, to a data processing method and a terminal device.
Background
The IEC104 protocol is an international standard protocol, has the advantages of good real-time performance, high reliability, large data flow, convenience for information quantity expansion, network transmission support and the like, and the content and the function of the IEC104 protocol cover the definition in the aspect of protection, so that the IEC104 protocol can be applied to a dispatching and transformer substation end and is completely suitable for a communication network in a transformer substation. Specifically, the master station applying the IEC104 protocol may perform operations of message acquisition, message analysis, data processing, and data storage. However, the conventional IEC104 master station development is not well designed in terms of communication, resulting in low stability. Each time a protocol based on IEC104 is developed, a set of acquisition, analysis and storage logic needs to be implemented, and the coupling of service logic results in no multiplexing and expansion. In addition, the traditional message analysis method is not structured and designed, so that errors are easy to occur during message analysis, and the errors are not easy to be eliminated.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data processing method and a terminal device, so as to solve the problems in the prior art that a set of acquisition and analysis logic needs to be implemented for each development of a protocol based on IEC104, and multiplexing and expansion cannot be performed due to coupling of service logic, and a message analysis method is not structured and designed, so that a message is easy to make a mistake during message analysis, and is not easy to be checked after a mistake is made.
A first aspect of an embodiment of the present invention provides a data processing method, including:
receiving a message;
according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data;
and carrying out data grouping on the data and storing the data.
In an embodiment, the step of performing a segment analysis on the packet according to the preset packet analysis chain to obtain analyzed data includes:
A. determining bytes to be analyzed in the message corresponding to the analysis chain subclass;
B. analyzing the corresponding bytes to be analyzed according to the analysis chain subclass;
and circularly executing the steps A and B until the message is analyzed, and obtaining analyzed data.
In an embodiment, the data grouping and storing the data includes:
according to the analyzed data, obtaining a remote number in an Iec104 protocol used for transmitting the data;
and storing the data by taking the corresponding remote number as an index.
In an embodiment, the data grouping and storing the data includes:
according to the analyzed data, inquiring a pre-stored service attribute table to obtain a service attribute name of the data, wherein at least one pair of data and a corresponding service attribute name are stored in the service attribute table;
and storing the data by taking the service attribute name as an index.
In an embodiment, after the data is packetized and stored, the method further includes:
and inquiring a data value corresponding to the data in the service attribute table according to the service attribute name of the data, and setting the data value of the data, wherein at least one pair of service attribute name and corresponding data value is stored in the service attribute table.
In an embodiment, after the setting the data value of the data, the method further includes:
and processing the data according to the corresponding service logic according to the data value of the data.
In one embodiment, the analyzed data corresponds to different point locations, and each point location is bound with an analyzer;
the processing the data according to the corresponding service logic includes:
setting all the analyzers corresponding to the stored data into a binary tree structure;
and traversing each analyzer in the binary tree structure in a mode of middle-order traversal. .
A second aspect of an embodiment of the present invention provides an apparatus for data processing, including:
the receiving module is used for receiving the message;
the analysis module is used for carrying out segmented analysis on the message according to a preset message analysis chain to obtain analyzed data;
and the storage module is used for carrying out data grouping on the data and storing the data.
A third aspect of an embodiment of the present invention provides a terminal device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above for data processing when executing the computer program.
A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method as described above for data processing.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: by receiving a message; according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data; the data is grouped and stored, and a set of good design of message acquisition, message analysis, data processing and data storage based on the IEC104 protocol is provided, so that the messages, analysis messages and data processing acquired by the IEC104 can be well decoupled, and multiplexing, expansion and maintenance are facilitated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of an implementation of a data processing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a message parsing chain according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of an apparatus for data processing provided by an embodiment of the present invention;
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
An embodiment of the present invention provides a data processing method, as shown in fig. 1, the method includes the following steps:
step 101, receiving a message.
Optionally, an asynchronous non-blocking IEC-104 protocol master station is constructed in this embodiment, and a complete implementation method is provided. Asynchronization and synchronization are relative concepts, and synchronization refers to that when a call instruction is sent out, the result of the call is not returned until the result is not obtained, and a return value is obtained once the call is returned. Asynchronous is the opposite, and the call is directly returned after the call instruction is issued, so no result is returned, i.e. after an asynchronous procedure call is issued, the caller does not get the result immediately, but after the call is issued, the callee notifies the caller through state and notification, or processes the call through a callback function. And when the calling result is obtained, the result is sent in a callback mode. Non-blocking is a relative concept to blocking, which concerns the state of a program while waiting for the result of a call (message or return value). Blocking the call means that the current thread is suspended before the call result is returned, and the call thread is returned only after the result is obtained. A non-blocking call refers to a call that does not block the current thread until the result is not immediately available.
Optionally, the Client object receives the message, and the Client object may be an IEC-104 Client. The IEC-104Client realizes the start and stop of a main station program based on an asynchronous non-blocking IEC-104 protocol and the start of all actions of the program.
Step 102, according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data.
Optionally, the message analysis chain is designed in a responsibility chain mode, and a plurality of analysis chain subclasses forming the message analysis chain can be implemented to analyze the message in segments, as shown in fig. 2, the message analysis chain includes: chain01_ Start initiator, Chain02_ Length successor Length, Chain03_ Ctrl control field, Chain03b _ Package _ SS frame, Chain03c _ Package _ UU frame, Chain03a _ Package _ II frame, Chain04_ Type, Chain05_ Changeable variable structure qualifier, Chain06_ Reason transport Reason, Chain07_ FTUAddress FTU site, Chain08_ DataParse data body, and other parse Chain subclasses.
Optionally, each parsing chain sub-class in the message parsing chain may parse a plurality of bytes in the message. The message analysis comprises the following steps:
A. determining bytes to be analyzed in the message corresponding to the analysis chain subclass;
B. analyzing the corresponding bytes to be analyzed according to the analysis chain subclass;
and circularly executing the steps A and B until the message is analyzed, and obtaining analyzed data.
Optionally, for example, according to a first parsing chain subclass of a message parsing chain, N to be parsed in the message corresponding to the first parsing chain subclass is determined1One byte, the N1Greater than or equal to 1; analyzing the N according to the first analysis chain subclass1A byte;
for another example, according to a second parsing chain subclass of a message parsing chain, determining N to be parsed in the message corresponding to the second parsing chain subclass2One byte, the N2Greater than or equal to 1; analyzing the N according to the first analysis chain subclass2A byte; and sequentially analyzing all bytes of the message according to all analysis chain subclasses of the message analysis chain to obtain analyzed data.
The following illustrates the message parsing process. The received message is represented by hexadecimal, and can be: 681 c 00000000018 f 14003300010200; 010001000100010001000100010001.
chain01_ Start parses initiator 1 byte, i.e., parses 68, and automatically performs the next step.
Chain02_ length resolves the subsequent length, i.e. resolves 1c, 1c to decimal 28, indicating that the subsequent 28 bytes are resolved and the next step is performed automatically.
Chain03_ Ctrl parses 4 bytes, i.e., parses 00000000. And judging whether the data frame is an I frame or not, and if the data frame is the I frame, automatically executing the next step according to the trend of the I frame.
Optionally, the I frame is an information frame, used for user data transmission, and includes an information field. The S frame is a monitoring frame and is used for monitoring and controlling a data link and completing functions of receiving confirmation, retransmission request, transmission pause request and the like of the I frame, and the S frame has no information field. The U frame is a non-numbered frame and is used for controlling a data link, is not numbered and can be sent out at any required moment without influencing the exchange sequence of numbered information frames.
The Chain04_ Type parses one byte, namely parse 01, to indicate that the message Type is single point telemetry, and then automatically executes the next step.
Chain05_ Changeable parses one byte, i.e., parses 8f, which is converted to binary 10001111, representing 15 consecutive telemetry data.
The resolution of 2 bytes, namely the resolution 1400, of the Chain06_ Reason is converted into decimal 20, which indicates that the message transmission Reason is the call of the corresponding station.
Chain07_ FTUAddress parses 2 bytes, i.e., parses 3300, which is converted to 51 decimal, indicating that the FTU site is 51.
Chain07_ DataParse parses 3 bytes, i.e., parses 010200, which indicates the starting address of the data volume: 0201H.
010001000100010001000100010001 denotes information element data, i.e. values of 15 remote signalling data. The 15 telesignaling data obtained after analysis are:
Index=0201H,value=01H&0x01=1;
Index=0202H,value=00H&0x01=0;
……
Index=020dH,value=01H&0x01=1;
Index=020eH,value=00H&0x01=0;
Index=020fH,value=01H&0x01=1。
the embodiment realizes the analysis of the message by adopting the responsibility chain mode design, so that the message analysis process is clearer and errors are not easy to occur.
And 103, grouping the data and storing the data.
As an implementable manner, this step may include: according to the analyzed data, obtaining a remote number in an Iec104 protocol used for transmitting the data; and storing the data by taking the corresponding remote number as an index. The analyzed data flows into a point location, namely Iec104Pointer, and the data on the point location is stored into a point table according to a remote number in a Iec104 protocol adopted for transmitting the data, namely the point table is a point location set taking the remote number as an index. The data is grouped by remote number and the grouped data enters Iec104Table group point Table interface.
The main capabilities and characteristics of a point site include: holds references and indexes for the belonging Iec104 Entity; saving and acquiring data values; acquiring a last data value; and each point location is bound with an analyzer, and the bound analyzer is executed after the point location collects the data scanning value.
As another possible embodiment, the present step may include: and inquiring a data value corresponding to the data in the service attribute table according to the analyzed data, wherein at least one pair of data and a corresponding service attribute name are stored in the service attribute table.
The data is grouped by service attribute name and the grouped data enters Iec104Entity interface. Iec104Entity "the main capabilities and characteristics of the interface include: the inheritance Map interface is a dynamic object interface; holding a point location set with a service attribute name as an index; and acquiring a data value according to the attribute name and acquiring the data value according to the attribute name.
Further, the method can further comprise the following steps: according to the business attribute name of the data, inquiring Iec104Entity input interface data in a business attribute table to obtain data value of the data; and setting the data value of the data according to the service attribute name of the data. At least one pair of service attribute names and corresponding data values are stored in the service attribute table. It will be appreciated that a service attribute table holds a number of corresponding records for data, service attribute names and data values.
Optionally, when the service needs to be executed, the data is set to a data value, and then the data is subjected to service processing according to the data value and the service logic corresponding to the data value.
Optionally, when the data has data values, the bound parser may be executed, that is, Iec104Parse is executed with parser "interface, and Iec104Parse with parser" interface main capabilities and characteristics include: the analyzer is arranged in a binary tree structure and is executed in the order of the middle-order traversal; setting a front analyzer and a rear analyzer; obtaining a first analyzer leaf node in the middle-sequence traversal order; acquiring leaf nodes of a last analyzer in the middle-sequence traversal sequence; the most common abstraction base class is BaseIec104 Parse.
Optionally, according to the characteristic of the interface of the Iec104Parsea analyzer ", the data is processed according to the corresponding service logic according to the data value of the data.
Optionally, after this step, the method may further include: setting all the analyzers corresponding to the stored data into a binary tree structure; and traversing each analyzer in the binary tree structure in a mode of middle-order traversal.
Optionally, the analyzer is further configured to decouple system business logic unrelated to the acquisition. After the data is collected, the data is decoupled from the service, the data can be analyzed differently through an analyzer, or the data can be considered as an analyzer for data configuration, so that the same data can be analyzed and aggregated differently through different analyzers, and the desired service requirement is realized. The relationship to the system business logic depends on the logic in the parser.
The embodiment provides a data storage mode and a data flow direction link design, and the data provides an external call interface from message analysis to data aggregation and storage, so that the development and application of the IEC104 protocol master station are more regular and the stability is strong.
The embodiment of the invention provides a data processing method, which comprises the steps of receiving a message; according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data; the data is grouped and stored, a set of good design of message acquisition, message analysis, data processing and data storage based on the IEC104 protocol is provided, so that the messages, analysis messages and data processing acquired by the IEC104 are well decoupled, and multiplexing and expansion are facilitated.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
An embodiment of the present invention provides a data processing apparatus, as shown in fig. 3, the apparatus includes: a receiving module 301, a parsing module 302 and a storing module 303.
The receiving module 301 is configured to receive a message.
The parsing module 302 is configured to perform segmented parsing on the packet according to a preset packet parsing chain, so as to obtain parsed data.
Optionally, the parsing module 302 is configured to a determine a byte to be parsed in the message corresponding to the parsing chain subclass; B. analyzing the corresponding bytes to be analyzed according to the analysis chain subclass; and circularly executing the steps A and B until the message is analyzed, and obtaining analyzed data.
And the storage module 303 is configured to perform data grouping on the data and store the data.
Optionally, the storage module 303 is configured to obtain, according to the analyzed data, a remote number in an Iec104 protocol used for transmitting the data; and storing the data by taking the corresponding remote number as an index.
Optionally, the storage module 303 is configured to query a pre-stored service attribute table according to the analyzed data to obtain a service attribute name of the data, where the service attribute table stores at least one pair of data and a corresponding service attribute name; and storing the data by taking the service attribute name as an index.
Further, after storing the data, the apparatus is further configured to query, according to the service attribute name of the data, a data value corresponding to the data in the service attribute table, and set a data value of the data, where at least one pair of the service attribute name and the corresponding data value is stored in the service attribute table. And processing the data according to the corresponding business logic according to the data value of the data
Optionally, the analyzed data corresponds to different point locations, and each point location is bound with an analyzer; the device is used for setting all the analyzers corresponding to the stored data into a binary tree structure; and traversing each analyzer in the binary tree structure in a mode of middle-order traversal.
The embodiment of the invention provides a data processing device, which comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a message; according to a preset message analysis chain, an analysis module carries out segmented analysis on the message to obtain analyzed data; the embodiment of the invention provides a set of good design of message acquisition, message analysis, data processing and data storage based on the IEC104 protocol, so that the messages, analysis messages and data processing acquired by the IEC104 are well decoupled, and multiplexing and expansion are more convenient.
Fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 401, a memory 402 and a computer program 403, such as a detection program for a dc bias of a transformer core, stored in said memory 402 and executable on said processor 401. The processor 401 implements the steps in the above-described method embodiments of data processing, such as the steps 101 to 103 shown in fig. 1, when executing the computer program 403. The processor 401, when executing the computer program 403, implements the functions of the modules in the device embodiments described above, such as the functions of the modules 301 to 303 shown in fig. 3.
Illustratively, the computer program 403 may be partitioned into one or more modules that are stored in the memory 402 and executed by the processor 401 to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program 403 in the data processing apparatus or terminal device 4. For example, the computer program 403 may be divided into a receiving module 301, an analyzing module 302, and a storing module 303, and specific functions of the modules are shown in fig. 3, which is not described herein again.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 401, a memory 402. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 401 may be a Central Processing Unit (CPU), other 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, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 402 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 402 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 402 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 402 is used for storing the computer programs and other programs and data required by the terminal device 4. The memory 402 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (7)

1. A method of data processing, the method for resolving a protocol developed based on IEC104, the method comprising:
receiving a message;
according to a preset message analysis chain, carrying out segmented analysis on the message to obtain analyzed data;
performing data grouping on the data and storing the data;
the preset message analysis chain comprises at least one analysis chain subclass, and the step of carrying out segmented analysis on the message according to the preset message analysis chain to obtain analyzed data comprises the following steps:
A. determining bytes to be analyzed in the message corresponding to the analysis chain subclass;
B. analyzing the corresponding bytes to be analyzed according to the analysis chain subclass;
circularly executing the steps A and B until the message is analyzed, and obtaining analyzed data;
the analyzed data corresponds to different point locations, each point location is bound with an analyzer, and after the data is grouped and stored, the method further comprises the following steps:
acquiring a data value of the analyzed data according to the index of the stored data;
setting all the analyzers corresponding to the stored data into a binary tree structure;
and traversing each analyzer in the binary tree structure in a mode of middle-order traversal according to the data value of the data so as to process the data according to the corresponding service logic.
2. The method of data processing according to claim 1, wherein said data packetizing and storing said data comprises:
according to the analyzed data, obtaining a remote number in an Iec104 protocol used for transmitting the data;
and storing the data by taking the corresponding remote number as an index.
3. The method of data processing according to claim 1, wherein said data packetizing and storing said data comprises:
according to the analyzed data, inquiring a pre-stored service attribute table to obtain a service attribute name of the data, wherein at least one pair of data and a corresponding service attribute name are stored in the service attribute table;
and storing the data by taking the service attribute name as an index.
4. The method of data processing according to claim 3, further comprising, after said data is data-grouped and stored:
and inquiring a data value corresponding to the data in the service attribute table according to the service attribute name of the data, and setting the data value of the data, wherein at least one pair of service attribute name and corresponding data value is stored in the service attribute table.
5. An apparatus for data processing, the apparatus configured to parse a protocol developed based on IEC104, the apparatus comprising:
the receiving module is used for receiving the message;
the analysis module is used for carrying out segmented analysis on the message according to a preset message analysis chain to obtain analyzed data;
the storage module is used for carrying out data grouping on the data and storing the data;
the preset message parsing chain comprises at least one parsing chain subclass, and the parsing module is specifically configured to:
A. determining bytes to be analyzed in the message corresponding to the analysis chain subclass;
B. analyzing the corresponding bytes to be analyzed according to the analysis chain subclass;
circularly executing the steps A and B until the message is analyzed, and obtaining analyzed data;
the analyzed data corresponds to different point locations, each point location is bound with an analyzer, and after the data is grouped and stored, the device is further configured to:
acquiring a data value of the analyzed data according to the index of the stored data;
setting all the analyzers corresponding to the stored data into a binary tree structure;
and traversing each analyzer in the binary tree structure in a mode of middle-order traversal according to the data value of the data so as to process the data according to the corresponding service logic.
6. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201910351974.7A 2019-04-28 2019-04-28 Data processing method and terminal equipment Active CN110191095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910351974.7A CN110191095B (en) 2019-04-28 2019-04-28 Data processing method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910351974.7A CN110191095B (en) 2019-04-28 2019-04-28 Data processing method and terminal equipment

Publications (2)

Publication Number Publication Date
CN110191095A CN110191095A (en) 2019-08-30
CN110191095B true CN110191095B (en) 2022-01-07

Family

ID=67715306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910351974.7A Active CN110191095B (en) 2019-04-28 2019-04-28 Data processing method and terminal equipment

Country Status (1)

Country Link
CN (1) CN110191095B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325084A (en) * 2011-07-21 2012-01-18 航天科工深圳(集团)有限公司 Method and system for realizing data exchange in IEC104 (international electrotechnical commission 104) communication protocol forwarding
CN103036893A (en) * 2012-12-21 2013-04-10 国电南瑞科技股份有限公司 One-layer network data processing method suitable for intelligent substation
CN103391290A (en) * 2013-07-16 2013-11-13 沈阳时尚实业有限公司 Power consumer power utilization information acquisition system with protocol parsing
CN109510759A (en) * 2018-10-22 2019-03-22 智强通达科技(北京)有限公司 A kind of Universal-purpose quick multi-protocol gateway realization system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9219616B2 (en) * 2011-05-25 2015-12-22 Cisco Technology, Inc. Supporting multiple IEC-101/IEC-104 masters on an IEC-101/IEC-104 translation gateway

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325084A (en) * 2011-07-21 2012-01-18 航天科工深圳(集团)有限公司 Method and system for realizing data exchange in IEC104 (international electrotechnical commission 104) communication protocol forwarding
CN103036893A (en) * 2012-12-21 2013-04-10 国电南瑞科技股份有限公司 One-layer network data processing method suitable for intelligent substation
CN103391290A (en) * 2013-07-16 2013-11-13 沈阳时尚实业有限公司 Power consumer power utilization information acquisition system with protocol parsing
CN109510759A (en) * 2018-10-22 2019-03-22 智强通达科技(北京)有限公司 A kind of Universal-purpose quick multi-protocol gateway realization system and method

Also Published As

Publication number Publication date
CN110191095A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN109117209B (en) Serialization and deserialization method and device
CN110445860B (en) Message sending method, device, terminal equipment and storage medium
CN110032511A (en) A kind of interface test method and interface testing equipment
CN109388417B (en) Communication protocol updating method, system and terminal equipment
US11188443B2 (en) Method, apparatus and system for processing log data
CN110688828A (en) File processing method and device, file processing system and computer equipment
CN111813622B (en) Equipment monitoring method and device
CN107748718B (en) Application program testing method and device and server
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN110719215A (en) Flow information acquisition method and device of virtual network
CN113656194A (en) Account checking result data notification method and device, electronic device and storage medium
CN114331416A (en) Data processing method and device, electronic equipment and storage medium
CN110795069A (en) Code analysis method, intelligent terminal and computer readable storage medium
CN114095535B (en) Method for automatically mapping time sequence variable of physical equipment into digital model
CN107040613A (en) A kind of message transmitting method and system
CN112671878B (en) Block chain information subscription method, device, server and storage medium
CN114185973A (en) Parameter calling method, device, equipment and computer readable storage medium
CN110191095B (en) Data processing method and terminal equipment
CN116737598B (en) Page debugging method, device, electronic equipment and computer readable medium
CN113760242A (en) Data processing method, device, server and medium
CN114285774B (en) Flow recording method and device, electronic equipment and storage medium
CN114979307A (en) Communication protocol analysis method, intelligent terminal and storage medium
CN108805741B (en) Fusion method, device and system of power quality data
CN113779018A (en) Data processing method and device
CN112769741A (en) Message communication method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 361000 unit 211, zone Z, Shengtong center 2, No.40, Xiangyun 1st Road, Xiamen area, Xiamen pilot Free Trade Zone, Fujian Province

Applicant after: XIAMEN KECAN INFORMATION TECHNOLOGY Co.,Ltd.

Applicant after: Kehua Data Co., Ltd

Address before: 361000 unit 211, zone Z, Shengtong center 2, No.40, Xiangyun 1st Road, Xiamen area, Xiamen pilot Free Trade Zone, Fujian Province

Applicant before: XIAMEN KECAN INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: Kehua Hengsheng Co., Ltd

CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Wang Jingqing

Inventor after: Lin Chenqiang

Inventor after: Chen Minhong

Inventor after: Liu Jun

Inventor before: Wang Jingqing

Inventor before: Lin Chenqiang

Inventor before: Chen Minhong

GR01 Patent grant
GR01 Patent grant
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211231

Address after: 100176 floor 5, building 1, No. 28, Jinghai Second Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant after: BEIJING KEHUA ZHONGSHENG CLOUD COMPUTING TECHNOLOGY CO.,LTD.

Applicant after: Xiamen kecan Information Technology Co., Ltd

Address before: 361000 unit 211, zone Z, Shengtong center 2, No.40, Xiangyun 1st Road, Xiamen area, Xiamen pilot Free Trade Zone, Fujian Province

Applicant before: XIAMEN KECAN INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: Kehua Data Co., Ltd